This commit is contained in:
2022-03-27 17:17:12 +08:00
parent 9e120025de
commit 47e68ae106
3 changed files with 64 additions and 3 deletions

View File

@@ -174,6 +174,56 @@ static int GetTownYpos(uint32_t v)
SQPushInt(v, DNFTOOL::GetHook(0x1AB7CE0, "0x2C0+"));
return 1;
}
//获取疲劳值
static int GetFatigue(uint32_t v)
{
int Type;
int num = SQGetTop(v);
if (num == 2)
{
SQGetInt(v, 2, &Type);
switch (Type)
{
case 0:
SQPushInt(v, DNFTOOL::DNFDeCode(0x1AB7E1C));
break;
case 1:
SQPushInt(v, DNFTOOL::DNFDeCode(0x1AB7E10));
break;
default:
SQPushBool(v,false);
break;
}
}
return 1;
}
//获取经验值
static int GetExp(uint32_t v)
{
int Type;
int num = SQGetTop(v);
if (num == 2)
{
SQGetInt(v, 2, &Type);
switch (Type)
{
case 0:
SQPushInt(v, DNFTOOL::DNFDeCode(DNFTOOL::GetHook(0x1AB7CDC, "0x3C4C+",1)));
break;
case 1:
SQPushInt(v, DNFTOOL::DNFDeCode(DNFTOOL::GetHook(0x1AB7CDC, "0x3C40+",1)));
break;
default:
SQPushBool(v, false);
break;
}
}
return 1;
}
//发包类型
static int SendPackType(uint32_t v)
@@ -875,6 +925,9 @@ void squirrel::R_Register_Nut()
RegisterNutApi(L"L_sq_GetRegionIndex", GetRegionIndex);
RegisterNutApi(L"L_sq_GetTownXpos", GetTownXpos);
RegisterNutApi(L"L_sq_GetTownYpos", GetTownYpos);
RegisterNutApi(L"L_sq_GetFatigue", GetFatigue);
RegisterNutApi(L"L_sq_GetExp", GetExp);
RegisterNutApi(L"L_sq_SendPackType", SendPackType);
RegisterNutApi(L"L_sq_SendPackByte", SendPackByte);
RegisterNutApi(L"L_sq_SendPackWord", SendPackWord);