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
+2 -2
View File
@@ -369,7 +369,7 @@ namespace Game.Garrisons
map.AddToMap(go);
}
_owner.ModifyCurrency(building.CurrencyTypeID, -building.CurrencyQty, false, true);
_owner.RemoveCurrency(building.CurrencyTypeID, building.CurrencyQty, CurrencyDestroyReason.Garrison);
_owner.ModifyMoney(-building.GoldCost * MoneyConstants.Gold, false);
if (oldBuildingId != 0)
@@ -409,7 +409,7 @@ namespace Game.Garrisons
GarrBuildingRecord constructing = CliDB.GarrBuildingStorage.LookupByKey(buildingRemoved.GarrBuildingID);
// Refund construction/upgrade cost
_owner.ModifyCurrency(constructing.CurrencyTypeID, constructing.CurrencyQty, false, true);
_owner.AddCurrency(constructing.CurrencyTypeID, (uint)constructing.CurrencyQty, CurrencyGainSource.GarrisonBuildingRefund);
_owner.ModifyMoney(constructing.GoldCost * MoneyConstants.Gold, false);
if (constructing.UpgradeLevel > 1)