This commit is contained in:
parent
9e120025de
commit
47e68ae106
|
|
@ -25,7 +25,7 @@ void DNFTOOL::SetNutArrNum(int Nutͷ
|
||||||
*p = num;
|
*p = num;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DNFTOOL::GetHook(int Addr, std::string 華硊)
|
int DNFTOOL::GetHook(int Addr, std::string µØÖ·,int Type)
|
||||||
{
|
{
|
||||||
size_t pos = 華硊.find("+");
|
size_t pos = 華硊.find("+");
|
||||||
size_t size = 華硊.size();
|
size_t size = 華硊.size();
|
||||||
|
|
@ -48,7 +48,15 @@ int DNFTOOL::GetHook(int Addr, std::string
|
||||||
{
|
{
|
||||||
for (int z = 0; z < i; z++)
|
for (int z = 0; z < i; z++)
|
||||||
{
|
{
|
||||||
num = *(int*)(num + GetHookArr[z]);
|
if (z == i - 1)
|
||||||
|
{
|
||||||
|
if (Type == 0)return *(int*)(num + GetHookArr[z]);
|
||||||
|
else return (num + GetHookArr[z]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
num = *(int*)(num + GetHookArr[z]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ public:
|
||||||
//写Nut头 号位数据
|
//写Nut头 号位数据
|
||||||
static void SetNutArrNum(int Nut头地址, int Pos, int num);
|
static void SetNutArrNum(int Nut头地址, int Pos, int num);
|
||||||
//读内存偏移地址
|
//读内存偏移地址
|
||||||
static int GetHook(int Addr, std::string 華硊);
|
static int GetHook(int Addr, std::string 華硊,int Type = 0);
|
||||||
//解密读取
|
//解密读取
|
||||||
static int DNFDeCode(int Address);
|
static int DNFDeCode(int Address);
|
||||||
//加密写入
|
//加密写入
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,56 @@ static int GetTownYpos(uint32_t v)
|
||||||
SQPushInt(v, DNFTOOL::GetHook(0x1AB7CE0, "0x2C0+"));
|
SQPushInt(v, DNFTOOL::GetHook(0x1AB7CE0, "0x2C0+"));
|
||||||
return 1;
|
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)
|
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_GetRegionIndex", GetRegionIndex);
|
||||||
RegisterNutApi(L"L_sq_GetTownXpos", GetTownXpos);
|
RegisterNutApi(L"L_sq_GetTownXpos", GetTownXpos);
|
||||||
RegisterNutApi(L"L_sq_GetTownYpos", GetTownYpos);
|
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_SendPackType", SendPackType);
|
||||||
RegisterNutApi(L"L_sq_SendPackByte", SendPackByte);
|
RegisterNutApi(L"L_sq_SendPackByte", SendPackByte);
|
||||||
RegisterNutApi(L"L_sq_SendPackWord", SendPackWord);
|
RegisterNutApi(L"L_sq_SendPackWord", SendPackWord);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue