This commit is contained in:
2024-09-16 17:09:36 +08:00
commit 39d60b284e
47 changed files with 12314 additions and 0 deletions

View File

@@ -0,0 +1,113 @@
/*
文件名: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);

302
Base/_Z_Data/ItemData.nut Normal file
View File

@@ -0,0 +1,302 @@
/*
文件名:ItemData.nut
路径:Base/_Z_Data/ItemData.nut
创建日期:2024-08-06 23:58
文件用途:用于存放Item数据
*/
if (!getroottable().rawin("Rindro_ItemInfoObject")) Rindro_ItemInfoObject <- {};
if (!getroottable().rawin("Rindro_ItemInfoBuf")) Rindro_ItemInfoBuf <- "";
if (!getroottable().rawin("RINDRO_INIT_FLAG")) RINDRO_INIT_FLAG <- false;
//获取本地配置
function Rindro_GetLocalConfig() {
local Buf = L_sq_GetLocalConfig();
if (!Buf) {
return {
md5 = -1
};
} else return Json.Decode(Buf);
}
// if (!getroottable().rawin("RINDRO_CONFIG"))
RINDRO_CONFIG <- Rindro_GetLocalConfig();
//获取本地信息版本
function Rindro_GetMd5() {
return RINDRO_CONFIG.md5;
}
//初始化各种信息
function Rindro_Init() {
//道具信息
local ItemArray = getroottable().RINDRO_CONFIG.itemInfo;
Rindro_ItemInfoBuf = "";
foreach(Value in ItemArray) {
if (Value.Name2.len() == 0)
Value.Name2 = "Rindro-Team";
getroottable().Rindro_ItemInfoObject[Value.Id] <- Value;
}
RINDRO_INIT_FLAG = true;
}
//更新本地配置
function Rindro_ItemInfoCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
if ("ZipSEnd" in Jso) {
getroottable().Rindro_ItemInfoObject <- {};
Rindro_ItemInfoBuf += Jso.ZipS;
local ZlibStrBuf = L_sq_Dezlib(Rindro_ItemInfoBuf);
if (ZlibStrBuf == "null") {
Rindro_ItemInfoBuf = "";
return;
}
L_sq_SetLocalConfig(ZlibStrBuf);
getroottable().RINDRO_CONFIG <- Json.Decode(ZlibStrBuf);
Rindro_Init();
} else {
Rindro_ItemInfoBuf += Jso.ZipS;
}
}
Pack_Control.rawset(20240422, Rindro_ItemInfoCallBack);
//无需更新本地配置
Pack_Control.rawset(20240424, function(Chunk) {
Rindro_Init();
});
//道具绘制类
class ItemInfoClass {
//Gm模式
GmModel = true;
Info = null;
PageLength = 0;
//静态品级颜色
static RarityColor = [
0xFFFFFFFF, //白
0xFFEDD568, //蓝
0xFFFF6BB3, //紫
0xFFF000FF, //粉
0xFF00B1FF, //黄
0xFF6666FF, //红
0xFF0055FF, //橙
];
//我的品级颜色
MyRarityColor = null;
//我的售价长度
MyPriceLength = null;
//我的冷却时间长度
MyCoolTimeLength = null;
//获取真实类型
function GetRealType(Type) {
switch (Type) {
case "[material]":
return "材料";
case "[recipe]":
return "设计图";
case "[upgradable legacy]":
return "袖珍罐";
case "[quest]":
return "任务";
case "[booster random]":
case "[multi upgradable legacy]":
case "[booster selection]":
case "[cera booster]":
case "[unlimited waste]":
case "[usable cera package]":
case "[only effect]":
return "消耗品";
case "[weapon]":
return "武器";
case "[title name]":
return "称号";
case "[coat]":
return "上衣";
case "[pants]":
return "下衣";
case "[hat]":
return "帽子";
case "[shoulder]":
return "护肩";
case "[waist]":
return "腰带";
case "[shoes]":
return "鞋子";
case "[amulet]":
return "项链";
case "[wrist]":
return "手镯";
case "[ring]":
return "戒指";
case "[support]":
return "辅助装备";
case "[aurora avatar]":
return "光环";
case "[magic stone]":
return "魔法石";
case "[creature]":
return "寵物";
case "[artifact red]":
return "宠物装备 红";
case "[artifact blue]":
return "宠物装备 蓝";
case "[artifact green]":
return "宠物装备 绿";
case "[skin avatar]":
return "皮肤";
case "[hair avatar]":
return "头部装扮";
case "[waist avatar]":
return "腰部装扮";
case "[hat avatar]":
return "帽子装扮";
case "[coat avatar]":
return "上衣装扮";
case "[face avatar]":
return "脸部装扮";
case "[breast avatar]":
return "胸部装扮";
case "[pants avatar]":
return "下装装扮";
case "[shoes avatar]":
return "鞋装扮";
default:
return "道具";
}
}
constructor(gInfo) {
Info = clone(gInfo);
//Gm模式显示编号
if (GmModel) Info.Name += "[" + Info.Id + "]";
//配置品级颜色
if (Info.Rarity< 0 || Info.Rarity > 6) {
MyRarityColor = Info.Rarity;
} else {
MyRarityColor = RarityColor[Info.Rarity];
}
//配置售价长度
if ("Price" in Info) {
MyPriceLength = LenheartTextClass.GetStringLength(Info.Price.tostring());
}
//配置冷却时间长度
if ("CoolTime" in Info) {
MyCoolTimeLength = LenheartTextClass.GetStringLength((Info.CoolTime / 1000.0).tostring());
}
//配置类型
if ("Type" in Info) {
Info.Type = GetRealType(Info.Type);
}
//配置装备类型
else if ("EquipmentType" in Info) {
Info.Type <- GetRealType(Info.EquipmentType);
}
PageLength += 72;
CheckStrLength();
}
function CheckInfoLength(TableKey, AddLength) {
if (TableKey in Info) {
PageLength += AddLength;
}
}
function CheckStrLength() {
if ("Explain" in Info) {
// local Buf = LenheartTextClass.GetStringLength(Info.Explain.tostring());
// local Pn = (Buf / 211.0);
// if (Pn< 1) PageLength += 12;
// if (Pn > 1) Pn = Pn.tointeger() + 1;
// PageLength += (16 * Pn);
local Buf = L_sq_GetStringDrawArray(Info.Explain, 220);
PageLength += (Buf.len() * 16);
// PageLength += 12;
}
}
//高级绘制文字(带换行)
function L_sq_DrawCode_Ex(str, x, y, rgba, mb, jc, hl) {
local strarr = [];
if (str.find("\n") == null) L_sq_DrawCode(str, x, y, rgba, mb, jc);
else {
local Bpos = 0;
while (true) {
local Npos = str.find("\n", Bpos);
if (!Npos) {
local strbuff = str.slice(Bpos, str.len());
strarr.append(strbuff);
break;
}
local strbuff = str.slice(Bpos, Npos);
strarr.append(strbuff);
Bpos = Npos + 1;
}
for (local z = 0; z< strarr.len(); z++) {
L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc);
}
}
}
function Show(X, Y) {
if (X< 0) X = 0;
if ((X + 211) > 800) X = (800 - 211);
if (Y< 0) Y = 0;
if (Y + PageLength > 600) Y = 600 - PageLength;
//Item信息框一般为211的宽度
L_sq_DrawWindow(X, Y, 211, PageLength, "interface2/popup/popup.img", 134, 6, 12, 6, 13);
//绘制名字 和 图标
if ("Id" in Info) L_Sq_DrawItem(X + 8 + 174, Y + 8, Info.Id, 1, 0, 0, 0);
if ("Name2" in Info) L_sq_DrawCode(Info.Name2, X + 8, Y + 9, MyRarityColor, 1, 1);
if ("Name" in Info) L_sq_DrawCode(Info.Name, X + 8, Y + 23, MyRarityColor, 1, 1);
//绘制线
L_sq_DrawImg("interface2/popup/popup.img", 270, X + 7, Y + 26 + 16);
//绘制重量
if ("Weight" in Info) {
L_sq_DrawCode((Info.Weight.tofloat() / 1000.0).tostring() + "kg", X + 7, Y + 24 + 24, 0xFFFFFFFF, 1, 1);
}
//绘制售价
if ("Price" in Info) {
L_sq_DrawCode("金币", X + 186, Y + 24 + 24, 0xFFFFFFFF, 1, 1);
L_sq_DrawCode(Info.Price.tostring(), X - MyPriceLength + 186, Y + 24 + 24, 0xFFFFFFFF, 1, 1);
}
//绘制类型
if ("Type" in Info) {
L_sq_DrawCode(Info.Type.tostring(), X + 7, Y + 48 + 16, 0xFFFFFFFF, 1, 1);
}
//绘制冷却时间
if ("CoolTime" in Info) {
L_sq_DrawCode("秒", X + 186 + 12, Y + 48 + 16, 0xFFFFFFFF, 1, 1);
L_sq_DrawCode((Info.CoolTime / 1000.0).tostring(), X - MyCoolTimeLength + 214 - 18, Y + 48 + 16, 0xFFFFFFFF, 1, 1);
}
//绘制普通描述
if ("Explain" in Info) {
local a = L_sq_GetStringDrawArray(Info.Explain, 220);
foreach(Pos, va in a) {
L_sq_DrawCode(va, X + 7, Y + 48 + 12 + 24 + (Pos * 16), 0xFFEDD568, 1, 1);
}
}
}
}