Rindro-Sqr/Base/_Z_Data/CharacterInfoData.nut

113 lines
4.4 KiB
Plaintext

/*
文件名:CharacterInfoData.nut
路径:Base/_Z_Data/CharacterInfoData.nut
创建日期:2024-09-03 11:34
文件用途:角色信息数据
*/
//读取属性数据
function Lenheart_Character_GetAttribute(Address) {
//传入读传入不传读自己
local ObjectAddress = Address;
if (ObjectAddress == null)
ObjectAddress = L_sq_RA(0x1AB7CDC);
if (!ObjectAddress) return;
local Info = {};
//当前HP
Info.CurHp <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2BEC);
//总HP
Info.MaxHp <- L_sq_RA(ObjectAddress + 0x36A0);
//当前MP
Info.CurMp <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2BF8);
//总MP
Info.MaxMp <- L_sq_RA(ObjectAddress + 0x36A4);
//力量
Info.Strength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2364);
//智力
Info.Intellect <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2394);
//体力
Info.Vitality <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x237C);
//精神
Info.Spirit <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x23AC);
//物理攻击 (没读武器精通)
Info.PhysicalAttack <- (MemoryTool.DecodeMemoryData(ObjectAddress + 0x1E54) * (Info.Strength.tofloat() * 0.004 + 1)).tointeger() + MemoryTool.DecodeMemoryData(ObjectAddress + 0x1EB4);
//魔法攻击
Info.MagicalAttack <- (MemoryTool.DecodeMemoryData(ObjectAddress + 0x1E84) * (Info.Intellect.tofloat() * 0.004 + 1)).tointeger() + MemoryTool.DecodeMemoryData(ObjectAddress + 0x1ED8);
//独立攻击力 //TODO 需要加上成长独立攻击力 需要服务端发送给我
Info.IndependentAttack <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x22C8) + MemoryTool.DecodeMemoryData(ObjectAddress + 0x22F8);
//物理防御
Info.PhysicalDefend <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x273C);
//魔法防御
Info.MagicalDefend <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x276C);
//物理暴击
Info.PhysicalCrit <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1F14);
//魔法暴击
Info.MagicalCrit <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1F20);
//攻击速度
Info.AttackSpeed <- (MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x2688) - 1.0) * 100.0;
//释放速度
Info.ReleaseSpeed <- (MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x26A0) - 1.0) * 100.0;
//移动速度
Info.MoveSpeed <- (MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x2670) - 1.0) * 100.0;
//抗魔值
local Kbuf = 0;
for (local i = 1; i< 13; ++i) {
local EquOffset = Rindro_GetEquAddr(i);
local AbAddress = L_sq_RA(ObjectAddress + EquOffset);
if (AbAddress) {
Kbuf += MemoryTool.DecodeMemoryData(AbAddress + 0xAD4);
}
}
Info.AntiMagic <- Kbuf;
//命中率
Info.HitRate <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1F50);
//闪避率
Info.DodgeRate <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1C50);
//HP回复量
Info.HPRecovery <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1D64) * 1.6;
//MP回复量
Info.MPRecovery <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1D7C) * 7.2;
//僵直度
Info.StunRate <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1DF4);
//硬直
Info.StunResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1DDC);
//火属性强化
Info.FireStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B54);
//冰属性强化
Info.IceStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B60);
//光属性强化
Info.LightStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B78);
//暗属性强化
Info.DarkStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B6C);
//火属性抗性
Info.FireResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1AF4);
//冰属性抗性
Info.IceResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B00);
//光属性抗性
Info.LightResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B18);
//暗属性抗性
Info.DarkResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B0C);
//名望值
Info.Fame <- 0;
//最终伤害
Info.FinalDamage <- 0;
return Info;
}
// function Rindro_GetCharacterInfoCallBack(Chunk) {
// local Jso = Json.Decode(Chunk);
// Jso.op <- 20069011;
// Jso.Info <- Lenheart_Character_GetAttribute(null);
// Rindro_BaseToolClass.SendPackEx(Jso);
// }
// Pack_Control.rawset(20069010, Rindro_GetCharacterInfoCallBack);