Core/Players: Several currency fixes and improvements

Port From (https://github.com/TrinityCore/TrinityCore/commit/03918978c166c9fb191117a0cae9ba1285bf0e37)
This commit is contained in:
hondacrx
2023-02-11 23:28:57 -05:00
parent 90cc620c11
commit 4b798e7cab
25 changed files with 603 additions and 347 deletions
+5 -4
View File
@@ -221,7 +221,7 @@ namespace Game
CurrencyTypesRecord currency = CliDB.CurrencyTypesStorage.LookupByKey(renownFactionEntry.RenownCurrencyID);
if (currency != null)
return (int)_player.GetCurrency(currency.Id);
return (int)_player.GetCurrencyQuantity(currency.Id);
return 0;
}
@@ -245,7 +245,7 @@ namespace Game
CurrencyTypesRecord currency = CliDB.CurrencyTypesStorage.LookupByKey(renownFactionEntry.RenownCurrencyID);
if (currency != null)
return (int)currency.MaxQty;
return (int)_player.GetCurrencyMaxQuantity(currency);
return 0;
}
@@ -481,7 +481,7 @@ namespace Game
if (factionState != null)
{
// Ignore renown reputation already raised to the maximum level
if (HasMaximumRenownReputation(factionEntry))
if (HasMaximumRenownReputation(factionEntry) && standing > 0)
{
factionState.needSend = false;
factionState.needSave = false;
@@ -547,8 +547,9 @@ namespace Game
factionState.VisualStandingIncrease = reputationChange;
// If the reputation is decreased by command, we will send CurrencyDestroyReason::Cheat
if (oldRenownLevel != newRenownLevel)
_player.ModifyCurrency(currency.Id, newRenownLevel - oldRenownLevel, false);
_player.ModifyCurrency(currency.Id, newRenownLevel - oldRenownLevel, CurrencyGainSource.RenownRepGain, CurrencyDestroyReason.Cheat);
}
}