Core/Battleground:

- Fix team logo after countdown timer expire. close #8887
- Add more options with justice and honor points in conf file, also fix a wrong cap value.
- Grant back currencies when refunding an item and fix price.
ref #8892
This commit is contained in:
Tuxity committed 2013-01-09 20:37:02 +01:00
1 parent db330750b7
commit 71b0b30712
4 files changed
+51 -30

No files matched your search

@@ -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]);
+12 -5
View File
@@ -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);
+16 -23
View File
@@ -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])
{
+22 -1
View File
@@ -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