Core/Guilds: Implement guild bank gold limit matching client

Port From (https://github.com/TrinityCore/TrinityCore/commit/def97385ccb3e81ae8e5661479118d12cf0372de)
This commit is contained in:
hondacrx
2022-01-07 12:48:25 -05:00
parent 5b73cb06e7
commit da3895b215
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -25,6 +25,7 @@ namespace Framework.Constants
public const int MaxBankSlots = 98;
public const int BankMoneyLogsTab = 100;
public const ulong MoneyLimit = 100000000000;
public const uint WithdrawMoneyUnlimited = 0xFFFFFFFF;
public const int WithdrawSlotUnlimited = -1;
public const uint EventLogGuidUndefined = 0xFFFFFFFF;
+7
View File
@@ -824,6 +824,13 @@ namespace Game.Guilds
// Call script after validation and before money transfer.
Global.ScriptMgr.OnGuildMemberDepositMoney(this, player, amount);
if (m_bankMoney > GuildConst.MoneyLimit - amount)
{
if (!cashFlow)
SendCommandResult(session, GuildCommandType.MoveItem, GuildCommandError.TooMuchMoney);
return;
}
SQLTransaction trans = new();
_ModifyBankMoney(trans, amount, true);
if (!cashFlow)