feat(Core/Conf): Move BG rewards to config (#2798)
This commit is contained in:
committed by
GitHub
parent
32a6d330ff
commit
9ca9194d9b
@@ -381,7 +381,7 @@ TeamId Battleground::GetPrematureWinner()
|
|||||||
return TEAM_ALLIANCE;
|
return TEAM_ALLIANCE;
|
||||||
else if (GetPlayersCountByTeam(TEAM_HORDE) >= GetMinPlayersPerTeam())
|
else if (GetPlayersCountByTeam(TEAM_HORDE) >= GetMinPlayersPerTeam())
|
||||||
return TEAM_HORDE;
|
return TEAM_HORDE;
|
||||||
|
|
||||||
return TEAM_NEUTRAL;
|
return TEAM_NEUTRAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -973,13 +973,13 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
|
|||||||
// Arena lost => reset the win_rated_arena having the "no_lose" condition
|
// Arena lost => reset the win_rated_arena having the "no_lose" condition
|
||||||
player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE, 0);
|
player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA, GetMapId());
|
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA, GetMapId());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 winner_kills = player->GetRandomWinner() ? BG_REWARD_WINNER_HONOR_LAST : BG_REWARD_WINNER_HONOR_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() ? BG_REWARD_LOSER_HONOR_LAST : BG_REWARD_LOSER_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() ? BG_REWARD_WINNER_ARENA_LAST : BG_REWARD_WINNER_ARENA_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);
|
sScriptMgr->OnBattlegroundEndReward(this, player, winnerTeamId);
|
||||||
|
|
||||||
|
|||||||
@@ -155,16 +155,6 @@ enum BattlegroundBuffObjects
|
|||||||
BG_OBJECTID_BERSERKERBUFF_ENTRY = 179905
|
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 };
|
const uint32 Buff_Entries[3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENBUFF_ENTRY, BG_OBJECTID_BERSERKERBUFF_ENTRY };
|
||||||
|
|
||||||
enum BattlegroundStatus
|
enum BattlegroundStatus
|
||||||
@@ -407,7 +397,7 @@ class Battleground
|
|||||||
bool HasFreeSlots() const;
|
bool HasFreeSlots() const;
|
||||||
uint32 GetFreeSlotsForTeam(TeamId teamId) const;
|
uint32 GetFreeSlotsForTeam(TeamId teamId) const;
|
||||||
uint32 GetMaxFreeSlots() const;
|
uint32 GetMaxFreeSlots() const;
|
||||||
|
|
||||||
typedef std::set<Player*> SpectatorList;
|
typedef std::set<Player*> SpectatorList;
|
||||||
typedef std::map<uint64, uint64> ToBeTeleportedMap;
|
typedef std::map<uint64, uint64> ToBeTeleportedMap;
|
||||||
void AddSpectator(Player* p) { m_Spectators.insert(p); }
|
void AddSpectator(Player* p) { m_Spectators.insert(p); }
|
||||||
@@ -590,7 +580,7 @@ class Battleground
|
|||||||
virtual uint64 GetFlagPickerGUID(TeamId /*teamId*/ = TEAM_NEUTRAL) const { return 0; }
|
virtual uint64 GetFlagPickerGUID(TeamId /*teamId*/ = TEAM_NEUTRAL) const { return 0; }
|
||||||
virtual void SetDroppedFlagGUID(uint64 /*guid*/, TeamId /*teamId*/ = TEAM_NEUTRAL) {}
|
virtual void SetDroppedFlagGUID(uint64 /*guid*/, TeamId /*teamId*/ = TEAM_NEUTRAL) {}
|
||||||
uint32 GetTeamScore(TeamId teamId) const;
|
uint32 GetTeamScore(TeamId teamId) const;
|
||||||
|
|
||||||
virtual TeamId GetPrematureWinner();
|
virtual TeamId GetPrematureWinner();
|
||||||
|
|
||||||
// because BattleGrounds with different types and same level range has different m_BracketId
|
// because BattleGrounds with different types and same level range has different m_BracketId
|
||||||
|
|||||||
@@ -663,9 +663,9 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid
|
|||||||
if (!player)
|
if (!player)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 winner_kills = player->GetRandomWinner() ? BG_REWARD_WINNER_HONOR_LAST : BG_REWARD_WINNER_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() ? BG_REWARD_WINNER_ARENA_LAST : BG_REWARD_WINNER_ARENA_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() ? BG_REWARD_LOSER_HONOR_LAST : BG_REWARD_LOSER_HONOR_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));
|
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));
|
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);
|
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_POLICY] = sConfigMgr->GetIntDefault("PacketSpoof.Policy", (uint32)WorldSession::DosProtection::POLICY_KICK);
|
||||||
m_int_configs[CONFIG_PACKET_SPOOF_BANMODE] = sConfigMgr->GetIntDefault("PacketSpoof.BanMode", (uint32)0);
|
m_int_configs[CONFIG_PACKET_SPOOF_BANMODE] = sConfigMgr->GetIntDefault("PacketSpoof.BanMode", (uint32)0);
|
||||||
if (m_int_configs[CONFIG_PACKET_SPOOF_BANMODE] > 1)
|
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);
|
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);
|
m_int_configs[CONFIG_WAYPOINT_MOVEMENT_STOP_TIME_FOR_PLAYER] = sConfigMgr->GetIntDefault("WaypointMovementStopTimeForPlayer", 120);
|
||||||
|
|
||||||
// call ScriptMgr if we're reloading the configuration
|
// call ScriptMgr if we're reloading the configuration
|
||||||
|
|||||||
@@ -353,6 +353,12 @@ enum WorldIntConfigs
|
|||||||
CONFIG_ICC_BUFF_ALLIANCE,
|
CONFIG_ICC_BUFF_ALLIANCE,
|
||||||
CONFIG_ITEMDELETE_QUALITY,
|
CONFIG_ITEMDELETE_QUALITY,
|
||||||
CONFIG_ITEMDELETE_ITEM_LEVEL,
|
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_GUILD,
|
||||||
CONFIG_CHARTER_COST_ARENA_2v2,
|
CONFIG_CHARTER_COST_ARENA_2v2,
|
||||||
CONFIG_CHARTER_COST_ARENA_3v3,
|
CONFIG_CHARTER_COST_ARENA_3v3,
|
||||||
|
|||||||
@@ -2762,6 +2762,29 @@ Battleground.TrackDeserters.Enable = 1
|
|||||||
|
|
||||||
Battleground.InvitationType = 0
|
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