11111
This commit is contained in:
@@ -70,7 +70,7 @@ static SQInteger sq_StringBinById(HSQUIRRELVM v)
|
||||
|
||||
Sq_pushstring(v, cfg, -1);
|
||||
delete[]cfg;
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,8 @@ static SQInteger sq_LongLongOperation(HSQUIRRELVM v)
|
||||
std::string RetString = "";
|
||||
if (Type == "+") {
|
||||
RetString = std::to_string(value1 + value2);
|
||||
}else if(Type == "-") {
|
||||
}
|
||||
else if (Type == "-") {
|
||||
RetString = std::to_string(value1 - value2);
|
||||
}
|
||||
else if (Type == "*") {
|
||||
@@ -123,7 +124,7 @@ static SQInteger sq_LongLongOperation(HSQUIRRELVM v)
|
||||
RetString = std::to_string(value1 / 1000000000.0) + "G";
|
||||
}
|
||||
else {
|
||||
RetString = std::to_string(value1 / 1000000000000.0) + "T";
|
||||
RetString = std::to_string(value1 / 1000000000000.0) + "T";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1065,7 +1066,7 @@ static SQInteger sq_GetWindowById(HSQUIRRELVM v) {
|
||||
Sq_getinteger(v, 2, &Idx);
|
||||
int WindowAddress = GetWindowByIdx(Idx);
|
||||
Sq_pushinteger(v, WindowAddress);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
//选择大地图区域
|
||||
@@ -1228,6 +1229,8 @@ static SQInteger sq_DrawItem(HSQUIRRELVM v)
|
||||
|
||||
//获取SQR的对象转换为原始对象地址
|
||||
typedef int(_cdecl __GetSqrObject)(HSQUIRRELVM a1, int a2);
|
||||
typedef int(_cdecl __PushDnfobject)(HSQUIRRELVM a1, wchar_t* Type, DWORD ObjectAddress, DWORD S);
|
||||
static __PushDnfobject* PushDnfobject = (__PushDnfobject*)0x11809C0;
|
||||
static __GetSqrObject* GetSqrObject = (__GetSqrObject*)0x5c1420;
|
||||
static __GetSqrObject* GetExeObject = (__GetSqrObject*)0x5c13A0;
|
||||
//获取对象地址
|
||||
@@ -1237,6 +1240,18 @@ static SQInteger GetObjectAddress(HSQUIRRELVM v)
|
||||
Sq_pushinteger(v, objAddress);
|
||||
return 1;
|
||||
}
|
||||
//对象地址转换为Sqr对象
|
||||
static SQInteger ObjectAddressToSqrObject(HSQUIRRELVM v)
|
||||
{
|
||||
int objAddress;
|
||||
Sq_getinteger(v, 2, &objAddress);
|
||||
const SQChar* Type;
|
||||
Sq_getstring(v, 3, &Type);
|
||||
int Flag;
|
||||
Sq_getinteger(v, 4, &Flag);
|
||||
PushDnfobject(v, (wchar_t*)Type, objAddress, 0);
|
||||
return 1;
|
||||
}
|
||||
//获取对象名称
|
||||
static SQInteger GetObjectName(HSQUIRRELVM v)
|
||||
{
|
||||
@@ -1249,6 +1264,18 @@ static SQInteger GetObjectName(HSQUIRRELVM v)
|
||||
delete[]name;
|
||||
return 1;
|
||||
}
|
||||
//设置对象名称
|
||||
static SQInteger DeleteObjectName(HSQUIRRELVM v)
|
||||
{
|
||||
int objAddress = GetSqrObject(v, 2);
|
||||
wchar_t* objNameAddress = *(wchar_t**)(objAddress + 0x258);
|
||||
// 遍历字符串直到遇到宽字符空终止符
|
||||
for (wchar_t* p = objNameAddress; *p != L'\0'; ++p) {
|
||||
// 将每个字符替换为空格
|
||||
*p = L' ';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//获取对象名称
|
||||
static SQInteger GetObjectNameByAddress(HSQUIRRELVM v)
|
||||
{
|
||||
@@ -1514,17 +1541,17 @@ static SQInteger GetObjectIsCharacter(HSQUIRRELVM v)
|
||||
return 1;
|
||||
}
|
||||
|
||||
typedef int(__fastcall* _GetObjectAttribute)(DWORD thisc, int Seat, int Type);
|
||||
typedef int(__fastcall* _GetObjectAttribute)(DWORD thisc, int Seat, int Type);
|
||||
typedef int(__fastcall* _FloatDecode)(int Address);
|
||||
static _GetObjectAttribute GetObjectAttributeFunc = (_GetObjectAttribute)0xD07390;
|
||||
static _FloatDecode FloatDecode = (_FloatDecode)0x5B0090;
|
||||
//获取对象属性
|
||||
static SQInteger GetObjectAttribute(HSQUIRRELVM v)
|
||||
{
|
||||
int objAddress ,Type;
|
||||
int objAddress, Type;
|
||||
Sq_getinteger(v, 2, &objAddress);
|
||||
Sq_getinteger(v, 3, &Type);
|
||||
int Ret = GetObjectAttributeFunc(objAddress,0, Type);
|
||||
int Ret = GetObjectAttributeFunc(objAddress, 0, Type);
|
||||
Ret = FloatDecode(Ret);
|
||||
Sq_pushinteger(v, Ret);
|
||||
return 1;
|
||||
@@ -1603,25 +1630,25 @@ static SQInteger SetCharacterAttribute(HSQUIRRELVM v)
|
||||
//获取城镇编号
|
||||
static SQInteger GetTownIndex(HSQUIRRELVM v)
|
||||
{
|
||||
Sq_pushinteger(v, DNFTOOL::GetHook(0x1A5E258, "0xAC+0xD4+",0));
|
||||
Sq_pushinteger(v, DNFTOOL::GetHook(0x1A5E258, "0xAC+0xD4+", 0));
|
||||
return 1;
|
||||
}
|
||||
//获取城镇区域编号
|
||||
static SQInteger GetRegionIndex(HSQUIRRELVM v)
|
||||
{
|
||||
Sq_pushinteger(v, *(int*)(DNFTOOL::GetHook(0x1A5E258, "0xAC+0xD8+",0)));
|
||||
Sq_pushinteger(v, *(int*)(DNFTOOL::GetHook(0x1A5E258, "0xAC+0xD8+", 0)));
|
||||
return 1;
|
||||
}
|
||||
//获取城镇X坐标
|
||||
static SQInteger GetTownXpos(HSQUIRRELVM v)
|
||||
{
|
||||
Sq_pushinteger(v, DNFTOOL::GetHook(0x1AB7CE0, "0x2BC+",0));
|
||||
Sq_pushinteger(v, DNFTOOL::GetHook(0x1AB7CE0, "0x2BC+", 0));
|
||||
return 1;
|
||||
}
|
||||
//获取城镇Y坐标
|
||||
static SQInteger GetTownYpos(HSQUIRRELVM v)
|
||||
{
|
||||
Sq_pushinteger(v, DNFTOOL::GetHook(0x1AB7CE0, "0x2C0+",0));
|
||||
Sq_pushinteger(v, DNFTOOL::GetHook(0x1AB7CE0, "0x2C0+", 0));
|
||||
return 1;
|
||||
}
|
||||
//获取疲劳值
|
||||
@@ -2074,7 +2101,7 @@ static SQInteger LReadAddress(HSQUIRRELVM v)
|
||||
Sq_getinteger(v, 2, &Address);
|
||||
Sq_getstring(v, 3, &offset);
|
||||
|
||||
int Value = DNFTOOL::GetHook(Address, DNFTOOL::wchar_tTochar((wchar_t*)offset),0);
|
||||
int Value = DNFTOOL::GetHook(Address, DNFTOOL::wchar_tTochar((wchar_t*)offset), 0);
|
||||
Sq_pushinteger(v, Value);
|
||||
return 1;
|
||||
}
|
||||
@@ -2743,7 +2770,7 @@ static SQInteger sq_Test(HSQUIRRELVM v)
|
||||
sq_getstring(v, 2, &Path);
|
||||
char* a = new char[1024];
|
||||
//wchar_t* path = L"region/region.lst";
|
||||
SUB_11A2030(0x1D17638,0, (int)Path,(int)a, 0x100000, 0x19DAF4);
|
||||
SUB_11A2030(0x1D17638, 0, (int)Path, (int)a, 0x100000, 0x19DAF4);
|
||||
|
||||
//std::cout << a << std::endl;
|
||||
return 0;
|
||||
@@ -2967,6 +2994,7 @@ static SQInteger L_Str_Ptr(HSQUIRRELVM v)
|
||||
Sq_pushuserpointer(v, (void*)str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static SQInteger New_Point(HSQUIRRELVM v)
|
||||
{
|
||||
SQInteger Len;
|
||||
@@ -3111,7 +3139,7 @@ static SQInteger ConvertWideChar(HSQUIRRELVM v)
|
||||
|
||||
if (CONTAINS_STRING(fromEncoding, "big5")) {
|
||||
|
||||
char* csa = DNFTOOL::wchar_tTochar((wchar_t*) Str);
|
||||
char* csa = DNFTOOL::wchar_tTochar((wchar_t*)Str);
|
||||
wchar_t* name = DNFTOOL::BIG5ToUnicode(csa);
|
||||
char* str = DNFTOOL::UnicodeToUtf8(name);
|
||||
wchar_t* realname = DNFTOOL::charTowchar_t(str);
|
||||
@@ -3123,7 +3151,7 @@ static SQInteger ConvertWideChar(HSQUIRRELVM v)
|
||||
delete[]realname;
|
||||
}
|
||||
else if (CONTAINS_STRING(fromEncoding, "unicode")) {
|
||||
char* str = DNFTOOL::UnicodeToUtf8((wchar_t*)Str);
|
||||
char* str = DNFTOOL::UnicodeToUtf8((wchar_t*)Str);
|
||||
wchar_t* name = DNFTOOL::charTowchar_t(str);
|
||||
free(str);
|
||||
Sq_pushstring(v, name, -1);
|
||||
@@ -3168,7 +3196,7 @@ static SQInteger OutPutTable(HSQUIRRELVM v)
|
||||
void R_Register_Nut() {
|
||||
|
||||
RegisterMyNutApi(L"L_sq_Test", sq_Test);//zlib解压
|
||||
|
||||
|
||||
|
||||
RegisterMyNutApi(L"Sq_OutPutTable", OutPutTable);
|
||||
RegisterMyNutApi(L"Sq_HookFunc", L_HookFunc);
|
||||
@@ -3220,10 +3248,12 @@ void R_Register_Nut() {
|
||||
|
||||
RegisterMyNutApi(L"L_Sq_GetImg", sq_GetImg);//通过Item编号获取图标Img
|
||||
RegisterMyNutApi(L"L_Sq_DrawItem", sq_DrawItem);//绘制Item
|
||||
|
||||
|
||||
RegisterMyNutApi(L"L_Sq_GetObjectAddress", GetObjectAddress);//获取对象地址
|
||||
RegisterMyNutApi(L"L_Sq_ObjectAddressToSqrObject", ObjectAddressToSqrObject);//对象地址转换为Sqr对象
|
||||
RegisterMyNutApi(L"L_Sq_GetRidingObjectAddress", GetRidingObjectAddress);//获取骑乘对象地址
|
||||
RegisterMyNutApi(L"L_Sq_GetObjectName", GetObjectName);//获取对象名字
|
||||
RegisterMyNutApi(L"L_Sq_DeleteObjectName", DeleteObjectName);//设置对象名字
|
||||
RegisterMyNutApi(L"L_Sq_GetObjectNameByAddress", GetObjectNameByAddress);//获取对象名字
|
||||
RegisterMyNutApi(L"L_Sq_GetObjectInfo", GetObjectInfo);//获取对象信息
|
||||
RegisterMyNutApi(L"L_Sq_GetObjectDeInfo", GetObjectDeInfo);//获取对象加密信息
|
||||
|
||||
Reference in New Issue
Block a user