aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Player/Player.cpp15
-rw-r--r--src/server/game/Entities/Player/Player.h2
2 files changed, 13 insertions, 4 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 1512b07540e..b03593c6e7d 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -517,8 +517,8 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac
InitRunes();
SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::Coinage), sWorld->getIntConfig(CONFIG_START_PLAYER_MONEY));
- SetCurrency(CURRENCY_TYPE_APEXIS_CRYSTALS, sWorld->getIntConfig(CONFIG_CURRENCY_START_APEXIS_CRYSTALS));
- SetCurrency(CURRENCY_TYPE_JUSTICE_POINTS, sWorld->getIntConfig(CONFIG_CURRENCY_START_JUSTICE_POINTS));
+ SetCreateCurrency(CURRENCY_TYPE_APEXIS_CRYSTALS, sWorld->getIntConfig(CONFIG_CURRENCY_START_APEXIS_CRYSTALS));
+ SetCreateCurrency(CURRENCY_TYPE_JUSTICE_POINTS, sWorld->getIntConfig(CONFIG_CURRENCY_START_JUSTICE_POINTS));
// start with every map explored
if (sWorld->getBoolConfig(CONFIG_START_ALL_EXPLORED))
@@ -6759,6 +6759,15 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo
if (!ignoreMultipliers)
count *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_CURRENCY_GAIN, id);
+ // Currency that is immediately converted into reputation with that faction instead
+ if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(currency->FactionID))
+ {
+ if (currency->Flags & CURRENCY_FLAG_HIGH_PRECISION)
+ count /= 100;
+ GetReputationMgr().ModifyReputation(factionEntry, count, true);
+ return;
+ }
+
uint32 oldTotalCount = 0;
uint32 oldWeekCount = 0;
uint32 oldTrackedCount = 0;
@@ -6846,7 +6855,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo
}
}
-void Player::SetCurrency(uint32 id, uint32 count, bool /*printLog*/ /*= true*/)
+void Player::SetCreateCurrency(uint32 id, uint32 count, bool /*printLog*/ /*= true*/)
{
PlayerCurrenciesMap::iterator itr = _currencyStorage.find(id);
if (itr == _currencyStorage.end())
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index f7c8ae952d1..b2081dbd9d0 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1191,7 +1191,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
/// return presence related currency
bool HasCurrency(uint32 id, uint32 count) const;
/// initialize currency count for custom initialization at create character
- void SetCurrency(uint32 id, uint32 count, bool printLog = true);
+ void SetCreateCurrency(uint32 id, uint32 count, bool printLog = true);
void ResetCurrencyWeekCap();
/**