slp13at420
Mad Scientist
How to Bypass the gold cap. TrinityCore2 with Boost
thanks to all those who posted the fix as the core changes [MENTION=10]AlexeWarr[/MENTION], [MENTION=428]darksoke[/MENTION] and more , this is just another update to the work-a-round for players gold cap. this is just a more in-depth work-around with help from [MENTION=6]Rochet2[/MENTION].
go to \src\server\game\Entities\Player and open player.cpp.
search for this block around line 22744 :
go to 'if (sendError)'
and remove these 3 consecutive lines:
and add these lines within the `{}` brackets:
the block should look like this now:
edit item_ID to the sql id of an item you chose with a buy/sell value of 50k gold (500000000)
basically when a player loots or receives gold that max's there amount, this will remove 200k gold and give 4 items worth 50k gold each allowing the gold/silver/copper currently attempting to add to be added.
this award for amounts over 50k gold for players current gold count and reward for players amounts over 50k gold of current loot.
should work as a good catch-22
thanks to all those who posted the fix as the core changes [MENTION=10]AlexeWarr[/MENTION], [MENTION=428]darksoke[/MENTION] and more , this is just another update to the work-a-round for players gold cap. this is just a more in-depth work-around with help from [MENTION=6]Rochet2[/MENTION].
go to \src\server\game\Entities\Player and open player.cpp.
search for this block around line 22744 :
Code:
bool Player::ModifyMoney(int32 amount, bool sendError /*= true*/)
{
if (!amount)
return true;
sScriptMgr->OnPlayerMoneyChanged(this, amount);
if (amount < 0)
SetMoney (GetMoney() > uint32(-amount) ? GetMoney() + amount : 0);
else
{
if (GetMoney() < MAX_MONEY_AMOUNT - static_cast<uint32>(amount))
SetMoney(GetMoney() + amount);
else
{
[COLOR="#FF0000"]sScriptMgr->OnPlayerMoneyLimit(this, amount);
if (sendError)
SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL
return false;[/COLOR]
}
}
return true;
}
go to 'if (sendError)'
and remove these 3 consecutive lines:
Code:
[COLOR="#FF0000"]sScriptMgr->OnPlayerMoneyLimit(this, amount);
if (sendError)
SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL
return false;[/COLOR]
and add these lines within the `{}` brackets:
Code:
static const uint32 item_ID = ITEM_SQL_ID; // the id of your item worth 50k gold buy/sell
const ItemTemplate* currency = sObjectMgr->GetItemTemplate(item_ID);
if(!currency)
{
sScriptMgr->OnPlayerMoneyLimit(this, amount);
if (sendError)
SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL);
return false;
}
uint16 Pamount = (GetMoney() / 500000000); // int16 since the answer shouldnt be large or somethings wrong
uint16 Namount = (amount / 500000000);
uint16 Icount = Pamount + Namount;
uint64 Ptotal = GetMoney() + amount;
if(!AddItem(item_ID, Icount))
return false;
SetMoney(Ptotal - (Icount * 500000000));
ChatHandler(GetSession()).PSendSysMessage("|cFFFFCC00You have reached the gold limit and have been compensated with %u Gold Bar's|r!", Icount);
return true;
the block should look like this now:
Code:
bool Player::ModifyMoney(int32 amount, bool sendError /*= true*/)
{
if (!amount)
return true;
sScriptMgr->OnPlayerMoneyChanged(this, amount);
if (amount < 0)
SetMoney (GetMoney() > uint32(-amount) ? GetMoney() + amount : 0);
else
{
if (GetMoney() < MAX_MONEY_AMOUNT - static_cast<uint32>(amount))
SetMoney(GetMoney() + amount);
else
{
static const uint32 item_ID = ITEM_SQL_ID; // the id of your item worth 50k gold buy/sell
const ItemTemplate* currency = sObjectMgr->GetItemTemplate(item_ID);
if(!currency)
{
sScriptMgr->OnPlayerMoneyLimit(this, amount);
if (sendError)
SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL);
return false;
}
uint16 Pamount = (GetMoney() / 500000000); // int16 since the answer shouldnt be large or somethings wrong
uint16 Namount = (amount / 500000000);
uint16 Icount = Pamount + Namount;
uint64 Ptotal = GetMoney() + amount;
if(!AddItem(item_ID, Icount))
return false;
SetMoney(Ptotal - (Icount * 500000000));
ChatHandler(GetSession()).PSendSysMessage("|cFFFFCC00You have reached the gold limit and have been compensated with %u Gold Bar's|r!", Icount);
return true;
}
}
return true;
}
edit item_ID to the sql id of an item you chose with a buy/sell value of 50k gold (500000000)
basically when a player loots or receives gold that max's there amount, this will remove 200k gold and give 4 items worth 50k gold each allowing the gold/silver/copper currently attempting to add to be added.
this award for amounts over 50k gold for players current gold count and reward for players amounts over 50k gold of current loot.
should work as a good catch-22
A full version of this exists in the donor section
Last edited: