Skip to content

Commit

Permalink
Merge pull request #24 from 444Ro666/myBranch
Browse files Browse the repository at this point in the history
My branch
  • Loading branch information
444Ro666 authored Oct 23, 2023
2 parents f2eef5b + b2123a7 commit 1e0b67c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ezorsia/AutoTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,7 @@ static auto _IWzNameSpace__Mount = reinterpret_cast<_IWzNameSpace__Mount_t>(0x00
static _IWzNameSpace__Mount_t _IWzNameSpace__Mount_Hook = [](void* pThis, void* edx, void* sPath, void* pDown, int nPriority) {
//-> HRESULT {_IWzNameSpace__Mount(pThis, edx, sPath, pDown, nPriority); //HRESULT //return _IWzNameSpace__Mount(pThis, edx, sPath, pDown, nPriority);
return _IWzNameSpace__Mount(pThis, edx, sPath, pDown, nPriority);
};
};

typedef void* (__cdecl* _lpfn_NextLevel_t)(int[]);
static auto _lpfn_NextLevel = reinterpret_cast<_lpfn_NextLevel_t>(0x0078C8A6);
37 changes: 36 additions & 1 deletion ezorsia/ReplacementFuncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,39 @@ bool HookMyTestHook(bool bEnable)
{ return Memory::SetHook(bEnable, reinterpret_cast<void**>(&_CWndCreateWnd), _CWndCreateWnd_Hook); }

bool HookDetectLogin(bool bEnable)
{ return Memory::SetHook(bEnable, reinterpret_cast<void**>(&_CLoginSendSelectCharPacket), _CLoginSendSelectCharPacket_Hook); }
{ return Memory::SetHook(bEnable, reinterpret_cast<void**>(&_CLoginSendSelectCharPacket), _CLoginSendSelectCharPacket_Hook); }

int myArrayForCustomEXP[] = { 15, 15, 34, 57, 92, 135, 372, 560, 840, 1144, 1242, 1573, 2144, 2800, 3640, 4700, 5893, 7360, 9144, 11120, 13477, 16268, 19320, 22880, 27008, 31477, 36600, 42444, 48720, 55813, 63800, 86784, 98208, 110932, 124432, 139372, 155865, 173280, 192400, 213345, 235372, 259392, 285532, 312928, 342624, 374760, 408336, 445544, 483532, 524160, 567772, 598886, 631704, 666321, 702836, 741351, 781976, 824828, 870028, 917625, 967995, 1021041, 1076994, 1136013, 1198266, 1263930, 1333194, 1406252, 1483314, 1564600, 1650340, 1740778, 1836173, 1936794, 2042930, 2154882, 2272970, 2397528, 2528912, 2667496, 2813674, 2967863, 3130502, 3302053, 3483005, 3673873, 3875201, 4087562, 4311559, 4547832, 4797053, 5059931, 5337215, 5629694, 5938202, 6263614, 6606860, 6968915, 7350811, 7753635, 8178534, 8626718, 9099462, 9598112, 10124088, 10678888, 11264090, 11881362, 12532461, 13219239, 13943653, 14707765, 15513750, 16363902, 17260644, 18206527, 19204245, 20256637, 21366700, 22537594, 23772654, 25075395, 26449526, 27898960, 29427822, 31040466, 32741483, 34535716, 36428273, 38424542, 40530206, 42751262, 45094030, 47565183, 50171755, 52921167, 55821246, 58880250, 62106888, 65510344, 69100311, 72887008, 76881216, 81094306, 85594273, 90225770, 95170142, 100385466, 105886589, 111689174, 117809740, 124265714, 131075474, 138258410, 145834970, 153826726, 162256430, 171148082, 180526997, 190419876, 200854885, 211861732, 223471711, 223471711, 248635353, 262260570, 276632449, 291791906, 307782102, 324648562, 342439302, 361204976, 380999008, 401877754, 423900654, 447130410, 471633156, 497478653, 524740482, 553496261, 583827855, 615821622, 649568646, 685165008, 722712050, 762316670, 804091623, 848155844, 894634784, 943660770, 995373379, 1049919840, 1107455447, 1168144006, 1232158297, 1299680571, 1370903066, 1446028554, 1525246918, 1608855764, 1697021059 };
const int maxLevelForCustomEXP = sizeof(myArrayForCustomEXP);//paste your custom exp table's array into the place of myArrayForCustomEXP[]
void* __fastcall _lpfn_NextLevel_Hook(int expTable[maxLevelForCustomEXP]) //your max level is the size of your array
{
memcpy(expTable, myArrayForCustomEXP, maxLevelForCustomEXP); //ty to creator of github.com/PurpleMadness/CustomExpTable
expTable[maxLevelForCustomEXP] = 0; //insert your own formula or predefined array into this part. MUST MATCH server numbers
return expTable; //currently using predefined array
}
//void* __fastcall _lpfn_NextLevel_v62_Hook(int expTable[]) //formula for v62 exp table, kept for reference/example
//{ //if you want to use it remember to change the setting in Hook_lpfn_NextLevel
// int level = 1;
// while (level <= 5)
// {
// expTable[level] = level * (level * level / 2 + 15);
// level++;
// }
// while (level <= 50)
// {
// expTable[level] = level * level / 3 * (level * level / 3 + 19);
// level++;
// }
// while (level < 200)
// {
// expTable[level] = long(double(expTable[level - 1]) * 1.0548);
// level++;
// }
// expTable[200] = 0; //you need a MAX_INT checker for exp if you have levels over 200 and are not using a predefined array
// return expTable;
//}
bool Hook_lpfn_NextLevel(bool bEnable)
{
return Memory::SetHook(bEnable, reinterpret_cast<void**>(&_lpfn_NextLevel), _lpfn_NextLevel_Hook);
//return Memory::SetHook(bEnable, reinterpret_cast<void**>(&_lpfn_NextLevel), _lpfn_NextLevel_v62_Hook);
}
1 change: 1 addition & 0 deletions ezorsia/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReser
HookIWzNameSpace__Mount(true);
HookCWvsApp__InitializeResMan(false); //experimental //ty to all the contributors of the ragezone release: Client load .img instead of .wz v62~v92
Hook_StringPool__GetString(true); //hook stringpool modification //ty !! popcorn //ty darter
Hook_lpfn_NextLevel(true);
//Hook_get_unknown(true);
//Hook_get_resource_object(true); //helper function hooks //ty teto for helping me get started
//Hook_com_ptr_t_IWzProperty__ctor(true);
Expand Down

0 comments on commit 1e0b67c

Please sign in to comment.