2026-02-09 23:36:05 +08:00
|
|
|
/*
|
|
|
|
|
文件名:ObjectConvert.nut
|
|
|
|
|
路径:Project/CustomPlugins/lulu/ObjectConvert.nut
|
|
|
|
|
创建日期:2026-02-09 23:33
|
|
|
|
|
文件用途:
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function sq_GetCNRDObjectToPassiveObject(obj) {
|
|
|
|
|
return L_Sq_ObjectAddressToSqrObject(L_Sq_GetObjectAddress(obj), "CNRDPassiveObject", 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function sq_GetCNRDObjectToSQRPassiveObject(obj) {
|
|
|
|
|
return L_Sq_ObjectAddressToSqrObject(L_Sq_GetObjectAddress(obj), "CNSquirrelPassiveObject", 0);
|
2026-03-10 19:31:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-14 23:59:31 +08:00
|
|
|
function sq_GetObjectAbilityInteger(obj, ObjectAddressOffset) {
|
2026-03-11 01:06:17 +08:00
|
|
|
return NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).readInt();
|
2026-03-10 19:31:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-14 23:59:31 +08:00
|
|
|
function sq_SetObjectAbilityInteger(obj, ObjectAddressOffset, Value) {
|
2026-03-11 01:06:17 +08:00
|
|
|
NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).writeInt(Value);
|
2026-03-10 19:31:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-14 23:59:31 +08:00
|
|
|
function sq_GetObjectAbilityFloat(obj, ObjectAddressOffset) {
|
2026-03-11 01:06:17 +08:00
|
|
|
return NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).readFloat();
|
2026-03-10 19:31:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-14 23:59:31 +08:00
|
|
|
function sq_SetObjectAbilityFloat(obj, ObjectAddressOffset, Value) {
|
2026-03-11 01:06:17 +08:00
|
|
|
NativePointer(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset).writeFloat(Value);
|
2026-03-10 19:31:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-14 23:59:31 +08:00
|
|
|
function sq_GetObjectAbilityIntegerWithDecrypt(obj, ObjectAddressOffset) {
|
2026-03-11 01:06:17 +08:00
|
|
|
return MemoryTool.DecodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset);
|
2026-03-10 19:31:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-14 23:59:31 +08:00
|
|
|
function sq_SetObjectAbilityIntegerWithDecrypt(obj, ObjectAddressOffset, Value) {
|
2026-03-11 01:06:17 +08:00
|
|
|
MemoryTool.EncodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset, Value);
|
2026-03-10 19:31:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-14 23:59:31 +08:00
|
|
|
function sq_GetObjectAbilityFloatWithDecrypt(obj, ObjectAddressOffset) {
|
2026-03-11 01:06:17 +08:00
|
|
|
local Res = MemoryTool.DecodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset);
|
2026-03-10 19:31:51 +08:00
|
|
|
local B = blob();
|
|
|
|
|
B.writen(Res, 'i');
|
|
|
|
|
return B.readn('f');
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-14 23:59:31 +08:00
|
|
|
function sq_SetObjectAbilityFloatWithDecrypt(obj, ObjectAddressOffset, Value) {
|
2026-03-10 19:31:51 +08:00
|
|
|
local B = blob();
|
|
|
|
|
B.writen(Value, 'f');
|
2026-03-11 01:06:17 +08:00
|
|
|
MemoryTool.EncodeMemoryData(L_Sq_GetObjectAddress(obj) + ObjectAddressOffset, B.readn('i'));
|
2026-03-14 23:59:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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');
|
2026-03-15 01:10:58 +08:00
|
|
|
B.seek(0);
|
2026-03-14 23:59:31 +08:00
|
|
|
return B.readn('f');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function sq_SetCurrentAttackInfoDamage(attackInfo, damage) {
|
|
|
|
|
local AtkC = L_sq_P2I(attackInfo["__ot"][28259608]);
|
|
|
|
|
local B = blob();
|
|
|
|
|
B.writen(damage, 'f');
|
2026-03-15 01:10:58 +08:00
|
|
|
B.seek(0);
|
2026-03-14 23:59:31 +08:00
|
|
|
MemoryTool.EncodeMemoryData(AtkC + 0x0, B.readn('i'));
|
2026-02-09 23:36:05 +08:00
|
|
|
}
|