Core/Loot: Implemented currency loot
Port From (https://github.com/TrinityCore/TrinityCore/commit/3e28ee080a1cf3c7cd332a8d1e0808505b4ea9d4)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user