diff --git a/Project/CustomPlugins/lulu/ObjectConvert.nut b/Project/CustomPlugins/lulu/ObjectConvert.nut index 3d2e796..fabf0a5 100644 --- a/Project/CustomPlugins/lulu/ObjectConvert.nut +++ b/Project/CustomPlugins/lulu/ObjectConvert.nut @@ -14,47 +14,47 @@ function sq_GetCNRDObjectToSQRPassiveObject(obj) { return L_Sq_ObjectAddressToSqrObject(L_Sq_GetObjectAddress(obj), "CNSquirrelPassiveObject", 0); } -function sq_GetObjectAbilityInteger(ObjectAddress) +function sq_GetObjectAbilityInteger(obj, ObjectAddressOffset) { - return NativePointer(ObjectAddress).readInt(); + return NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).readInt(); } -function sq_SetObjectAbilityInteger(ObjectAddress, Value) +function sq_SetObjectAbilityInteger(obj, ObjectAddressOffset, Value) { - NativePointer(ObjectAddress).writeInt(Value); + NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).writeInt(Value); } -function sq_GetObjectAbilityFloat(ObjectAddress) +function sq_GetObjectAbilityFloat(obj, ObjectAddressOffset) { - return NativePointer(ObjectAddress).readFloat(); + return NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).readFloat(); } -function sq_SetObjectAbilityFloat(ObjectAddress, Value) +function sq_SetObjectAbilityFloat(obj, ObjectAddressOffset, Value) { - NativePointer(ObjectAddress).writeFloat(Value); + NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).writeFloat(Value); } -function sq_GetObjectAbilityIntegerWithDecrypt(ObjectAddress) +function sq_GetObjectAbilityIntegerWithDecrypt(obj, ObjectAddressOffset) { - return MemoryTool.DecodeMemoryData(ObjectAddress); + return MemoryTool.DecodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset); } -function sq_SetObjectAbilityIntegerWithDecrypt(ObjectAddress, Value) +function sq_SetObjectAbilityIntegerWithDecrypt(obj, ObjectAddressOffset, Value) { - MemoryTool.EncodeMemoryData(ObjectAddress, Value); + MemoryTool.EncodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset, Value); } -function sq_GetObjectAbilityFloatWithDecrypt(ObjectAddress) +function sq_GetObjectAbilityFloatWithDecrypt(obj, ObjectAddressOffset) { - local Res = MemoryTool.DecodeMemoryData(ObjectAddress); + local Res = MemoryTool.DecodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset); local B = blob(); B.writen(Res, 'i'); return B.readn('f'); } -function sq_SetObjectAbilityFloatWithDecrypt(ObjectAddress, Value) +function sq_SetObjectAbilityFloatWithDecrypt(obj, ObjectAddressOffset, Value) { local B = blob(); B.writen(Value, 'f'); - MemoryTool.EncodeMemoryData(ObjectAddress, B.readn('i')); + MemoryTool.EncodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset, B.readn('i')); } \ No newline at end of file