mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
feat(Core): BG reputation modifier for WSG, AB and AV (#22685)
Co-authored-by: Zoidwaffle <zoidwaffle@gmail.com>
This commit is contained in:
@@ -2350,6 +2350,18 @@ Rate.Reputation.LowLevel.Quest = 1
|
||||
|
||||
Rate.Reputation.RecruitAFriendBonus = 0.1
|
||||
|
||||
#
|
||||
# Rate.Reputation.Gain.WSG
|
||||
# Rate.Reputation.Gain.AB
|
||||
# Rate.Reputation.Gain.AV
|
||||
# Description: Reputation bonus rate for WSG, AB and AV battlegrounds.
|
||||
# This is applied IN ADDITION to the global Rate.Reputation.Gain.
|
||||
# Default: 1
|
||||
|
||||
Rate.Reputation.Gain.WSG = 1
|
||||
Rate.Reputation.Gain.AB = 1
|
||||
Rate.Reputation.Gain.AV = 1
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ void BattlegroundAB::PostUpdateImpl(uint32 diff)
|
||||
if (honorRewards < uint8(m_TeamScores[teamId] / _honorTics))
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), teamId);
|
||||
if (reputationRewards < uint8(m_TeamScores[teamId] / _reputationTics))
|
||||
RewardReputationToTeam(teamId == TEAM_ALLIANCE ? 509 : 510, 10, teamId);
|
||||
RewardReputationToTeam(teamId == TEAM_ALLIANCE ? 509 : 510, uint32(10 * _abReputationRate), teamId);
|
||||
if (information < uint8(m_TeamScores[teamId] / BG_AB_WARNING_NEAR_VICTORY_SCORE))
|
||||
{
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
@@ -421,6 +421,7 @@ bool BattlegroundAB::SetupBattleground()
|
||||
{
|
||||
_honorTics = BattlegroundMgr::IsBGWeekend(GetBgTypeID(true)) ? BG_AB_HONOR_TICK_WEEKEND : BG_AB_HONOR_TICK_NORMAL;
|
||||
_reputationTics = BattlegroundMgr::IsBGWeekend(GetBgTypeID(true)) ? BG_AB_REP_TICK_WEEKEND : BG_AB_REP_TICK_NORMAL;
|
||||
_abReputationRate = sWorld->getRate(RATE_REPUTATION_GAIN_AB);
|
||||
|
||||
for (uint32 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
|
||||
{
|
||||
|
||||
@@ -299,6 +299,7 @@ private:
|
||||
EventMap _bgEvents;
|
||||
uint32 _honorTics;
|
||||
uint32 _reputationTics;
|
||||
float _abReputationRate;
|
||||
uint8 _controlledPoints[PVP_TEAMS_COUNT] {};
|
||||
bool _teamScores500Disadvantage[PVP_TEAMS_COUNT] {};
|
||||
uint32 _configurableMaxTeamScore;
|
||||
|
||||
@@ -194,21 +194,21 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
case AV_QUEST_A_COMMANDER1:
|
||||
case AV_QUEST_H_COMMANDER1:
|
||||
m_Team_QuestStatus[teamId][1]++;
|
||||
RewardReputationToTeam(teamId, 1, teamId);
|
||||
RewardReputationToTeam(teamId, uint32(1 * _avReputationRate), teamId);
|
||||
if (m_Team_QuestStatus[teamId][1] == 30)
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest {} completed (need to implement some events here", questid);
|
||||
break;
|
||||
case AV_QUEST_A_COMMANDER2:
|
||||
case AV_QUEST_H_COMMANDER2:
|
||||
m_Team_QuestStatus[teamId][2]++;
|
||||
RewardReputationToTeam(teamId, 1, teamId);
|
||||
RewardReputationToTeam(teamId, uint32(1 * _avReputationRate), teamId);
|
||||
if (m_Team_QuestStatus[teamId][2] == 60)
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest {} completed (need to implement some events here", questid);
|
||||
break;
|
||||
case AV_QUEST_A_COMMANDER3:
|
||||
case AV_QUEST_H_COMMANDER3:
|
||||
m_Team_QuestStatus[teamId][3]++;
|
||||
RewardReputationToTeam(teamId, 1, teamId);
|
||||
RewardReputationToTeam(teamId, uint32(1 * _avReputationRate), teamId);
|
||||
if (m_Team_QuestStatus[teamId][3] == 120)
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest {} completed (need to implement some events here", questid);
|
||||
break;
|
||||
@@ -316,21 +316,21 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
|
||||
type -= AV_CPLACE_MAX;
|
||||
cinfoid = uint16(BG_AV_StaticCreaturePos[type][4]);
|
||||
creature = AddCreature(BG_AV_StaticCreatureInfo[cinfoid],
|
||||
type + AV_CPLACE_MAX,
|
||||
BG_AV_StaticCreaturePos[type][0],
|
||||
BG_AV_StaticCreaturePos[type][1],
|
||||
BG_AV_StaticCreaturePos[type][2],
|
||||
BG_AV_StaticCreaturePos[type][3]);
|
||||
type + AV_CPLACE_MAX,
|
||||
BG_AV_StaticCreaturePos[type][0],
|
||||
BG_AV_StaticCreaturePos[type][1],
|
||||
BG_AV_StaticCreaturePos[type][2],
|
||||
BG_AV_StaticCreaturePos[type][3]);
|
||||
isStatic = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
creature = AddCreature(BG_AV_CreatureInfo[cinfoid],
|
||||
type,
|
||||
BG_AV_CreaturePos[type][0],
|
||||
BG_AV_CreaturePos[type][1],
|
||||
BG_AV_CreaturePos[type][2],
|
||||
BG_AV_CreaturePos[type][3]);
|
||||
type,
|
||||
BG_AV_CreaturePos[type][0],
|
||||
BG_AV_CreaturePos[type][1],
|
||||
BG_AV_CreaturePos[type][2],
|
||||
BG_AV_CreaturePos[type][3]);
|
||||
}
|
||||
if (!creature)
|
||||
return nullptr;
|
||||
@@ -344,7 +344,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
|
||||
(cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3))))
|
||||
{
|
||||
if (!isStatic && ((cinfoid >= AV_NPC_A_GRAVEDEFENSE0 && cinfoid <= AV_NPC_A_GRAVEDEFENSE3)
|
||||
|| (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3)))
|
||||
|| (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3)))
|
||||
{
|
||||
CreatureData& data = sObjectMgr->NewOrExistCreatureData(creature->GetSpawnId());
|
||||
data.wander_distance = 5;
|
||||
@@ -814,11 +814,11 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
if (!trigger)
|
||||
{
|
||||
trigger = AddCreature(WORLD_TRIGGER,
|
||||
node + 302,
|
||||
BG_AV_CreaturePos[node + 302][0],
|
||||
BG_AV_CreaturePos[node + 302][1],
|
||||
BG_AV_CreaturePos[node + 302][2],
|
||||
BG_AV_CreaturePos[node + 302][3]);
|
||||
node + 302,
|
||||
BG_AV_CreaturePos[node + 302][0],
|
||||
BG_AV_CreaturePos[node + 302][1],
|
||||
BG_AV_CreaturePos[node + 302][2],
|
||||
BG_AV_CreaturePos[node + 302][3]);
|
||||
}
|
||||
|
||||
//add bonus honor aura trigger creature when node is accupied
|
||||
@@ -1240,25 +1240,28 @@ GraveyardStruct const* BattlegroundAV::GetClosestGraveyard(Player* player)
|
||||
|
||||
bool BattlegroundAV::SetupBattleground()
|
||||
{
|
||||
_avReputationRate = sWorld->getRate(RATE_REPUTATION_GAIN_AV);
|
||||
|
||||
if (sBattlegroundMgr->IsBGWeekend(GetBgTypeID(true)))
|
||||
{
|
||||
_reputationTower = 18;
|
||||
_reputationCaptain = 185;
|
||||
_reputationBoss = 525;
|
||||
_reputationPerOwnedGraveyard = 18;
|
||||
_reputationSurvivingCaptain = 175;
|
||||
_reputationSurvivingTower = 18;
|
||||
_reputationPerOwnedMine = 36;
|
||||
_reputationTower = uint32(18 * _avReputationRate);
|
||||
_reputationCaptain = uint32(185 * _avReputationRate);
|
||||
_reputationBoss = uint32(525 * _avReputationRate);
|
||||
_reputationPerOwnedGraveyard = uint32(18 * _avReputationRate);
|
||||
_reputationSurvivingCaptain = uint32(175 * _avReputationRate);
|
||||
_reputationSurvivingTower = uint32(18 * _avReputationRate);
|
||||
_reputationPerOwnedMine = uint32(36 * _avReputationRate);
|
||||
}
|
||||
else
|
||||
{
|
||||
_reputationTower = 12;
|
||||
_reputationCaptain = 125;
|
||||
_reputationBoss = sWorld->getIntConfig(CONFIG_BATTLEGROUND_ALTERAC_REP_ONBOSSDEATH);
|
||||
_reputationPerOwnedGraveyard = 12;
|
||||
_reputationSurvivingCaptain = 125;
|
||||
_reputationSurvivingTower = 12;
|
||||
_reputationPerOwnedMine = 24;
|
||||
_reputationTower = uint32(12 * _avReputationRate);
|
||||
_reputationCaptain = uint32(125 * _avReputationRate);
|
||||
// Special case: This value comes from another config setting, but we still apply our multiplier
|
||||
_reputationBoss = uint32(sWorld->getIntConfig(CONFIG_BATTLEGROUND_ALTERAC_REP_ONBOSSDEATH) * _avReputationRate);
|
||||
_reputationPerOwnedGraveyard = uint32(12 * _avReputationRate);
|
||||
_reputationSurvivingCaptain = uint32(125 * _avReputationRate);
|
||||
_reputationSurvivingTower = uint32(12 * _avReputationRate);
|
||||
_reputationPerOwnedMine = uint32(24 * _avReputationRate);
|
||||
}
|
||||
|
||||
// Create starting objects
|
||||
|
||||
@@ -1846,6 +1846,7 @@ private:
|
||||
uint32 _reputationSurvivingCaptain = 0; // 125, 175
|
||||
uint32 _reputationSurvivingTower = 0; // 12, 18
|
||||
uint32 _reputationPerOwnedMine = 0; // 24, 36
|
||||
float _avReputationRate;
|
||||
|
||||
bool m_IsInformedNearVictory[2] {};
|
||||
};
|
||||
|
||||
@@ -426,15 +426,17 @@ void BattlegroundWS::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
|
||||
bool BattlegroundWS::SetupBattleground()
|
||||
{
|
||||
_wsReputationRate = sWorld->getRate(RATE_REPUTATION_GAIN_WSG);
|
||||
|
||||
if (sBattlegroundMgr->IsBGWeekend(GetBgTypeID(true)))
|
||||
{
|
||||
_reputationCapture = 45;
|
||||
_reputationCapture = uint32(45 * _wsReputationRate);
|
||||
_honorWinKills = 3;
|
||||
_honorEndKills = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
_reputationCapture = 35;
|
||||
_reputationCapture = uint32(35 * _wsReputationRate);
|
||||
_honorWinKills = 1;
|
||||
_honorEndKills = 2;
|
||||
}
|
||||
|
||||
@@ -258,6 +258,7 @@ private:
|
||||
ObjectGuid _droppedFlagGUID[2];
|
||||
uint8 _flagState[2];
|
||||
TeamId _lastFlagCaptureTeam;
|
||||
float _wsReputationRate;
|
||||
uint32 _reputationCapture;
|
||||
uint32 _honorWinKills;
|
||||
uint32 _honorEndKills;
|
||||
|
||||
@@ -85,6 +85,9 @@ void WorldConfig::BuildConfigCache()
|
||||
SetConfigValue<float>(RATE_BUYVALUE_ITEM_HEIRLOOM, "Rate.BuyValue.Item.Heirloom", 1.0f);
|
||||
|
||||
SetConfigValue<float>(RATE_REPUTATION_GAIN, "Rate.Reputation.Gain", 1.0f);
|
||||
SetConfigValue<float>(RATE_REPUTATION_GAIN_AB, "Rate.Reputation.Gain.AB", 1.0f);
|
||||
SetConfigValue<float>(RATE_REPUTATION_GAIN_AV, "Rate.Reputation.Gain.AV", 1.0f);
|
||||
SetConfigValue<float>(RATE_REPUTATION_GAIN_WSG, "Rate.Reputation.Gain.WSG", 1.0f);
|
||||
SetConfigValue<float>(RATE_REPUTATION_LOWLEVEL_KILL, "Rate.Reputation.LowLevel.Kill", 1.0f);
|
||||
SetConfigValue<float>(RATE_REPUTATION_LOWLEVEL_QUEST, "Rate.Reputation.LowLevel.Quest", 1.0f);
|
||||
SetConfigValue<float>(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS, "Rate.Reputation.RecruitAFriendBonus", 0.1f);
|
||||
|
||||
@@ -437,6 +437,9 @@ enum ServerConfigs
|
||||
RATE_XP_PET_NEXT_LEVEL,
|
||||
RATE_REPAIRCOST,
|
||||
RATE_REPUTATION_GAIN,
|
||||
RATE_REPUTATION_GAIN_AB,
|
||||
RATE_REPUTATION_GAIN_AV,
|
||||
RATE_REPUTATION_GAIN_WSG,
|
||||
RATE_REPUTATION_LOWLEVEL_KILL,
|
||||
RATE_REPUTATION_LOWLEVEL_QUEST,
|
||||
RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS,
|
||||
|
||||
Reference in New Issue
Block a user