feat(Core/Conf): Move BG rewards to config (#2798)
This commit is contained in:
committed by
GitHub
parent
32a6d330ff
commit
9ca9194d9b
@@ -977,9 +977,9 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA, GetMapId());
|
||||
}
|
||||
|
||||
uint32 winner_kills = player->GetRandomWinner() ? BG_REWARD_WINNER_HONOR_LAST : BG_REWARD_WINNER_HONOR_FIRST;
|
||||
uint32 loser_kills = player->GetRandomWinner() ? BG_REWARD_LOSER_HONOR_LAST : BG_REWARD_LOSER_HONOR_FIRST;
|
||||
uint32 winner_arena = player->GetRandomWinner() ? BG_REWARD_WINNER_ARENA_LAST : BG_REWARD_WINNER_ARENA_FIRST;
|
||||
uint32 winner_kills = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_HONOR_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_HONOR_FIRST);
|
||||
uint32 loser_kills = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_FIRST);
|
||||
uint32 winner_arena = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_FIRST);
|
||||
|
||||
sScriptMgr->OnBattlegroundEndReward(this, player, winnerTeamId);
|
||||
|
||||
|
||||
@@ -155,16 +155,6 @@ enum BattlegroundBuffObjects
|
||||
BG_OBJECTID_BERSERKERBUFF_ENTRY = 179905
|
||||
};
|
||||
|
||||
enum BattlegroundRandomRewards
|
||||
{
|
||||
BG_REWARD_WINNER_HONOR_FIRST = 30,
|
||||
BG_REWARD_WINNER_ARENA_FIRST = 25,
|
||||
BG_REWARD_WINNER_HONOR_LAST = 15,
|
||||
BG_REWARD_WINNER_ARENA_LAST = 0,
|
||||
BG_REWARD_LOSER_HONOR_FIRST = 5,
|
||||
BG_REWARD_LOSER_HONOR_LAST = 5
|
||||
};
|
||||
|
||||
const uint32 Buff_Entries[3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENBUFF_ENTRY, BG_OBJECTID_BERSERKERBUFF_ENTRY };
|
||||
|
||||
enum BattlegroundStatus
|
||||
|
||||
@@ -663,9 +663,9 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
uint32 winner_kills = player->GetRandomWinner() ? BG_REWARD_WINNER_HONOR_LAST : BG_REWARD_WINNER_HONOR_FIRST;
|
||||
uint32 winner_arena = player->GetRandomWinner() ? BG_REWARD_WINNER_ARENA_LAST : BG_REWARD_WINNER_ARENA_FIRST;
|
||||
uint32 loser_kills = player->GetRandomWinner() ? BG_REWARD_LOSER_HONOR_LAST : BG_REWARD_LOSER_HONOR_FIRST;
|
||||
uint32 winner_kills = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_HONOR_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_HONOR_FIRST);
|
||||
uint32 winner_arena = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_FIRST);
|
||||
uint32 loser_kills = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_FIRST);
|
||||
|
||||
winner_kills = acore::Honor::hk_honor_at_level(player->getLevel(), float(winner_kills));
|
||||
loser_kills = acore::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills));
|
||||
|
||||
@@ -1384,7 +1384,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
m_bool_configs[CONFIG_SET_ALL_CREATURES_WITH_WAYPOINT_MOVEMENT_ACTIVE] = sConfigMgr->GetBoolDefault("SetAllCreaturesWithWaypointMovementActive", false);
|
||||
|
||||
//packet spoof punishment
|
||||
// packet spoof punishment
|
||||
m_int_configs[CONFIG_PACKET_SPOOF_POLICY] = sConfigMgr->GetIntDefault("PacketSpoof.Policy", (uint32)WorldSession::DosProtection::POLICY_KICK);
|
||||
m_int_configs[CONFIG_PACKET_SPOOF_BANMODE] = sConfigMgr->GetIntDefault("PacketSpoof.BanMode", (uint32)0);
|
||||
if (m_int_configs[CONFIG_PACKET_SPOOF_BANMODE] > 1)
|
||||
@@ -1392,6 +1392,14 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
m_int_configs[CONFIG_PACKET_SPOOF_BANDURATION] = sConfigMgr->GetIntDefault("PacketSpoof.BanDuration", 86400);
|
||||
|
||||
// Random Battleground Rewards
|
||||
m_int_configs[CONFIG_BG_REWARD_WINNER_HONOR_FIRST] = sConfigMgr->GetIntDefault("Battleground.RewardWinnerHonorFirst", 30);
|
||||
m_int_configs[CONFIG_BG_REWARD_WINNER_ARENA_FIRST] = sConfigMgr->GetIntDefault("Battleground.RewardWinnerArenaFirst", 25);
|
||||
m_int_configs[CONFIG_BG_REWARD_WINNER_HONOR_LAST] = sConfigMgr->GetIntDefault("Battleground.RewardWinnerHonorLast", 15);
|
||||
m_int_configs[CONFIG_BG_REWARD_WINNER_ARENA_LAST] = sConfigMgr->GetIntDefault("Battleground.RewardWinnerArenaLast", 0);
|
||||
m_int_configs[CONFIG_BG_REWARD_LOSER_HONOR_FIRST] = sConfigMgr->GetIntDefault("Battleground.RewardLoserHonorFirst", 5);
|
||||
m_int_configs[CONFIG_BG_REWARD_LOSER_HONOR_LAST] = sConfigMgr->GetIntDefault("Battleground.RewardLoserHonorLast", 5);
|
||||
|
||||
m_int_configs[CONFIG_WAYPOINT_MOVEMENT_STOP_TIME_FOR_PLAYER] = sConfigMgr->GetIntDefault("WaypointMovementStopTimeForPlayer", 120);
|
||||
|
||||
// call ScriptMgr if we're reloading the configuration
|
||||
|
||||
@@ -353,6 +353,12 @@ enum WorldIntConfigs
|
||||
CONFIG_ICC_BUFF_ALLIANCE,
|
||||
CONFIG_ITEMDELETE_QUALITY,
|
||||
CONFIG_ITEMDELETE_ITEM_LEVEL,
|
||||
CONFIG_BG_REWARD_WINNER_HONOR_FIRST,
|
||||
CONFIG_BG_REWARD_WINNER_ARENA_FIRST,
|
||||
CONFIG_BG_REWARD_WINNER_HONOR_LAST,
|
||||
CONFIG_BG_REWARD_WINNER_ARENA_LAST,
|
||||
CONFIG_BG_REWARD_LOSER_HONOR_FIRST,
|
||||
CONFIG_BG_REWARD_LOSER_HONOR_LAST,
|
||||
CONFIG_CHARTER_COST_GUILD,
|
||||
CONFIG_CHARTER_COST_ARENA_2v2,
|
||||
CONFIG_CHARTER_COST_ARENA_3v3,
|
||||
|
||||
@@ -2762,6 +2762,29 @@ Battleground.TrackDeserters.Enable = 1
|
||||
|
||||
Battleground.InvitationType = 0
|
||||
|
||||
#
|
||||
# Battleground.RewardWinnerHonorFirst
|
||||
# Battleground.RewardWinnerArenaFirst
|
||||
# Battleground.RewardWinnerHonorLast
|
||||
# Battleground.RewardWinnerArenaLast
|
||||
# Battleground.RewardLoserHonorFirst
|
||||
# Battleground.RewardLoserHonorLast
|
||||
# Description: Random Battlegrounds / call to the arms rewards
|
||||
# Default: 30 - Battleground.RewardWinnerHonorFirst
|
||||
# 25 - Battleground.RewardWinnerArenaFirst
|
||||
# 15 - Battleground.RewardWinnerHonorLast
|
||||
# 0 - Battleground.RewardWinnerArenaLast
|
||||
# 5 - Battleground.RewardLoserHonorFirst
|
||||
# 5 - Battleground.RewardLoserHonorLast
|
||||
#
|
||||
|
||||
Battleground.RewardWinnerHonorFirst = 30
|
||||
Battleground.RewardWinnerArenaFirst = 25
|
||||
Battleground.RewardWinnerHonorLast = 15
|
||||
Battleground.RewardWinnerArenaLast = 0
|
||||
Battleground.RewardLoserHonorFirst = 5
|
||||
Battleground.RewardLoserHonorLast = 5
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user