Core/Loot: Implemented currency loot

Port From (https://github.com/TrinityCore/TrinityCore/commit/3e28ee080a1cf3c7cd332a8d1e0808505b4ea9d4)
This commit is contained in:
Hondacrx
2024-10-09 00:18:14 -04:00
parent 57858e1bed
commit 4c3074d462
11 changed files with 494 additions and 214 deletions
+2 -13
View File
@@ -611,11 +611,8 @@ namespace Game.Chat
}
[Command("currency", RBACPermissions.CommandModifyCurrency)]
static bool HandleModifyCurrencyCommand(CommandHandler handler, StringArguments args)
static bool HandleModifyCurrencyCommand(CommandHandler handler, CurrencyTypesRecord currency, int amount)
{
if (args.Empty())
return false;
Player target = handler.GetSelectedPlayerOrSelf();
if (target == null)
{
@@ -624,15 +621,7 @@ namespace Game.Chat
return false;
}
uint currencyId = args.NextUInt32();
if (!CliDB.CurrencyTypesStorage.ContainsKey(currencyId))
return false;
uint amount = args.NextUInt32();
if (amount == 0)
return false;
target.ModifyCurrency(currencyId, (int)amount, CurrencyGainSource.Cheat, CurrencyDestroyReason.Cheat);
target.ModifyCurrency(currency.Id, amount, CurrencyGainSource.Cheat, CurrencyDestroyReason.Cheat);
return true;
}