This commit is contained in:
lenheart
2025-04-05 22:03:40 +08:00
parent 4d65103501
commit eeb773e723
53 changed files with 2348 additions and 505 deletions

View File

@@ -222,20 +222,20 @@ class EquimentUseJewel {
}
HackReturnAddSocketToAvatarFalg = null;
function HackReturnAddSocketToAvatar(Code) {
//标记flag
HackReturnAddSocketToAvatarFalg = Code;
Cb_PacketBuf_get_short_Leave_Func.EquimentUseJewel <- function(args) {
Cb_PacketBuf_get_short_Leave_Func.rawdelete("EquimentUseJewel");
return 0;
}.bindenv(this);
function HackAddSocketToAvatarLogic(Flag) {
if (Flag) {
Sq_WriteByteArr(S_Ptr("821A449"), [0x90,0x90]);
Sq_WriteByteArr(S_Ptr("0x821A44B"), array(36,0x90));
} else {
Sq_WriteByteArr(S_Ptr("821A449"), [0x74,0x2B]);
}
}
function FixFunction() {
//称号回包
Cb_CTitleBook_putItemData_Leave_Func.EquimentUseJewel <- function(args) {
@@ -258,7 +258,9 @@ class EquimentUseJewel {
//装备开孔
Cb_AddSocketToAvatar_Enter_Func.EquimentUseJewel <- function(args) {
local SUser = User(args[1]);
local Pack = Packet(args[2]);
local PackCopyBuffer = Memory.alloc(10001);
Memory.copy(PackCopyBuffer, NativePointer(args[2]), 1000);
local Pack = Packet(PackCopyBuffer.C_Object);
local equ_slot = Pack.GetShort();
local equitem_id = Pack.GetInt();
local sta_slot = Pack.GetShort();
@@ -276,7 +278,8 @@ class EquimentUseJewel {
//如果已开启镶嵌槽则不执行
local equ_id = NativePointer(inven_item.C_Object).add(25).readU32();
if (api_exitjeweldata(equ_id)) {
HackReturnAddSocketToAvatar(0x13);
CUser_SendCmdErrorPacket(SUser, 209, 19);
HackAddSocketToAvatarLogic(true);
return null;
}
@@ -285,11 +288,13 @@ class EquimentUseJewel {
if (ItemType == 10) {
SUser.SendNotiBox("装备为武器类型,不支持打孔!", 1)
HackReturnAddSocketToAvatar(0x0);
CUser_SendCmdErrorPacket(SUser, 209, 0);
HackAddSocketToAvatarLogic(true);
return null;
} else if (ItemType == 11) {
SUser.SendNotiBox("装备为称号类型,不支持打孔!", 1)
HackReturnAddSocketToAvatar(0x0);
CUser_SendCmdErrorPacket(SUser, 209, 0);
HackAddSocketToAvatarLogic(true);
return null;
}
@@ -310,23 +315,12 @@ class EquimentUseJewel {
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
HackReturnAddSocketToAvatar(0x0);
HackAddSocketToAvatarLogic(true);
return null;
}.bindenv(this);
Cb_AddSocketToAvatar_Leave_Func.EquimentUseJewel <- function(args) {
local Pack = Packet(args[2]);
local equ_slot = Pack.GetShort();
print(equ_slot);
//跳的错误返回0 正常调用的话不处理返回值
if (HackReturnAddSocketToAvatarFalg != null) {
local SUser = User(args[1]);
// SUser.SendItemSpace(0);
CUser_SendCmdErrorPacket(SUser, 209, HackReturnAddSocketToAvatarFalg);
HackReturnAddSocketToAvatarFalg = null;
return 0;
}
HackAddSocketToAvatarLogic(false);
return null;
}.bindenv(this);