Core/Reputation: Implemented renown reputation (Dragonflight)
Port From (https://github.com/TrinityCore/TrinityCore/commit/d64d84dfa68da4ff83f0b88ad4e88dccc5ace623)
This commit is contained in:
@@ -1098,6 +1098,7 @@ namespace Game.Entities
|
||||
_currencyStorage[(uint)id] = cur;
|
||||
}
|
||||
}
|
||||
|
||||
public uint GetCurrency(uint id)
|
||||
{
|
||||
var playerCurrency = _currencyStorage.LookupByKey(id);
|
||||
@@ -1106,7 +1107,8 @@ namespace Game.Entities
|
||||
|
||||
return playerCurrency.Quantity;
|
||||
}
|
||||
public void ModifyCurrency(CurrencyTypes id, int count, bool printLog = true, bool ignoreMultipliers = false)
|
||||
|
||||
public void ModifyCurrency(uint id, int count, bool printLog = true, bool ignoreMultipliers = false)
|
||||
{
|
||||
if (count == 0)
|
||||
return;
|
||||
@@ -1127,7 +1129,7 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == CurrencyTypes.Azerite)
|
||||
if (id == (uint)CurrencyTypes.Azerite)
|
||||
{
|
||||
if (count > 0)
|
||||
{
|
||||
@@ -1151,7 +1153,7 @@ namespace Game.Entities
|
||||
cur.WeeklyQuantity = 0;
|
||||
cur.TrackedQuantity = 0;
|
||||
cur.Flags = 0;
|
||||
_currencyStorage[(uint)id] = cur;
|
||||
_currencyStorage[id] = cur;
|
||||
playerCurrency = _currencyStorage.LookupByKey(id);
|
||||
}
|
||||
else
|
||||
@@ -1203,19 +1205,19 @@ namespace Game.Entities
|
||||
if (playerCurrency.state != PlayerCurrencyState.New)
|
||||
playerCurrency.state = PlayerCurrencyState.Changed;
|
||||
|
||||
CurrencyChanged((uint)id, count);
|
||||
CurrencyChanged(id, count);
|
||||
|
||||
playerCurrency.Quantity = (uint)newTotalCount;
|
||||
playerCurrency.WeeklyQuantity = (uint)newWeekCount;
|
||||
playerCurrency.TrackedQuantity = (uint)newTrackedCount;
|
||||
|
||||
if (count > 0)
|
||||
UpdateCriteria(CriteriaType.CurrencyGained, (uint)id, (uint)count);
|
||||
UpdateCriteria(CriteriaType.CurrencyGained, id, (uint)count);
|
||||
|
||||
_currencyStorage[(uint)id] = playerCurrency;
|
||||
_currencyStorage[id] = playerCurrency;
|
||||
|
||||
SetCurrency packet = new();
|
||||
packet.Type = (uint)id;
|
||||
packet.Type = id;
|
||||
packet.Quantity = newTotalCount;
|
||||
packet.SuppressChatLog = !printLog;
|
||||
packet.WeeklyQuantity = newWeekCount;
|
||||
@@ -1226,6 +1228,7 @@ namespace Game.Entities
|
||||
SendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasCurrency(uint id, uint count)
|
||||
{
|
||||
var playerCurrency = _currencyStorage.LookupByKey(id);
|
||||
|
||||
Reference in New Issue
Block a user