From 1194db30b34f39a53d0f2e8745ef29db3a2fa297 Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Sat, 14 Mar 2026 23:59:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=92=8C=E8=AE=BE=E7=BD=AE=E6=94=BB=E5=87=BB=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E5=80=BC=E7=9A=84=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 sq_GetCurrentAttackInfoDamage 和 sq_SetCurrentAttackInfoDamage 函数,用于读取和修改攻击信息的伤害值,扩展对象能力操作功能 --- Project/CustomPlugins/lulu/ObjectConvert.nut | 41 ++++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/Project/CustomPlugins/lulu/ObjectConvert.nut b/Project/CustomPlugins/lulu/ObjectConvert.nut index fabf0a5..4b6a91e 100644 --- a/Project/CustomPlugins/lulu/ObjectConvert.nut +++ b/Project/CustomPlugins/lulu/ObjectConvert.nut @@ -14,47 +14,56 @@ function sq_GetCNRDObjectToSQRPassiveObject(obj) { return L_Sq_ObjectAddressToSqrObject(L_Sq_GetObjectAddress(obj), "CNSquirrelPassiveObject", 0); } -function sq_GetObjectAbilityInteger(obj, ObjectAddressOffset) -{ +function sq_GetObjectAbilityInteger(obj, ObjectAddressOffset) { return NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).readInt(); } -function sq_SetObjectAbilityInteger(obj, ObjectAddressOffset, Value) -{ +function sq_SetObjectAbilityInteger(obj, ObjectAddressOffset, Value) { NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).writeInt(Value); } -function sq_GetObjectAbilityFloat(obj, ObjectAddressOffset) -{ +function sq_GetObjectAbilityFloat(obj, ObjectAddressOffset) { return NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).readFloat(); } -function sq_SetObjectAbilityFloat(obj, ObjectAddressOffset, Value) -{ +function sq_SetObjectAbilityFloat(obj, ObjectAddressOffset, Value) { NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).writeFloat(Value); } -function sq_GetObjectAbilityIntegerWithDecrypt(obj, ObjectAddressOffset) -{ +function sq_GetObjectAbilityIntegerWithDecrypt(obj, ObjectAddressOffset) { return MemoryTool.DecodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset); } -function sq_SetObjectAbilityIntegerWithDecrypt(obj, ObjectAddressOffset, Value) -{ +function sq_SetObjectAbilityIntegerWithDecrypt(obj, ObjectAddressOffset, Value) { MemoryTool.EncodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset, Value); } -function sq_GetObjectAbilityFloatWithDecrypt(obj, ObjectAddressOffset) -{ +function sq_GetObjectAbilityFloatWithDecrypt(obj, ObjectAddressOffset) { local Res = MemoryTool.DecodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset); local B = blob(); B.writen(Res, 'i'); return B.readn('f'); } -function sq_SetObjectAbilityFloatWithDecrypt(obj, ObjectAddressOffset, Value) -{ +function sq_SetObjectAbilityFloatWithDecrypt(obj, ObjectAddressOffset, Value) { local B = blob(); B.writen(Value, 'f'); MemoryTool.EncodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset, B.readn('i')); +} + + + +function sq_GetCurrentAttackInfoDamage(attackInfo) { + local AtkC = L_sq_P2I(attackInfo["__ot"][28259608]); + local Res = MemoryTool.DecodeMemoryData(AtkC + 0x0); + local B = blob(); + B.writen(Res, 'i'); + return B.readn('f'); +} + +function sq_SetCurrentAttackInfoDamage(attackInfo, damage) { + local AtkC = L_sq_P2I(attackInfo["__ot"][28259608]); + local B = blob(); + B.writen(damage, 'f'); + MemoryTool.EncodeMemoryData(AtkC + 0x0, B.readn('i')); } \ No newline at end of file