aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp2
-rw-r--r--src/server/game/Entities/Player/Player.cpp17
-rw-r--r--src/server/game/World/World.cpp39
-rw-r--r--src/server/worldserver/worldserver.conf.dist23
4 files changed, 51 insertions, 30 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index f52e917ccdb..b95d8e85a79 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -299,7 +299,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
data->WriteBit(bgGuid[7]);
data->WriteBit(bgGuid[1]);
data->WriteBit(playerGuid[5]);
- data->WriteBit(player->GetBGTeam() == TEAM_ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance )
+ data->WriteBit(player->GetBGTeam() == TEAM_HORDE);
data->WriteBit(bgGuid[0]);
data->WriteBit(playerGuid[1]);
data->WriteBit(bgGuid[3]);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index b23614d4a05..cd576c8e89b 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -25985,7 +25985,7 @@ void Player::SendRefundInfo(Item* item)
data.WriteByteSeq(guid[2]);
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // currency cost data
{
- data << uint32(iece->RequiredCurrencyCount[i]);
+ data << uint32(iece->RequiredCurrencyCount[i] / CURRENCY_PRECISION);
data << uint32(iece->RequiredCurrency[i]);
}
@@ -26039,7 +26039,7 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece,
{
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
{
- data << uint32(iece->RequiredCurrencyCount[i]);
+ data << uint32(iece->RequiredCurrencyCount[i] / CURRENCY_PRECISION);
data << uint32(iece->RequiredCurrency[i]);
}
@@ -26132,7 +26132,7 @@ void Player::RefundItem(Item* item)
DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
// Grant back extendedcost items
- for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
+ for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i)
{
uint32 count = iece->RequiredItemCount[i];
uint32 itemid = iece->RequiredItem[i];
@@ -26146,12 +26146,19 @@ void Player::RefundItem(Item* item)
}
}
+ // Grant back currencies
+ for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
+ {
+ uint32 count = iece->RequiredCurrencyCount[i];
+ uint32 currencyid = iece->RequiredCurrency[i];
+ if (count && currencyid)
+ ModifyCurrency(currencyid, count);
+ }
+
// Grant back money
if (moneyRefund)
ModifyMoney(moneyRefund); // Saved in SaveInventoryAndGoldToDB
- // Grant back Arena and Honor points ?
-
SaveInventoryAndGoldToDB(trans);
CharacterDatabase.CommitTransaction(trans);
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index d291d1d2fe9..b4d2e7933d2 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -808,11 +808,24 @@ void World::LoadConfigSettings(bool reload)
sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.StartHonorPoints (%i) must be >= 0, set to default 0.", m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS]);
m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS] = 0;
}
- m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxHonorPoints", 40000);
+ m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxHonorPoints", 400000);
if (int32(m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]) < 0)
{
- sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]);
- m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = 0;
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxHonorPoints (%i) can't be negative. Set to default 400000 (with precision).", m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]);
+ m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = 400000;
+ }
+
+ m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("Currency.StartJusticePoints", 0);
+ if (int32(m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS]) < 0)
+ {
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.StartJusticePoints (%i) must be >= 0, set to default 0.", m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS]);
+ m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = 0;
+ }
+ m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxJusticePoints", 400000);
+ if (int32(m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]) < 0)
+ {
+ sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxJusticePoints (%i) can't be negative. Set to default 400000 (with precision).", m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]);
+ m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = 400000;
}
m_int_configs[CONFIG_CURRENCY_START_CONQUEST_POINTS] = ConfigMgr::GetIntDefault("Currency.StartConquestPoints", 0);
@@ -837,26 +850,6 @@ void World::LoadConfigSettings(bool reload)
}
m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] *= 100; //precision mod
- m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("StartJusticePoints", 0);
- if (int32(m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS]) < 0)
- {
- sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.",
- m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS], m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS], 0);
- m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = 0;
- }
- else if (m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] > m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS])
- {
- sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.",
- m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS], m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS], m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]);
- m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS];
- }
- m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("MaxJusticePoints", 400000);
- if (int32(m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]) < 0)
- {
- sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxJusticePoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]);
- m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = 0;
- }
-
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("RecruitAFriend.MaxLevel", 60);
if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
{
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 05c756c757c..22f99dbb04c 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -2860,12 +2860,33 @@ Guild.WeeklyReputationCap = 4375
# CURRENCIES SETTINGS
#
# Currency.StartHonorPoints
-# Amount of honor that new players will start with
+# Amount of honor points that new players will start with
# Default: 0 (with precision)
#
Currency.StartHonorPoints = 0
+# Currency.MaxHonorPoints
+# Max honor points of players
+# Default: 400000 (with precision)
+#
+
+Currency.MaxHonorPoints = 400000
+
+# Currency.StartJusticePoints
+# Amount of justice points that new players will start with
+# Default: 0 (with precision)
+#
+
+Currency.StartJusticePoints = 0
+
+# Currency.MaxJusticePoints
+# Max justice points of players
+# Default: 400000 (with precision)
+#
+
+Currency.MaxJusticePoints = 400000
+
#
# Currency.StartConquestPoints
# Amount of conquest points that new players will start with