feat(Core/Conf): Move BG rewards to config (#2798)

This commit is contained in:
IntelligentQuantum
2020-05-07 04:11:39 +04:30
committed by GitHub
parent 32a6d330ff
commit 9ca9194d9b
6 changed files with 48 additions and 21 deletions
@@ -381,7 +381,7 @@ TeamId Battleground::GetPrematureWinner()
return TEAM_ALLIANCE;
else if (GetPlayersCountByTeam(TEAM_HORDE) >= GetMinPlayersPerTeam())
return TEAM_HORDE;
return TEAM_NEUTRAL;
}
@@ -973,13 +973,13 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
// Arena lost => reset the win_rated_arena having the "no_lose" condition
player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE, 0);
}
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);