Hey there,
It's been a while, but guess what... Hi.
Most of you should've faced this bug already, the bug is basically because joymax did not limit guild skill points or even make it unsigned.
The first thing that crossed my mind was doing it through game server, I did it actually but after testing in a live server, it actually caused a disconnect problem. Then I realized that it was because the value stored in the game server that I modified was fine, but SQL was not :D
I actually still could do it through game server, but a better idea crossed my mind, why don't we do it through sro client instead!
So, basically this limits guild point donation to provide positive values only. However, the bug can still occur if somebody donates with a packet injector unless you fix it in server-side too, but anyways who wants to harm himself with minus GP? Client-side shall be enough.
CInterfaceNetSender.h:
Code:
#pragma once
#include <iostream>
class CInterfaceNetSender
{
private:
char pad_0000[8504]; //0x0000
unsigned int GuildSkillPoints; //0x2138
char pad_2140[8]; //0x213C
std::wstring GuildName; //0x2140
std::wstring CharName; //0x2160
public:
void DonateGuildPoints(unsigned int GP);
};
CInterfaceNetSender.cpp:
Code:
#define GP_LIMIT 0x7FFFFFFF
void CInterfaceNetSender::DonateGuildPoints(unsigned int GP)
{
if (GuildSkillPoints == GP_LIMIT)
{
CGInterface* g_interface = CGInterface::GetInterface();
if (g_interface)
{
g_interface->HandleSystemMessages(1, L"You have reached maximum limit of guild skills points.");
g_interface->ShowBlueNotify(L"You have reached maximum limit of guild skills points.");
}
}
else
{
unsigned int TotalGP = GuildSkillPoints + GP;
if (TotalGP > GP_LIMIT && GuildSkillPoints < GP_LIMIT)
GP = GP_LIMIT - GuildSkillPoints;
reinterpret_cast<void(__thiscall*)(CInterfaceNetSender*, unsigned int)>(0x0081FAB0)(this, GP);
}
}
A small hook of flo's:
Code:
replaceOffset(0x0070BCF2, addr_from_this(&CInterfaceNetSender::DonateGuildPoints));
flo's lib, in case you're interested:
[Only registered and activated users can see links. Click Here To Register...]
And that's it, good luck.
Special Thanks To: florian0