毁梦更新

This commit is contained in:
lenheart
2025-12-31 15:27:22 +08:00
parent f58fc1e30e
commit ea5d573cde
5 changed files with 421 additions and 66 deletions

View File

@@ -112,26 +112,9 @@ Gm_InputFunc_Handle["点券"] <- function(SUser, CmdString) {
Gm_InputFunc_Handle["test"] <- function(SUser, CmdString) {
// MoveToCargo(SUser, 1);
}
Timer.SetTimeOut(function() {
// Haker.LoadHook("0x0850D39C", ["pointer", "int", "bool"],
// function(args) {
// return null;
// },
// function(args) {
// print(SUser.GetCharacName());
// // return false;
// return null;
// });
}, 1)

View File

@@ -0,0 +1,121 @@
// 定义修复老技能槽信息的函数
function FixOldSkillSlotInfo() {
Cb_reform_ui_group_no_Leave_Func["月光修复老技能"] <- function(args) {
local skillClassValue = NativePointer(args[1]).sub(0x60).readInt();
if (skillClassValue == 197) {
NativePointer(args[1]).writeInt(4);
}
return 0;
}
Cb_get_skillslot_group_Leave_Func["月光修复老技能"] <- function(args) {
local slot = args[1];
if (slot< 8 || slot >= 198) return -1;
else if (slot >= 160) return 4;
else if (slot >= 122) return 3;
else if (slot >= 84) return 2;
else if (slot >= 46) return 1;
else return 0;
}
Cb_get_skillslot_no_Leave_Func["月光修复老技能"] <- function(args) {
local thisP = args[0];
local skillId = args[1];
local group = args[2];
local slot = args[3];
local is_active_skill = args[4];
if (!thisP || !NativePointer(thisP).readPointer()) {
return -1;
}
local buf = Sq_CallFunc(S_Ptr("0x86067DE"), "pointer", ["pointer", "int"], thisP, slot);
if (!buf) {
return -1;
}
if (is_active_skill && Sq_CallFunc(S_Ptr("0x8608D58"), "byte", ["pointer", "int"], thisP, skillId)) {
local end = skillId ? 7 : 5;
for (local i = 0; i <= end; ++i) {
if (NativePointer(buf).add(2 * i).readU8() == skillId) {
return i;
}
}
for (local i = 198; i <= 203; ++i) {
if (NativePointer(buf).add(2 * i).readU8() == skillId) {
return i;
}
}
}
local pos = 8 + group * 38;
for (local i = 0; i< 38; ++i) {
if (NativePointer(buf).add(2 * (pos + i)).readU8() == skillId) {
return pos + i;
}
}
return -1;
}
Cb_get_skillslot_no2_Leave_Func["月光修复老技能"] <- function(args) {
local thisP = args[0];
local buf = args[1];
local skillId = args[2];
local group = args[3];
local is_active_skill = args[4];
if (!thisP || !NativePointer(thisP).readPointer()) {
return -1;
}
if (is_active_skill) {
local end = skillId ? 7 : 5;
for (local i = 0; i <= end; ++i) {
if (NativePointer(buf).add(2 * i).readU8() == skillId) {
return i;
}
}
for (local i = 198; i <= 203; ++i) {
if (NativePointer(buf).add(2 * i).readU8() == skillId) {
return i;
}
}
}
local pos = 8 + group * 38;
for (local i = 0; i< 38; ++i) {
if (NativePointer(buf).add(2 * (pos + i)).readU8() == skillId) {
return pos + i;
}
}
return -1;
}
NativePointer(0x08604596).writeS8(5);
NativePointer(0x0860459C).writeS8(5);
NativePointer(0x08606A27).writeS8(5);
NativePointer(0x0860795E).writeS8(5);
NativePointer(0x08608CD5).writeS8(8);
NativePointer(0x08608CCF).writeS8(8);
NativePointer(0x08608969).writeS8(8);
NativePointer(0x08609001).writeS8(8);
NativePointer(0x08605090).writeUInt(8 + 38 * 4);
NativePointer(0x08605097).writeUInt(8 + 38 * 5);
NativePointer(0x0860514F).writeUInt(8 + 38 * 3);
NativePointer(0x08605156).writeUInt(8 + 38 * 4);
NativePointer(0x0860513F).writeUInt(8 + 38 * 2);
NativePointer(0x08605146).writeUInt(8 + 38 * 3);
NativePointer(0x0860512F).writeUInt(8 + 38 * 1);
NativePointer(0x08605136).writeUInt(8 + 38 * 2);
NativePointer(0x0860511F).writeUInt(8 + 38 * 0);
NativePointer(0x08605126).writeUInt(8 + 38 * 1);
NativePointer(0x0866C6C4).writeUInt(196);
}
Timer.SetTimeOut(function() {
// 调用函数启用修复
FixOldSkillSlotInfo();
}, 1);

View File

@@ -28,7 +28,6 @@ Cb_MyDisPatcher_DisJointItem_disjoint_Enter_Func["茶服自定义分解机"] <-
if (Sq_CallFunc(S_Ptr("0x81424E8"), "int", ["pointer"], v9)) return null;
}
ChaFuCustomDecompositionFixFlag = true;
//跳过原逻辑
Sq_WriteByteArr(S_Ptr("0x81F92D0"), Haker.AsmGenerateMcd(
@@ -42,6 +41,8 @@ Cb_MyDisPatcher_DisJointItem_disjoint_Enter_Func["茶服自定义分解机"] <-
try {
HandleDisjointRequest(SelfUser, args[1], args[2], args[3], OthersUser, args[5]);
} catch (exception){
print("error:")
print(exception)
Sq_CallFunc(S_Ptr("0x0867bf42"), "int", ["pointer", "int", "char"], SelfUser.C_Object, args[3], 19);
Sq_CallFunc(S_Ptr("0x0867bf42"), "int", ["pointer", "int", "char"], OthersUser.C_Object, args[3], 19);
}
@@ -321,10 +322,11 @@ function HandleDisjointRequest(MyUser, EquStol, Inventype, HeadId, ObjUser, Chan
// 添加物品到玩家背包
// 参数说明:玩家对象, 物品ID, 数量, 类型(6=直接添加), 物品空间指针, 标志位(0)
local slot = MyUser.GiveItem(itemId, itemCount);
// local slot = MyUser.GiveItem(itemId, itemCount);
local slot = Sq_CallFunc(S_Ptr("0x867B6D4"), "int", ["pointer", "int", "int", "int", "pointer", "int"], MyUser.C_Object, itemId, itemCount, 6, item_space.C_Object, 0);
// 将物品信息写入数据包
PackObject.Put_Short(slot[1]); // 槽位
PackObject.Put_Short(slot); // 槽位
PackObject.Put_Int(itemId); // 物品ID
PackObject.Put_Int(itemCount); // 数量
}
@@ -438,7 +440,6 @@ function SetLevelCnt(itemId, equLevel, disjointerLevel) {
return ret;
}
}
// 确保至少返回1个
return baseCount > 0 ? baseCount : 1;
}