From 74774dbfaba297ea352663d850dc804eb022d25e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 21:39:25 +0000 Subject: [PATCH 1/3] Add Winterchill death and decay avoidance Agent-Logs-Url: https://github.com/brighton-chi/mod-playerbots/sessions/28459f39-4269-42c9-9b34-eb504d2897c1 Co-authored-by: brighton-chi <190869400+brighton-chi@users.noreply.github.com> --- .../Action/RaidHyjalSummitActions.cpp | 280 ++++++++--------- .../Action/RaidHyjalSummitActions.h | 173 +++++++---- .../Multiplier/RaidHyjalSummitMultipliers.cpp | 81 ++--- .../Multiplier/RaidHyjalSummitMultipliers.h | 87 ++++-- .../RaidHyjalSummitActionContext.h | 214 +++++++------ .../RaidHyjalSummitTriggerContext.h | 199 +++++++----- .../Strategy/RaidHyjalSummitStrategy.cpp | 130 ++++---- .../Trigger/RaidHyjalSummitTriggers.cpp | 106 +++---- .../Trigger/RaidHyjalSummitTriggers.h | 137 +++++---- .../Util/RaidHyjalSummitHelpers.cpp | 284 ++++++++++-------- .../HyjalSummit/Util/RaidHyjalSummitHelpers.h | 185 ++++++------ .../Util/RaidHyjalSummitScripts.cpp | 30 +- 12 files changed, 1054 insertions(+), 852 deletions(-) diff --git a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp index 72b7f558019..84b76e00ef2 100644 --- a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp +++ b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp @@ -4,16 +4,16 @@ */ #include "RaidHyjalSummitActions.h" -#include "RaidHyjalSummitHelpers.h" + #include "Playerbots.h" #include "RaidBossHelpers.h" +#include "RaidHyjalSummitHelpers.h" #include "Timer.h" using namespace HyjalSummitHelpers; -static bool GetGroundedStepPosition( - Player* bot, float destinationX, float destinationY, float maxStep, - float& stepX, float& stepY, float& stepZ) +static bool GetGroundedStepPosition(Player* bot, float destinationX, float destinationY, float maxStep, float& stepX, + float& stepY, float& stepZ) { float distance = bot->GetExactDist2d(destinationX, destinationY); if (distance <= 0.0f) @@ -28,9 +28,8 @@ static bool GetGroundedStepPosition( if (stepZ <= INVALID_HEIGHT) stepZ = bot->GetPositionZ(); - bot->GetMap()->CheckCollisionAndGetValidCoords( - bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), - stepX, stepY, stepZ, false); + bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), + stepX, stepY, stepZ, false); return true; } @@ -44,32 +43,26 @@ bool HyjalSummitEraseTrackersAction::Execute(Event /*event*/) bool erased = false; if (botAI->IsTank(bot)) { - if (!AI_VALUE2(Unit*, "find target", "kaz'rogal") && - kazrogalTankStep.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "kaz'rogal") && kazrogalTankStep.erase(guid) > 0) erased = true; - if (!AI_VALUE2(Unit*, "find target", "azgalor") && - azgalorTankStep.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "azgalor") && azgalorTankStep.erase(guid) > 0) erased = true; return erased; } else { - if (!AI_VALUE2(Unit*, "find target", "rage winterchill") && - hasReachedWinterchillPosition.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "rage winterchill") && hasReachedWinterchillPosition.erase(guid) > 0) erased = true; - if (!AI_VALUE2(Unit*, "find target", "anetheron") && - hasReachedAnetheronPosition.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "anetheron") && hasReachedAnetheronPosition.erase(guid) > 0) erased = true; - if (!AI_VALUE2(Unit*, "find target", "kaz'rogal") && - isBelowManaThreshold.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "kaz'rogal") && isBelowManaThreshold.erase(guid) > 0) erased = true; - if (!AI_VALUE2(Unit*, "find target", "archimonde") && - doomfireTrails.erase(bot->GetMap()->GetInstanceId()) > 0) + if (!AI_VALUE2(Unit*, "find target", "archimonde") && doomfireTrails.erase(bot->GetMap()->GetInstanceId()) > 0) erased = true; return erased; @@ -111,16 +104,15 @@ bool RageWinterchillMainTankPositionBossAction::Execute(Event /*event*/) if (winterchill->GetVictim() == bot) { const Position& position = WINTERCHILL_TANK_POSITION; - float distToPosition = - bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); if (distToPosition > 4.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, + moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true); } } @@ -147,8 +139,8 @@ bool RageWinterchillSpreadRangedInCircleAction::Execute(Event /*event*/) constexpr float arcCenter = 0.0f; constexpr float arcStart = arcCenter - arcSpan / 2.0f; - angle = (count == 1) ? arcCenter : - (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); + angle = (count == 1) ? arcCenter + : (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); const Position& position = WINTERCHILL_TANK_POSITION; float targetX = position.GetPositionX() + radius * std::cos(angle); @@ -157,10 +149,9 @@ bool RageWinterchillSpreadRangedInCircleAction::Execute(Event /*event*/) if (bot->GetExactDist2d(targetX, targetY) > 2.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, - moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true); } else { @@ -171,6 +162,15 @@ bool RageWinterchillSpreadRangedInCircleAction::Execute(Event /*event*/) return false; } +bool RageWinterchillMoveAwayFromDeathAndDecayAction::Execute(Event /*event*/) +{ + Unit* winterchill = AI_VALUE2(Unit*, "find target", "rage winterchill"); + if (!winterchill || !IsBotInsideActiveWinterchillDeathAndDecay(bot, 17.0f)) + return false; + + return MoveAway(winterchill, 5.0f); +} + // Anetheron bool AnetheronMisdirectBossAndInfernalsToTanksAction::Execute(Event /*event*/) @@ -227,16 +227,15 @@ bool AnetheronMainTankPositionBossAction::Execute(Event /*event*/) if (anetheron->GetVictim() == bot) { const Position& position = ANETHERON_TANK_POSITION; - float distToPosition = - bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); if (distToPosition > 4.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, + moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true); } } @@ -262,8 +261,8 @@ bool AnetheronSpreadRangedInCircleAction::Execute(Event /*event*/) constexpr float arcCenter = 0.0f; constexpr float arcStart = arcCenter - arcSpan / 2.0f; - angle = (count == 1) ? arcCenter : - (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); + angle = (count == 1) ? arcCenter + : (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); const Position& position = ANETHERON_TANK_POSITION; @@ -273,10 +272,9 @@ bool AnetheronSpreadRangedInCircleAction::Execute(Event /*event*/) if (bot->GetExactDist2d(targetX, targetY) > 2.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, - moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true); } else { @@ -301,10 +299,9 @@ bool AnetheronBringInfernalToInfernalTankAction::Execute(Event /*event*/) if (bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()) > 2.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_FORCED, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_FORCED, true); } return false; @@ -324,11 +321,10 @@ bool AnetheronFirstAssistTankPickUpInfernalsAction::Execute(Event /*event*/) if (distToInfernoTarget > 5.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, infernoTarget->GetPositionX(), - infernoTarget->GetPositionY(), 10.0f, - moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_FORCED, true); + if (GetGroundedStepPosition(bot, infernoTarget->GetPositionX(), infernoTarget->GetPositionY(), 10.0f, moveX, + moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_FORCED, true); } } @@ -342,21 +338,18 @@ bool AnetheronFirstAssistTankPickUpInfernalsAction::Execute(Event /*event*/) if (bot->GetVictim() != infernal) return Attack(infernal); - if ((infernoTarget && infernoTarget == bot) || - (infernal->GetVictim() == bot && bot->IsWithinMeleeRange(infernal))) + if ((infernoTarget && infernoTarget == bot) || (infernal->GetVictim() == bot && bot->IsWithinMeleeRange(infernal))) { const Position& position = GetClosestInfernalTankPosition(bot); - float distToPosition = - bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); if (distToPosition > 3.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - 5.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true, - true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 5.0f, moveX, moveY, + moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true, true); } } @@ -383,14 +376,12 @@ bool AnetheronAssignDpsPriorityAction::Execute(Event /*event*/) { constexpr float safeDistFromInfernal = 10.0f; constexpr uint32 minInterval = 0; - if (infernal->GetVictim() != bot && - bot->GetDistance2d(infernal) < safeDistFromInfernal) + if (infernal->GetVictim() != bot && bot->GetDistance2d(infernal) < safeDistFromInfernal) { return FleePosition(infernal->GetPosition(), safeDistFromInfernal, minInterval); } - if (anetheron->GetHealthPct() > 10.0f && botAI->IsRangedDps(bot) && - bot->GetDistance2d(infernal) < 50.0f) + if (anetheron->GetHealthPct() > 10.0f && botAI->IsRangedDps(bot) && bot->GetDistance2d(infernal) < 50.0f) { if (Player* firstAssistTank = GetGroupAssistTank(botAI, bot, 0); !firstAssistTank || infernal->GetVictim() == firstAssistTank) @@ -448,33 +439,31 @@ bool KazrogalMainTankPositionBossAction::Execute(Event /*event*/) if (kazrogal->GetVictim() == bot && bot->IsWithinMeleeRange(kazrogal)) { const ObjectGuid guid = bot->GetGUID(); - TankPositionState state = kazrogalTankStep.count(guid) ? - kazrogalTankStep[guid] : TankPositionState::MovingToTransition; + TankPositionState state = + kazrogalTankStep.count(guid) ? kazrogalTankStep[guid] : TankPositionState::MovingToTransition; constexpr float maxDistance = 2.0f; - const Position& position = state == TankPositionState::MovingToTransition ? - KAZROGAL_TANK_TRANSITION_POSITION : KAZROGAL_TANK_FINAL_POSITION; + const Position& position = state == TankPositionState::MovingToTransition ? KAZROGAL_TANK_TRANSITION_POSITION + : KAZROGAL_TANK_FINAL_POSITION; float distToPosition = bot->GetExactDist2d(position); if (distToPosition > maxDistance) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - 5.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true, - true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 5.0f, moveX, moveY, + moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true, true); } if (state == TankPositionState::MovingToTransition && distToPosition <= maxDistance) { kazrogalTankStep[guid] = TankPositionState::MovingToFinal; } - else if (state != TankPositionState::MovingToTransition && - distToPosition <= maxDistance) + else if (state != TankPositionState::MovingToTransition && distToPosition <= maxDistance) { - float orientation = atan2(kazrogal->GetPositionY() - bot->GetPositionY(), - kazrogal->GetPositionX() - bot->GetPositionX()); + float orientation = + atan2(kazrogal->GetPositionY() - bot->GetPositionY(), kazrogal->GetPositionX() - bot->GetPositionX()); bot->SetFacingTo(orientation); kazrogalTankStep[guid] = TankPositionState::Positioned; } @@ -493,10 +482,10 @@ bool KazrogalAssistTanksMoveInFrontOfBossAction::Execute(Event /*event*/) if (bot->GetExactDist2d(mainTank) > 4.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, mainTank->GetPositionX(), mainTank->GetPositionY(), - 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, mainTank->GetPositionX(), mainTank->GetPositionY(), 10.0f, moveX, moveY, + moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true); } return false; @@ -527,16 +516,15 @@ bool KazrogalSpreadRangedInArcAction::Execute(Event /*event*/) size_t count = rangedMembers.size(); auto findIt = std::find(rangedMembers.begin(), rangedMembers.end(), bot); - size_t botIndex = (findIt != rangedMembers.end()) ? - std::distance(rangedMembers.begin(), findIt) : 0; + size_t botIndex = (findIt != rangedMembers.end()) ? std::distance(rangedMembers.begin(), findIt) : 0; constexpr float arcSpan = M_PI / 3.0f; constexpr float arcCenter = 4.225f; constexpr float arcStart = arcCenter - arcSpan / 2.0f; constexpr float radius = 20.0f; - float angle = (count == 1) ? arcCenter : - (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); + float angle = + (count == 1) ? arcCenter : (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); float targetX = kazrogal->GetPositionX() + radius * std::cos(angle); float targetY = kazrogal->GetPositionY() + radius * std::sin(angle); @@ -544,10 +532,9 @@ bool KazrogalSpreadRangedInArcAction::Execute(Event /*event*/) if (bot->GetExactDist2d(targetX, targetY) > 0.5f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, - moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true); } return false; @@ -557,8 +544,7 @@ bool KazrogalLowManaBotTakeDefensiveMeasuresAction::Execute(Event /*event*/) { if (bot->getClass() == CLASS_HUNTER) { - if (!botAI->HasAura("aspect of the viper", bot) && - botAI->CanCastSpell("aspect of the viper", bot)) + if (!botAI->HasAura("aspect of the viper", bot) && botAI->CanCastSpell("aspect of the viper", bot)) { return botAI->CastSpell("aspect of the viper", bot); } @@ -566,8 +552,7 @@ bool KazrogalLowManaBotTakeDefensiveMeasuresAction::Execute(Event /*event*/) } else { - if (bot->getClass() == CLASS_WARLOCK && - botAI->CanCastSpell("life tap", bot) && + if (bot->getClass() == CLASS_WARLOCK && botAI->CanCastSpell("life tap", bot) && botAI->CastSpell("life tap", bot)) { return true; @@ -579,14 +564,12 @@ bool KazrogalLowManaBotTakeDefensiveMeasuresAction::Execute(Event /*event*/) if (bot->HasAura(static_cast(HyjalSummitSpells::SPELL_MARK_OF_KAZROGAL)) && bot->GetPower(POWER_MANA) <= 1200) { - if (bot->getClass() == CLASS_MAGE && - botAI->CanCastSpell("ice block", bot) && + if (bot->getClass() == CLASS_MAGE && botAI->CanCastSpell("ice block", bot) && botAI->CastSpell("ice block", bot)) { return true; } - else if (bot->getClass() == CLASS_PALADIN && - botAI->CanCastSpell("divine shield", bot) && + else if (bot->getClass() == CLASS_PALADIN && botAI->CanCastSpell("divine shield", bot) && botAI->CastSpell("divine shield", bot)) { return true; @@ -627,8 +610,7 @@ bool KazrogalCastShadowProtectionSpellAction::Execute(Event /*event*/) botAI->CanCastSpell("shadow ward", bot)) return botAI->CastSpell("shadow ward", bot); - if (bot->getClass() == CLASS_PALADIN && - botAI->CanCastSpell("shadow resistance aura", bot)) + if (bot->getClass() == CLASS_PALADIN && botAI->CanCastSpell("shadow resistance aura", bot)) return botAI->CastSpell("shadow resistance aura", bot); return false; @@ -673,34 +655,31 @@ bool AzgalorMainTankPositionBossAction::Execute(Event /*event*/) if (azgalor->GetVictim() == bot && bot->IsWithinMeleeRange(azgalor)) { const ObjectGuid guid = bot->GetGUID(); - auto it = azgalorTankStep.try_emplace( - guid, TankPositionState::MovingToTransition).first; + auto it = azgalorTankStep.try_emplace(guid, TankPositionState::MovingToTransition).first; TankPositionState state = it->second; constexpr float maxDistance = 2.0f; - const Position& position = state == TankPositionState::MovingToTransition ? - AZGALOR_TANK_TRANSITION_POSITION : AZGALOR_TANK_FINAL_POSITION; + const Position& position = state == TankPositionState::MovingToTransition ? AZGALOR_TANK_TRANSITION_POSITION + : AZGALOR_TANK_FINAL_POSITION; float distToPosition = bot->GetExactDist2d(position); if (distToPosition > maxDistance) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - 5.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true, - true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 5.0f, moveX, moveY, + moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true, true); } if (state == TankPositionState::MovingToTransition && distToPosition <= maxDistance) { azgalorTankStep[guid] = TankPositionState::MovingToFinal; } - else if (state != TankPositionState::MovingToTransition && - distToPosition <= maxDistance) + else if (state != TankPositionState::MovingToTransition && distToPosition <= maxDistance) { - float orientation = atan2(azgalor->GetPositionY() - bot->GetPositionY(), - azgalor->GetPositionX() - bot->GetPositionX()); + float orientation = + atan2(azgalor->GetPositionY() - bot->GetPositionY(), azgalor->GetPositionX() - bot->GetPositionX()); bot->SetFacingTo(orientation); azgalorTankStep[guid] = TankPositionState::Positioned; } @@ -717,8 +696,7 @@ bool AzgalorDisperseRangedAction::Execute(Event /*event*/) // Azgalor's hitbox is 8.8 yards TankPositionState tankState = GetAzgalorTankPositionState(botAI, bot); - const float safeDistFromBoss = - (tankState == TankPositionState::MovingToTransition ? 35.0f : 29.0f); + const float safeDistFromBoss = (tankState == TankPositionState::MovingToTransition ? 35.0f : 29.0f); constexpr uint32 minInterval = 0; if (bot->GetExactDist2d(azgalor) < safeDistFromBoss && @@ -761,8 +739,7 @@ bool AzgalorMeleeGetOutOfFireAction::Execute(Event /*event*/) return false; } - if (doomguard && - (bot->GetVictim() != doomguard || bot->GetTarget() != doomguard->GetGUID())) + if (doomguard && (bot->GetVictim() != doomguard || bot->GetTarget() != doomguard->GetGUID())) return Attack(doomguard); return MoveAway(azgalor, 5.0f); @@ -775,10 +752,9 @@ bool AzgalorWaitAtSafePositionAction::Execute(Event /*event*/) const Position& position = AZGALOR_DOOMGUARD_POSITION; botAI->Reset(); float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_FORCED, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_FORCED, true); return false; } @@ -790,10 +766,9 @@ bool AzgalorMoveToDoomguardTankAction::Execute(Event /*event*/) if (bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()) > 5.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_FORCED, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_FORCED, true); } return false; @@ -802,8 +777,7 @@ bool AzgalorMoveToDoomguardTankAction::Execute(Event /*event*/) bool AzgalorFirstAssistTankPositionDoomguardAction::Execute(Event /*event*/) { const Position& position = AZGALOR_DOOMGUARD_POSITION; - float distToPosition = - bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); float moveDist = 0.0f; bool shouldMove = false; @@ -817,8 +791,7 @@ bool AzgalorFirstAssistTankPositionDoomguardAction::Execute(Event /*event*/) if (bot->GetVictim() != doomguard) return Attack(doomguard); - if (doomguard->GetVictim() == bot && bot->IsWithinMeleeRange(doomguard) && - distToPosition > 3.0f) + if (doomguard->GetVictim() == bot && bot->IsWithinMeleeRange(doomguard) && distToPosition > 3.0f) { moveDist = std::min(5.0f, distToPosition); shouldMove = true; @@ -839,11 +812,10 @@ bool AzgalorFirstAssistTankPositionDoomguardAction::Execute(Event /*event*/) if (shouldMove) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - moveDist, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true, - moveBackwards); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), moveDist, moveX, moveY, + moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true, moveBackwards); } return false; @@ -911,21 +883,18 @@ bool ArchimondeMoveBossToInitialPositionAction::Execute(Event /*event*/) if (bot->GetVictim() != archimonde) return Attack(archimonde); - if (archimonde->GetVictim() == bot && bot->IsWithinMeleeRange(archimonde) && - bot->GetHealthPct() > 50.0f) + if (archimonde->GetVictim() == bot && bot->IsWithinMeleeRange(archimonde) && bot->GetHealthPct() > 50.0f) { const Position& position = ARCHIMONDE_INITIAL_POSITION; - float distToPosition = - bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); if (distToPosition > 3.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), - 5.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, - false, false, MovementPriority::MOVEMENT_COMBAT, true, - true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 5.0f, moveX, moveY, + moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, + MovementPriority::MOVEMENT_COMBAT, true, true); } } @@ -971,8 +940,7 @@ bool ArchimondeSpreadToAvoidAirBurstAction::Execute(Event /*event*/) if (archimonde->HasUnitState(UNIT_STATE_CASTING)) { Spell* spell = archimonde->GetCurrentSpell(CURRENT_GENERIC_SPELL); - if (spell && spell->m_spellInfo->Id == - static_cast(HyjalSummitSpells::SPELL_AIR_BURST)) + if (spell && spell->m_spellInfo->Id == static_cast(HyjalSummitSpells::SPELL_AIR_BURST)) { Player* mainTank = GetGroupMainTank(botAI, bot); if (mainTank && spell->m_targets.GetUnitTarget() == mainTank) @@ -994,8 +962,7 @@ bool ArchimondeSpreadToAvoidAirBurstAction::Execute(Event /*event*/) if (botAI->IsRanged(bot)) { Unit* nearestPlayer = GetNearestPlayerInRadius(bot, safeDistFromPlayer); - if (nearestPlayer && - FleePosition(nearestPlayer->GetPosition(), safeDistFromPlayer, minInterval)) + if (nearestPlayer && FleePosition(nearestPlayer->GetPosition(), safeDistFromPlayer, minInterval)) return true; } @@ -1014,17 +981,14 @@ bool ArchimondeAvoidDoomfireAction::Execute(Event /*event*/) if (it == doomfireTrails.end() || it->second.empty()) return false; - it->second.erase(std::remove_if(it->second.begin(), it->second.end(), - [now](const DoomfireTrailData& d) - { - return getMSTimeDiff(d.recordTime, now) > trailDuration; - }), it->second.end()); + it->second.erase(std::remove_if(it->second.begin(), it->second.end(), [now](const DoomfireTrailData& d) + { return getMSTimeDiff(d.recordTime, now) > trailDuration; }), + it->second.end()); float totalDx = 0.0f, totalDy = 0.0f; for (auto const& data : it->second) { - float d = bot->GetExactDist2d(data.position.GetPositionX(), - data.position.GetPositionY()); + float d = bot->GetExactDist2d(data.position.GetPositionX(), data.position.GetPositionY()); if (d < dangerDist && d > 0.0f) { @@ -1044,13 +1008,13 @@ bool ArchimondeAvoidDoomfireAction::Execute(Event /*event*/) float targetX = bot->GetPositionX() + (totalDx / norm) * moveDist; float targetY = bot->GetPositionY() + (totalDy / norm) * moveDist; - MovementPriority priority = botAI->IsHeal(bot) ? - MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_FORCED; + MovementPriority priority = + botAI->IsHeal(bot) ? MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_FORCED; bool backwards = botAI->IsMainTank(bot); - return MoveTo(HYJAL_SUMMIT_MAP_ID, targetX, targetY, bot->GetPositionZ(), - false, false, false, false, priority, true, backwards); + return MoveTo(HYJAL_SUMMIT_MAP_ID, targetX, targetY, bot->GetPositionZ(), false, false, false, false, priority, + true, backwards); } return false; diff --git a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.h b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.h index 6eab69c238f..0051111a453 100644 --- a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.h +++ b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.h @@ -18,8 +18,7 @@ using HyjalSummitAttackAction = AttackAction; class HyjalSummitEraseTrackersAction : public Action { public: - HyjalSummitEraseTrackersAction( - PlayerbotAI* botAI) : Action(botAI, "hyjal summit erase trackers") {} + HyjalSummitEraseTrackersAction(PlayerbotAI* botAI) : Action(botAI, "hyjal summit erase trackers") {} bool Execute(Event event) override; }; @@ -28,24 +27,40 @@ class HyjalSummitEraseTrackersAction : public Action class RageWinterchillMisdirectBossToMainTankAction : public HyjalSummitAttackAction { public: - RageWinterchillMisdirectBossToMainTankAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "rage winterchill misdirect boss to main tank") {} + RageWinterchillMisdirectBossToMainTankAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "rage winterchill misdirect boss to main tank") + { + } bool Execute(Event event) override; }; class RageWinterchillMainTankPositionBossAction : public HyjalSummitAttackAction { public: - RageWinterchillMainTankPositionBossAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "rage winterchill main tank position boss") {} + RageWinterchillMainTankPositionBossAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "rage winterchill main tank position boss") + { + } bool Execute(Event event) override; }; class RageWinterchillSpreadRangedInCircleAction : public HyjalSummitMovementAction { public: - RageWinterchillSpreadRangedInCircleAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "rage winterchill spread ranged in circle") {} + RageWinterchillSpreadRangedInCircleAction(PlayerbotAI* botAI) + : HyjalSummitMovementAction(botAI, "rage winterchill spread ranged in circle") + { + } + bool Execute(Event event) override; +}; + +class RageWinterchillMoveAwayFromDeathAndDecayAction : public HyjalSummitAttackAction +{ +public: + RageWinterchillMoveAwayFromDeathAndDecayAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "rage winterchill move away from death and decay") + { + } bool Execute(Event event) override; }; @@ -54,48 +69,60 @@ class RageWinterchillSpreadRangedInCircleAction : public HyjalSummitMovementActi class AnetheronMisdirectBossAndInfernalsToTanksAction : public HyjalSummitAttackAction { public: - AnetheronMisdirectBossAndInfernalsToTanksAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "anetheron misdirect boss and infernals to tanks") {} + AnetheronMisdirectBossAndInfernalsToTanksAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "anetheron misdirect boss and infernals to tanks") + { + } bool Execute(Event event) override; }; class AnetheronMainTankPositionBossAction : public HyjalSummitAttackAction { public: - AnetheronMainTankPositionBossAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "anetheron main tank position boss") {} + AnetheronMainTankPositionBossAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "anetheron main tank position boss") + { + } bool Execute(Event event) override; }; class AnetheronSpreadRangedInCircleAction : public HyjalSummitMovementAction { public: - AnetheronSpreadRangedInCircleAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "anetheron spread ranged in circle") {} + AnetheronSpreadRangedInCircleAction(PlayerbotAI* botAI) + : HyjalSummitMovementAction(botAI, "anetheron spread ranged in circle") + { + } bool Execute(Event event) override; }; class AnetheronBringInfernalToInfernalTankAction : public HyjalSummitMovementAction { public: - AnetheronBringInfernalToInfernalTankAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "anetheron bring infernal to infernal tank") {} + AnetheronBringInfernalToInfernalTankAction(PlayerbotAI* botAI) + : HyjalSummitMovementAction(botAI, "anetheron bring infernal to infernal tank") + { + } bool Execute(Event event) override; }; class AnetheronFirstAssistTankPickUpInfernalsAction : public HyjalSummitAttackAction { public: - AnetheronFirstAssistTankPickUpInfernalsAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "anetheron first assist tank pick up infernals") {} + AnetheronFirstAssistTankPickUpInfernalsAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "anetheron first assist tank pick up infernals") + { + } bool Execute(Event event) override; }; class AnetheronAssignDpsPriorityAction : public HyjalSummitAttackAction { public: - AnetheronAssignDpsPriorityAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "anetheron assign dps priority") {} + AnetheronAssignDpsPriorityAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "anetheron assign dps priority") + { + } bool Execute(Event event) override; }; @@ -104,48 +131,60 @@ class AnetheronAssignDpsPriorityAction : public HyjalSummitAttackAction class KazrogalMisdirectBossToMainTankAction : public HyjalSummitAttackAction { public: - KazrogalMisdirectBossToMainTankAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "kaz'rogal misdirect boss to main tank") {} + KazrogalMisdirectBossToMainTankAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "kaz'rogal misdirect boss to main tank") + { + } bool Execute(Event event) override; }; class KazrogalMainTankPositionBossAction : public HyjalSummitAttackAction { public: - KazrogalMainTankPositionBossAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "kaz'rogal main tank position boss") {} + KazrogalMainTankPositionBossAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "kaz'rogal main tank position boss") + { + } bool Execute(Event event) override; }; class KazrogalAssistTanksMoveInFrontOfBossAction : public HyjalSummitAttackAction { public: - KazrogalAssistTanksMoveInFrontOfBossAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "kaz'rogal assist tanks move in front of boss") {} + KazrogalAssistTanksMoveInFrontOfBossAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "kaz'rogal assist tanks move in front of boss") + { + } bool Execute(Event event) override; }; class KazrogalSpreadRangedInArcAction : public HyjalSummitMovementAction { public: - KazrogalSpreadRangedInArcAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "kaz'rogal spread ranged in arc") {} + KazrogalSpreadRangedInArcAction(PlayerbotAI* botAI) + : HyjalSummitMovementAction(botAI, "kaz'rogal spread ranged in arc") + { + } bool Execute(Event event) override; }; class KazrogalLowManaBotTakeDefensiveMeasuresAction : public HyjalSummitMovementAction { public: -KazrogalLowManaBotTakeDefensiveMeasuresAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "kaz'rogal low mana bot take defensive measures") {} + KazrogalLowManaBotTakeDefensiveMeasuresAction(PlayerbotAI* botAI) + : HyjalSummitMovementAction(botAI, "kaz'rogal low mana bot take defensive measures") + { + } bool Execute(Event event) override; }; class KazrogalCastShadowProtectionSpellAction : public Action { public: - KazrogalCastShadowProtectionSpellAction( - PlayerbotAI* botAI) : Action(botAI, "kaz'rogal cast shadow protection spell") {} + KazrogalCastShadowProtectionSpellAction(PlayerbotAI* botAI) + : Action(botAI, "kaz'rogal cast shadow protection spell") + { + } bool Execute(Event event) override; }; @@ -154,64 +193,75 @@ class KazrogalCastShadowProtectionSpellAction : public Action class AzgalorMisdirectBossToMainTankAction : public HyjalSummitAttackAction { public: - AzgalorMisdirectBossToMainTankAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor misdirect boss to main tank") {} + AzgalorMisdirectBossToMainTankAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "azgalor misdirect boss to main tank") + { + } bool Execute(Event event) override; }; class AzgalorMainTankPositionBossAction : public HyjalSummitAttackAction { public: - AzgalorMainTankPositionBossAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor main tank position boss") {} + AzgalorMainTankPositionBossAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "azgalor main tank position boss") + { + } bool Execute(Event event) override; }; class AzgalorWaitAtSafePositionAction : public HyjalSummitMovementAction { public: - AzgalorWaitAtSafePositionAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "azgalor wait at safe position") {} + AzgalorWaitAtSafePositionAction(PlayerbotAI* botAI) + : HyjalSummitMovementAction(botAI, "azgalor wait at safe position") + { + } bool Execute(Event event) override; }; class AzgalorDisperseRangedAction : public HyjalSummitMovementAction { public: - AzgalorDisperseRangedAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "azgalor disperse ranged") {} + AzgalorDisperseRangedAction(PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "azgalor disperse ranged") {} bool Execute(Event event) override; }; class AzgalorMeleeGetOutOfFireAction : public HyjalSummitAttackAction { public: - AzgalorMeleeGetOutOfFireAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor melee get out of fire") {} + AzgalorMeleeGetOutOfFireAction(PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor melee get out of fire") + { + } bool Execute(Event event) override; }; class AzgalorMoveToDoomguardTankAction : public HyjalSummitMovementAction { public: - AzgalorMoveToDoomguardTankAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "azgalor move to doomguard tank") {} + AzgalorMoveToDoomguardTankAction(PlayerbotAI* botAI) + : HyjalSummitMovementAction(botAI, "azgalor move to doomguard tank") + { + } bool Execute(Event event) override; }; class AzgalorFirstAssistTankPositionDoomguardAction : public HyjalSummitAttackAction { public: - AzgalorFirstAssistTankPositionDoomguardAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor first assist tank position doomguard") {} + AzgalorFirstAssistTankPositionDoomguardAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "azgalor first assist tank position doomguard") + { + } bool Execute(Event event) override; }; class AzgalorAssignDpsPriorityAction : public HyjalSummitAttackAction { public: - AzgalorAssignDpsPriorityAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor assign dps priority") {} + AzgalorAssignDpsPriorityAction(PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor assign dps priority") + { + } bool Execute(Event event) override; }; @@ -220,24 +270,27 @@ class AzgalorAssignDpsPriorityAction : public HyjalSummitAttackAction class ArchimondeMisdirectBossToMainTankAction : public HyjalSummitAttackAction { public: - ArchimondeMisdirectBossToMainTankAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "archimonde misdirect boss to main tank") {} + ArchimondeMisdirectBossToMainTankAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "archimonde misdirect boss to main tank") + { + } bool Execute(Event event) override; }; class ArchimondeMoveBossToInitialPositionAction : public HyjalSummitAttackAction { public: - ArchimondeMoveBossToInitialPositionAction( - PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "archimonde move boss to initial position") {} + ArchimondeMoveBossToInitialPositionAction(PlayerbotAI* botAI) + : HyjalSummitAttackAction(botAI, "archimonde move boss to initial position") + { + } bool Execute(Event event) override; }; class ArchimondeCastFearImmunitySpellAction : public Action { public: - ArchimondeCastFearImmunitySpellAction( - PlayerbotAI* botAI) : Action(botAI, "archimonde cast fear immunity spell") {} + ArchimondeCastFearImmunitySpellAction(PlayerbotAI* botAI) : Action(botAI, "archimonde cast fear immunity spell") {} bool Execute(Event event) override; private: @@ -248,24 +301,24 @@ class ArchimondeCastFearImmunitySpellAction : public Action class ArchimondeSpreadToAvoidAirBurstAction : public HyjalSummitMovementAction { public: - ArchimondeSpreadToAvoidAirBurstAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "archimonde spread to avoid air burst") {} + ArchimondeSpreadToAvoidAirBurstAction(PlayerbotAI* botAI) + : HyjalSummitMovementAction(botAI, "archimonde spread to avoid air burst") + { + } bool Execute(Event event) override; }; class ArchimondeAvoidDoomfireAction : public HyjalSummitMovementAction { public: - ArchimondeAvoidDoomfireAction( - PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "archimonde avoid doomfire") {} + ArchimondeAvoidDoomfireAction(PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "archimonde avoid doomfire") {} bool Execute(Event event) override; }; class ArchimondeRemoveDoomfireDotAction : public Action { public: - ArchimondeRemoveDoomfireDotAction( - PlayerbotAI* botAI) : Action(botAI, "archimonde remove doomfire dot") {} + ArchimondeRemoveDoomfireDotAction(PlayerbotAI* botAI) : Action(botAI, "archimonde remove doomfire dot") {} bool Execute(Event event) override; }; diff --git a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp index b559e74bf7e..1dccc1a3de5 100644 --- a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp +++ b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp @@ -4,8 +4,7 @@ */ #include "RaidHyjalSummitMultipliers.h" -#include "RaidHyjalSummitActions.h" -#include "RaidHyjalSummitHelpers.h" + #include "AiFactory.h" #include "ChooseTargetActions.h" #include "DKActions.h" @@ -13,6 +12,8 @@ #include "HunterActions.h" #include "PaladinActions.h" #include "RaidBossHelpers.h" +#include "RaidHyjalSummitActions.h" +#include "RaidHyjalSummitHelpers.h" #include "ReachTargetActions.h" #include "ShamanActions.h" #include "WarriorActions.h" @@ -26,8 +27,7 @@ float HyjalSummitTimeBloodlustAndHeroismMultiplier::GetValue(Action* action) if (bot->getClass() != CLASS_SHAMAN) return 1.0f; - if (dynamic_cast(action) || - dynamic_cast(action)) + if (dynamic_cast(action) || dynamic_cast(action)) { Unit* archimonde = AI_VALUE2(Unit*, "find target", "archimonde"); if (archimonde && archimonde->GetHealthPct() < 90.0f) @@ -59,8 +59,7 @@ float HyjalSummitTimeBloodlustAndHeroismMultiplier::GetValue(Action* action) float RageWinterchillDisableMainTankAvoidAoeMultiplier::GetValue(Action* action) { - if (!botAI->IsMainTank(bot) || - !AI_VALUE2(Unit*, "find target", "rage winterchill")) + if (!botAI->IsMainTank(bot) || !AI_VALUE2(Unit*, "find target", "rage winterchill")) return 1.0f; if (dynamic_cast(action)) @@ -74,13 +73,33 @@ float RageWinterchillDisableCombatFormationMoveMultiplier::GetValue(Action* acti if (!AI_VALUE2(Unit*, "find target", "rage winterchill")) return 1.0f; - if (dynamic_cast(action) && - !dynamic_cast(action)) + if (dynamic_cast(action) && !dynamic_cast(action)) return 0.0f; return 1.0f; } +float RageWinterchillControlDeathAndDecayAvoidanceMultiplier::GetValue(Action* action) +{ + if (botAI->IsTank(bot) || !AI_VALUE2(Unit*, "find target", "rage winterchill")) + return 1.0f; + + if (IsBotInsideActiveWinterchillDeathAndDecay(bot, 23.0f)) + { + if (dynamic_cast(action)) + return 0.0f; + + if (dynamic_cast(action) && + !dynamic_cast(action)) + return 0.0f; + + if (dynamic_cast(action)) + return 0.0f; + } + + return 1.0f; +} + // Anetheron float AnetheronDisableTankActionsMultiplier::GetValue(Action* action) @@ -91,8 +110,7 @@ float AnetheronDisableTankActionsMultiplier::GetValue(Action* action) if (dynamic_cast(action)) return 0.0f; - if (bot->GetVictim() != nullptr && - dynamic_cast(action)) + if (bot->GetVictim() != nullptr && dynamic_cast(action)) return 0.0f; return 1.0f; @@ -103,8 +121,7 @@ float AnetheronDisableCombatFormationMoveMultiplier::GetValue(Action* action) if (!AI_VALUE2(Unit*, "find target", "anetheron")) return 1.0f; - if (dynamic_cast(action) && - !dynamic_cast(action)) + if (dynamic_cast(action) && !dynamic_cast(action)) return 0.0f; return 1.0f; @@ -112,8 +129,7 @@ float AnetheronDisableCombatFormationMoveMultiplier::GetValue(Action* action) float AnetheronControlMisdirectionMultiplier::GetValue(Action* action) { - if (bot->getClass() != CLASS_HUNTER || - !AI_VALUE2(Unit*, "find target", "anetheron")) + if (bot->getClass() != CLASS_HUNTER || !AI_VALUE2(Unit*, "find target", "anetheron")) return 1.0f; if (dynamic_cast(action)) @@ -126,8 +142,8 @@ float AnetheronControlMisdirectionMultiplier::GetValue(Action* action) float KazrogalLowManaBotStayAwayFromGroupMultiplier::GetValue(Action* action) { - if (bot->getClass() == CLASS_WARRIOR || bot->getClass() == CLASS_ROGUE || - bot->getClass() == CLASS_DEATH_KNIGHT || bot->getClass() == CLASS_HUNTER) + if (bot->getClass() == CLASS_WARRIOR || bot->getClass() == CLASS_ROGUE || bot->getClass() == CLASS_DEATH_KNIGHT || + bot->getClass() == CLASS_HUNTER) return 1.0f; uint8 tab = AiFactory::GetPlayerSpecTab(bot); @@ -141,8 +157,7 @@ float KazrogalLowManaBotStayAwayFromGroupMultiplier::GetValue(Action* action) return 1.0f; if (dynamic_cast(action) || - (dynamic_cast(action) && - !dynamic_cast(action) && + (dynamic_cast(action) && !dynamic_cast(action) && !dynamic_cast(action))) return 0.0f; @@ -151,17 +166,13 @@ float KazrogalLowManaBotStayAwayFromGroupMultiplier::GetValue(Action* action) float KazrogalKeepAspectOfTheViperActiveMultiplier::GetValue(Action* action) { - if (bot->getClass() != CLASS_HUNTER || - !AI_VALUE2(Unit*, "find target", "kaz'rogal") || + if (bot->getClass() != CLASS_HUNTER || !AI_VALUE2(Unit*, "find target", "kaz'rogal") || bot->GetPower(POWER_MANA) > 4000) return 1.0f; - if (dynamic_cast(action) || - dynamic_cast(action) || - dynamic_cast(action) || - dynamic_cast(action) || - dynamic_cast(action) || - dynamic_cast(action)) + if (dynamic_cast(action) || dynamic_cast(action) || + dynamic_cast(action) || dynamic_cast(action) || + dynamic_cast(action) || dynamic_cast(action)) return 0.0f; return 1.0f; @@ -172,8 +183,7 @@ float KazrogalControlMovementMultiplier::GetValue(Action* action) if (!AI_VALUE2(Unit*, "find target", "kaz'rogal")) return 1.0f; - if (dynamic_cast(action) && - !dynamic_cast(action)) + if (dynamic_cast(action) && !dynamic_cast(action)) return 0.0f; if (dynamic_cast(action)) @@ -205,8 +215,7 @@ float AzgalorDisableTankActionsMultiplier::GetValue(Action* action) return 0.0f; } else if (botAI->IsAssistTank(bot) && - (AnyGroupMemberHasDoom(bot) || - AI_VALUE2(Unit*, "find target", "lesser doomguard"))) + (AnyGroupMemberHasDoom(bot) || AI_VALUE2(Unit*, "find target", "lesser doomguard"))) { return 0.0f; } @@ -220,10 +229,8 @@ float AzgalorDoomedBotPrioritizePositioningMultiplier::GetValue(Action* action) if (!bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) return 1.0f; - if (dynamic_cast(action) && - !dynamic_cast(action) && - !dynamic_cast(action) && - !dynamic_cast(action)) + if (dynamic_cast(action) && !dynamic_cast(action) && + !dynamic_cast(action) && !dynamic_cast(action)) return 0.0f; return 1.0f; @@ -242,8 +249,7 @@ float AzgalorMeleeControlAvoidanceMultiplier::GetValue(Action* action) if (IsBotInsideActiveAzgalorRainOfFire(bot, 23.0f)) { - if (dynamic_cast(action) && - !dynamic_cast(action)) + if (dynamic_cast(action) && !dynamic_cast(action)) return 0.0f; if (dynamic_cast(action)) @@ -260,8 +266,7 @@ float ArchimondeDisableCombatFormationMoveMultiplier::GetValue(Action* action) if (!AI_VALUE2(Unit*, "find target", "archimonde")) return 1.0f; - if (dynamic_cast(action) && - !dynamic_cast(action)) + if (dynamic_cast(action) && !dynamic_cast(action)) return 0.0f; return 1.0f; diff --git a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.h b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.h index 10447ae2198..4e5a71a0e4d 100644 --- a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.h +++ b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.h @@ -11,8 +11,10 @@ class HyjalSummitTimeBloodlustAndHeroismMultiplier : public Multiplier { public: - HyjalSummitTimeBloodlustAndHeroismMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "hyjal summit time bloodlust and heroism multiplier") {} + HyjalSummitTimeBloodlustAndHeroismMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "hyjal summit time bloodlust and heroism multiplier") + { + } virtual float GetValue(Action* action); }; @@ -21,16 +23,30 @@ class HyjalSummitTimeBloodlustAndHeroismMultiplier : public Multiplier class RageWinterchillDisableMainTankAvoidAoeMultiplier : public Multiplier { public: - RageWinterchillDisableMainTankAvoidAoeMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "rage winterchill disable main tank avoid aoe multiplier") {} + RageWinterchillDisableMainTankAvoidAoeMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "rage winterchill disable main tank avoid aoe multiplier") + { + } virtual float GetValue(Action* action); }; class RageWinterchillDisableCombatFormationMoveMultiplier : public Multiplier { public: - RageWinterchillDisableCombatFormationMoveMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "rage winterchill disable combat formation move multiplier") {} + RageWinterchillDisableCombatFormationMoveMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "rage winterchill disable combat formation move multiplier") + { + } + virtual float GetValue(Action* action); +}; + +class RageWinterchillControlDeathAndDecayAvoidanceMultiplier : public Multiplier +{ +public: + RageWinterchillControlDeathAndDecayAvoidanceMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "rage winterchill control death and decay avoidance multiplier") + { + } virtual float GetValue(Action* action); }; @@ -39,24 +55,30 @@ class RageWinterchillDisableCombatFormationMoveMultiplier : public Multiplier class AnetheronDisableTankActionsMultiplier : public Multiplier { public: - AnetheronDisableTankActionsMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "anetheron disable tank actions multiplier") {} + AnetheronDisableTankActionsMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "anetheron disable tank actions multiplier") + { + } virtual float GetValue(Action* action); }; class AnetheronDisableCombatFormationMoveMultiplier : public Multiplier { public: - AnetheronDisableCombatFormationMoveMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "anetheron disable combat formation move multiplier") {} + AnetheronDisableCombatFormationMoveMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "anetheron disable combat formation move multiplier") + { + } virtual float GetValue(Action* action); }; class AnetheronControlMisdirectionMultiplier : public Multiplier { public: - AnetheronControlMisdirectionMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "anetheron control misdirection multiplier") {} + AnetheronControlMisdirectionMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "anetheron control misdirection multiplier") + { + } virtual float GetValue(Action* action); }; @@ -65,24 +87,29 @@ class AnetheronControlMisdirectionMultiplier : public Multiplier class KazrogalLowManaBotStayAwayFromGroupMultiplier : public Multiplier { public: - KazrogalLowManaBotStayAwayFromGroupMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "kaz'rogal low mana bot stay away from group multiplier") {} + KazrogalLowManaBotStayAwayFromGroupMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "kaz'rogal low mana bot stay away from group multiplier") + { + } virtual float GetValue(Action* action); }; class KazrogalKeepAspectOfTheViperActiveMultiplier : public Multiplier { public: - KazrogalKeepAspectOfTheViperActiveMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "kaz'rogal keep aspect of the viper active multiplier") {} + KazrogalKeepAspectOfTheViperActiveMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "kaz'rogal keep aspect of the viper active multiplier") + { + } virtual float GetValue(Action* action); }; class KazrogalControlMovementMultiplier : public Multiplier { public: - KazrogalControlMovementMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "kaz'rogal control movement multiplier") {} + KazrogalControlMovementMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "kaz'rogal control movement multiplier") + { + } virtual float GetValue(Action* action); }; @@ -91,24 +118,30 @@ class KazrogalControlMovementMultiplier : public Multiplier class AzgalorDisableTankActionsMultiplier : public Multiplier { public: - AzgalorDisableTankActionsMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "azgalor disable tank actions multiplier") {} + AzgalorDisableTankActionsMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "azgalor disable tank actions multiplier") + { + } virtual float GetValue(Action* action); }; class AzgalorDoomedBotPrioritizePositioningMultiplier : public Multiplier { public: - AzgalorDoomedBotPrioritizePositioningMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "azgalor doomed bot prioritize positioning multiplier") {} + AzgalorDoomedBotPrioritizePositioningMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "azgalor doomed bot prioritize positioning multiplier") + { + } virtual float GetValue(Action* action); }; class AzgalorMeleeControlAvoidanceMultiplier : public Multiplier { public: - AzgalorMeleeControlAvoidanceMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "azgalor melee control avoidance multiplier") {} + AzgalorMeleeControlAvoidanceMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "azgalor melee control avoidance multiplier") + { + } virtual float GetValue(Action* action); }; @@ -117,8 +150,10 @@ class AzgalorMeleeControlAvoidanceMultiplier : public Multiplier class ArchimondeDisableCombatFormationMoveMultiplier : public Multiplier { public: - ArchimondeDisableCombatFormationMoveMultiplier( - PlayerbotAI* botAI) : Multiplier(botAI, "archimonde disable combat formation move multiplier") {} + ArchimondeDisableCombatFormationMoveMultiplier(PlayerbotAI* botAI) + : Multiplier(botAI, "archimonde disable combat formation move multiplier") + { + } virtual float GetValue(Action* action); }; diff --git a/src/Ai/Raid/HyjalSummit/RaidHyjalSummitActionContext.h b/src/Ai/Raid/HyjalSummit/RaidHyjalSummitActionContext.h index 27ef6fe9d3f..9b557cb7a76 100644 --- a/src/Ai/Raid/HyjalSummit/RaidHyjalSummitActionContext.h +++ b/src/Ai/Raid/HyjalSummit/RaidHyjalSummitActionContext.h @@ -6,8 +6,8 @@ #ifndef _PLAYERBOT_RAIDHYJALSUMMITACTIONCONTEXT_H #define _PLAYERBOT_RAIDHYJALSUMMITACTIONCONTEXT_H -#include "RaidHyjalSummitActions.h" #include "NamedObjectContext.h" +#include "RaidHyjalSummitActions.h" class RaidHyjalSummitActionContext : public NamedObjectContext { @@ -15,8 +15,7 @@ class RaidHyjalSummitActionContext : public NamedObjectContext RaidHyjalSummitActionContext() { // General - creators["hyjal summit erase trackers"] = - &RaidHyjalSummitActionContext::hyjal_summit_erase_trackers; + creators["hyjal summit erase trackers"] = &RaidHyjalSummitActionContext::hyjal_summit_erase_trackers; // Rage Winterchill creators["rage winterchill misdirect boss to main tank"] = @@ -28,6 +27,9 @@ class RaidHyjalSummitActionContext : public NamedObjectContext creators["rage winterchill spread ranged in circle"] = &RaidHyjalSummitActionContext::rage_winterchill_spread_ranged_in_circle; + creators["rage winterchill move away from death and decay"] = + &RaidHyjalSummitActionContext::rage_winterchill_move_away_from_death_and_decay; + // Anetheron creators["anetheron misdirect boss and infernals to tanks"] = &RaidHyjalSummitActionContext::anetheron_misdirect_boss_and_infernals_to_tanks; @@ -44,21 +46,18 @@ class RaidHyjalSummitActionContext : public NamedObjectContext creators["anetheron first assist tank pick up infernals"] = &RaidHyjalSummitActionContext::anetheron_first_assist_tank_pick_up_infernals; - creators["anetheron assign dps priority"] = - &RaidHyjalSummitActionContext::anetheron_assign_dps_priority; + creators["anetheron assign dps priority"] = &RaidHyjalSummitActionContext::anetheron_assign_dps_priority; // Kaz'rogal creators["kaz'rogal misdirect boss to main tank"] = &RaidHyjalSummitActionContext::kazrogal_misdirect_boss_to_main_tank; - creators["kaz'rogal main tank position boss"] = - &RaidHyjalSummitActionContext::kazrogal_main_tank_position_boss; + creators["kaz'rogal main tank position boss"] = &RaidHyjalSummitActionContext::kazrogal_main_tank_position_boss; creators["kaz'rogal assist tanks move in front of boss"] = &RaidHyjalSummitActionContext::kazrogal_assist_tanks_move_in_front_of_boss; - creators["kaz'rogal spread ranged in arc"] = - &RaidHyjalSummitActionContext::kazrogal_spread_ranged_in_arc; + creators["kaz'rogal spread ranged in arc"] = &RaidHyjalSummitActionContext::kazrogal_spread_ranged_in_arc; creators["kaz'rogal low mana bot take defensive measures"] = &RaidHyjalSummitActionContext::kazrogal_low_mana_bot_take_defensive_measures; @@ -70,26 +69,20 @@ class RaidHyjalSummitActionContext : public NamedObjectContext creators["azgalor misdirect boss to main tank"] = &RaidHyjalSummitActionContext::azgalor_misdirect_boss_to_main_tank; - creators["azgalor main tank position boss"] = - &RaidHyjalSummitActionContext::azgalor_main_tank_position_boss; + creators["azgalor main tank position boss"] = &RaidHyjalSummitActionContext::azgalor_main_tank_position_boss; - creators["azgalor wait at safe position"] = - &RaidHyjalSummitActionContext::azgalor_wait_at_safe_position; + creators["azgalor wait at safe position"] = &RaidHyjalSummitActionContext::azgalor_wait_at_safe_position; - creators["azgalor disperse ranged"] = - &RaidHyjalSummitActionContext::azgalor_disperse_ranged; + creators["azgalor disperse ranged"] = &RaidHyjalSummitActionContext::azgalor_disperse_ranged; - creators["azgalor melee get out of fire"] = - &RaidHyjalSummitActionContext::azgalor_melee_get_out_of_fire; + creators["azgalor melee get out of fire"] = &RaidHyjalSummitActionContext::azgalor_melee_get_out_of_fire; - creators["azgalor move to doomguard tank"] = - &RaidHyjalSummitActionContext::azgalor_move_to_doomguard_tank; + creators["azgalor move to doomguard tank"] = &RaidHyjalSummitActionContext::azgalor_move_to_doomguard_tank; creators["azgalor first assist tank position doomguard"] = &RaidHyjalSummitActionContext::azgalor_first_assist_tank_position_doomguard; - creators["azgalor assign dps priority"] = - &RaidHyjalSummitActionContext::azgalor_assign_dps_priority; + creators["azgalor assign dps priority"] = &RaidHyjalSummitActionContext::azgalor_assign_dps_priority; // Archimonde creators["archimonde misdirect boss to main tank"] = @@ -104,109 +97,160 @@ class RaidHyjalSummitActionContext : public NamedObjectContext creators["archimonde spread to avoid air burst"] = &RaidHyjalSummitActionContext::archimonde_spread_to_avoid_air_burst; - creators["archimonde avoid doomfire"] = - &RaidHyjalSummitActionContext::archimonde_avoid_doomfire; + creators["archimonde avoid doomfire"] = &RaidHyjalSummitActionContext::archimonde_avoid_doomfire; - creators["archimonde remove doomfire dot"] = - &RaidHyjalSummitActionContext::archimonde_remove_doomfire_dot; + creators["archimonde remove doomfire dot"] = &RaidHyjalSummitActionContext::archimonde_remove_doomfire_dot; } private: // General - static Action* hyjal_summit_erase_trackers( - PlayerbotAI* botAI) { return new HyjalSummitEraseTrackersAction(botAI); } + static Action* hyjal_summit_erase_trackers(PlayerbotAI* botAI) { return new HyjalSummitEraseTrackersAction(botAI); } // Rage Winterchill - static Action* rage_winterchill_misdirect_boss_to_main_tank( - PlayerbotAI* botAI) { return new RageWinterchillMisdirectBossToMainTankAction(botAI); } + static Action* rage_winterchill_misdirect_boss_to_main_tank(PlayerbotAI* botAI) + { + return new RageWinterchillMisdirectBossToMainTankAction(botAI); + } - static Action* rage_winterchill_main_tank_position_boss( - PlayerbotAI* botAI) { return new RageWinterchillMainTankPositionBossAction(botAI); } + static Action* rage_winterchill_main_tank_position_boss(PlayerbotAI* botAI) + { + return new RageWinterchillMainTankPositionBossAction(botAI); + } - static Action* rage_winterchill_spread_ranged_in_circle( - PlayerbotAI* botAI) { return new RageWinterchillSpreadRangedInCircleAction(botAI); } + static Action* rage_winterchill_spread_ranged_in_circle(PlayerbotAI* botAI) + { + return new RageWinterchillSpreadRangedInCircleAction(botAI); + } + + static Action* rage_winterchill_move_away_from_death_and_decay(PlayerbotAI* botAI) + { + return new RageWinterchillMoveAwayFromDeathAndDecayAction(botAI); + } // Anetheron - static Action* anetheron_misdirect_boss_and_infernals_to_tanks( - PlayerbotAI* botAI) { return new AnetheronMisdirectBossAndInfernalsToTanksAction(botAI); } + static Action* anetheron_misdirect_boss_and_infernals_to_tanks(PlayerbotAI* botAI) + { + return new AnetheronMisdirectBossAndInfernalsToTanksAction(botAI); + } - static Action* anetheron_main_tank_position_boss( - PlayerbotAI* botAI) { return new AnetheronMainTankPositionBossAction(botAI); } + static Action* anetheron_main_tank_position_boss(PlayerbotAI* botAI) + { + return new AnetheronMainTankPositionBossAction(botAI); + } - static Action* anetheron_spread_ranged_in_circle( - PlayerbotAI* botAI) { return new AnetheronSpreadRangedInCircleAction(botAI); } + static Action* anetheron_spread_ranged_in_circle(PlayerbotAI* botAI) + { + return new AnetheronSpreadRangedInCircleAction(botAI); + } - static Action* anetheron_bring_infernal_to_infernal_tank( - PlayerbotAI* botAI) { return new AnetheronBringInfernalToInfernalTankAction(botAI); } + static Action* anetheron_bring_infernal_to_infernal_tank(PlayerbotAI* botAI) + { + return new AnetheronBringInfernalToInfernalTankAction(botAI); + } - static Action* anetheron_first_assist_tank_pick_up_infernals( - PlayerbotAI* botAI) { return new AnetheronFirstAssistTankPickUpInfernalsAction(botAI); } + static Action* anetheron_first_assist_tank_pick_up_infernals(PlayerbotAI* botAI) + { + return new AnetheronFirstAssistTankPickUpInfernalsAction(botAI); + } - static Action* anetheron_assign_dps_priority( - PlayerbotAI* botAI) { return new AnetheronAssignDpsPriorityAction(botAI); } + static Action* anetheron_assign_dps_priority(PlayerbotAI* botAI) + { + return new AnetheronAssignDpsPriorityAction(botAI); + } // Kaz'rogal - static Action* kazrogal_misdirect_boss_to_main_tank( - PlayerbotAI* botAI) { return new KazrogalMisdirectBossToMainTankAction(botAI); } + static Action* kazrogal_misdirect_boss_to_main_tank(PlayerbotAI* botAI) + { + return new KazrogalMisdirectBossToMainTankAction(botAI); + } - static Action* kazrogal_main_tank_position_boss( - PlayerbotAI* botAI) { return new KazrogalMainTankPositionBossAction(botAI); } + static Action* kazrogal_main_tank_position_boss(PlayerbotAI* botAI) + { + return new KazrogalMainTankPositionBossAction(botAI); + } - static Action* kazrogal_assist_tanks_move_in_front_of_boss( - PlayerbotAI* botAI) { return new KazrogalAssistTanksMoveInFrontOfBossAction(botAI); } + static Action* kazrogal_assist_tanks_move_in_front_of_boss(PlayerbotAI* botAI) + { + return new KazrogalAssistTanksMoveInFrontOfBossAction(botAI); + } - static Action* kazrogal_spread_ranged_in_arc( - PlayerbotAI* botAI) { return new KazrogalSpreadRangedInArcAction(botAI); } + static Action* kazrogal_spread_ranged_in_arc(PlayerbotAI* botAI) + { + return new KazrogalSpreadRangedInArcAction(botAI); + } - static Action* kazrogal_low_mana_bot_take_defensive_measures( - PlayerbotAI* botAI) { return new KazrogalLowManaBotTakeDefensiveMeasuresAction(botAI); } + static Action* kazrogal_low_mana_bot_take_defensive_measures(PlayerbotAI* botAI) + { + return new KazrogalLowManaBotTakeDefensiveMeasuresAction(botAI); + } - static Action* kazrogal_cast_shadow_protection_spell( - PlayerbotAI* botAI) { return new KazrogalCastShadowProtectionSpellAction(botAI); } + static Action* kazrogal_cast_shadow_protection_spell(PlayerbotAI* botAI) + { + return new KazrogalCastShadowProtectionSpellAction(botAI); + } // Azgalor - static Action* azgalor_misdirect_boss_to_main_tank( - PlayerbotAI* botAI) { return new AzgalorMisdirectBossToMainTankAction(botAI); } + static Action* azgalor_misdirect_boss_to_main_tank(PlayerbotAI* botAI) + { + return new AzgalorMisdirectBossToMainTankAction(botAI); + } - static Action* azgalor_main_tank_position_boss( - PlayerbotAI* botAI) { return new AzgalorMainTankPositionBossAction(botAI); } + static Action* azgalor_main_tank_position_boss(PlayerbotAI* botAI) + { + return new AzgalorMainTankPositionBossAction(botAI); + } - static Action* azgalor_wait_at_safe_position( - PlayerbotAI* botAI) { return new AzgalorWaitAtSafePositionAction(botAI); } + static Action* azgalor_wait_at_safe_position(PlayerbotAI* botAI) + { + return new AzgalorWaitAtSafePositionAction(botAI); + } - static Action* azgalor_disperse_ranged( - PlayerbotAI* botAI) { return new AzgalorDisperseRangedAction(botAI); } + static Action* azgalor_disperse_ranged(PlayerbotAI* botAI) { return new AzgalorDisperseRangedAction(botAI); } - static Action* azgalor_melee_get_out_of_fire( - PlayerbotAI* botAI) { return new AzgalorMeleeGetOutOfFireAction(botAI); } + static Action* azgalor_melee_get_out_of_fire(PlayerbotAI* botAI) + { + return new AzgalorMeleeGetOutOfFireAction(botAI); + } - static Action* azgalor_move_to_doomguard_tank( - PlayerbotAI* botAI) { return new AzgalorMoveToDoomguardTankAction(botAI); } + static Action* azgalor_move_to_doomguard_tank(PlayerbotAI* botAI) + { + return new AzgalorMoveToDoomguardTankAction(botAI); + } - static Action* azgalor_first_assist_tank_position_doomguard( - PlayerbotAI* botAI) { return new AzgalorFirstAssistTankPositionDoomguardAction(botAI); } + static Action* azgalor_first_assist_tank_position_doomguard(PlayerbotAI* botAI) + { + return new AzgalorFirstAssistTankPositionDoomguardAction(botAI); + } - static Action* azgalor_assign_dps_priority( - PlayerbotAI* botAI) { return new AzgalorAssignDpsPriorityAction(botAI); } + static Action* azgalor_assign_dps_priority(PlayerbotAI* botAI) { return new AzgalorAssignDpsPriorityAction(botAI); } // Archimonde - static Action* archimonde_misdirect_boss_to_main_tank( - PlayerbotAI* botAI) { return new ArchimondeMisdirectBossToMainTankAction(botAI); } + static Action* archimonde_misdirect_boss_to_main_tank(PlayerbotAI* botAI) + { + return new ArchimondeMisdirectBossToMainTankAction(botAI); + } - static Action* archimonde_move_boss_to_initial_position( - PlayerbotAI* botAI) { return new ArchimondeMoveBossToInitialPositionAction(botAI); } + static Action* archimonde_move_boss_to_initial_position(PlayerbotAI* botAI) + { + return new ArchimondeMoveBossToInitialPositionAction(botAI); + } - static Action* archimonde_cast_fear_immunity_spell( - PlayerbotAI* botAI) { return new ArchimondeCastFearImmunitySpellAction(botAI); } + static Action* archimonde_cast_fear_immunity_spell(PlayerbotAI* botAI) + { + return new ArchimondeCastFearImmunitySpellAction(botAI); + } - static Action* archimonde_spread_to_avoid_air_burst( - PlayerbotAI* botAI) { return new ArchimondeSpreadToAvoidAirBurstAction(botAI); } + static Action* archimonde_spread_to_avoid_air_burst(PlayerbotAI* botAI) + { + return new ArchimondeSpreadToAvoidAirBurstAction(botAI); + } - static Action* archimonde_avoid_doomfire( - PlayerbotAI* botAI) { return new ArchimondeAvoidDoomfireAction(botAI); } + static Action* archimonde_avoid_doomfire(PlayerbotAI* botAI) { return new ArchimondeAvoidDoomfireAction(botAI); } - static Action* archimonde_remove_doomfire_dot( - PlayerbotAI* botAI) { return new ArchimondeRemoveDoomfireDotAction(botAI); } + static Action* archimonde_remove_doomfire_dot(PlayerbotAI* botAI) + { + return new ArchimondeRemoveDoomfireDotAction(botAI); + } }; #endif diff --git a/src/Ai/Raid/HyjalSummit/RaidHyjalSummitTriggerContext.h b/src/Ai/Raid/HyjalSummit/RaidHyjalSummitTriggerContext.h index e47595625ea..107632a084c 100644 --- a/src/Ai/Raid/HyjalSummit/RaidHyjalSummitTriggerContext.h +++ b/src/Ai/Raid/HyjalSummit/RaidHyjalSummitTriggerContext.h @@ -6,8 +6,8 @@ #ifndef _PLAYERBOT_RAIDHYJALSUMMITTRIGGERCONTEXT_H #define _PLAYERBOT_RAIDHYJALSUMMITTRIGGERCONTEXT_H -#include "RaidHyjalSummitTriggers.h" #include "AiObjectContext.h" +#include "RaidHyjalSummitTriggers.h" class RaidHyjalSummitTriggerContext : public NamedObjectContext { @@ -19,8 +19,7 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext &RaidHyjalSummitTriggerContext::hyjal_summit_bot_is_not_in_combat; // Rage Winterchill - creators["rage winterchill pulling boss"] = - &RaidHyjalSummitTriggerContext::rage_winterchill_pulling_boss; + creators["rage winterchill pulling boss"] = &RaidHyjalSummitTriggerContext::rage_winterchill_pulling_boss; creators["rage winterchill boss engaged by main tank"] = &RaidHyjalSummitTriggerContext::rage_winterchill_boss_engaged_by_main_tank; @@ -28,6 +27,9 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext creators["rage winterchill boss casts death and decay"] = &RaidHyjalSummitTriggerContext::rage_winterchill_boss_casts_death_and_decay; + creators["rage winterchill bot is standing in death and decay"] = + &RaidHyjalSummitTriggerContext::rage_winterchill_bot_is_standing_in_death_and_decay; + // Anetheron creators["anetheron pulling boss or infernal"] = &RaidHyjalSummitTriggerContext::anetheron_pulling_boss_or_infernal; @@ -48,8 +50,7 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext &RaidHyjalSummitTriggerContext::anetheron_infernals_continue_to_spawn; // Kaz'rogal - creators["kaz'rogal pulling boss"] = - &RaidHyjalSummitTriggerContext::kazrogal_pulling_boss; + creators["kaz'rogal pulling boss"] = &RaidHyjalSummitTriggerContext::kazrogal_pulling_boss; creators["kaz'rogal boss engaged by main tank"] = &RaidHyjalSummitTriggerContext::kazrogal_boss_engaged_by_main_tank; @@ -57,8 +58,7 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext creators["kaz'rogal boss engaged by assist tanks"] = &RaidHyjalSummitTriggerContext::kazrogal_boss_engaged_by_assist_tanks; - creators["kaz'rogal bot is low on mana"] = - &RaidHyjalSummitTriggerContext::kazrogal_bot_is_low_on_mana; + creators["kaz'rogal bot is low on mana"] = &RaidHyjalSummitTriggerContext::kazrogal_bot_is_low_on_mana; creators["kaz'rogal low mana bots need escape path"] = &RaidHyjalSummitTriggerContext::kazrogal_low_mana_bots_need_escape_path; @@ -67,8 +67,7 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext &RaidHyjalSummitTriggerContext::kazrogal_mark_deals_shadow_damage; // Azgalor - creators["azgalor pulling boss"] = - &RaidHyjalSummitTriggerContext::azgalor_pulling_boss; + creators["azgalor pulling boss"] = &RaidHyjalSummitTriggerContext::azgalor_pulling_boss; creators["azgalor boss engaged by main tank"] = &RaidHyjalSummitTriggerContext::azgalor_boss_engaged_by_main_tank; @@ -82,8 +81,7 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext creators["azgalor boss casts rain of fire on melee"] = &RaidHyjalSummitTriggerContext::azgalor_boss_casts_rain_of_fire_on_melee; - creators["azgalor bot is doomed"] = - &RaidHyjalSummitTriggerContext::azgalor_bot_is_doomed; + creators["azgalor bot is doomed"] = &RaidHyjalSummitTriggerContext::azgalor_bot_is_doomed; creators["azgalor doomguards must be controlled"] = &RaidHyjalSummitTriggerContext::azgalor_doomguards_must_be_controlled; @@ -92,121 +90,164 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext &RaidHyjalSummitTriggerContext::azgalor_doomguards_continue_to_spawn; // Archimonde - creators["archimonde pulling boss"] = - &RaidHyjalSummitTriggerContext::archimonde_pulling_boss; + creators["archimonde pulling boss"] = &RaidHyjalSummitTriggerContext::archimonde_pulling_boss; creators["archimonde boss engaged by main tank"] = &RaidHyjalSummitTriggerContext::archimonde_boss_engaged_by_main_tank; - creators["archimonde boss casts fear"] = - &RaidHyjalSummitTriggerContext::archimonde_boss_casts_fear; + creators["archimonde boss casts fear"] = &RaidHyjalSummitTriggerContext::archimonde_boss_casts_fear; - creators["archimonde boss casts air burst"] = - &RaidHyjalSummitTriggerContext::archimonde_boss_casts_air_burst; + creators["archimonde boss casts air burst"] = &RaidHyjalSummitTriggerContext::archimonde_boss_casts_air_burst; creators["archimonde boss summoned doomfire"] = &RaidHyjalSummitTriggerContext::archimonde_boss_summoned_doomfire; - creators["archimonde bot stood in doomfire"] = - &RaidHyjalSummitTriggerContext::archimonde_bot_stood_in_doomfire; + creators["archimonde bot stood in doomfire"] = &RaidHyjalSummitTriggerContext::archimonde_bot_stood_in_doomfire; } private: // General - static Trigger* hyjal_summit_bot_is_not_in_combat( - PlayerbotAI* botAI) { return new HyjalSummitBotIsNotInCombatTrigger(botAI); } + static Trigger* hyjal_summit_bot_is_not_in_combat(PlayerbotAI* botAI) + { + return new HyjalSummitBotIsNotInCombatTrigger(botAI); + } // Rage Winterchill - static Trigger* rage_winterchill_pulling_boss( - PlayerbotAI* botAI) { return new RageWinterchillPullingBossTrigger(botAI); } + static Trigger* rage_winterchill_pulling_boss(PlayerbotAI* botAI) + { + return new RageWinterchillPullingBossTrigger(botAI); + } - static Trigger* rage_winterchill_boss_engaged_by_main_tank( - PlayerbotAI* botAI) { return new RageWinterchillBossEngagedByMainTankTrigger(botAI); } + static Trigger* rage_winterchill_boss_engaged_by_main_tank(PlayerbotAI* botAI) + { + return new RageWinterchillBossEngagedByMainTankTrigger(botAI); + } - static Trigger* rage_winterchill_boss_casts_death_and_decay( - PlayerbotAI* botAI) { return new RageWinterchillBossCastsDeathAndDecayTrigger(botAI); } + static Trigger* rage_winterchill_boss_casts_death_and_decay(PlayerbotAI* botAI) + { + return new RageWinterchillBossCastsDeathAndDecayTrigger(botAI); + } + + static Trigger* rage_winterchill_bot_is_standing_in_death_and_decay(PlayerbotAI* botAI) + { + return new RageWinterchillBotIsStandingInDeathAndDecayTrigger(botAI); + } // Anetheron - static Trigger* anetheron_pulling_boss_or_infernal( - PlayerbotAI* botAI) { return new AnetheronPullingBossOrInfernalTrigger(botAI); } + static Trigger* anetheron_pulling_boss_or_infernal(PlayerbotAI* botAI) + { + return new AnetheronPullingBossOrInfernalTrigger(botAI); + } - static Trigger* anetheron_boss_engaged_by_main_tank( - PlayerbotAI* botAI) { return new AnetheronBossEngagedByMainTankTrigger(botAI); } + static Trigger* anetheron_boss_engaged_by_main_tank(PlayerbotAI* botAI) + { + return new AnetheronBossEngagedByMainTankTrigger(botAI); + } - static Trigger* anetheron_boss_casts_carrion_swarm( - PlayerbotAI* botAI) { return new AnetheronBossCastsCarrionSwarmTrigger(botAI); } + static Trigger* anetheron_boss_casts_carrion_swarm(PlayerbotAI* botAI) + { + return new AnetheronBossCastsCarrionSwarmTrigger(botAI); + } - static Trigger* anetheron_bot_is_targeted_by_infernal( - PlayerbotAI* botAI) { return new AnetheronBotIsTargetedByInfernalTrigger(botAI); } + static Trigger* anetheron_bot_is_targeted_by_infernal(PlayerbotAI* botAI) + { + return new AnetheronBotIsTargetedByInfernalTrigger(botAI); + } - static Trigger* anetheron_infernals_need_to_be_kept_away_from_raid( - PlayerbotAI* botAI) { return new AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger(botAI); } + static Trigger* anetheron_infernals_need_to_be_kept_away_from_raid(PlayerbotAI* botAI) + { + return new AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger(botAI); + } - static Trigger* anetheron_infernals_continue_to_spawn( - PlayerbotAI* botAI) { return new AnetheronInfernalsContinueToSpawnTrigger(botAI); } + static Trigger* anetheron_infernals_continue_to_spawn(PlayerbotAI* botAI) + { + return new AnetheronInfernalsContinueToSpawnTrigger(botAI); + } // Kaz'rogal - static Trigger* kazrogal_pulling_boss( - PlayerbotAI* botAI) { return new KazrogalPullingBossTrigger(botAI); } + static Trigger* kazrogal_pulling_boss(PlayerbotAI* botAI) { return new KazrogalPullingBossTrigger(botAI); } - static Trigger* kazrogal_boss_engaged_by_main_tank( - PlayerbotAI* botAI) { return new KazrogalBossEngagedByMainTankTrigger(botAI); } + static Trigger* kazrogal_boss_engaged_by_main_tank(PlayerbotAI* botAI) + { + return new KazrogalBossEngagedByMainTankTrigger(botAI); + } - static Trigger* kazrogal_boss_engaged_by_assist_tanks( - PlayerbotAI* botAI) { return new KazrogalBossEngagedByAssistTanksTrigger(botAI); } + static Trigger* kazrogal_boss_engaged_by_assist_tanks(PlayerbotAI* botAI) + { + return new KazrogalBossEngagedByAssistTanksTrigger(botAI); + } - static Trigger* kazrogal_low_mana_bots_need_escape_path( - PlayerbotAI* botAI) { return new KazrogalLowManaBotsNeedEscapePathTrigger(botAI); } + static Trigger* kazrogal_low_mana_bots_need_escape_path(PlayerbotAI* botAI) + { + return new KazrogalLowManaBotsNeedEscapePathTrigger(botAI); + } - static Trigger* kazrogal_bot_is_low_on_mana( - PlayerbotAI* botAI) { return new KazrogalBotIsLowOnManaTrigger(botAI); } + static Trigger* kazrogal_bot_is_low_on_mana(PlayerbotAI* botAI) { return new KazrogalBotIsLowOnManaTrigger(botAI); } - static Trigger* kazrogal_mark_deals_shadow_damage( - PlayerbotAI* botAI) { return new KazrogalMarkDealsShadowDamageTrigger(botAI); } + static Trigger* kazrogal_mark_deals_shadow_damage(PlayerbotAI* botAI) + { + return new KazrogalMarkDealsShadowDamageTrigger(botAI); + } // Azgalor - static Trigger* azgalor_pulling_boss( - PlayerbotAI* botAI) { return new AzgalorPullingBossTrigger(botAI); } + static Trigger* azgalor_pulling_boss(PlayerbotAI* botAI) { return new AzgalorPullingBossTrigger(botAI); } - static Trigger* azgalor_boss_engaged_by_main_tank( - PlayerbotAI* botAI) { return new AzgalorBossEngagedByMainTankTrigger(botAI); } + static Trigger* azgalor_boss_engaged_by_main_tank(PlayerbotAI* botAI) + { + return new AzgalorBossEngagedByMainTankTrigger(botAI); + } - static Trigger* azgalor_main_tank_is_positioning_boss( - PlayerbotAI* botAI) { return new AzgalorMainTankIsPositioningBossTrigger(botAI); } + static Trigger* azgalor_main_tank_is_positioning_boss(PlayerbotAI* botAI) + { + return new AzgalorMainTankIsPositioningBossTrigger(botAI); + } - static Trigger* azgalor_boss_casts_rain_of_fire_on_ranged( - PlayerbotAI* botAI) { return new AzgalorBossCastsRainOfFireOnRangedTrigger(botAI); } + static Trigger* azgalor_boss_casts_rain_of_fire_on_ranged(PlayerbotAI* botAI) + { + return new AzgalorBossCastsRainOfFireOnRangedTrigger(botAI); + } - static Trigger* azgalor_boss_casts_rain_of_fire_on_melee( - PlayerbotAI* botAI) { return new AzgalorBossCastsRainOfFireOnMeleeTrigger(botAI); } + static Trigger* azgalor_boss_casts_rain_of_fire_on_melee(PlayerbotAI* botAI) + { + return new AzgalorBossCastsRainOfFireOnMeleeTrigger(botAI); + } - static Trigger* azgalor_bot_is_doomed( - PlayerbotAI* botAI) { return new AzgalorBotIsDoomedTrigger(botAI); } + static Trigger* azgalor_bot_is_doomed(PlayerbotAI* botAI) { return new AzgalorBotIsDoomedTrigger(botAI); } - static Trigger* azgalor_doomguards_must_be_controlled( - PlayerbotAI* botAI) { return new AzgalorDoomguardsMustBeControlledTrigger(botAI); } + static Trigger* azgalor_doomguards_must_be_controlled(PlayerbotAI* botAI) + { + return new AzgalorDoomguardsMustBeControlledTrigger(botAI); + } - static Trigger* azgalor_doomguards_continue_to_spawn( - PlayerbotAI* botAI) { return new AzgalorDoomguardsContinueToSpawnTrigger(botAI); } + static Trigger* azgalor_doomguards_continue_to_spawn(PlayerbotAI* botAI) + { + return new AzgalorDoomguardsContinueToSpawnTrigger(botAI); + } // Archimonde - static Trigger* archimonde_pulling_boss( - PlayerbotAI* botAI) { return new ArchimondePullingBossTrigger(botAI); } + static Trigger* archimonde_pulling_boss(PlayerbotAI* botAI) { return new ArchimondePullingBossTrigger(botAI); } - static Trigger* archimonde_boss_engaged_by_main_tank( - PlayerbotAI* botAI) { return new ArchimondeBossEngagedByMainTankTrigger(botAI); } + static Trigger* archimonde_boss_engaged_by_main_tank(PlayerbotAI* botAI) + { + return new ArchimondeBossEngagedByMainTankTrigger(botAI); + } - static Trigger* archimonde_boss_casts_fear( - PlayerbotAI* botAI) { return new ArchimondeBossCastsFearTrigger(botAI); } + static Trigger* archimonde_boss_casts_fear(PlayerbotAI* botAI) { return new ArchimondeBossCastsFearTrigger(botAI); } - static Trigger* archimonde_boss_casts_air_burst( - PlayerbotAI* botAI) { return new ArchimondeBossCastsAirBurstTrigger(botAI); } + static Trigger* archimonde_boss_casts_air_burst(PlayerbotAI* botAI) + { + return new ArchimondeBossCastsAirBurstTrigger(botAI); + } - static Trigger* archimonde_boss_summoned_doomfire( - PlayerbotAI* botAI) { return new ArchimondeBossSummonedDoomfireTrigger(botAI); } + static Trigger* archimonde_boss_summoned_doomfire(PlayerbotAI* botAI) + { + return new ArchimondeBossSummonedDoomfireTrigger(botAI); + } - static Trigger* archimonde_bot_stood_in_doomfire( - PlayerbotAI* botAI) { return new ArchimondeBotStoodInDoomfireTrigger(botAI); } + static Trigger* archimonde_bot_stood_in_doomfire(PlayerbotAI* botAI) + { + return new ArchimondeBotStoodInDoomfireTrigger(botAI); + } }; #endif diff --git a/src/Ai/Raid/HyjalSummit/Strategy/RaidHyjalSummitStrategy.cpp b/src/Ai/Raid/HyjalSummit/Strategy/RaidHyjalSummitStrategy.cpp index 21b7e0ba05e..0805ac9c055 100644 --- a/src/Ai/Raid/HyjalSummit/Strategy/RaidHyjalSummitStrategy.cpp +++ b/src/Ai/Raid/HyjalSummit/Strategy/RaidHyjalSummitStrategy.cpp @@ -4,105 +4,114 @@ */ #include "RaidHyjalSummitStrategy.h" + #include "RaidHyjalSummitMultipliers.h" void RaidHyjalSummitStrategy::InitTriggers(std::vector& triggers) { // General - triggers.push_back(new TriggerNode("hyjal summit bot is not in combat", { - NextAction("hyjal summit erase trackers", ACTION_EMERGENCY + 11) })); + triggers.push_back(new TriggerNode("hyjal summit bot is not in combat", + {NextAction("hyjal summit erase trackers", ACTION_EMERGENCY + 11)})); // Rage Winterchill - triggers.push_back(new TriggerNode("rage winterchill pulling boss", { - NextAction("rage winterchill misdirect boss to main tank", ACTION_RAID + 2) })); + triggers.push_back(new TriggerNode("rage winterchill pulling boss", + {NextAction("rage winterchill misdirect boss to main tank", ACTION_RAID + 2)})); + + triggers.push_back(new TriggerNode("rage winterchill boss engaged by main tank", + {NextAction("rage winterchill main tank position boss", ACTION_RAID + 1)})); - triggers.push_back(new TriggerNode("rage winterchill boss engaged by main tank", { - NextAction("rage winterchill main tank position boss", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("rage winterchill boss casts death and decay", + {NextAction("rage winterchill spread ranged in circle", ACTION_RAID + 1)})); - triggers.push_back(new TriggerNode("rage winterchill boss casts death and decay", { - NextAction("rage winterchill spread ranged in circle", ACTION_RAID + 1) })); + triggers.push_back( + new TriggerNode("rage winterchill bot is standing in death and decay", + {NextAction("rage winterchill move away from death and decay", ACTION_EMERGENCY + 2)})); // Anetheron - triggers.push_back(new TriggerNode("anetheron pulling boss or infernal", { - NextAction("anetheron misdirect boss and infernals to tanks", ACTION_RAID + 3) })); + triggers.push_back( + new TriggerNode("anetheron pulling boss or infernal", + {NextAction("anetheron misdirect boss and infernals to tanks", ACTION_RAID + 3)})); - triggers.push_back(new TriggerNode("anetheron boss engaged by main tank", { - NextAction("anetheron main tank position boss", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("anetheron boss engaged by main tank", + {NextAction("anetheron main tank position boss", ACTION_RAID + 1)})); - triggers.push_back(new TriggerNode("anetheron boss casts carrion swarm", { - NextAction("anetheron spread ranged in circle", ACTION_RAID + 2) })); + triggers.push_back(new TriggerNode("anetheron boss casts carrion swarm", + {NextAction("anetheron spread ranged in circle", ACTION_RAID + 2)})); - triggers.push_back(new TriggerNode("anetheron bot is targeted by infernal", { - NextAction("anetheron bring infernal to infernal tank", ACTION_EMERGENCY + 2) })); + triggers.push_back( + new TriggerNode("anetheron bot is targeted by infernal", + {NextAction("anetheron bring infernal to infernal tank", ACTION_EMERGENCY + 2)})); - triggers.push_back(new TriggerNode("anetheron infernals need to be kept away from raid", { - NextAction("anetheron first assist tank pick up infernals", ACTION_EMERGENCY + 1) })); + triggers.push_back( + new TriggerNode("anetheron infernals need to be kept away from raid", + {NextAction("anetheron first assist tank pick up infernals", ACTION_EMERGENCY + 1)})); - triggers.push_back(new TriggerNode("anetheron infernals continue to spawn", { - NextAction("anetheron assign dps priority", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("anetheron infernals continue to spawn", + {NextAction("anetheron assign dps priority", ACTION_RAID + 1)})); // Kaz'rogal - triggers.push_back(new TriggerNode("kaz'rogal pulling boss", { - NextAction("kaz'rogal misdirect boss to main tank", ACTION_RAID + 2) })); + triggers.push_back(new TriggerNode("kaz'rogal pulling boss", + {NextAction("kaz'rogal misdirect boss to main tank", ACTION_RAID + 2)})); - triggers.push_back(new TriggerNode("kaz'rogal boss engaged by main tank", { - NextAction("kaz'rogal main tank position boss", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("kaz'rogal boss engaged by main tank", + {NextAction("kaz'rogal main tank position boss", ACTION_RAID + 1)})); - triggers.push_back(new TriggerNode("kaz'rogal boss engaged by assist tanks", { - NextAction("kaz'rogal assist tanks move in front of boss", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("kaz'rogal boss engaged by assist tanks", + {NextAction("kaz'rogal assist tanks move in front of boss", ACTION_RAID + 1)})); - triggers.push_back(new TriggerNode("kaz'rogal low mana bots need escape path", { - NextAction("kaz'rogal spread ranged in arc", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("kaz'rogal low mana bots need escape path", + {NextAction("kaz'rogal spread ranged in arc", ACTION_RAID + 1)})); - triggers.push_back(new TriggerNode("kaz'rogal bot is low on mana", { - NextAction("kaz'rogal low mana bot take defensive measures", ACTION_EMERGENCY + 1) })); + triggers.push_back( + new TriggerNode("kaz'rogal bot is low on mana", + {NextAction("kaz'rogal low mana bot take defensive measures", ACTION_EMERGENCY + 1)})); - triggers.push_back(new TriggerNode("kaz'rogal mark deals shadow damage", { - NextAction("kaz'rogal cast shadow protection spell", ACTION_EMERGENCY + 6) })); + triggers.push_back(new TriggerNode("kaz'rogal mark deals shadow damage", + {NextAction("kaz'rogal cast shadow protection spell", ACTION_EMERGENCY + 6)})); // Azgalor - triggers.push_back(new TriggerNode("azgalor pulling boss", { - NextAction("azgalor misdirect boss to main tank", ACTION_RAID + 3) })); + triggers.push_back( + new TriggerNode("azgalor pulling boss", {NextAction("azgalor misdirect boss to main tank", ACTION_RAID + 3)})); - triggers.push_back(new TriggerNode("azgalor boss engaged by main tank", { - NextAction("azgalor main tank position boss", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("azgalor boss engaged by main tank", + {NextAction("azgalor main tank position boss", ACTION_RAID + 1)})); - triggers.push_back(new TriggerNode("azgalor main tank is positioning boss", { - NextAction("azgalor wait at safe position", ACTION_EMERGENCY + 1) })); + triggers.push_back(new TriggerNode("azgalor main tank is positioning boss", + {NextAction("azgalor wait at safe position", ACTION_EMERGENCY + 1)})); - triggers.push_back(new TriggerNode("azgalor boss casts rain of fire on ranged", { - NextAction("azgalor disperse ranged", ACTION_RAID + 2) })); + triggers.push_back(new TriggerNode("azgalor boss casts rain of fire on ranged", + {NextAction("azgalor disperse ranged", ACTION_RAID + 2)})); - triggers.push_back(new TriggerNode("azgalor boss casts rain of fire on melee", { - NextAction("azgalor melee get out of fire", ACTION_EMERGENCY + 2) })); + triggers.push_back(new TriggerNode("azgalor boss casts rain of fire on melee", + {NextAction("azgalor melee get out of fire", ACTION_EMERGENCY + 2)})); - triggers.push_back(new TriggerNode("azgalor bot is doomed", { - NextAction("azgalor move to doomguard tank", ACTION_EMERGENCY + 3) })); + triggers.push_back( + new TriggerNode("azgalor bot is doomed", {NextAction("azgalor move to doomguard tank", ACTION_EMERGENCY + 3)})); - triggers.push_back(new TriggerNode("azgalor doomguards must be controlled", { - NextAction("azgalor first assist tank position doomguard", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("azgalor doomguards must be controlled", + {NextAction("azgalor first assist tank position doomguard", ACTION_RAID + 1)})); - triggers.push_back(new TriggerNode("azgalor doomguards continue to spawn", { - NextAction("azgalor assign dps priority", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("azgalor doomguards continue to spawn", + {NextAction("azgalor assign dps priority", ACTION_RAID + 1)})); // Archimonde - triggers.push_back(new TriggerNode("archimonde pulling boss", { - NextAction("archimonde misdirect boss to main tank", ACTION_RAID + 2) })); + triggers.push_back(new TriggerNode("archimonde pulling boss", + {NextAction("archimonde misdirect boss to main tank", ACTION_RAID + 2)})); - triggers.push_back(new TriggerNode("archimonde boss engaged by main tank", { - NextAction("archimonde move boss to initial position", ACTION_RAID + 2) })); + triggers.push_back(new TriggerNode("archimonde boss engaged by main tank", + {NextAction("archimonde move boss to initial position", ACTION_RAID + 2)})); - triggers.push_back(new TriggerNode("archimonde boss casts fear", { - NextAction("archimonde cast fear immunity spell", ACTION_RAID + 2) })); + triggers.push_back(new TriggerNode("archimonde boss casts fear", + {NextAction("archimonde cast fear immunity spell", ACTION_RAID + 2)})); - triggers.push_back(new TriggerNode("archimonde boss casts air burst", { - NextAction("archimonde spread to avoid air burst", ACTION_RAID + 1) })); + triggers.push_back(new TriggerNode("archimonde boss casts air burst", + {NextAction("archimonde spread to avoid air burst", ACTION_RAID + 1)})); - triggers.push_back(new TriggerNode("archimonde boss summoned doomfire", { - NextAction("archimonde avoid doomfire", ACTION_EMERGENCY + 6) })); + triggers.push_back(new TriggerNode("archimonde boss summoned doomfire", + {NextAction("archimonde avoid doomfire", ACTION_EMERGENCY + 6)})); - triggers.push_back(new TriggerNode("archimonde bot stood in doomfire", { - NextAction("archimonde remove doomfire dot", ACTION_EMERGENCY + 7) })); + triggers.push_back(new TriggerNode("archimonde bot stood in doomfire", + {NextAction("archimonde remove doomfire dot", ACTION_EMERGENCY + 7)})); } void RaidHyjalSummitStrategy::InitMultipliers(std::vector& multipliers) @@ -113,6 +122,7 @@ void RaidHyjalSummitStrategy::InitMultipliers(std::vector& multipli // Rage Winterchill multipliers.push_back(new RageWinterchillDisableMainTankAvoidAoeMultiplier(botAI)); multipliers.push_back(new RageWinterchillDisableCombatFormationMoveMultiplier(botAI)); + multipliers.push_back(new RageWinterchillControlDeathAndDecayAvoidanceMultiplier(botAI)); // Anetheron multipliers.push_back(new AnetheronDisableTankActionsMultiplier(botAI)); diff --git a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp index a1c2d66c81b..430784f3e2d 100644 --- a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp +++ b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp @@ -4,20 +4,18 @@ */ #include "RaidHyjalSummitTriggers.h" -#include "RaidHyjalSummitHelpers.h" -#include "RaidHyjalSummitActions.h" + #include "AiFactory.h" #include "Playerbots.h" #include "RaidBossHelpers.h" +#include "RaidHyjalSummitActions.h" +#include "RaidHyjalSummitHelpers.h" using namespace HyjalSummitHelpers; // General -bool HyjalSummitBotIsNotInCombatTrigger::IsActive() -{ - return !bot->IsInCombat(); -} +bool HyjalSummitBotIsNotInCombatTrigger::IsActive() { return !bot->IsInCombat(); } // Rage Winterchill @@ -32,28 +30,35 @@ bool RageWinterchillPullingBossTrigger::IsActive() bool RageWinterchillBossEngagedByMainTankTrigger::IsActive() { - return botAI->IsMainTank(bot) && - AI_VALUE2(Unit*, "find target", "rage winterchill"); + return botAI->IsMainTank(bot) && AI_VALUE2(Unit*, "find target", "rage winterchill"); } bool RageWinterchillBossCastsDeathAndDecayTrigger::IsActive() { - return botAI->IsRanged(bot) && - AI_VALUE2(Unit*, "find target", "rage winterchill"); + return botAI->IsRanged(bot) && AI_VALUE2(Unit*, "find target", "rage winterchill"); +} + +bool RageWinterchillBotIsStandingInDeathAndDecayTrigger::IsActive() +{ + if (botAI->IsTank(bot)) + return false; + + if (!AI_VALUE2(Unit*, "find target", "rage winterchill")) + return false; + + return IsBotInsideActiveWinterchillDeathAndDecay(bot, 16.0f); } // Anetheron bool AnetheronPullingBossOrInfernalTrigger::IsActive() { - return bot->getClass() == CLASS_HUNTER && - AI_VALUE2(Unit*, "find target", "anetheron"); + return bot->getClass() == CLASS_HUNTER && AI_VALUE2(Unit*, "find target", "anetheron"); } bool AnetheronBossEngagedByMainTankTrigger::IsActive() { - return botAI->IsMainTank(bot) && - AI_VALUE2(Unit*, "find target", "anetheron"); + return botAI->IsMainTank(bot) && AI_VALUE2(Unit*, "find target", "anetheron"); } bool AnetheronBossCastsCarrionSwarmTrigger::IsActive() @@ -82,14 +87,12 @@ bool AnetheronBotIsTargetedByInfernalTrigger::IsActive() bool AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger::IsActive() { - return botAI->IsAssistTankOfIndex(bot, 0, true) && - AI_VALUE2(Unit*, "find target", "towering infernal"); + return botAI->IsAssistTankOfIndex(bot, 0, true) && AI_VALUE2(Unit*, "find target", "towering infernal"); } bool AnetheronInfernalsContinueToSpawnTrigger::IsActive() { - return !botAI->IsTank(bot) && - AI_VALUE2(Unit*, "find target", "anetheron"); + return !botAI->IsTank(bot) && AI_VALUE2(Unit*, "find target", "anetheron"); } // Kaz'rogal @@ -121,9 +124,7 @@ bool KazrogalBossEngagedByAssistTanksTrigger::IsActive() bool KazrogalLowManaBotsNeedEscapePathTrigger::IsActive() { - if (bot->getClass() == CLASS_WARRIOR || - bot->getClass() == CLASS_ROGUE || - bot->getClass() == CLASS_DEATH_KNIGHT) + if (bot->getClass() == CLASS_WARRIOR || bot->getClass() == CLASS_ROGUE || bot->getClass() == CLASS_DEATH_KNIGHT) return false; uint8 tab = AiFactory::GetPlayerSpecTab(bot); @@ -151,9 +152,7 @@ bool KazrogalLowManaBotsNeedEscapePathTrigger::IsActive() bool KazrogalBotIsLowOnManaTrigger::IsActive() { - if (bot->getClass() == CLASS_WARRIOR || - bot->getClass() == CLASS_ROGUE || - bot->getClass() == CLASS_DEATH_KNIGHT) + if (bot->getClass() == CLASS_WARRIOR || bot->getClass() == CLASS_ROGUE || bot->getClass() == CLASS_DEATH_KNIGHT) return false; uint8 tab = AiFactory::GetPlayerSpecTab(bot); @@ -166,8 +165,7 @@ bool KazrogalBotIsLowOnManaTrigger::IsActive() if (botAI->HasAnyAuraOf(bot, "ice block", "divine shield", nullptr)) return false; - if (isBelowManaThreshold.count(bot->GetGUID()) || - bot->GetPower(POWER_MANA) <= 3200) + if (isBelowManaThreshold.count(bot->GetGUID()) || bot->GetPower(POWER_MANA) <= 3200) return true; return false; @@ -175,21 +173,18 @@ bool KazrogalBotIsLowOnManaTrigger::IsActive() bool KazrogalMarkDealsShadowDamageTrigger::IsActive() { - if (bot->getClass() != CLASS_PALADIN && - bot->getClass() != CLASS_WARLOCK) + if (bot->getClass() != CLASS_PALADIN && bot->getClass() != CLASS_WARLOCK) return false; if (!AI_VALUE2(Unit*, "find target", "kaz'rogal")) return false; if (bot->getClass() == CLASS_PALADIN && - (botAI->HasAura("shadow resistance aura", bot) || - botAI->HasAura("prayer of shadow protection", bot) || + (botAI->HasAura("shadow resistance aura", bot) || botAI->HasAura("prayer of shadow protection", bot) || botAI->HasAura("shadow protection", bot))) return false; - return bot->HasAura( - static_cast(HyjalSummitSpells::SPELL_MARK_OF_KAZROGAL)); + return bot->HasAura(static_cast(HyjalSummitSpells::SPELL_MARK_OF_KAZROGAL)); } // Azgalor @@ -205,8 +200,7 @@ bool AzgalorPullingBossTrigger::IsActive() bool AzgalorBossEngagedByMainTankTrigger::IsActive() { - return botAI->IsMainTank(bot) && - AI_VALUE2(Unit*, "find target", "azgalor"); + return botAI->IsMainTank(bot) && AI_VALUE2(Unit*, "find target", "azgalor"); } bool AzgalorMainTankIsPositioningBossTrigger::IsActive() @@ -229,8 +223,7 @@ bool AzgalorMainTankIsPositioningBossTrigger::IsActive() return azgalor->GetHealthPct() > 95.0f; TankPositionState tankState = GetAzgalorTankPositionState(botAI, bot); - return tankState == TankPositionState::Unknown || - tankState == TankPositionState::MovingToTransition; + return tankState == TankPositionState::Unknown || tankState == TankPositionState::MovingToTransition; } bool AzgalorBossCastsRainOfFireOnRangedTrigger::IsActive() @@ -239,8 +232,7 @@ bool AzgalorBossCastsRainOfFireOnRangedTrigger::IsActive() return false; Unit* azgalor = AI_VALUE2(Unit*, "find target", "azgalor"); - return azgalor && azgalor->GetVictim() != bot && - !bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM)); + return azgalor && azgalor->GetVictim() != bot && !bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM)); } bool AzgalorBossCastsRainOfFireOnMeleeTrigger::IsActive() @@ -249,40 +241,32 @@ bool AzgalorBossCastsRainOfFireOnMeleeTrigger::IsActive() return false; Unit* azgalor = AI_VALUE2(Unit*, "find target", "azgalor"); - if (!azgalor || azgalor->GetVictim() == bot || - bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) + if (!azgalor || azgalor->GetVictim() == bot || bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) return false; return IsBotInsideActiveAzgalorRainOfFire(bot, 16.0f); } -bool AzgalorBotIsDoomedTrigger::IsActive() -{ - return bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM)); -} +bool AzgalorBotIsDoomedTrigger::IsActive() { return bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM)); } bool AzgalorDoomguardsMustBeControlledTrigger::IsActive() { - if (!botAI->IsAssistTank(bot) || - !AI_VALUE2(Unit*, "find target", "azgalor")) + if (!botAI->IsAssistTank(bot) || !AI_VALUE2(Unit*, "find target", "azgalor")) return false; if (botAI->IsAssistTankOfIndex(bot, 0, true)) { - return AI_VALUE2(Unit*, "find target", "lesser doomguard") || - AnyGroupMemberHasDoom(bot); + return AI_VALUE2(Unit*, "find target", "lesser doomguard") || AnyGroupMemberHasDoom(bot); } if (botAI->IsAssistTankOfIndex(bot, 1, true)) { // Trigger for second assist tank only if first assist tank has Doom Player* firstAssistTank = GetGroupAssistTank(botAI, bot, 0); - if (firstAssistTank && - !firstAssistTank->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) + if (firstAssistTank && !firstAssistTank->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) return false; - return AI_VALUE2(Unit*, "find target", "lesser doomguard") || - AnyGroupMemberHasDoom(bot); + return AI_VALUE2(Unit*, "find target", "lesser doomguard") || AnyGroupMemberHasDoom(bot); } return false; @@ -318,8 +302,7 @@ bool ArchimondeBossEngagedByMainTankTrigger::IsActive() bool ArchimondeBossCastsFearTrigger::IsActive() { - if (bot->getClass() != CLASS_PRIEST && - bot->getClass() != CLASS_SHAMAN) + if (bot->getClass() != CLASS_PRIEST && bot->getClass() != CLASS_SHAMAN) return false; Unit* archimonde = AI_VALUE2(Unit*, "find target", "archimonde"); @@ -329,8 +312,7 @@ bool ArchimondeBossCastsFearTrigger::IsActive() bool ArchimondeBossCastsAirBurstTrigger::IsActive() { Unit* archimonde = AI_VALUE2(Unit*, "find target", "archimonde"); - if (!archimonde || archimonde->GetHealthPct() <= 10.0f || - archimonde->GetVictim() == bot) + if (!archimonde || archimonde->GetHealthPct() <= 10.0f || archimonde->GetVictim() == bot) return false; return !botAI->IsMainTank(bot); @@ -344,18 +326,14 @@ bool ArchimondeBossSummonedDoomfireTrigger::IsActive() // If I don't make an exception, bots actually refuse to enter the // Doomfire even when feared - return !bot->HasAura( - static_cast(HyjalSummitSpells::SPELL_ARCHIMONDE_FEAR)); + return !bot->HasAura(static_cast(HyjalSummitSpells::SPELL_ARCHIMONDE_FEAR)); } bool ArchimondeBotStoodInDoomfireTrigger::IsActive() { - if (bot->getClass() != CLASS_MAGE && - bot->getClass() != CLASS_ROGUE && - bot->getClass() != CLASS_PALADIN) + if (bot->getClass() != CLASS_MAGE && bot->getClass() != CLASS_ROGUE && bot->getClass() != CLASS_PALADIN) return false; - return bot->GetHealthPct() < 40.0f && - (bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOMFIRE)) || - bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOMFIRE_DOT))); + return bot->GetHealthPct() < 40.0f && (bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOMFIRE)) || + bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOMFIRE_DOT))); } diff --git a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.h b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.h index 8327865ba22..01b39e9acd8 100644 --- a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.h +++ b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.h @@ -13,8 +13,7 @@ class HyjalSummitBotIsNotInCombatTrigger : public Trigger { public: - HyjalSummitBotIsNotInCombatTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "hyjal summit bot is not in combat") {} + HyjalSummitBotIsNotInCombatTrigger(PlayerbotAI* botAI) : Trigger(botAI, "hyjal summit bot is not in combat") {} bool IsActive() override; }; @@ -23,24 +22,37 @@ class HyjalSummitBotIsNotInCombatTrigger : public Trigger class RageWinterchillPullingBossTrigger : public Trigger { public: - RageWinterchillPullingBossTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "rage winterchill pulling boss") {} + RageWinterchillPullingBossTrigger(PlayerbotAI* botAI) : Trigger(botAI, "rage winterchill pulling boss") {} bool IsActive() override; }; class RageWinterchillBossEngagedByMainTankTrigger : public Trigger { public: - RageWinterchillBossEngagedByMainTankTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "rage winterchill boss engaged by main tank") {} + RageWinterchillBossEngagedByMainTankTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "rage winterchill boss engaged by main tank") + { + } bool IsActive() override; }; class RageWinterchillBossCastsDeathAndDecayTrigger : public Trigger { public: - RageWinterchillBossCastsDeathAndDecayTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "rage winterchill boss casts death and decay") {} + RageWinterchillBossCastsDeathAndDecayTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "rage winterchill boss casts death and decay") + { + } + bool IsActive() override; +}; + +class RageWinterchillBotIsStandingInDeathAndDecayTrigger : public Trigger +{ +public: + RageWinterchillBotIsStandingInDeathAndDecayTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "rage winterchill bot is standing in death and decay") + { + } bool IsActive() override; }; @@ -49,48 +61,51 @@ class RageWinterchillBossCastsDeathAndDecayTrigger : public Trigger class AnetheronPullingBossOrInfernalTrigger : public Trigger { public: - AnetheronPullingBossOrInfernalTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "anetheron pulling boss or infernal") {} + AnetheronPullingBossOrInfernalTrigger(PlayerbotAI* botAI) : Trigger(botAI, "anetheron pulling boss or infernal") {} bool IsActive() override; }; class AnetheronBossEngagedByMainTankTrigger : public Trigger { public: - AnetheronBossEngagedByMainTankTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "anetheron boss engaged by main tank") {} + AnetheronBossEngagedByMainTankTrigger(PlayerbotAI* botAI) : Trigger(botAI, "anetheron boss engaged by main tank") {} bool IsActive() override; }; class AnetheronBossCastsCarrionSwarmTrigger : public Trigger { public: - AnetheronBossCastsCarrionSwarmTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "anetheron boss casts carrion swarm") {} + AnetheronBossCastsCarrionSwarmTrigger(PlayerbotAI* botAI) : Trigger(botAI, "anetheron boss casts carrion swarm") {} bool IsActive() override; }; class AnetheronBotIsTargetedByInfernalTrigger : public Trigger { public: - AnetheronBotIsTargetedByInfernalTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "anetheron bot is targeted by infernal") {} + AnetheronBotIsTargetedByInfernalTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "anetheron bot is targeted by infernal") + { + } bool IsActive() override; }; class AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger : public Trigger { public: - AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "anetheron infernals need to be kept away from raid") {} + AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "anetheron infernals need to be kept away from raid") + { + } bool IsActive() override; }; class AnetheronInfernalsContinueToSpawnTrigger : public Trigger { public: - AnetheronInfernalsContinueToSpawnTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "anetheron infernals continue to spawn") {} + AnetheronInfernalsContinueToSpawnTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "anetheron infernals continue to spawn") + { + } bool IsActive() override; }; @@ -99,48 +114,48 @@ class AnetheronInfernalsContinueToSpawnTrigger : public Trigger class KazrogalPullingBossTrigger : public Trigger { public: - KazrogalPullingBossTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal pulling boss") {} + KazrogalPullingBossTrigger(PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal pulling boss") {} bool IsActive() override; }; class KazrogalBossEngagedByMainTankTrigger : public Trigger { public: - KazrogalBossEngagedByMainTankTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal boss engaged by main tank") {} + KazrogalBossEngagedByMainTankTrigger(PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal boss engaged by main tank") {} bool IsActive() override; }; class KazrogalBossEngagedByAssistTanksTrigger : public Trigger { public: - KazrogalBossEngagedByAssistTanksTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal boss engaged by assist tanks") {} + KazrogalBossEngagedByAssistTanksTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "kaz'rogal boss engaged by assist tanks") + { + } bool IsActive() override; }; class KazrogalLowManaBotsNeedEscapePathTrigger : public Trigger { public: - KazrogalLowManaBotsNeedEscapePathTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal low mana bots need escape path") {} + KazrogalLowManaBotsNeedEscapePathTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "kaz'rogal low mana bots need escape path") + { + } bool IsActive() override; }; class KazrogalBotIsLowOnManaTrigger : public Trigger { public: - KazrogalBotIsLowOnManaTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal bot is low on mana") {} + KazrogalBotIsLowOnManaTrigger(PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal bot is low on mana") {} bool IsActive() override; }; class KazrogalMarkDealsShadowDamageTrigger : public Trigger { public: - KazrogalMarkDealsShadowDamageTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal mark deals shadow damage") {} + KazrogalMarkDealsShadowDamageTrigger(PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal mark deals shadow damage") {} bool IsActive() override; }; @@ -149,64 +164,70 @@ class KazrogalMarkDealsShadowDamageTrigger : public Trigger class AzgalorPullingBossTrigger : public Trigger { public: - AzgalorPullingBossTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "azgalor pulling boss") {} + AzgalorPullingBossTrigger(PlayerbotAI* botAI) : Trigger(botAI, "azgalor pulling boss") {} bool IsActive() override; }; class AzgalorBossEngagedByMainTankTrigger : public Trigger { public: - AzgalorBossEngagedByMainTankTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "azgalor boss engaged by main tank") {} + AzgalorBossEngagedByMainTankTrigger(PlayerbotAI* botAI) : Trigger(botAI, "azgalor boss engaged by main tank") {} bool IsActive() override; }; class AzgalorMainTankIsPositioningBossTrigger : public Trigger { public: - AzgalorMainTankIsPositioningBossTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "azgalor main tank is positioning boss") {} + AzgalorMainTankIsPositioningBossTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "azgalor main tank is positioning boss") + { + } bool IsActive() override; }; class AzgalorBossCastsRainOfFireOnRangedTrigger : public Trigger { public: - AzgalorBossCastsRainOfFireOnRangedTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "azgalor boss casts rain of fire on ranged") {} + AzgalorBossCastsRainOfFireOnRangedTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "azgalor boss casts rain of fire on ranged") + { + } bool IsActive() override; }; class AzgalorBossCastsRainOfFireOnMeleeTrigger : public Trigger { public: - AzgalorBossCastsRainOfFireOnMeleeTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "azgalor boss casts rain of fire on melee") {} + AzgalorBossCastsRainOfFireOnMeleeTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "azgalor boss casts rain of fire on melee") + { + } bool IsActive() override; }; class AzgalorBotIsDoomedTrigger : public Trigger { public: - AzgalorBotIsDoomedTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "azgalor bot is doomed") {} + AzgalorBotIsDoomedTrigger(PlayerbotAI* botAI) : Trigger(botAI, "azgalor bot is doomed") {} bool IsActive() override; }; class AzgalorDoomguardsMustBeControlledTrigger : public Trigger { public: - AzgalorDoomguardsMustBeControlledTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "azgalor doomguards must be controlled") {} + AzgalorDoomguardsMustBeControlledTrigger(PlayerbotAI* botAI) + : Trigger(botAI, "azgalor doomguards must be controlled") + { + } bool IsActive() override; }; class AzgalorDoomguardsContinueToSpawnTrigger : public Trigger { public: - AzgalorDoomguardsContinueToSpawnTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "azgalor doomguards continue to spawn") {} + AzgalorDoomguardsContinueToSpawnTrigger(PlayerbotAI* botAI) : Trigger(botAI, "azgalor doomguards continue to spawn") + { + } bool IsActive() override; }; @@ -215,48 +236,44 @@ class AzgalorDoomguardsContinueToSpawnTrigger : public Trigger class ArchimondePullingBossTrigger : public Trigger { public: - ArchimondePullingBossTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "archimonde pulling boss") {} + ArchimondePullingBossTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde pulling boss") {} bool IsActive() override; }; class ArchimondeBossEngagedByMainTankTrigger : public Trigger { public: - ArchimondeBossEngagedByMainTankTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss engaged by main tank") {} + ArchimondeBossEngagedByMainTankTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss engaged by main tank") + { + } bool IsActive() override; }; class ArchimondeBossCastsFearTrigger : public Trigger { public: - ArchimondeBossCastsFearTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss casts fear") {} + ArchimondeBossCastsFearTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss casts fear") {} bool IsActive() override; }; class ArchimondeBossCastsAirBurstTrigger : public Trigger { public: - ArchimondeBossCastsAirBurstTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss casts air burst") {} + ArchimondeBossCastsAirBurstTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss casts air burst") {} bool IsActive() override; }; class ArchimondeBossSummonedDoomfireTrigger : public Trigger { public: - ArchimondeBossSummonedDoomfireTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss summoned doomfire") {} + ArchimondeBossSummonedDoomfireTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss summoned doomfire") {} bool IsActive() override; }; class ArchimondeBotStoodInDoomfireTrigger : public Trigger { public: - ArchimondeBotStoodInDoomfireTrigger( - PlayerbotAI* botAI) : Trigger(botAI, "archimonde bot stood in doomfire") {} + ArchimondeBotStoodInDoomfireTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde bot stood in doomfire") {} bool IsActive() override; }; diff --git a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.cpp b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.cpp index 4220f950f04..9c5268c4261 100644 --- a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.cpp +++ b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.cpp @@ -13,181 +13,209 @@ namespace HyjalSummitHelpers { - std::unordered_map* GetActiveAzgalorRainOfFire(uint32 instanceId) +DeathAndDecayData* GetActiveWinterchillDeathAndDecay(uint32 instanceId) +{ + auto instanceIt = deathAndDecayPosition.find(instanceId); + if (instanceIt == deathAndDecayPosition.end()) + return nullptr; + + uint32 now = getMSTime(); + if (getMSTimeDiff(instanceIt->second.spawnTime, now) >= WINTERCHILL_DEATH_AND_DECAY_DURATION) { - auto instanceIt = rainOfFirePosition.find(instanceId); - if (instanceIt == rainOfFirePosition.end()) - return nullptr; + deathAndDecayPosition.erase(instanceIt); + return nullptr; + } - uint32 now = getMSTime(); - auto& dynObjMap = instanceIt->second; - for (auto it = dynObjMap.begin(); it != dynObjMap.end(); ) - { - if (getMSTimeDiff(it->second.spawnTime, now) >= AZGALOR_RAIN_OF_FIRE_DURATION) - it = dynObjMap.erase(it); - else - ++it; - } + return &instanceIt->second; +} - if (dynObjMap.empty()) - { - rainOfFirePosition.erase(instanceIt); - return nullptr; - } +std::unordered_map* GetActiveAzgalorRainOfFire(uint32 instanceId) +{ + auto instanceIt = rainOfFirePosition.find(instanceId); + if (instanceIt == rainOfFirePosition.end()) + return nullptr; - return &dynObjMap; + uint32 now = getMSTime(); + auto& dynObjMap = instanceIt->second; + for (auto it = dynObjMap.begin(); it != dynObjMap.end();) + { + if (getMSTimeDiff(it->second.spawnTime, now) >= AZGALOR_RAIN_OF_FIRE_DURATION) + it = dynObjMap.erase(it); + else + ++it; } - // General - - RangedGroups GetRangedGroups(PlayerbotAI* botAI, Player* bot) + if (dynObjMap.empty()) { - RangedGroups result; - Group* group = bot->GetGroup(); - if (!group) - return result; + rainOfFirePosition.erase(instanceIt); + return nullptr; + } - for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) - { - Player* member = ref->GetSource(); - if (!member || !botAI->IsRanged(member)) - continue; + return &dynObjMap; +} - if (botAI->IsHeal(member)) - result.healers.push_back(member); - else - result.rangedDps.push_back(member); - } +// General +RangedGroups GetRangedGroups(PlayerbotAI* botAI, Player* bot) +{ + RangedGroups result; + Group* group = bot->GetGroup(); + if (!group) return result; - } - std::pair GetBotCircleIndexAndCount(PlayerbotAI* botAI, Player* bot, - const RangedGroups& groups) + for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) { - const std::vector& vec = botAI->IsHeal(bot) ? groups.healers : groups.rangedDps; - auto it = std::find(vec.begin(), vec.end(), bot); - size_t index = (it != vec.end()) ? std::distance(vec.begin(), it) : 0; - - return {index, vec.size()}; + Player* member = ref->GetSource(); + if (!member || !botAI->IsRanged(member)) + continue; + + if (botAI->IsHeal(member)) + result.healers.push_back(member); + else + result.rangedDps.push_back(member); } - // Rage Winterchill + return result; +} - const Position WINTERCHILL_TANK_POSITION = { 5031.061f, -1784.521f, 1321.626f }; - std::unordered_map hasReachedWinterchillPosition; +std::pair GetBotCircleIndexAndCount(PlayerbotAI* botAI, Player* bot, const RangedGroups& groups) +{ + const std::vector& vec = botAI->IsHeal(bot) ? groups.healers : groups.rangedDps; + auto it = std::find(vec.begin(), vec.end(), bot); + size_t index = (it != vec.end()) ? std::distance(vec.begin(), it) : 0; - // Anetheron + return {index, vec.size()}; +} - const Position ANETHERON_TANK_POSITION = { 5033.177f, -1765.996f, 1324.195f }; - const Position ANETHERON_E_INFERNAL_POSITION = { 5016.578f, -1800.233f, 1323.070f }; - const Position ANETHERON_W_INFERNAL_POSITION = { 5048.911f, -1722.164f, 1321.408f }; - std::unordered_map hasReachedAnetheronPosition; +// Rage Winterchill - Player* GetInfernoTarget(Unit* anetheron) - { - if (!anetheron) - return nullptr; +const Position WINTERCHILL_TANK_POSITION = {5031.061f, -1784.521f, 1321.626f}; +std::unordered_map hasReachedWinterchillPosition; +std::unordered_map deathAndDecayPosition; - Spell* spell = anetheron->GetCurrentSpell(CURRENT_GENERIC_SPELL); - if (spell && spell->m_spellInfo->Id == - static_cast(HyjalSummitSpells::SPELL_INFERNO)) - { - Unit* spellTarget = spell->m_targets.GetUnitTarget(); - if (spellTarget && spellTarget->IsPlayer()) - return spellTarget->ToPlayer(); - } +bool IsBotInsideActiveWinterchillDeathAndDecay(Player* bot, float radius) +{ + if (!bot || !bot->GetMap()) + return false; + + DeathAndDecayData* data = GetActiveWinterchillDeathAndDecay(bot->GetMap()->GetInstanceId()); + if (!data) + return false; + + return bot->GetExactDist2d(data->position) < radius; +} + +// Anetheron + +const Position ANETHERON_TANK_POSITION = {5033.177f, -1765.996f, 1324.195f}; +const Position ANETHERON_E_INFERNAL_POSITION = {5016.578f, -1800.233f, 1323.070f}; +const Position ANETHERON_W_INFERNAL_POSITION = {5048.911f, -1722.164f, 1321.408f}; +std::unordered_map hasReachedAnetheronPosition; +Player* GetInfernoTarget(Unit* anetheron) +{ + if (!anetheron) return nullptr; - } - const Position& GetClosestInfernalTankPosition(Player* bot) + Spell* spell = anetheron->GetCurrentSpell(CURRENT_GENERIC_SPELL); + if (spell && spell->m_spellInfo->Id == static_cast(HyjalSummitSpells::SPELL_INFERNO)) { - const Position& east = ANETHERON_E_INFERNAL_POSITION; - const Position& west = ANETHERON_W_INFERNAL_POSITION; - return (bot->GetExactDist2d(east.GetPositionX(), east.GetPositionY()) <= - bot->GetExactDist2d(west.GetPositionX(), west.GetPositionY())) ? east : west; + Unit* spellTarget = spell->m_targets.GetUnitTarget(); + if (spellTarget && spellTarget->IsPlayer()) + return spellTarget->ToPlayer(); } - // Kaz'rogal + return nullptr; +} - const Position KAZROGAL_TANK_TRANSITION_POSITION = { 5528.792f, -2636.486f, 1481.293f }; - const Position KAZROGAL_TANK_FINAL_POSITION = { 5511.514f, -2662.466f, 1480.288f }; - std::unordered_map kazrogalTankStep; - std::unordered_map isBelowManaThreshold; +const Position& GetClosestInfernalTankPosition(Player* bot) +{ + const Position& east = ANETHERON_E_INFERNAL_POSITION; + const Position& west = ANETHERON_W_INFERNAL_POSITION; + return (bot->GetExactDist2d(east.GetPositionX(), east.GetPositionY()) <= + bot->GetExactDist2d(west.GetPositionX(), west.GetPositionY())) + ? east + : west; +} - TankPositionState GetKazrogalTankPositionState(PlayerbotAI* botAI, Player* bot) - { - Player* mainTank = GetGroupMainTank(botAI, bot); - if (!mainTank) - return TankPositionState::Unknown; +// Kaz'rogal - auto it = kazrogalTankStep.find(mainTank->GetGUID()); - if (it != kazrogalTankStep.end()) - return it->second; +const Position KAZROGAL_TANK_TRANSITION_POSITION = {5528.792f, -2636.486f, 1481.293f}; +const Position KAZROGAL_TANK_FINAL_POSITION = {5511.514f, -2662.466f, 1480.288f}; +std::unordered_map kazrogalTankStep; +std::unordered_map isBelowManaThreshold; +TankPositionState GetKazrogalTankPositionState(PlayerbotAI* botAI, Player* bot) +{ + Player* mainTank = GetGroupMainTank(botAI, bot); + if (!mainTank) return TankPositionState::Unknown; - } - // Azgalor + auto it = kazrogalTankStep.find(mainTank->GetGUID()); + if (it != kazrogalTankStep.end()) + return it->second; - const Position AZGALOR_TANK_TRANSITION_POSITION = { 5486.787f, -2696.215f, 1482.007f }; - const Position AZGALOR_TANK_FINAL_POSITION = { 5496.379f, -2675.265f, 1481.053f }; - const Position AZGALOR_DOOMGUARD_POSITION = { 5485.555f, -2731.659f, 1485.555f }; - std::unordered_map azgalorTankStep; - std::unordered_map> rainOfFirePosition; + return TankPositionState::Unknown; +} - TankPositionState GetAzgalorTankPositionState(PlayerbotAI* botAI, Player* bot) - { - Player* mainTank = GetGroupMainTank(botAI, bot); - if (!mainTank) - return TankPositionState::Unknown; +// Azgalor - auto it = azgalorTankStep.find(mainTank->GetGUID()); - if (it != azgalorTankStep.end()) - return it->second; +const Position AZGALOR_TANK_TRANSITION_POSITION = {5486.787f, -2696.215f, 1482.007f}; +const Position AZGALOR_TANK_FINAL_POSITION = {5496.379f, -2675.265f, 1481.053f}; +const Position AZGALOR_DOOMGUARD_POSITION = {5485.555f, -2731.659f, 1485.555f}; +std::unordered_map azgalorTankStep; +std::unordered_map> rainOfFirePosition; +TankPositionState GetAzgalorTankPositionState(PlayerbotAI* botAI, Player* bot) +{ + Player* mainTank = GetGroupMainTank(botAI, bot); + if (!mainTank) return TankPositionState::Unknown; - } - bool IsBotInsideActiveAzgalorRainOfFire(Player* bot, float radius) - { - if (!bot || !bot->GetMap()) - return false; + auto it = azgalorTankStep.find(mainTank->GetGUID()); + if (it != azgalorTankStep.end()) + return it->second; - std::unordered_map* dynObjMap = - GetActiveAzgalorRainOfFire(bot->GetMap()->GetInstanceId()); - if (!dynObjMap) - return false; + return TankPositionState::Unknown; +} - for (auto const& entry : *dynObjMap) - { - if (bot->GetExactDist2d(entry.second.position) < radius) - return true; - } +bool IsBotInsideActiveAzgalorRainOfFire(Player* bot, float radius) +{ + if (!bot || !bot->GetMap()) + return false; + std::unordered_map* dynObjMap = + GetActiveAzgalorRainOfFire(bot->GetMap()->GetInstanceId()); + if (!dynObjMap) return false; + + for (auto const& entry : *dynObjMap) + { + if (bot->GetExactDist2d(entry.second.position) < radius) + return true; } - bool AnyGroupMemberHasDoom(Player* bot) + return false; +} + +bool AnyGroupMemberHasDoom(Player* bot) +{ + if (Group* group = bot->GetGroup()) { - if (Group* group = bot->GetGroup()) + for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) { - for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) - { - Player* member = ref->GetSource(); - if (member && - member->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) - return true; - } + Player* member = ref->GetSource(); + if (member && member->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) + return true; } - - return false; } - // Archimonde - - const Position ARCHIMONDE_INITIAL_POSITION = { 5640.502f, -3421.238f, 1587.453f }; - std::unordered_map> doomfireTrails; - std::unordered_map doomfireLastSampleTime; + return false; } + +// Archimonde + +const Position ARCHIMONDE_INITIAL_POSITION = {5640.502f, -3421.238f, 1587.453f}; +std::unordered_map> doomfireTrails; +std::unordered_map doomfireLastSampleTime; +} // namespace HyjalSummitHelpers diff --git a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h index bea3fbbb7a8..fe7514ed172 100644 --- a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h +++ b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h @@ -16,101 +16,112 @@ namespace HyjalSummitHelpers { - enum class HyjalSummitSpells : uint32 - { - // Anetheron - SPELL_INFERNO = 31299, - - // Kaz'rogal - SPELL_MARK_OF_KAZROGAL = 31447, - - // Azgalor - SPELL_RAIN_OF_FIRE = 31340, - SPELL_DOOM = 31347, - - // Archimonde - SPELL_DOOMFIRE = 31944, // Damaging part of trail - SPELL_DOOMFIRE_DOT = 31969, // DoT after exiting trail - SPELL_ARCHIMONDE_FEAR = 31970, - SPELL_AIR_BURST = 32014, - - // Hunter - SPELL_MISDIRECTION = 35079, - - // Priest - SPELL_FEAR_WARD = 6346, - }; - - enum class HyjalSummitNpcs : uint32 - { - // Archimonde - NPC_DOOMFIRE = 18095, - }; - - enum class TankPositionState : uint8 - { - MovingToTransition = 0, - MovingToFinal = 1, - Positioned = 2, - Unknown = 255, - }; - - // General - constexpr uint32 HYJAL_SUMMIT_MAP_ID = 534; - struct RangedGroups - { - std::vector healers; - std::vector rangedDps; - }; - RangedGroups GetRangedGroups(PlayerbotAI* botAI, Player* bot); - std::pair GetBotCircleIndexAndCount(PlayerbotAI* botAI, Player* bot, - const RangedGroups& groups); - +enum class HyjalSummitSpells : uint32 +{ // Rage Winterchill - extern const Position WINTERCHILL_TANK_POSITION; - extern std::unordered_map hasReachedWinterchillPosition; + SPELL_DEATH_AND_DECAY = 31258, // Anetheron - extern const Position ANETHERON_TANK_POSITION; - extern const Position ANETHERON_E_INFERNAL_POSITION; - extern const Position ANETHERON_W_INFERNAL_POSITION; - extern std::unordered_map hasReachedAnetheronPosition; - Player* GetInfernoTarget(Unit* anetheron); - const Position& GetClosestInfernalTankPosition(Player* bot); + SPELL_INFERNO = 31299, // Kaz'rogal - extern const Position KAZROGAL_TANK_TRANSITION_POSITION; - extern const Position KAZROGAL_TANK_FINAL_POSITION; - extern std::unordered_map kazrogalTankStep; - extern std::unordered_map isBelowManaThreshold; - TankPositionState GetKazrogalTankPositionState(PlayerbotAI* botAI, Player* bot); + SPELL_MARK_OF_KAZROGAL = 31447, // Azgalor - extern const Position AZGALOR_TANK_TRANSITION_POSITION; - extern const Position AZGALOR_TANK_FINAL_POSITION; - extern const Position AZGALOR_DOOMGUARD_POSITION; - extern std::unordered_map azgalorTankStep; - constexpr uint32 AZGALOR_RAIN_OF_FIRE_DURATION = 10000; - struct RainOfFireData - { - Position position; - uint32 spawnTime; - }; - extern std::unordered_map> rainOfFirePosition; - TankPositionState GetAzgalorTankPositionState(PlayerbotAI* botAI, Player* bot); - std::unordered_map* GetActiveAzgalorRainOfFire(uint32 instanceId); - bool IsBotInsideActiveAzgalorRainOfFire(Player* bot, float radius); - bool AnyGroupMemberHasDoom(Player* bot); + SPELL_RAIN_OF_FIRE = 31340, + SPELL_DOOM = 31347, + + // Archimonde + SPELL_DOOMFIRE = 31944, // Damaging part of trail + SPELL_DOOMFIRE_DOT = 31969, // DoT after exiting trail + SPELL_ARCHIMONDE_FEAR = 31970, + SPELL_AIR_BURST = 32014, + // Hunter + SPELL_MISDIRECTION = 35079, + + // Priest + SPELL_FEAR_WARD = 6346, +}; + +enum class HyjalSummitNpcs : uint32 +{ // Archimonde - struct DoomfireTrailData - { - Position position; - uint32 recordTime; - }; - extern const Position ARCHIMONDE_INITIAL_POSITION; - extern std::unordered_map> doomfireTrails; - extern std::unordered_map doomfireLastSampleTime; -} + NPC_DOOMFIRE = 18095, +}; + +enum class TankPositionState : uint8 +{ + MovingToTransition = 0, + MovingToFinal = 1, + Positioned = 2, + Unknown = 255, +}; + +// General +constexpr uint32 HYJAL_SUMMIT_MAP_ID = 534; +struct RangedGroups +{ + std::vector healers; + std::vector rangedDps; +}; +RangedGroups GetRangedGroups(PlayerbotAI* botAI, Player* bot); +std::pair GetBotCircleIndexAndCount(PlayerbotAI* botAI, Player* bot, const RangedGroups& groups); + +// Rage Winterchill +extern const Position WINTERCHILL_TANK_POSITION; +extern std::unordered_map hasReachedWinterchillPosition; +constexpr uint32 WINTERCHILL_DEATH_AND_DECAY_DURATION = 20000; +struct DeathAndDecayData +{ + Position position; + uint32 spawnTime; +}; +extern std::unordered_map deathAndDecayPosition; +DeathAndDecayData* GetActiveWinterchillDeathAndDecay(uint32 instanceId); +bool IsBotInsideActiveWinterchillDeathAndDecay(Player* bot, float radius); + +// Anetheron +extern const Position ANETHERON_TANK_POSITION; +extern const Position ANETHERON_E_INFERNAL_POSITION; +extern const Position ANETHERON_W_INFERNAL_POSITION; +extern std::unordered_map hasReachedAnetheronPosition; +Player* GetInfernoTarget(Unit* anetheron); +const Position& GetClosestInfernalTankPosition(Player* bot); + +// Kaz'rogal +extern const Position KAZROGAL_TANK_TRANSITION_POSITION; +extern const Position KAZROGAL_TANK_FINAL_POSITION; +extern std::unordered_map kazrogalTankStep; +extern std::unordered_map isBelowManaThreshold; +TankPositionState GetKazrogalTankPositionState(PlayerbotAI* botAI, Player* bot); + +// Azgalor +extern const Position AZGALOR_TANK_TRANSITION_POSITION; +extern const Position AZGALOR_TANK_FINAL_POSITION; +extern const Position AZGALOR_DOOMGUARD_POSITION; +extern std::unordered_map azgalorTankStep; +constexpr uint32 AZGALOR_RAIN_OF_FIRE_DURATION = 10000; +struct RainOfFireData +{ + Position position; + uint32 spawnTime; +}; +extern std::unordered_map> rainOfFirePosition; +TankPositionState GetAzgalorTankPositionState(PlayerbotAI* botAI, Player* bot); +std::unordered_map* GetActiveAzgalorRainOfFire(uint32 instanceId); +bool IsBotInsideActiveAzgalorRainOfFire(Player* bot, float radius); +bool AnyGroupMemberHasDoom(Player* bot); + +// Archimonde +struct DoomfireTrailData +{ + Position position; + uint32 recordTime; +}; +extern const Position ARCHIMONDE_INITIAL_POSITION; +extern std::unordered_map> doomfireTrails; +extern std::unordered_map doomfireLastSampleTime; +} // namespace HyjalSummitHelpers #endif diff --git a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitScripts.cpp b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitScripts.cpp index 444f9e3c698..1f29ae5a810 100644 --- a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitScripts.cpp +++ b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitScripts.cpp @@ -3,10 +3,10 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ -#include "RaidHyjalSummitHelpers.h" #include "AllCreatureScript.h" #include "DynamicObjectScript.h" #include "Playerbots.h" +#include "RaidHyjalSummitHelpers.h" #include "ScriptMgr.h" #include "Timer.h" @@ -44,11 +44,9 @@ class ArchimondeDoomfireTrailScript : public AllCreatureScript trail.push_back(data); constexpr uint32 TRAIL_DURATION = 18000; - trail.erase(std::remove_if(trail.begin(), trail.end(), - [now](const DoomfireTrailData& d) - { - return getMSTimeDiff(d.recordTime, now) > TRAIL_DURATION; - }), trail.end()); + trail.erase(std::remove_if(trail.begin(), trail.end(), [now](const DoomfireTrailData& d) + { return getMSTimeDiff(d.recordTime, now) > TRAIL_DURATION; }), + trail.end()); constexpr float DOOMFIRE_DANGER_RANGE = 10.0f; Map::PlayerList const& players = creature->GetMap()->GetPlayers(); @@ -96,7 +94,24 @@ class AzgalorRainOfFireScript : public DynamicObjectScript auto& instanceMap = rainOfFirePosition[instanceId]; ObjectGuid guid = dynobj->GetGUID(); - instanceMap.try_emplace(guid, RainOfFireData{ dynobj->GetPosition(), now }); + instanceMap.try_emplace(guid, RainOfFireData{dynobj->GetPosition(), now}); + } +}; + +// Records the active Death and Decay dynamic object so bots can step away from +// Winterchill using encounter-specific movement instead of generic aoe avoidance +class RageWinterchillDeathAndDecayScript : public DynamicObjectScript +{ +public: + RageWinterchillDeathAndDecayScript() : DynamicObjectScript("RageWinterchillDeathAndDecayScript") {} + + void OnUpdate(DynamicObject* dynobj, uint32 /*diff*/) override + { + if (dynobj->GetSpellId() != static_cast(HyjalSummitSpells::SPELL_DEATH_AND_DECAY)) + return; + + deathAndDecayPosition[dynobj->GetMap()->GetInstanceId()] = + DeathAndDecayData{dynobj->GetPosition(), getMSTime()}; } }; @@ -104,4 +119,5 @@ void AddSC_HyjalSummitBotScripts() { new ArchimondeDoomfireTrailScript(); new AzgalorRainOfFireScript(); + new RageWinterchillDeathAndDecayScript(); } From c0db38b1bc985b22f5badcc3585c54604b22e0a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 21:40:37 +0000 Subject: [PATCH 2/3] Minimize Winterchill avoidance diff Agent-Logs-Url: https://github.com/brighton-chi/mod-playerbots/sessions/28459f39-4269-42c9-9b34-eb504d2897c1 Co-authored-by: brighton-chi <190869400+brighton-chi@users.noreply.github.com> --- .../Action/RaidHyjalSummitActions.cpp | 271 +++++++++------- .../Action/RaidHyjalSummitActions.h | 169 ++++------ .../Multiplier/RaidHyjalSummitMultipliers.cpp | 60 ++-- .../Multiplier/RaidHyjalSummitMultipliers.h | 83 ++--- .../RaidHyjalSummitActionContext.h | 212 +++++------- .../RaidHyjalSummitTriggerContext.h | 197 +++++------ .../Strategy/RaidHyjalSummitStrategy.cpp | 130 ++++---- .../Trigger/RaidHyjalSummitTriggers.cpp | 95 ++++-- .../Trigger/RaidHyjalSummitTriggers.h | 133 ++++---- .../Util/RaidHyjalSummitHelpers.cpp | 305 +++++++++--------- .../HyjalSummit/Util/RaidHyjalSummitHelpers.h | 197 +++++------ .../Util/RaidHyjalSummitScripts.cpp | 14 +- 12 files changed, 902 insertions(+), 964 deletions(-) diff --git a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp index 84b76e00ef2..68f3461e785 100644 --- a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp +++ b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp @@ -4,16 +4,16 @@ */ #include "RaidHyjalSummitActions.h" - +#include "RaidHyjalSummitHelpers.h" #include "Playerbots.h" #include "RaidBossHelpers.h" -#include "RaidHyjalSummitHelpers.h" #include "Timer.h" using namespace HyjalSummitHelpers; -static bool GetGroundedStepPosition(Player* bot, float destinationX, float destinationY, float maxStep, float& stepX, - float& stepY, float& stepZ) +static bool GetGroundedStepPosition( + Player* bot, float destinationX, float destinationY, float maxStep, + float& stepX, float& stepY, float& stepZ) { float distance = bot->GetExactDist2d(destinationX, destinationY); if (distance <= 0.0f) @@ -28,8 +28,9 @@ static bool GetGroundedStepPosition(Player* bot, float destinationX, float desti if (stepZ <= INVALID_HEIGHT) stepZ = bot->GetPositionZ(); - bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), - stepX, stepY, stepZ, false); + bot->GetMap()->CheckCollisionAndGetValidCoords( + bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), + stepX, stepY, stepZ, false); return true; } @@ -43,26 +44,32 @@ bool HyjalSummitEraseTrackersAction::Execute(Event /*event*/) bool erased = false; if (botAI->IsTank(bot)) { - if (!AI_VALUE2(Unit*, "find target", "kaz'rogal") && kazrogalTankStep.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "kaz'rogal") && + kazrogalTankStep.erase(guid) > 0) erased = true; - if (!AI_VALUE2(Unit*, "find target", "azgalor") && azgalorTankStep.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "azgalor") && + azgalorTankStep.erase(guid) > 0) erased = true; return erased; } else { - if (!AI_VALUE2(Unit*, "find target", "rage winterchill") && hasReachedWinterchillPosition.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "rage winterchill") && + hasReachedWinterchillPosition.erase(guid) > 0) erased = true; - if (!AI_VALUE2(Unit*, "find target", "anetheron") && hasReachedAnetheronPosition.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "anetheron") && + hasReachedAnetheronPosition.erase(guid) > 0) erased = true; - if (!AI_VALUE2(Unit*, "find target", "kaz'rogal") && isBelowManaThreshold.erase(guid) > 0) + if (!AI_VALUE2(Unit*, "find target", "kaz'rogal") && + isBelowManaThreshold.erase(guid) > 0) erased = true; - if (!AI_VALUE2(Unit*, "find target", "archimonde") && doomfireTrails.erase(bot->GetMap()->GetInstanceId()) > 0) + if (!AI_VALUE2(Unit*, "find target", "archimonde") && + doomfireTrails.erase(bot->GetMap()->GetInstanceId()) > 0) erased = true; return erased; @@ -104,15 +111,16 @@ bool RageWinterchillMainTankPositionBossAction::Execute(Event /*event*/) if (winterchill->GetVictim() == bot) { const Position& position = WINTERCHILL_TANK_POSITION; - float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = + bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); if (distToPosition > 4.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, - moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true); } } @@ -139,8 +147,8 @@ bool RageWinterchillSpreadRangedInCircleAction::Execute(Event /*event*/) constexpr float arcCenter = 0.0f; constexpr float arcStart = arcCenter - arcSpan / 2.0f; - angle = (count == 1) ? arcCenter - : (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); + angle = (count == 1) ? arcCenter : + (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); const Position& position = WINTERCHILL_TANK_POSITION; float targetX = position.GetPositionX() + radius * std::cos(angle); @@ -149,9 +157,10 @@ bool RageWinterchillSpreadRangedInCircleAction::Execute(Event /*event*/) if (bot->GetExactDist2d(targetX, targetY) > 2.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, + moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true); } else { @@ -227,15 +236,16 @@ bool AnetheronMainTankPositionBossAction::Execute(Event /*event*/) if (anetheron->GetVictim() == bot) { const Position& position = ANETHERON_TANK_POSITION; - float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = + bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); if (distToPosition > 4.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, - moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true); } } @@ -261,8 +271,8 @@ bool AnetheronSpreadRangedInCircleAction::Execute(Event /*event*/) constexpr float arcCenter = 0.0f; constexpr float arcStart = arcCenter - arcSpan / 2.0f; - angle = (count == 1) ? arcCenter - : (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); + angle = (count == 1) ? arcCenter : + (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); const Position& position = ANETHERON_TANK_POSITION; @@ -272,9 +282,10 @@ bool AnetheronSpreadRangedInCircleAction::Execute(Event /*event*/) if (bot->GetExactDist2d(targetX, targetY) > 2.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, + moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true); } else { @@ -299,9 +310,10 @@ bool AnetheronBringInfernalToInfernalTankAction::Execute(Event /*event*/) if (bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()) > 2.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_FORCED, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_FORCED, true); } return false; @@ -321,10 +333,11 @@ bool AnetheronFirstAssistTankPickUpInfernalsAction::Execute(Event /*event*/) if (distToInfernoTarget > 5.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, infernoTarget->GetPositionX(), infernoTarget->GetPositionY(), 10.0f, moveX, - moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_FORCED, true); + if (GetGroundedStepPosition(bot, infernoTarget->GetPositionX(), + infernoTarget->GetPositionY(), 10.0f, + moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_FORCED, true); } } @@ -338,18 +351,21 @@ bool AnetheronFirstAssistTankPickUpInfernalsAction::Execute(Event /*event*/) if (bot->GetVictim() != infernal) return Attack(infernal); - if ((infernoTarget && infernoTarget == bot) || (infernal->GetVictim() == bot && bot->IsWithinMeleeRange(infernal))) + if ((infernoTarget && infernoTarget == bot) || + (infernal->GetVictim() == bot && bot->IsWithinMeleeRange(infernal))) { const Position& position = GetClosestInfernalTankPosition(bot); - float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = + bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); if (distToPosition > 3.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 5.0f, moveX, moveY, - moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + 5.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true, + true); } } @@ -376,12 +392,14 @@ bool AnetheronAssignDpsPriorityAction::Execute(Event /*event*/) { constexpr float safeDistFromInfernal = 10.0f; constexpr uint32 minInterval = 0; - if (infernal->GetVictim() != bot && bot->GetDistance2d(infernal) < safeDistFromInfernal) + if (infernal->GetVictim() != bot && + bot->GetDistance2d(infernal) < safeDistFromInfernal) { return FleePosition(infernal->GetPosition(), safeDistFromInfernal, minInterval); } - if (anetheron->GetHealthPct() > 10.0f && botAI->IsRangedDps(bot) && bot->GetDistance2d(infernal) < 50.0f) + if (anetheron->GetHealthPct() > 10.0f && botAI->IsRangedDps(bot) && + bot->GetDistance2d(infernal) < 50.0f) { if (Player* firstAssistTank = GetGroupAssistTank(botAI, bot, 0); !firstAssistTank || infernal->GetVictim() == firstAssistTank) @@ -439,31 +457,33 @@ bool KazrogalMainTankPositionBossAction::Execute(Event /*event*/) if (kazrogal->GetVictim() == bot && bot->IsWithinMeleeRange(kazrogal)) { const ObjectGuid guid = bot->GetGUID(); - TankPositionState state = - kazrogalTankStep.count(guid) ? kazrogalTankStep[guid] : TankPositionState::MovingToTransition; + TankPositionState state = kazrogalTankStep.count(guid) ? + kazrogalTankStep[guid] : TankPositionState::MovingToTransition; constexpr float maxDistance = 2.0f; - const Position& position = state == TankPositionState::MovingToTransition ? KAZROGAL_TANK_TRANSITION_POSITION - : KAZROGAL_TANK_FINAL_POSITION; + const Position& position = state == TankPositionState::MovingToTransition ? + KAZROGAL_TANK_TRANSITION_POSITION : KAZROGAL_TANK_FINAL_POSITION; float distToPosition = bot->GetExactDist2d(position); if (distToPosition > maxDistance) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 5.0f, moveX, moveY, - moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + 5.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true, + true); } if (state == TankPositionState::MovingToTransition && distToPosition <= maxDistance) { kazrogalTankStep[guid] = TankPositionState::MovingToFinal; } - else if (state != TankPositionState::MovingToTransition && distToPosition <= maxDistance) + else if (state != TankPositionState::MovingToTransition && + distToPosition <= maxDistance) { - float orientation = - atan2(kazrogal->GetPositionY() - bot->GetPositionY(), kazrogal->GetPositionX() - bot->GetPositionX()); + float orientation = atan2(kazrogal->GetPositionY() - bot->GetPositionY(), + kazrogal->GetPositionX() - bot->GetPositionX()); bot->SetFacingTo(orientation); kazrogalTankStep[guid] = TankPositionState::Positioned; } @@ -482,10 +502,10 @@ bool KazrogalAssistTanksMoveInFrontOfBossAction::Execute(Event /*event*/) if (bot->GetExactDist2d(mainTank) > 4.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, mainTank->GetPositionX(), mainTank->GetPositionY(), 10.0f, moveX, moveY, - moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, mainTank->GetPositionX(), mainTank->GetPositionY(), + 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true); } return false; @@ -516,15 +536,16 @@ bool KazrogalSpreadRangedInArcAction::Execute(Event /*event*/) size_t count = rangedMembers.size(); auto findIt = std::find(rangedMembers.begin(), rangedMembers.end(), bot); - size_t botIndex = (findIt != rangedMembers.end()) ? std::distance(rangedMembers.begin(), findIt) : 0; + size_t botIndex = (findIt != rangedMembers.end()) ? + std::distance(rangedMembers.begin(), findIt) : 0; constexpr float arcSpan = M_PI / 3.0f; constexpr float arcCenter = 4.225f; constexpr float arcStart = arcCenter - arcSpan / 2.0f; constexpr float radius = 20.0f; - float angle = - (count == 1) ? arcCenter : (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); + float angle = (count == 1) ? arcCenter : + (arcStart + arcSpan * static_cast(botIndex) / static_cast(count - 1)); float targetX = kazrogal->GetPositionX() + radius * std::cos(angle); float targetY = kazrogal->GetPositionY() + radius * std::sin(angle); @@ -532,9 +553,10 @@ bool KazrogalSpreadRangedInArcAction::Execute(Event /*event*/) if (bot->GetExactDist2d(targetX, targetY) > 0.5f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true); + if (GetGroundedStepPosition(bot, targetX, targetY, 10.0f, + moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true); } return false; @@ -544,7 +566,8 @@ bool KazrogalLowManaBotTakeDefensiveMeasuresAction::Execute(Event /*event*/) { if (bot->getClass() == CLASS_HUNTER) { - if (!botAI->HasAura("aspect of the viper", bot) && botAI->CanCastSpell("aspect of the viper", bot)) + if (!botAI->HasAura("aspect of the viper", bot) && + botAI->CanCastSpell("aspect of the viper", bot)) { return botAI->CastSpell("aspect of the viper", bot); } @@ -552,7 +575,8 @@ bool KazrogalLowManaBotTakeDefensiveMeasuresAction::Execute(Event /*event*/) } else { - if (bot->getClass() == CLASS_WARLOCK && botAI->CanCastSpell("life tap", bot) && + if (bot->getClass() == CLASS_WARLOCK && + botAI->CanCastSpell("life tap", bot) && botAI->CastSpell("life tap", bot)) { return true; @@ -564,12 +588,14 @@ bool KazrogalLowManaBotTakeDefensiveMeasuresAction::Execute(Event /*event*/) if (bot->HasAura(static_cast(HyjalSummitSpells::SPELL_MARK_OF_KAZROGAL)) && bot->GetPower(POWER_MANA) <= 1200) { - if (bot->getClass() == CLASS_MAGE && botAI->CanCastSpell("ice block", bot) && + if (bot->getClass() == CLASS_MAGE && + botAI->CanCastSpell("ice block", bot) && botAI->CastSpell("ice block", bot)) { return true; } - else if (bot->getClass() == CLASS_PALADIN && botAI->CanCastSpell("divine shield", bot) && + else if (bot->getClass() == CLASS_PALADIN && + botAI->CanCastSpell("divine shield", bot) && botAI->CastSpell("divine shield", bot)) { return true; @@ -610,7 +636,8 @@ bool KazrogalCastShadowProtectionSpellAction::Execute(Event /*event*/) botAI->CanCastSpell("shadow ward", bot)) return botAI->CastSpell("shadow ward", bot); - if (bot->getClass() == CLASS_PALADIN && botAI->CanCastSpell("shadow resistance aura", bot)) + if (bot->getClass() == CLASS_PALADIN && + botAI->CanCastSpell("shadow resistance aura", bot)) return botAI->CastSpell("shadow resistance aura", bot); return false; @@ -655,31 +682,34 @@ bool AzgalorMainTankPositionBossAction::Execute(Event /*event*/) if (azgalor->GetVictim() == bot && bot->IsWithinMeleeRange(azgalor)) { const ObjectGuid guid = bot->GetGUID(); - auto it = azgalorTankStep.try_emplace(guid, TankPositionState::MovingToTransition).first; + auto it = azgalorTankStep.try_emplace( + guid, TankPositionState::MovingToTransition).first; TankPositionState state = it->second; constexpr float maxDistance = 2.0f; - const Position& position = state == TankPositionState::MovingToTransition ? AZGALOR_TANK_TRANSITION_POSITION - : AZGALOR_TANK_FINAL_POSITION; + const Position& position = state == TankPositionState::MovingToTransition ? + AZGALOR_TANK_TRANSITION_POSITION : AZGALOR_TANK_FINAL_POSITION; float distToPosition = bot->GetExactDist2d(position); if (distToPosition > maxDistance) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 5.0f, moveX, moveY, - moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + 5.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true, + true); } if (state == TankPositionState::MovingToTransition && distToPosition <= maxDistance) { azgalorTankStep[guid] = TankPositionState::MovingToFinal; } - else if (state != TankPositionState::MovingToTransition && distToPosition <= maxDistance) + else if (state != TankPositionState::MovingToTransition && + distToPosition <= maxDistance) { - float orientation = - atan2(azgalor->GetPositionY() - bot->GetPositionY(), azgalor->GetPositionX() - bot->GetPositionX()); + float orientation = atan2(azgalor->GetPositionY() - bot->GetPositionY(), + azgalor->GetPositionX() - bot->GetPositionX()); bot->SetFacingTo(orientation); azgalorTankStep[guid] = TankPositionState::Positioned; } @@ -696,7 +726,8 @@ bool AzgalorDisperseRangedAction::Execute(Event /*event*/) // Azgalor's hitbox is 8.8 yards TankPositionState tankState = GetAzgalorTankPositionState(botAI, bot); - const float safeDistFromBoss = (tankState == TankPositionState::MovingToTransition ? 35.0f : 29.0f); + const float safeDistFromBoss = + (tankState == TankPositionState::MovingToTransition ? 35.0f : 29.0f); constexpr uint32 minInterval = 0; if (bot->GetExactDist2d(azgalor) < safeDistFromBoss && @@ -739,7 +770,8 @@ bool AzgalorMeleeGetOutOfFireAction::Execute(Event /*event*/) return false; } - if (doomguard && (bot->GetVictim() != doomguard || bot->GetTarget() != doomguard->GetGUID())) + if (doomguard && + (bot->GetVictim() != doomguard || bot->GetTarget() != doomguard->GetGUID())) return Attack(doomguard); return MoveAway(azgalor, 5.0f); @@ -752,9 +784,10 @@ bool AzgalorWaitAtSafePositionAction::Execute(Event /*event*/) const Position& position = AZGALOR_DOOMGUARD_POSITION; botAI->Reset(); float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_FORCED, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_FORCED, true); return false; } @@ -766,9 +799,10 @@ bool AzgalorMoveToDoomguardTankAction::Execute(Event /*event*/) if (bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()) > 5.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 10.0f, moveX, moveY, moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_FORCED, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + 10.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_FORCED, true); } return false; @@ -777,7 +811,8 @@ bool AzgalorMoveToDoomguardTankAction::Execute(Event /*event*/) bool AzgalorFirstAssistTankPositionDoomguardAction::Execute(Event /*event*/) { const Position& position = AZGALOR_DOOMGUARD_POSITION; - float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = + bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); float moveDist = 0.0f; bool shouldMove = false; @@ -791,7 +826,8 @@ bool AzgalorFirstAssistTankPositionDoomguardAction::Execute(Event /*event*/) if (bot->GetVictim() != doomguard) return Attack(doomguard); - if (doomguard->GetVictim() == bot && bot->IsWithinMeleeRange(doomguard) && distToPosition > 3.0f) + if (doomguard->GetVictim() == bot && bot->IsWithinMeleeRange(doomguard) && + distToPosition > 3.0f) { moveDist = std::min(5.0f, distToPosition); shouldMove = true; @@ -812,10 +848,11 @@ bool AzgalorFirstAssistTankPositionDoomguardAction::Execute(Event /*event*/) if (shouldMove) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), moveDist, moveX, moveY, - moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true, moveBackwards); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + moveDist, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true, + moveBackwards); } return false; @@ -883,18 +920,21 @@ bool ArchimondeMoveBossToInitialPositionAction::Execute(Event /*event*/) if (bot->GetVictim() != archimonde) return Attack(archimonde); - if (archimonde->GetVictim() == bot && bot->IsWithinMeleeRange(archimonde) && bot->GetHealthPct() > 50.0f) + if (archimonde->GetVictim() == bot && bot->IsWithinMeleeRange(archimonde) && + bot->GetHealthPct() > 50.0f) { const Position& position = ARCHIMONDE_INITIAL_POSITION; - float distToPosition = bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); + float distToPosition = + bot->GetExactDist2d(position.GetPositionX(), position.GetPositionY()); if (distToPosition > 3.0f) { float moveX, moveY, moveZ; - if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), 5.0f, moveX, moveY, - moveZ)) - return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, false, false, - MovementPriority::MOVEMENT_COMBAT, true, true); + if (GetGroundedStepPosition(bot, position.GetPositionX(), position.GetPositionY(), + 5.0f, moveX, moveY, moveZ)) + return MoveTo(HYJAL_SUMMIT_MAP_ID, moveX, moveY, moveZ, false, false, + false, false, MovementPriority::MOVEMENT_COMBAT, true, + true); } } @@ -940,7 +980,8 @@ bool ArchimondeSpreadToAvoidAirBurstAction::Execute(Event /*event*/) if (archimonde->HasUnitState(UNIT_STATE_CASTING)) { Spell* spell = archimonde->GetCurrentSpell(CURRENT_GENERIC_SPELL); - if (spell && spell->m_spellInfo->Id == static_cast(HyjalSummitSpells::SPELL_AIR_BURST)) + if (spell && spell->m_spellInfo->Id == + static_cast(HyjalSummitSpells::SPELL_AIR_BURST)) { Player* mainTank = GetGroupMainTank(botAI, bot); if (mainTank && spell->m_targets.GetUnitTarget() == mainTank) @@ -962,7 +1003,8 @@ bool ArchimondeSpreadToAvoidAirBurstAction::Execute(Event /*event*/) if (botAI->IsRanged(bot)) { Unit* nearestPlayer = GetNearestPlayerInRadius(bot, safeDistFromPlayer); - if (nearestPlayer && FleePosition(nearestPlayer->GetPosition(), safeDistFromPlayer, minInterval)) + if (nearestPlayer && + FleePosition(nearestPlayer->GetPosition(), safeDistFromPlayer, minInterval)) return true; } @@ -981,14 +1023,17 @@ bool ArchimondeAvoidDoomfireAction::Execute(Event /*event*/) if (it == doomfireTrails.end() || it->second.empty()) return false; - it->second.erase(std::remove_if(it->second.begin(), it->second.end(), [now](const DoomfireTrailData& d) - { return getMSTimeDiff(d.recordTime, now) > trailDuration; }), - it->second.end()); + it->second.erase(std::remove_if(it->second.begin(), it->second.end(), + [now](const DoomfireTrailData& d) + { + return getMSTimeDiff(d.recordTime, now) > trailDuration; + }), it->second.end()); float totalDx = 0.0f, totalDy = 0.0f; for (auto const& data : it->second) { - float d = bot->GetExactDist2d(data.position.GetPositionX(), data.position.GetPositionY()); + float d = bot->GetExactDist2d(data.position.GetPositionX(), + data.position.GetPositionY()); if (d < dangerDist && d > 0.0f) { @@ -1008,13 +1053,13 @@ bool ArchimondeAvoidDoomfireAction::Execute(Event /*event*/) float targetX = bot->GetPositionX() + (totalDx / norm) * moveDist; float targetY = bot->GetPositionY() + (totalDy / norm) * moveDist; - MovementPriority priority = - botAI->IsHeal(bot) ? MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_FORCED; + MovementPriority priority = botAI->IsHeal(bot) ? + MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_FORCED; bool backwards = botAI->IsMainTank(bot); - return MoveTo(HYJAL_SUMMIT_MAP_ID, targetX, targetY, bot->GetPositionZ(), false, false, false, false, priority, - true, backwards); + return MoveTo(HYJAL_SUMMIT_MAP_ID, targetX, targetY, bot->GetPositionZ(), + false, false, false, false, priority, true, backwards); } return false; diff --git a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.h b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.h index 0051111a453..06323fb1cae 100644 --- a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.h +++ b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.h @@ -18,7 +18,8 @@ using HyjalSummitAttackAction = AttackAction; class HyjalSummitEraseTrackersAction : public Action { public: - HyjalSummitEraseTrackersAction(PlayerbotAI* botAI) : Action(botAI, "hyjal summit erase trackers") {} + HyjalSummitEraseTrackersAction( + PlayerbotAI* botAI) : Action(botAI, "hyjal summit erase trackers") {} bool Execute(Event event) override; }; @@ -27,40 +28,32 @@ class HyjalSummitEraseTrackersAction : public Action class RageWinterchillMisdirectBossToMainTankAction : public HyjalSummitAttackAction { public: - RageWinterchillMisdirectBossToMainTankAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "rage winterchill misdirect boss to main tank") - { - } + RageWinterchillMisdirectBossToMainTankAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "rage winterchill misdirect boss to main tank") {} bool Execute(Event event) override; }; class RageWinterchillMainTankPositionBossAction : public HyjalSummitAttackAction { public: - RageWinterchillMainTankPositionBossAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "rage winterchill main tank position boss") - { - } + RageWinterchillMainTankPositionBossAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "rage winterchill main tank position boss") {} bool Execute(Event event) override; }; class RageWinterchillSpreadRangedInCircleAction : public HyjalSummitMovementAction { public: - RageWinterchillSpreadRangedInCircleAction(PlayerbotAI* botAI) - : HyjalSummitMovementAction(botAI, "rage winterchill spread ranged in circle") - { - } + RageWinterchillSpreadRangedInCircleAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "rage winterchill spread ranged in circle") {} bool Execute(Event event) override; }; class RageWinterchillMoveAwayFromDeathAndDecayAction : public HyjalSummitAttackAction { public: - RageWinterchillMoveAwayFromDeathAndDecayAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "rage winterchill move away from death and decay") - { - } + RageWinterchillMoveAwayFromDeathAndDecayAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "rage winterchill move away from death and decay") {} bool Execute(Event event) override; }; @@ -69,60 +62,48 @@ class RageWinterchillMoveAwayFromDeathAndDecayAction : public HyjalSummitAttackA class AnetheronMisdirectBossAndInfernalsToTanksAction : public HyjalSummitAttackAction { public: - AnetheronMisdirectBossAndInfernalsToTanksAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "anetheron misdirect boss and infernals to tanks") - { - } + AnetheronMisdirectBossAndInfernalsToTanksAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "anetheron misdirect boss and infernals to tanks") {} bool Execute(Event event) override; }; class AnetheronMainTankPositionBossAction : public HyjalSummitAttackAction { public: - AnetheronMainTankPositionBossAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "anetheron main tank position boss") - { - } + AnetheronMainTankPositionBossAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "anetheron main tank position boss") {} bool Execute(Event event) override; }; class AnetheronSpreadRangedInCircleAction : public HyjalSummitMovementAction { public: - AnetheronSpreadRangedInCircleAction(PlayerbotAI* botAI) - : HyjalSummitMovementAction(botAI, "anetheron spread ranged in circle") - { - } + AnetheronSpreadRangedInCircleAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "anetheron spread ranged in circle") {} bool Execute(Event event) override; }; class AnetheronBringInfernalToInfernalTankAction : public HyjalSummitMovementAction { public: - AnetheronBringInfernalToInfernalTankAction(PlayerbotAI* botAI) - : HyjalSummitMovementAction(botAI, "anetheron bring infernal to infernal tank") - { - } + AnetheronBringInfernalToInfernalTankAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "anetheron bring infernal to infernal tank") {} bool Execute(Event event) override; }; class AnetheronFirstAssistTankPickUpInfernalsAction : public HyjalSummitAttackAction { public: - AnetheronFirstAssistTankPickUpInfernalsAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "anetheron first assist tank pick up infernals") - { - } + AnetheronFirstAssistTankPickUpInfernalsAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "anetheron first assist tank pick up infernals") {} bool Execute(Event event) override; }; class AnetheronAssignDpsPriorityAction : public HyjalSummitAttackAction { public: - AnetheronAssignDpsPriorityAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "anetheron assign dps priority") - { - } + AnetheronAssignDpsPriorityAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "anetheron assign dps priority") {} bool Execute(Event event) override; }; @@ -131,60 +112,48 @@ class AnetheronAssignDpsPriorityAction : public HyjalSummitAttackAction class KazrogalMisdirectBossToMainTankAction : public HyjalSummitAttackAction { public: - KazrogalMisdirectBossToMainTankAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "kaz'rogal misdirect boss to main tank") - { - } + KazrogalMisdirectBossToMainTankAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "kaz'rogal misdirect boss to main tank") {} bool Execute(Event event) override; }; class KazrogalMainTankPositionBossAction : public HyjalSummitAttackAction { public: - KazrogalMainTankPositionBossAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "kaz'rogal main tank position boss") - { - } + KazrogalMainTankPositionBossAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "kaz'rogal main tank position boss") {} bool Execute(Event event) override; }; class KazrogalAssistTanksMoveInFrontOfBossAction : public HyjalSummitAttackAction { public: - KazrogalAssistTanksMoveInFrontOfBossAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "kaz'rogal assist tanks move in front of boss") - { - } + KazrogalAssistTanksMoveInFrontOfBossAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "kaz'rogal assist tanks move in front of boss") {} bool Execute(Event event) override; }; class KazrogalSpreadRangedInArcAction : public HyjalSummitMovementAction { public: - KazrogalSpreadRangedInArcAction(PlayerbotAI* botAI) - : HyjalSummitMovementAction(botAI, "kaz'rogal spread ranged in arc") - { - } + KazrogalSpreadRangedInArcAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "kaz'rogal spread ranged in arc") {} bool Execute(Event event) override; }; class KazrogalLowManaBotTakeDefensiveMeasuresAction : public HyjalSummitMovementAction { public: - KazrogalLowManaBotTakeDefensiveMeasuresAction(PlayerbotAI* botAI) - : HyjalSummitMovementAction(botAI, "kaz'rogal low mana bot take defensive measures") - { - } +KazrogalLowManaBotTakeDefensiveMeasuresAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "kaz'rogal low mana bot take defensive measures") {} bool Execute(Event event) override; }; class KazrogalCastShadowProtectionSpellAction : public Action { public: - KazrogalCastShadowProtectionSpellAction(PlayerbotAI* botAI) - : Action(botAI, "kaz'rogal cast shadow protection spell") - { - } + KazrogalCastShadowProtectionSpellAction( + PlayerbotAI* botAI) : Action(botAI, "kaz'rogal cast shadow protection spell") {} bool Execute(Event event) override; }; @@ -193,75 +162,64 @@ class KazrogalCastShadowProtectionSpellAction : public Action class AzgalorMisdirectBossToMainTankAction : public HyjalSummitAttackAction { public: - AzgalorMisdirectBossToMainTankAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "azgalor misdirect boss to main tank") - { - } + AzgalorMisdirectBossToMainTankAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor misdirect boss to main tank") {} bool Execute(Event event) override; }; class AzgalorMainTankPositionBossAction : public HyjalSummitAttackAction { public: - AzgalorMainTankPositionBossAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "azgalor main tank position boss") - { - } + AzgalorMainTankPositionBossAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor main tank position boss") {} bool Execute(Event event) override; }; class AzgalorWaitAtSafePositionAction : public HyjalSummitMovementAction { public: - AzgalorWaitAtSafePositionAction(PlayerbotAI* botAI) - : HyjalSummitMovementAction(botAI, "azgalor wait at safe position") - { - } + AzgalorWaitAtSafePositionAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "azgalor wait at safe position") {} bool Execute(Event event) override; }; class AzgalorDisperseRangedAction : public HyjalSummitMovementAction { public: - AzgalorDisperseRangedAction(PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "azgalor disperse ranged") {} + AzgalorDisperseRangedAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "azgalor disperse ranged") {} bool Execute(Event event) override; }; class AzgalorMeleeGetOutOfFireAction : public HyjalSummitAttackAction { public: - AzgalorMeleeGetOutOfFireAction(PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor melee get out of fire") - { - } + AzgalorMeleeGetOutOfFireAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor melee get out of fire") {} bool Execute(Event event) override; }; class AzgalorMoveToDoomguardTankAction : public HyjalSummitMovementAction { public: - AzgalorMoveToDoomguardTankAction(PlayerbotAI* botAI) - : HyjalSummitMovementAction(botAI, "azgalor move to doomguard tank") - { - } + AzgalorMoveToDoomguardTankAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "azgalor move to doomguard tank") {} bool Execute(Event event) override; }; class AzgalorFirstAssistTankPositionDoomguardAction : public HyjalSummitAttackAction { public: - AzgalorFirstAssistTankPositionDoomguardAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "azgalor first assist tank position doomguard") - { - } + AzgalorFirstAssistTankPositionDoomguardAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor first assist tank position doomguard") {} bool Execute(Event event) override; }; class AzgalorAssignDpsPriorityAction : public HyjalSummitAttackAction { public: - AzgalorAssignDpsPriorityAction(PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor assign dps priority") - { - } + AzgalorAssignDpsPriorityAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "azgalor assign dps priority") {} bool Execute(Event event) override; }; @@ -270,27 +228,24 @@ class AzgalorAssignDpsPriorityAction : public HyjalSummitAttackAction class ArchimondeMisdirectBossToMainTankAction : public HyjalSummitAttackAction { public: - ArchimondeMisdirectBossToMainTankAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "archimonde misdirect boss to main tank") - { - } + ArchimondeMisdirectBossToMainTankAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "archimonde misdirect boss to main tank") {} bool Execute(Event event) override; }; class ArchimondeMoveBossToInitialPositionAction : public HyjalSummitAttackAction { public: - ArchimondeMoveBossToInitialPositionAction(PlayerbotAI* botAI) - : HyjalSummitAttackAction(botAI, "archimonde move boss to initial position") - { - } + ArchimondeMoveBossToInitialPositionAction( + PlayerbotAI* botAI) : HyjalSummitAttackAction(botAI, "archimonde move boss to initial position") {} bool Execute(Event event) override; }; class ArchimondeCastFearImmunitySpellAction : public Action { public: - ArchimondeCastFearImmunitySpellAction(PlayerbotAI* botAI) : Action(botAI, "archimonde cast fear immunity spell") {} + ArchimondeCastFearImmunitySpellAction( + PlayerbotAI* botAI) : Action(botAI, "archimonde cast fear immunity spell") {} bool Execute(Event event) override; private: @@ -301,24 +256,24 @@ class ArchimondeCastFearImmunitySpellAction : public Action class ArchimondeSpreadToAvoidAirBurstAction : public HyjalSummitMovementAction { public: - ArchimondeSpreadToAvoidAirBurstAction(PlayerbotAI* botAI) - : HyjalSummitMovementAction(botAI, "archimonde spread to avoid air burst") - { - } + ArchimondeSpreadToAvoidAirBurstAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "archimonde spread to avoid air burst") {} bool Execute(Event event) override; }; class ArchimondeAvoidDoomfireAction : public HyjalSummitMovementAction { public: - ArchimondeAvoidDoomfireAction(PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "archimonde avoid doomfire") {} + ArchimondeAvoidDoomfireAction( + PlayerbotAI* botAI) : HyjalSummitMovementAction(botAI, "archimonde avoid doomfire") {} bool Execute(Event event) override; }; class ArchimondeRemoveDoomfireDotAction : public Action { public: - ArchimondeRemoveDoomfireDotAction(PlayerbotAI* botAI) : Action(botAI, "archimonde remove doomfire dot") {} + ArchimondeRemoveDoomfireDotAction( + PlayerbotAI* botAI) : Action(botAI, "archimonde remove doomfire dot") {} bool Execute(Event event) override; }; diff --git a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp index 1dccc1a3de5..17f089ad6cb 100644 --- a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp +++ b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp @@ -4,7 +4,8 @@ */ #include "RaidHyjalSummitMultipliers.h" - +#include "RaidHyjalSummitActions.h" +#include "RaidHyjalSummitHelpers.h" #include "AiFactory.h" #include "ChooseTargetActions.h" #include "DKActions.h" @@ -12,8 +13,6 @@ #include "HunterActions.h" #include "PaladinActions.h" #include "RaidBossHelpers.h" -#include "RaidHyjalSummitActions.h" -#include "RaidHyjalSummitHelpers.h" #include "ReachTargetActions.h" #include "ShamanActions.h" #include "WarriorActions.h" @@ -27,7 +26,8 @@ float HyjalSummitTimeBloodlustAndHeroismMultiplier::GetValue(Action* action) if (bot->getClass() != CLASS_SHAMAN) return 1.0f; - if (dynamic_cast(action) || dynamic_cast(action)) + if (dynamic_cast(action) || + dynamic_cast(action)) { Unit* archimonde = AI_VALUE2(Unit*, "find target", "archimonde"); if (archimonde && archimonde->GetHealthPct() < 90.0f) @@ -59,7 +59,8 @@ float HyjalSummitTimeBloodlustAndHeroismMultiplier::GetValue(Action* action) float RageWinterchillDisableMainTankAvoidAoeMultiplier::GetValue(Action* action) { - if (!botAI->IsMainTank(bot) || !AI_VALUE2(Unit*, "find target", "rage winterchill")) + if (!botAI->IsMainTank(bot) || + !AI_VALUE2(Unit*, "find target", "rage winterchill")) return 1.0f; if (dynamic_cast(action)) @@ -73,7 +74,8 @@ float RageWinterchillDisableCombatFormationMoveMultiplier::GetValue(Action* acti if (!AI_VALUE2(Unit*, "find target", "rage winterchill")) return 1.0f; - if (dynamic_cast(action) && !dynamic_cast(action)) + if (dynamic_cast(action) && + !dynamic_cast(action)) return 0.0f; return 1.0f; @@ -110,7 +112,8 @@ float AnetheronDisableTankActionsMultiplier::GetValue(Action* action) if (dynamic_cast(action)) return 0.0f; - if (bot->GetVictim() != nullptr && dynamic_cast(action)) + if (bot->GetVictim() != nullptr && + dynamic_cast(action)) return 0.0f; return 1.0f; @@ -121,7 +124,8 @@ float AnetheronDisableCombatFormationMoveMultiplier::GetValue(Action* action) if (!AI_VALUE2(Unit*, "find target", "anetheron")) return 1.0f; - if (dynamic_cast(action) && !dynamic_cast(action)) + if (dynamic_cast(action) && + !dynamic_cast(action)) return 0.0f; return 1.0f; @@ -129,7 +133,8 @@ float AnetheronDisableCombatFormationMoveMultiplier::GetValue(Action* action) float AnetheronControlMisdirectionMultiplier::GetValue(Action* action) { - if (bot->getClass() != CLASS_HUNTER || !AI_VALUE2(Unit*, "find target", "anetheron")) + if (bot->getClass() != CLASS_HUNTER || + !AI_VALUE2(Unit*, "find target", "anetheron")) return 1.0f; if (dynamic_cast(action)) @@ -142,8 +147,8 @@ float AnetheronControlMisdirectionMultiplier::GetValue(Action* action) float KazrogalLowManaBotStayAwayFromGroupMultiplier::GetValue(Action* action) { - if (bot->getClass() == CLASS_WARRIOR || bot->getClass() == CLASS_ROGUE || bot->getClass() == CLASS_DEATH_KNIGHT || - bot->getClass() == CLASS_HUNTER) + if (bot->getClass() == CLASS_WARRIOR || bot->getClass() == CLASS_ROGUE || + bot->getClass() == CLASS_DEATH_KNIGHT || bot->getClass() == CLASS_HUNTER) return 1.0f; uint8 tab = AiFactory::GetPlayerSpecTab(bot); @@ -157,7 +162,8 @@ float KazrogalLowManaBotStayAwayFromGroupMultiplier::GetValue(Action* action) return 1.0f; if (dynamic_cast(action) || - (dynamic_cast(action) && !dynamic_cast(action) && + (dynamic_cast(action) && + !dynamic_cast(action) && !dynamic_cast(action))) return 0.0f; @@ -166,13 +172,17 @@ float KazrogalLowManaBotStayAwayFromGroupMultiplier::GetValue(Action* action) float KazrogalKeepAspectOfTheViperActiveMultiplier::GetValue(Action* action) { - if (bot->getClass() != CLASS_HUNTER || !AI_VALUE2(Unit*, "find target", "kaz'rogal") || + if (bot->getClass() != CLASS_HUNTER || + !AI_VALUE2(Unit*, "find target", "kaz'rogal") || bot->GetPower(POWER_MANA) > 4000) return 1.0f; - if (dynamic_cast(action) || dynamic_cast(action) || - dynamic_cast(action) || dynamic_cast(action) || - dynamic_cast(action) || dynamic_cast(action)) + if (dynamic_cast(action) || + dynamic_cast(action) || + dynamic_cast(action) || + dynamic_cast(action) || + dynamic_cast(action) || + dynamic_cast(action)) return 0.0f; return 1.0f; @@ -183,7 +193,8 @@ float KazrogalControlMovementMultiplier::GetValue(Action* action) if (!AI_VALUE2(Unit*, "find target", "kaz'rogal")) return 1.0f; - if (dynamic_cast(action) && !dynamic_cast(action)) + if (dynamic_cast(action) && + !dynamic_cast(action)) return 0.0f; if (dynamic_cast(action)) @@ -215,7 +226,8 @@ float AzgalorDisableTankActionsMultiplier::GetValue(Action* action) return 0.0f; } else if (botAI->IsAssistTank(bot) && - (AnyGroupMemberHasDoom(bot) || AI_VALUE2(Unit*, "find target", "lesser doomguard"))) + (AnyGroupMemberHasDoom(bot) || + AI_VALUE2(Unit*, "find target", "lesser doomguard"))) { return 0.0f; } @@ -229,8 +241,10 @@ float AzgalorDoomedBotPrioritizePositioningMultiplier::GetValue(Action* action) if (!bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) return 1.0f; - if (dynamic_cast(action) && !dynamic_cast(action) && - !dynamic_cast(action) && !dynamic_cast(action)) + if (dynamic_cast(action) && + !dynamic_cast(action) && + !dynamic_cast(action) && + !dynamic_cast(action)) return 0.0f; return 1.0f; @@ -249,7 +263,8 @@ float AzgalorMeleeControlAvoidanceMultiplier::GetValue(Action* action) if (IsBotInsideActiveAzgalorRainOfFire(bot, 23.0f)) { - if (dynamic_cast(action) && !dynamic_cast(action)) + if (dynamic_cast(action) && + !dynamic_cast(action)) return 0.0f; if (dynamic_cast(action)) @@ -266,7 +281,8 @@ float ArchimondeDisableCombatFormationMoveMultiplier::GetValue(Action* action) if (!AI_VALUE2(Unit*, "find target", "archimonde")) return 1.0f; - if (dynamic_cast(action) && !dynamic_cast(action)) + if (dynamic_cast(action) && + !dynamic_cast(action)) return 0.0f; return 1.0f; diff --git a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.h b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.h index 4e5a71a0e4d..bc903c6c3e1 100644 --- a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.h +++ b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.h @@ -11,10 +11,8 @@ class HyjalSummitTimeBloodlustAndHeroismMultiplier : public Multiplier { public: - HyjalSummitTimeBloodlustAndHeroismMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "hyjal summit time bloodlust and heroism multiplier") - { - } + HyjalSummitTimeBloodlustAndHeroismMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "hyjal summit time bloodlust and heroism multiplier") {} virtual float GetValue(Action* action); }; @@ -23,30 +21,24 @@ class HyjalSummitTimeBloodlustAndHeroismMultiplier : public Multiplier class RageWinterchillDisableMainTankAvoidAoeMultiplier : public Multiplier { public: - RageWinterchillDisableMainTankAvoidAoeMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "rage winterchill disable main tank avoid aoe multiplier") - { - } + RageWinterchillDisableMainTankAvoidAoeMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "rage winterchill disable main tank avoid aoe multiplier") {} virtual float GetValue(Action* action); }; class RageWinterchillDisableCombatFormationMoveMultiplier : public Multiplier { public: - RageWinterchillDisableCombatFormationMoveMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "rage winterchill disable combat formation move multiplier") - { - } + RageWinterchillDisableCombatFormationMoveMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "rage winterchill disable combat formation move multiplier") {} virtual float GetValue(Action* action); }; class RageWinterchillControlDeathAndDecayAvoidanceMultiplier : public Multiplier { public: - RageWinterchillControlDeathAndDecayAvoidanceMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "rage winterchill control death and decay avoidance multiplier") - { - } + RageWinterchillControlDeathAndDecayAvoidanceMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "rage winterchill control death and decay avoidance multiplier") {} virtual float GetValue(Action* action); }; @@ -55,30 +47,24 @@ class RageWinterchillControlDeathAndDecayAvoidanceMultiplier : public Multiplier class AnetheronDisableTankActionsMultiplier : public Multiplier { public: - AnetheronDisableTankActionsMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "anetheron disable tank actions multiplier") - { - } + AnetheronDisableTankActionsMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "anetheron disable tank actions multiplier") {} virtual float GetValue(Action* action); }; class AnetheronDisableCombatFormationMoveMultiplier : public Multiplier { public: - AnetheronDisableCombatFormationMoveMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "anetheron disable combat formation move multiplier") - { - } + AnetheronDisableCombatFormationMoveMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "anetheron disable combat formation move multiplier") {} virtual float GetValue(Action* action); }; class AnetheronControlMisdirectionMultiplier : public Multiplier { public: - AnetheronControlMisdirectionMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "anetheron control misdirection multiplier") - { - } + AnetheronControlMisdirectionMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "anetheron control misdirection multiplier") {} virtual float GetValue(Action* action); }; @@ -87,29 +73,24 @@ class AnetheronControlMisdirectionMultiplier : public Multiplier class KazrogalLowManaBotStayAwayFromGroupMultiplier : public Multiplier { public: - KazrogalLowManaBotStayAwayFromGroupMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "kaz'rogal low mana bot stay away from group multiplier") - { - } + KazrogalLowManaBotStayAwayFromGroupMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "kaz'rogal low mana bot stay away from group multiplier") {} virtual float GetValue(Action* action); }; class KazrogalKeepAspectOfTheViperActiveMultiplier : public Multiplier { public: - KazrogalKeepAspectOfTheViperActiveMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "kaz'rogal keep aspect of the viper active multiplier") - { - } + KazrogalKeepAspectOfTheViperActiveMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "kaz'rogal keep aspect of the viper active multiplier") {} virtual float GetValue(Action* action); }; class KazrogalControlMovementMultiplier : public Multiplier { public: - KazrogalControlMovementMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "kaz'rogal control movement multiplier") - { - } + KazrogalControlMovementMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "kaz'rogal control movement multiplier") {} virtual float GetValue(Action* action); }; @@ -118,30 +99,24 @@ class KazrogalControlMovementMultiplier : public Multiplier class AzgalorDisableTankActionsMultiplier : public Multiplier { public: - AzgalorDisableTankActionsMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "azgalor disable tank actions multiplier") - { - } + AzgalorDisableTankActionsMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "azgalor disable tank actions multiplier") {} virtual float GetValue(Action* action); }; class AzgalorDoomedBotPrioritizePositioningMultiplier : public Multiplier { public: - AzgalorDoomedBotPrioritizePositioningMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "azgalor doomed bot prioritize positioning multiplier") - { - } + AzgalorDoomedBotPrioritizePositioningMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "azgalor doomed bot prioritize positioning multiplier") {} virtual float GetValue(Action* action); }; class AzgalorMeleeControlAvoidanceMultiplier : public Multiplier { public: - AzgalorMeleeControlAvoidanceMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "azgalor melee control avoidance multiplier") - { - } + AzgalorMeleeControlAvoidanceMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "azgalor melee control avoidance multiplier") {} virtual float GetValue(Action* action); }; @@ -150,10 +125,8 @@ class AzgalorMeleeControlAvoidanceMultiplier : public Multiplier class ArchimondeDisableCombatFormationMoveMultiplier : public Multiplier { public: - ArchimondeDisableCombatFormationMoveMultiplier(PlayerbotAI* botAI) - : Multiplier(botAI, "archimonde disable combat formation move multiplier") - { - } + ArchimondeDisableCombatFormationMoveMultiplier( + PlayerbotAI* botAI) : Multiplier(botAI, "archimonde disable combat formation move multiplier") {} virtual float GetValue(Action* action); }; diff --git a/src/Ai/Raid/HyjalSummit/RaidHyjalSummitActionContext.h b/src/Ai/Raid/HyjalSummit/RaidHyjalSummitActionContext.h index 9b557cb7a76..ae098d4a036 100644 --- a/src/Ai/Raid/HyjalSummit/RaidHyjalSummitActionContext.h +++ b/src/Ai/Raid/HyjalSummit/RaidHyjalSummitActionContext.h @@ -6,8 +6,8 @@ #ifndef _PLAYERBOT_RAIDHYJALSUMMITACTIONCONTEXT_H #define _PLAYERBOT_RAIDHYJALSUMMITACTIONCONTEXT_H -#include "NamedObjectContext.h" #include "RaidHyjalSummitActions.h" +#include "NamedObjectContext.h" class RaidHyjalSummitActionContext : public NamedObjectContext { @@ -15,7 +15,8 @@ class RaidHyjalSummitActionContext : public NamedObjectContext RaidHyjalSummitActionContext() { // General - creators["hyjal summit erase trackers"] = &RaidHyjalSummitActionContext::hyjal_summit_erase_trackers; + creators["hyjal summit erase trackers"] = + &RaidHyjalSummitActionContext::hyjal_summit_erase_trackers; // Rage Winterchill creators["rage winterchill misdirect boss to main tank"] = @@ -46,18 +47,21 @@ class RaidHyjalSummitActionContext : public NamedObjectContext creators["anetheron first assist tank pick up infernals"] = &RaidHyjalSummitActionContext::anetheron_first_assist_tank_pick_up_infernals; - creators["anetheron assign dps priority"] = &RaidHyjalSummitActionContext::anetheron_assign_dps_priority; + creators["anetheron assign dps priority"] = + &RaidHyjalSummitActionContext::anetheron_assign_dps_priority; // Kaz'rogal creators["kaz'rogal misdirect boss to main tank"] = &RaidHyjalSummitActionContext::kazrogal_misdirect_boss_to_main_tank; - creators["kaz'rogal main tank position boss"] = &RaidHyjalSummitActionContext::kazrogal_main_tank_position_boss; + creators["kaz'rogal main tank position boss"] = + &RaidHyjalSummitActionContext::kazrogal_main_tank_position_boss; creators["kaz'rogal assist tanks move in front of boss"] = &RaidHyjalSummitActionContext::kazrogal_assist_tanks_move_in_front_of_boss; - creators["kaz'rogal spread ranged in arc"] = &RaidHyjalSummitActionContext::kazrogal_spread_ranged_in_arc; + creators["kaz'rogal spread ranged in arc"] = + &RaidHyjalSummitActionContext::kazrogal_spread_ranged_in_arc; creators["kaz'rogal low mana bot take defensive measures"] = &RaidHyjalSummitActionContext::kazrogal_low_mana_bot_take_defensive_measures; @@ -69,20 +73,26 @@ class RaidHyjalSummitActionContext : public NamedObjectContext creators["azgalor misdirect boss to main tank"] = &RaidHyjalSummitActionContext::azgalor_misdirect_boss_to_main_tank; - creators["azgalor main tank position boss"] = &RaidHyjalSummitActionContext::azgalor_main_tank_position_boss; + creators["azgalor main tank position boss"] = + &RaidHyjalSummitActionContext::azgalor_main_tank_position_boss; - creators["azgalor wait at safe position"] = &RaidHyjalSummitActionContext::azgalor_wait_at_safe_position; + creators["azgalor wait at safe position"] = + &RaidHyjalSummitActionContext::azgalor_wait_at_safe_position; - creators["azgalor disperse ranged"] = &RaidHyjalSummitActionContext::azgalor_disperse_ranged; + creators["azgalor disperse ranged"] = + &RaidHyjalSummitActionContext::azgalor_disperse_ranged; - creators["azgalor melee get out of fire"] = &RaidHyjalSummitActionContext::azgalor_melee_get_out_of_fire; + creators["azgalor melee get out of fire"] = + &RaidHyjalSummitActionContext::azgalor_melee_get_out_of_fire; - creators["azgalor move to doomguard tank"] = &RaidHyjalSummitActionContext::azgalor_move_to_doomguard_tank; + creators["azgalor move to doomguard tank"] = + &RaidHyjalSummitActionContext::azgalor_move_to_doomguard_tank; creators["azgalor first assist tank position doomguard"] = &RaidHyjalSummitActionContext::azgalor_first_assist_tank_position_doomguard; - creators["azgalor assign dps priority"] = &RaidHyjalSummitActionContext::azgalor_assign_dps_priority; + creators["azgalor assign dps priority"] = + &RaidHyjalSummitActionContext::azgalor_assign_dps_priority; // Archimonde creators["archimonde misdirect boss to main tank"] = @@ -97,160 +107,112 @@ class RaidHyjalSummitActionContext : public NamedObjectContext creators["archimonde spread to avoid air burst"] = &RaidHyjalSummitActionContext::archimonde_spread_to_avoid_air_burst; - creators["archimonde avoid doomfire"] = &RaidHyjalSummitActionContext::archimonde_avoid_doomfire; + creators["archimonde avoid doomfire"] = + &RaidHyjalSummitActionContext::archimonde_avoid_doomfire; - creators["archimonde remove doomfire dot"] = &RaidHyjalSummitActionContext::archimonde_remove_doomfire_dot; + creators["archimonde remove doomfire dot"] = + &RaidHyjalSummitActionContext::archimonde_remove_doomfire_dot; } private: // General - static Action* hyjal_summit_erase_trackers(PlayerbotAI* botAI) { return new HyjalSummitEraseTrackersAction(botAI); } + static Action* hyjal_summit_erase_trackers( + PlayerbotAI* botAI) { return new HyjalSummitEraseTrackersAction(botAI); } // Rage Winterchill - static Action* rage_winterchill_misdirect_boss_to_main_tank(PlayerbotAI* botAI) - { - return new RageWinterchillMisdirectBossToMainTankAction(botAI); - } + static Action* rage_winterchill_misdirect_boss_to_main_tank( + PlayerbotAI* botAI) { return new RageWinterchillMisdirectBossToMainTankAction(botAI); } - static Action* rage_winterchill_main_tank_position_boss(PlayerbotAI* botAI) - { - return new RageWinterchillMainTankPositionBossAction(botAI); - } + static Action* rage_winterchill_main_tank_position_boss( + PlayerbotAI* botAI) { return new RageWinterchillMainTankPositionBossAction(botAI); } - static Action* rage_winterchill_spread_ranged_in_circle(PlayerbotAI* botAI) - { - return new RageWinterchillSpreadRangedInCircleAction(botAI); - } + static Action* rage_winterchill_spread_ranged_in_circle( + PlayerbotAI* botAI) { return new RageWinterchillSpreadRangedInCircleAction(botAI); } - static Action* rage_winterchill_move_away_from_death_and_decay(PlayerbotAI* botAI) - { - return new RageWinterchillMoveAwayFromDeathAndDecayAction(botAI); - } + static Action* rage_winterchill_move_away_from_death_and_decay( + PlayerbotAI* botAI) { return new RageWinterchillMoveAwayFromDeathAndDecayAction(botAI); } // Anetheron - static Action* anetheron_misdirect_boss_and_infernals_to_tanks(PlayerbotAI* botAI) - { - return new AnetheronMisdirectBossAndInfernalsToTanksAction(botAI); - } + static Action* anetheron_misdirect_boss_and_infernals_to_tanks( + PlayerbotAI* botAI) { return new AnetheronMisdirectBossAndInfernalsToTanksAction(botAI); } - static Action* anetheron_main_tank_position_boss(PlayerbotAI* botAI) - { - return new AnetheronMainTankPositionBossAction(botAI); - } + static Action* anetheron_main_tank_position_boss( + PlayerbotAI* botAI) { return new AnetheronMainTankPositionBossAction(botAI); } - static Action* anetheron_spread_ranged_in_circle(PlayerbotAI* botAI) - { - return new AnetheronSpreadRangedInCircleAction(botAI); - } + static Action* anetheron_spread_ranged_in_circle( + PlayerbotAI* botAI) { return new AnetheronSpreadRangedInCircleAction(botAI); } - static Action* anetheron_bring_infernal_to_infernal_tank(PlayerbotAI* botAI) - { - return new AnetheronBringInfernalToInfernalTankAction(botAI); - } + static Action* anetheron_bring_infernal_to_infernal_tank( + PlayerbotAI* botAI) { return new AnetheronBringInfernalToInfernalTankAction(botAI); } - static Action* anetheron_first_assist_tank_pick_up_infernals(PlayerbotAI* botAI) - { - return new AnetheronFirstAssistTankPickUpInfernalsAction(botAI); - } + static Action* anetheron_first_assist_tank_pick_up_infernals( + PlayerbotAI* botAI) { return new AnetheronFirstAssistTankPickUpInfernalsAction(botAI); } - static Action* anetheron_assign_dps_priority(PlayerbotAI* botAI) - { - return new AnetheronAssignDpsPriorityAction(botAI); - } + static Action* anetheron_assign_dps_priority( + PlayerbotAI* botAI) { return new AnetheronAssignDpsPriorityAction(botAI); } // Kaz'rogal - static Action* kazrogal_misdirect_boss_to_main_tank(PlayerbotAI* botAI) - { - return new KazrogalMisdirectBossToMainTankAction(botAI); - } + static Action* kazrogal_misdirect_boss_to_main_tank( + PlayerbotAI* botAI) { return new KazrogalMisdirectBossToMainTankAction(botAI); } - static Action* kazrogal_main_tank_position_boss(PlayerbotAI* botAI) - { - return new KazrogalMainTankPositionBossAction(botAI); - } + static Action* kazrogal_main_tank_position_boss( + PlayerbotAI* botAI) { return new KazrogalMainTankPositionBossAction(botAI); } - static Action* kazrogal_assist_tanks_move_in_front_of_boss(PlayerbotAI* botAI) - { - return new KazrogalAssistTanksMoveInFrontOfBossAction(botAI); - } + static Action* kazrogal_assist_tanks_move_in_front_of_boss( + PlayerbotAI* botAI) { return new KazrogalAssistTanksMoveInFrontOfBossAction(botAI); } - static Action* kazrogal_spread_ranged_in_arc(PlayerbotAI* botAI) - { - return new KazrogalSpreadRangedInArcAction(botAI); - } + static Action* kazrogal_spread_ranged_in_arc( + PlayerbotAI* botAI) { return new KazrogalSpreadRangedInArcAction(botAI); } - static Action* kazrogal_low_mana_bot_take_defensive_measures(PlayerbotAI* botAI) - { - return new KazrogalLowManaBotTakeDefensiveMeasuresAction(botAI); - } + static Action* kazrogal_low_mana_bot_take_defensive_measures( + PlayerbotAI* botAI) { return new KazrogalLowManaBotTakeDefensiveMeasuresAction(botAI); } - static Action* kazrogal_cast_shadow_protection_spell(PlayerbotAI* botAI) - { - return new KazrogalCastShadowProtectionSpellAction(botAI); - } + static Action* kazrogal_cast_shadow_protection_spell( + PlayerbotAI* botAI) { return new KazrogalCastShadowProtectionSpellAction(botAI); } // Azgalor - static Action* azgalor_misdirect_boss_to_main_tank(PlayerbotAI* botAI) - { - return new AzgalorMisdirectBossToMainTankAction(botAI); - } + static Action* azgalor_misdirect_boss_to_main_tank( + PlayerbotAI* botAI) { return new AzgalorMisdirectBossToMainTankAction(botAI); } - static Action* azgalor_main_tank_position_boss(PlayerbotAI* botAI) - { - return new AzgalorMainTankPositionBossAction(botAI); - } + static Action* azgalor_main_tank_position_boss( + PlayerbotAI* botAI) { return new AzgalorMainTankPositionBossAction(botAI); } - static Action* azgalor_wait_at_safe_position(PlayerbotAI* botAI) - { - return new AzgalorWaitAtSafePositionAction(botAI); - } + static Action* azgalor_wait_at_safe_position( + PlayerbotAI* botAI) { return new AzgalorWaitAtSafePositionAction(botAI); } - static Action* azgalor_disperse_ranged(PlayerbotAI* botAI) { return new AzgalorDisperseRangedAction(botAI); } + static Action* azgalor_disperse_ranged( + PlayerbotAI* botAI) { return new AzgalorDisperseRangedAction(botAI); } - static Action* azgalor_melee_get_out_of_fire(PlayerbotAI* botAI) - { - return new AzgalorMeleeGetOutOfFireAction(botAI); - } + static Action* azgalor_melee_get_out_of_fire( + PlayerbotAI* botAI) { return new AzgalorMeleeGetOutOfFireAction(botAI); } - static Action* azgalor_move_to_doomguard_tank(PlayerbotAI* botAI) - { - return new AzgalorMoveToDoomguardTankAction(botAI); - } + static Action* azgalor_move_to_doomguard_tank( + PlayerbotAI* botAI) { return new AzgalorMoveToDoomguardTankAction(botAI); } - static Action* azgalor_first_assist_tank_position_doomguard(PlayerbotAI* botAI) - { - return new AzgalorFirstAssistTankPositionDoomguardAction(botAI); - } + static Action* azgalor_first_assist_tank_position_doomguard( + PlayerbotAI* botAI) { return new AzgalorFirstAssistTankPositionDoomguardAction(botAI); } - static Action* azgalor_assign_dps_priority(PlayerbotAI* botAI) { return new AzgalorAssignDpsPriorityAction(botAI); } + static Action* azgalor_assign_dps_priority( + PlayerbotAI* botAI) { return new AzgalorAssignDpsPriorityAction(botAI); } // Archimonde - static Action* archimonde_misdirect_boss_to_main_tank(PlayerbotAI* botAI) - { - return new ArchimondeMisdirectBossToMainTankAction(botAI); - } + static Action* archimonde_misdirect_boss_to_main_tank( + PlayerbotAI* botAI) { return new ArchimondeMisdirectBossToMainTankAction(botAI); } - static Action* archimonde_move_boss_to_initial_position(PlayerbotAI* botAI) - { - return new ArchimondeMoveBossToInitialPositionAction(botAI); - } + static Action* archimonde_move_boss_to_initial_position( + PlayerbotAI* botAI) { return new ArchimondeMoveBossToInitialPositionAction(botAI); } - static Action* archimonde_cast_fear_immunity_spell(PlayerbotAI* botAI) - { - return new ArchimondeCastFearImmunitySpellAction(botAI); - } + static Action* archimonde_cast_fear_immunity_spell( + PlayerbotAI* botAI) { return new ArchimondeCastFearImmunitySpellAction(botAI); } - static Action* archimonde_spread_to_avoid_air_burst(PlayerbotAI* botAI) - { - return new ArchimondeSpreadToAvoidAirBurstAction(botAI); - } + static Action* archimonde_spread_to_avoid_air_burst( + PlayerbotAI* botAI) { return new ArchimondeSpreadToAvoidAirBurstAction(botAI); } - static Action* archimonde_avoid_doomfire(PlayerbotAI* botAI) { return new ArchimondeAvoidDoomfireAction(botAI); } + static Action* archimonde_avoid_doomfire( + PlayerbotAI* botAI) { return new ArchimondeAvoidDoomfireAction(botAI); } - static Action* archimonde_remove_doomfire_dot(PlayerbotAI* botAI) - { - return new ArchimondeRemoveDoomfireDotAction(botAI); - } + static Action* archimonde_remove_doomfire_dot( + PlayerbotAI* botAI) { return new ArchimondeRemoveDoomfireDotAction(botAI); } }; #endif diff --git a/src/Ai/Raid/HyjalSummit/RaidHyjalSummitTriggerContext.h b/src/Ai/Raid/HyjalSummit/RaidHyjalSummitTriggerContext.h index 107632a084c..5738c7fac9d 100644 --- a/src/Ai/Raid/HyjalSummit/RaidHyjalSummitTriggerContext.h +++ b/src/Ai/Raid/HyjalSummit/RaidHyjalSummitTriggerContext.h @@ -6,8 +6,8 @@ #ifndef _PLAYERBOT_RAIDHYJALSUMMITTRIGGERCONTEXT_H #define _PLAYERBOT_RAIDHYJALSUMMITTRIGGERCONTEXT_H -#include "AiObjectContext.h" #include "RaidHyjalSummitTriggers.h" +#include "AiObjectContext.h" class RaidHyjalSummitTriggerContext : public NamedObjectContext { @@ -19,7 +19,8 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext &RaidHyjalSummitTriggerContext::hyjal_summit_bot_is_not_in_combat; // Rage Winterchill - creators["rage winterchill pulling boss"] = &RaidHyjalSummitTriggerContext::rage_winterchill_pulling_boss; + creators["rage winterchill pulling boss"] = + &RaidHyjalSummitTriggerContext::rage_winterchill_pulling_boss; creators["rage winterchill boss engaged by main tank"] = &RaidHyjalSummitTriggerContext::rage_winterchill_boss_engaged_by_main_tank; @@ -50,7 +51,8 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext &RaidHyjalSummitTriggerContext::anetheron_infernals_continue_to_spawn; // Kaz'rogal - creators["kaz'rogal pulling boss"] = &RaidHyjalSummitTriggerContext::kazrogal_pulling_boss; + creators["kaz'rogal pulling boss"] = + &RaidHyjalSummitTriggerContext::kazrogal_pulling_boss; creators["kaz'rogal boss engaged by main tank"] = &RaidHyjalSummitTriggerContext::kazrogal_boss_engaged_by_main_tank; @@ -58,7 +60,8 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext creators["kaz'rogal boss engaged by assist tanks"] = &RaidHyjalSummitTriggerContext::kazrogal_boss_engaged_by_assist_tanks; - creators["kaz'rogal bot is low on mana"] = &RaidHyjalSummitTriggerContext::kazrogal_bot_is_low_on_mana; + creators["kaz'rogal bot is low on mana"] = + &RaidHyjalSummitTriggerContext::kazrogal_bot_is_low_on_mana; creators["kaz'rogal low mana bots need escape path"] = &RaidHyjalSummitTriggerContext::kazrogal_low_mana_bots_need_escape_path; @@ -67,7 +70,8 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext &RaidHyjalSummitTriggerContext::kazrogal_mark_deals_shadow_damage; // Azgalor - creators["azgalor pulling boss"] = &RaidHyjalSummitTriggerContext::azgalor_pulling_boss; + creators["azgalor pulling boss"] = + &RaidHyjalSummitTriggerContext::azgalor_pulling_boss; creators["azgalor boss engaged by main tank"] = &RaidHyjalSummitTriggerContext::azgalor_boss_engaged_by_main_tank; @@ -81,7 +85,8 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext creators["azgalor boss casts rain of fire on melee"] = &RaidHyjalSummitTriggerContext::azgalor_boss_casts_rain_of_fire_on_melee; - creators["azgalor bot is doomed"] = &RaidHyjalSummitTriggerContext::azgalor_bot_is_doomed; + creators["azgalor bot is doomed"] = + &RaidHyjalSummitTriggerContext::azgalor_bot_is_doomed; creators["azgalor doomguards must be controlled"] = &RaidHyjalSummitTriggerContext::azgalor_doomguards_must_be_controlled; @@ -90,164 +95,124 @@ class RaidHyjalSummitTriggerContext : public NamedObjectContext &RaidHyjalSummitTriggerContext::azgalor_doomguards_continue_to_spawn; // Archimonde - creators["archimonde pulling boss"] = &RaidHyjalSummitTriggerContext::archimonde_pulling_boss; + creators["archimonde pulling boss"] = + &RaidHyjalSummitTriggerContext::archimonde_pulling_boss; creators["archimonde boss engaged by main tank"] = &RaidHyjalSummitTriggerContext::archimonde_boss_engaged_by_main_tank; - creators["archimonde boss casts fear"] = &RaidHyjalSummitTriggerContext::archimonde_boss_casts_fear; + creators["archimonde boss casts fear"] = + &RaidHyjalSummitTriggerContext::archimonde_boss_casts_fear; - creators["archimonde boss casts air burst"] = &RaidHyjalSummitTriggerContext::archimonde_boss_casts_air_burst; + creators["archimonde boss casts air burst"] = + &RaidHyjalSummitTriggerContext::archimonde_boss_casts_air_burst; creators["archimonde boss summoned doomfire"] = &RaidHyjalSummitTriggerContext::archimonde_boss_summoned_doomfire; - creators["archimonde bot stood in doomfire"] = &RaidHyjalSummitTriggerContext::archimonde_bot_stood_in_doomfire; + creators["archimonde bot stood in doomfire"] = + &RaidHyjalSummitTriggerContext::archimonde_bot_stood_in_doomfire; } private: // General - static Trigger* hyjal_summit_bot_is_not_in_combat(PlayerbotAI* botAI) - { - return new HyjalSummitBotIsNotInCombatTrigger(botAI); - } + static Trigger* hyjal_summit_bot_is_not_in_combat( + PlayerbotAI* botAI) { return new HyjalSummitBotIsNotInCombatTrigger(botAI); } // Rage Winterchill - static Trigger* rage_winterchill_pulling_boss(PlayerbotAI* botAI) - { - return new RageWinterchillPullingBossTrigger(botAI); - } + static Trigger* rage_winterchill_pulling_boss( + PlayerbotAI* botAI) { return new RageWinterchillPullingBossTrigger(botAI); } - static Trigger* rage_winterchill_boss_engaged_by_main_tank(PlayerbotAI* botAI) - { - return new RageWinterchillBossEngagedByMainTankTrigger(botAI); - } + static Trigger* rage_winterchill_boss_engaged_by_main_tank( + PlayerbotAI* botAI) { return new RageWinterchillBossEngagedByMainTankTrigger(botAI); } - static Trigger* rage_winterchill_boss_casts_death_and_decay(PlayerbotAI* botAI) - { - return new RageWinterchillBossCastsDeathAndDecayTrigger(botAI); - } + static Trigger* rage_winterchill_boss_casts_death_and_decay( + PlayerbotAI* botAI) { return new RageWinterchillBossCastsDeathAndDecayTrigger(botAI); } - static Trigger* rage_winterchill_bot_is_standing_in_death_and_decay(PlayerbotAI* botAI) - { - return new RageWinterchillBotIsStandingInDeathAndDecayTrigger(botAI); - } + static Trigger* rage_winterchill_bot_is_standing_in_death_and_decay( + PlayerbotAI* botAI) { return new RageWinterchillBotIsStandingInDeathAndDecayTrigger(botAI); } // Anetheron - static Trigger* anetheron_pulling_boss_or_infernal(PlayerbotAI* botAI) - { - return new AnetheronPullingBossOrInfernalTrigger(botAI); - } + static Trigger* anetheron_pulling_boss_or_infernal( + PlayerbotAI* botAI) { return new AnetheronPullingBossOrInfernalTrigger(botAI); } - static Trigger* anetheron_boss_engaged_by_main_tank(PlayerbotAI* botAI) - { - return new AnetheronBossEngagedByMainTankTrigger(botAI); - } + static Trigger* anetheron_boss_engaged_by_main_tank( + PlayerbotAI* botAI) { return new AnetheronBossEngagedByMainTankTrigger(botAI); } - static Trigger* anetheron_boss_casts_carrion_swarm(PlayerbotAI* botAI) - { - return new AnetheronBossCastsCarrionSwarmTrigger(botAI); - } + static Trigger* anetheron_boss_casts_carrion_swarm( + PlayerbotAI* botAI) { return new AnetheronBossCastsCarrionSwarmTrigger(botAI); } - static Trigger* anetheron_bot_is_targeted_by_infernal(PlayerbotAI* botAI) - { - return new AnetheronBotIsTargetedByInfernalTrigger(botAI); - } + static Trigger* anetheron_bot_is_targeted_by_infernal( + PlayerbotAI* botAI) { return new AnetheronBotIsTargetedByInfernalTrigger(botAI); } - static Trigger* anetheron_infernals_need_to_be_kept_away_from_raid(PlayerbotAI* botAI) - { - return new AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger(botAI); - } + static Trigger* anetheron_infernals_need_to_be_kept_away_from_raid( + PlayerbotAI* botAI) { return new AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger(botAI); } - static Trigger* anetheron_infernals_continue_to_spawn(PlayerbotAI* botAI) - { - return new AnetheronInfernalsContinueToSpawnTrigger(botAI); - } + static Trigger* anetheron_infernals_continue_to_spawn( + PlayerbotAI* botAI) { return new AnetheronInfernalsContinueToSpawnTrigger(botAI); } // Kaz'rogal - static Trigger* kazrogal_pulling_boss(PlayerbotAI* botAI) { return new KazrogalPullingBossTrigger(botAI); } + static Trigger* kazrogal_pulling_boss( + PlayerbotAI* botAI) { return new KazrogalPullingBossTrigger(botAI); } - static Trigger* kazrogal_boss_engaged_by_main_tank(PlayerbotAI* botAI) - { - return new KazrogalBossEngagedByMainTankTrigger(botAI); - } + static Trigger* kazrogal_boss_engaged_by_main_tank( + PlayerbotAI* botAI) { return new KazrogalBossEngagedByMainTankTrigger(botAI); } - static Trigger* kazrogal_boss_engaged_by_assist_tanks(PlayerbotAI* botAI) - { - return new KazrogalBossEngagedByAssistTanksTrigger(botAI); - } + static Trigger* kazrogal_boss_engaged_by_assist_tanks( + PlayerbotAI* botAI) { return new KazrogalBossEngagedByAssistTanksTrigger(botAI); } - static Trigger* kazrogal_low_mana_bots_need_escape_path(PlayerbotAI* botAI) - { - return new KazrogalLowManaBotsNeedEscapePathTrigger(botAI); - } + static Trigger* kazrogal_low_mana_bots_need_escape_path( + PlayerbotAI* botAI) { return new KazrogalLowManaBotsNeedEscapePathTrigger(botAI); } - static Trigger* kazrogal_bot_is_low_on_mana(PlayerbotAI* botAI) { return new KazrogalBotIsLowOnManaTrigger(botAI); } + static Trigger* kazrogal_bot_is_low_on_mana( + PlayerbotAI* botAI) { return new KazrogalBotIsLowOnManaTrigger(botAI); } - static Trigger* kazrogal_mark_deals_shadow_damage(PlayerbotAI* botAI) - { - return new KazrogalMarkDealsShadowDamageTrigger(botAI); - } + static Trigger* kazrogal_mark_deals_shadow_damage( + PlayerbotAI* botAI) { return new KazrogalMarkDealsShadowDamageTrigger(botAI); } // Azgalor - static Trigger* azgalor_pulling_boss(PlayerbotAI* botAI) { return new AzgalorPullingBossTrigger(botAI); } + static Trigger* azgalor_pulling_boss( + PlayerbotAI* botAI) { return new AzgalorPullingBossTrigger(botAI); } - static Trigger* azgalor_boss_engaged_by_main_tank(PlayerbotAI* botAI) - { - return new AzgalorBossEngagedByMainTankTrigger(botAI); - } + static Trigger* azgalor_boss_engaged_by_main_tank( + PlayerbotAI* botAI) { return new AzgalorBossEngagedByMainTankTrigger(botAI); } - static Trigger* azgalor_main_tank_is_positioning_boss(PlayerbotAI* botAI) - { - return new AzgalorMainTankIsPositioningBossTrigger(botAI); - } + static Trigger* azgalor_main_tank_is_positioning_boss( + PlayerbotAI* botAI) { return new AzgalorMainTankIsPositioningBossTrigger(botAI); } - static Trigger* azgalor_boss_casts_rain_of_fire_on_ranged(PlayerbotAI* botAI) - { - return new AzgalorBossCastsRainOfFireOnRangedTrigger(botAI); - } + static Trigger* azgalor_boss_casts_rain_of_fire_on_ranged( + PlayerbotAI* botAI) { return new AzgalorBossCastsRainOfFireOnRangedTrigger(botAI); } - static Trigger* azgalor_boss_casts_rain_of_fire_on_melee(PlayerbotAI* botAI) - { - return new AzgalorBossCastsRainOfFireOnMeleeTrigger(botAI); - } + static Trigger* azgalor_boss_casts_rain_of_fire_on_melee( + PlayerbotAI* botAI) { return new AzgalorBossCastsRainOfFireOnMeleeTrigger(botAI); } - static Trigger* azgalor_bot_is_doomed(PlayerbotAI* botAI) { return new AzgalorBotIsDoomedTrigger(botAI); } + static Trigger* azgalor_bot_is_doomed( + PlayerbotAI* botAI) { return new AzgalorBotIsDoomedTrigger(botAI); } - static Trigger* azgalor_doomguards_must_be_controlled(PlayerbotAI* botAI) - { - return new AzgalorDoomguardsMustBeControlledTrigger(botAI); - } + static Trigger* azgalor_doomguards_must_be_controlled( + PlayerbotAI* botAI) { return new AzgalorDoomguardsMustBeControlledTrigger(botAI); } - static Trigger* azgalor_doomguards_continue_to_spawn(PlayerbotAI* botAI) - { - return new AzgalorDoomguardsContinueToSpawnTrigger(botAI); - } + static Trigger* azgalor_doomguards_continue_to_spawn( + PlayerbotAI* botAI) { return new AzgalorDoomguardsContinueToSpawnTrigger(botAI); } // Archimonde - static Trigger* archimonde_pulling_boss(PlayerbotAI* botAI) { return new ArchimondePullingBossTrigger(botAI); } + static Trigger* archimonde_pulling_boss( + PlayerbotAI* botAI) { return new ArchimondePullingBossTrigger(botAI); } - static Trigger* archimonde_boss_engaged_by_main_tank(PlayerbotAI* botAI) - { - return new ArchimondeBossEngagedByMainTankTrigger(botAI); - } + static Trigger* archimonde_boss_engaged_by_main_tank( + PlayerbotAI* botAI) { return new ArchimondeBossEngagedByMainTankTrigger(botAI); } - static Trigger* archimonde_boss_casts_fear(PlayerbotAI* botAI) { return new ArchimondeBossCastsFearTrigger(botAI); } + static Trigger* archimonde_boss_casts_fear( + PlayerbotAI* botAI) { return new ArchimondeBossCastsFearTrigger(botAI); } - static Trigger* archimonde_boss_casts_air_burst(PlayerbotAI* botAI) - { - return new ArchimondeBossCastsAirBurstTrigger(botAI); - } + static Trigger* archimonde_boss_casts_air_burst( + PlayerbotAI* botAI) { return new ArchimondeBossCastsAirBurstTrigger(botAI); } - static Trigger* archimonde_boss_summoned_doomfire(PlayerbotAI* botAI) - { - return new ArchimondeBossSummonedDoomfireTrigger(botAI); - } + static Trigger* archimonde_boss_summoned_doomfire( + PlayerbotAI* botAI) { return new ArchimondeBossSummonedDoomfireTrigger(botAI); } - static Trigger* archimonde_bot_stood_in_doomfire(PlayerbotAI* botAI) - { - return new ArchimondeBotStoodInDoomfireTrigger(botAI); - } + static Trigger* archimonde_bot_stood_in_doomfire( + PlayerbotAI* botAI) { return new ArchimondeBotStoodInDoomfireTrigger(botAI); } }; #endif diff --git a/src/Ai/Raid/HyjalSummit/Strategy/RaidHyjalSummitStrategy.cpp b/src/Ai/Raid/HyjalSummit/Strategy/RaidHyjalSummitStrategy.cpp index 0805ac9c055..c2af6d68652 100644 --- a/src/Ai/Raid/HyjalSummit/Strategy/RaidHyjalSummitStrategy.cpp +++ b/src/Ai/Raid/HyjalSummit/Strategy/RaidHyjalSummitStrategy.cpp @@ -4,114 +4,108 @@ */ #include "RaidHyjalSummitStrategy.h" - #include "RaidHyjalSummitMultipliers.h" void RaidHyjalSummitStrategy::InitTriggers(std::vector& triggers) { // General - triggers.push_back(new TriggerNode("hyjal summit bot is not in combat", - {NextAction("hyjal summit erase trackers", ACTION_EMERGENCY + 11)})); + triggers.push_back(new TriggerNode("hyjal summit bot is not in combat", { + NextAction("hyjal summit erase trackers", ACTION_EMERGENCY + 11) })); // Rage Winterchill - triggers.push_back(new TriggerNode("rage winterchill pulling boss", - {NextAction("rage winterchill misdirect boss to main tank", ACTION_RAID + 2)})); + triggers.push_back(new TriggerNode("rage winterchill pulling boss", { + NextAction("rage winterchill misdirect boss to main tank", ACTION_RAID + 2) })); - triggers.push_back(new TriggerNode("rage winterchill boss engaged by main tank", - {NextAction("rage winterchill main tank position boss", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("rage winterchill boss engaged by main tank", { + NextAction("rage winterchill main tank position boss", ACTION_RAID + 1) })); - triggers.push_back(new TriggerNode("rage winterchill boss casts death and decay", - {NextAction("rage winterchill spread ranged in circle", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("rage winterchill boss casts death and decay", { + NextAction("rage winterchill spread ranged in circle", ACTION_RAID + 1) })); - triggers.push_back( - new TriggerNode("rage winterchill bot is standing in death and decay", - {NextAction("rage winterchill move away from death and decay", ACTION_EMERGENCY + 2)})); + triggers.push_back(new TriggerNode("rage winterchill bot is standing in death and decay", { + NextAction("rage winterchill move away from death and decay", ACTION_EMERGENCY + 2) })); // Anetheron - triggers.push_back( - new TriggerNode("anetheron pulling boss or infernal", - {NextAction("anetheron misdirect boss and infernals to tanks", ACTION_RAID + 3)})); + triggers.push_back(new TriggerNode("anetheron pulling boss or infernal", { + NextAction("anetheron misdirect boss and infernals to tanks", ACTION_RAID + 3) })); - triggers.push_back(new TriggerNode("anetheron boss engaged by main tank", - {NextAction("anetheron main tank position boss", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("anetheron boss engaged by main tank", { + NextAction("anetheron main tank position boss", ACTION_RAID + 1) })); - triggers.push_back(new TriggerNode("anetheron boss casts carrion swarm", - {NextAction("anetheron spread ranged in circle", ACTION_RAID + 2)})); + triggers.push_back(new TriggerNode("anetheron boss casts carrion swarm", { + NextAction("anetheron spread ranged in circle", ACTION_RAID + 2) })); - triggers.push_back( - new TriggerNode("anetheron bot is targeted by infernal", - {NextAction("anetheron bring infernal to infernal tank", ACTION_EMERGENCY + 2)})); + triggers.push_back(new TriggerNode("anetheron bot is targeted by infernal", { + NextAction("anetheron bring infernal to infernal tank", ACTION_EMERGENCY + 2) })); - triggers.push_back( - new TriggerNode("anetheron infernals need to be kept away from raid", - {NextAction("anetheron first assist tank pick up infernals", ACTION_EMERGENCY + 1)})); + triggers.push_back(new TriggerNode("anetheron infernals need to be kept away from raid", { + NextAction("anetheron first assist tank pick up infernals", ACTION_EMERGENCY + 1) })); - triggers.push_back(new TriggerNode("anetheron infernals continue to spawn", - {NextAction("anetheron assign dps priority", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("anetheron infernals continue to spawn", { + NextAction("anetheron assign dps priority", ACTION_RAID + 1) })); // Kaz'rogal - triggers.push_back(new TriggerNode("kaz'rogal pulling boss", - {NextAction("kaz'rogal misdirect boss to main tank", ACTION_RAID + 2)})); + triggers.push_back(new TriggerNode("kaz'rogal pulling boss", { + NextAction("kaz'rogal misdirect boss to main tank", ACTION_RAID + 2) })); - triggers.push_back(new TriggerNode("kaz'rogal boss engaged by main tank", - {NextAction("kaz'rogal main tank position boss", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("kaz'rogal boss engaged by main tank", { + NextAction("kaz'rogal main tank position boss", ACTION_RAID + 1) })); - triggers.push_back(new TriggerNode("kaz'rogal boss engaged by assist tanks", - {NextAction("kaz'rogal assist tanks move in front of boss", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("kaz'rogal boss engaged by assist tanks", { + NextAction("kaz'rogal assist tanks move in front of boss", ACTION_RAID + 1) })); - triggers.push_back(new TriggerNode("kaz'rogal low mana bots need escape path", - {NextAction("kaz'rogal spread ranged in arc", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("kaz'rogal low mana bots need escape path", { + NextAction("kaz'rogal spread ranged in arc", ACTION_RAID + 1) })); - triggers.push_back( - new TriggerNode("kaz'rogal bot is low on mana", - {NextAction("kaz'rogal low mana bot take defensive measures", ACTION_EMERGENCY + 1)})); + triggers.push_back(new TriggerNode("kaz'rogal bot is low on mana", { + NextAction("kaz'rogal low mana bot take defensive measures", ACTION_EMERGENCY + 1) })); - triggers.push_back(new TriggerNode("kaz'rogal mark deals shadow damage", - {NextAction("kaz'rogal cast shadow protection spell", ACTION_EMERGENCY + 6)})); + triggers.push_back(new TriggerNode("kaz'rogal mark deals shadow damage", { + NextAction("kaz'rogal cast shadow protection spell", ACTION_EMERGENCY + 6) })); // Azgalor - triggers.push_back( - new TriggerNode("azgalor pulling boss", {NextAction("azgalor misdirect boss to main tank", ACTION_RAID + 3)})); + triggers.push_back(new TriggerNode("azgalor pulling boss", { + NextAction("azgalor misdirect boss to main tank", ACTION_RAID + 3) })); - triggers.push_back(new TriggerNode("azgalor boss engaged by main tank", - {NextAction("azgalor main tank position boss", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("azgalor boss engaged by main tank", { + NextAction("azgalor main tank position boss", ACTION_RAID + 1) })); - triggers.push_back(new TriggerNode("azgalor main tank is positioning boss", - {NextAction("azgalor wait at safe position", ACTION_EMERGENCY + 1)})); + triggers.push_back(new TriggerNode("azgalor main tank is positioning boss", { + NextAction("azgalor wait at safe position", ACTION_EMERGENCY + 1) })); - triggers.push_back(new TriggerNode("azgalor boss casts rain of fire on ranged", - {NextAction("azgalor disperse ranged", ACTION_RAID + 2)})); + triggers.push_back(new TriggerNode("azgalor boss casts rain of fire on ranged", { + NextAction("azgalor disperse ranged", ACTION_RAID + 2) })); - triggers.push_back(new TriggerNode("azgalor boss casts rain of fire on melee", - {NextAction("azgalor melee get out of fire", ACTION_EMERGENCY + 2)})); + triggers.push_back(new TriggerNode("azgalor boss casts rain of fire on melee", { + NextAction("azgalor melee get out of fire", ACTION_EMERGENCY + 2) })); - triggers.push_back( - new TriggerNode("azgalor bot is doomed", {NextAction("azgalor move to doomguard tank", ACTION_EMERGENCY + 3)})); + triggers.push_back(new TriggerNode("azgalor bot is doomed", { + NextAction("azgalor move to doomguard tank", ACTION_EMERGENCY + 3) })); - triggers.push_back(new TriggerNode("azgalor doomguards must be controlled", - {NextAction("azgalor first assist tank position doomguard", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("azgalor doomguards must be controlled", { + NextAction("azgalor first assist tank position doomguard", ACTION_RAID + 1) })); - triggers.push_back(new TriggerNode("azgalor doomguards continue to spawn", - {NextAction("azgalor assign dps priority", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("azgalor doomguards continue to spawn", { + NextAction("azgalor assign dps priority", ACTION_RAID + 1) })); // Archimonde - triggers.push_back(new TriggerNode("archimonde pulling boss", - {NextAction("archimonde misdirect boss to main tank", ACTION_RAID + 2)})); + triggers.push_back(new TriggerNode("archimonde pulling boss", { + NextAction("archimonde misdirect boss to main tank", ACTION_RAID + 2) })); - triggers.push_back(new TriggerNode("archimonde boss engaged by main tank", - {NextAction("archimonde move boss to initial position", ACTION_RAID + 2)})); + triggers.push_back(new TriggerNode("archimonde boss engaged by main tank", { + NextAction("archimonde move boss to initial position", ACTION_RAID + 2) })); - triggers.push_back(new TriggerNode("archimonde boss casts fear", - {NextAction("archimonde cast fear immunity spell", ACTION_RAID + 2)})); + triggers.push_back(new TriggerNode("archimonde boss casts fear", { + NextAction("archimonde cast fear immunity spell", ACTION_RAID + 2) })); - triggers.push_back(new TriggerNode("archimonde boss casts air burst", - {NextAction("archimonde spread to avoid air burst", ACTION_RAID + 1)})); + triggers.push_back(new TriggerNode("archimonde boss casts air burst", { + NextAction("archimonde spread to avoid air burst", ACTION_RAID + 1) })); - triggers.push_back(new TriggerNode("archimonde boss summoned doomfire", - {NextAction("archimonde avoid doomfire", ACTION_EMERGENCY + 6)})); + triggers.push_back(new TriggerNode("archimonde boss summoned doomfire", { + NextAction("archimonde avoid doomfire", ACTION_EMERGENCY + 6) })); - triggers.push_back(new TriggerNode("archimonde bot stood in doomfire", - {NextAction("archimonde remove doomfire dot", ACTION_EMERGENCY + 7)})); + triggers.push_back(new TriggerNode("archimonde bot stood in doomfire", { + NextAction("archimonde remove doomfire dot", ACTION_EMERGENCY + 7) })); } void RaidHyjalSummitStrategy::InitMultipliers(std::vector& multipliers) diff --git a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp index 430784f3e2d..012c7dc9bc9 100644 --- a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp +++ b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp @@ -4,18 +4,20 @@ */ #include "RaidHyjalSummitTriggers.h" - +#include "RaidHyjalSummitHelpers.h" +#include "RaidHyjalSummitActions.h" #include "AiFactory.h" #include "Playerbots.h" #include "RaidBossHelpers.h" -#include "RaidHyjalSummitActions.h" -#include "RaidHyjalSummitHelpers.h" using namespace HyjalSummitHelpers; // General -bool HyjalSummitBotIsNotInCombatTrigger::IsActive() { return !bot->IsInCombat(); } +bool HyjalSummitBotIsNotInCombatTrigger::IsActive() +{ + return !bot->IsInCombat(); +} // Rage Winterchill @@ -30,12 +32,14 @@ bool RageWinterchillPullingBossTrigger::IsActive() bool RageWinterchillBossEngagedByMainTankTrigger::IsActive() { - return botAI->IsMainTank(bot) && AI_VALUE2(Unit*, "find target", "rage winterchill"); + return botAI->IsMainTank(bot) && + AI_VALUE2(Unit*, "find target", "rage winterchill"); } bool RageWinterchillBossCastsDeathAndDecayTrigger::IsActive() { - return botAI->IsRanged(bot) && AI_VALUE2(Unit*, "find target", "rage winterchill"); + return botAI->IsRanged(bot) && + AI_VALUE2(Unit*, "find target", "rage winterchill"); } bool RageWinterchillBotIsStandingInDeathAndDecayTrigger::IsActive() @@ -53,12 +57,14 @@ bool RageWinterchillBotIsStandingInDeathAndDecayTrigger::IsActive() bool AnetheronPullingBossOrInfernalTrigger::IsActive() { - return bot->getClass() == CLASS_HUNTER && AI_VALUE2(Unit*, "find target", "anetheron"); + return bot->getClass() == CLASS_HUNTER && + AI_VALUE2(Unit*, "find target", "anetheron"); } bool AnetheronBossEngagedByMainTankTrigger::IsActive() { - return botAI->IsMainTank(bot) && AI_VALUE2(Unit*, "find target", "anetheron"); + return botAI->IsMainTank(bot) && + AI_VALUE2(Unit*, "find target", "anetheron"); } bool AnetheronBossCastsCarrionSwarmTrigger::IsActive() @@ -87,12 +93,14 @@ bool AnetheronBotIsTargetedByInfernalTrigger::IsActive() bool AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger::IsActive() { - return botAI->IsAssistTankOfIndex(bot, 0, true) && AI_VALUE2(Unit*, "find target", "towering infernal"); + return botAI->IsAssistTankOfIndex(bot, 0, true) && + AI_VALUE2(Unit*, "find target", "towering infernal"); } bool AnetheronInfernalsContinueToSpawnTrigger::IsActive() { - return !botAI->IsTank(bot) && AI_VALUE2(Unit*, "find target", "anetheron"); + return !botAI->IsTank(bot) && + AI_VALUE2(Unit*, "find target", "anetheron"); } // Kaz'rogal @@ -124,7 +132,9 @@ bool KazrogalBossEngagedByAssistTanksTrigger::IsActive() bool KazrogalLowManaBotsNeedEscapePathTrigger::IsActive() { - if (bot->getClass() == CLASS_WARRIOR || bot->getClass() == CLASS_ROGUE || bot->getClass() == CLASS_DEATH_KNIGHT) + if (bot->getClass() == CLASS_WARRIOR || + bot->getClass() == CLASS_ROGUE || + bot->getClass() == CLASS_DEATH_KNIGHT) return false; uint8 tab = AiFactory::GetPlayerSpecTab(bot); @@ -152,7 +162,9 @@ bool KazrogalLowManaBotsNeedEscapePathTrigger::IsActive() bool KazrogalBotIsLowOnManaTrigger::IsActive() { - if (bot->getClass() == CLASS_WARRIOR || bot->getClass() == CLASS_ROGUE || bot->getClass() == CLASS_DEATH_KNIGHT) + if (bot->getClass() == CLASS_WARRIOR || + bot->getClass() == CLASS_ROGUE || + bot->getClass() == CLASS_DEATH_KNIGHT) return false; uint8 tab = AiFactory::GetPlayerSpecTab(bot); @@ -165,7 +177,8 @@ bool KazrogalBotIsLowOnManaTrigger::IsActive() if (botAI->HasAnyAuraOf(bot, "ice block", "divine shield", nullptr)) return false; - if (isBelowManaThreshold.count(bot->GetGUID()) || bot->GetPower(POWER_MANA) <= 3200) + if (isBelowManaThreshold.count(bot->GetGUID()) || + bot->GetPower(POWER_MANA) <= 3200) return true; return false; @@ -173,18 +186,21 @@ bool KazrogalBotIsLowOnManaTrigger::IsActive() bool KazrogalMarkDealsShadowDamageTrigger::IsActive() { - if (bot->getClass() != CLASS_PALADIN && bot->getClass() != CLASS_WARLOCK) + if (bot->getClass() != CLASS_PALADIN && + bot->getClass() != CLASS_WARLOCK) return false; if (!AI_VALUE2(Unit*, "find target", "kaz'rogal")) return false; if (bot->getClass() == CLASS_PALADIN && - (botAI->HasAura("shadow resistance aura", bot) || botAI->HasAura("prayer of shadow protection", bot) || + (botAI->HasAura("shadow resistance aura", bot) || + botAI->HasAura("prayer of shadow protection", bot) || botAI->HasAura("shadow protection", bot))) return false; - return bot->HasAura(static_cast(HyjalSummitSpells::SPELL_MARK_OF_KAZROGAL)); + return bot->HasAura( + static_cast(HyjalSummitSpells::SPELL_MARK_OF_KAZROGAL)); } // Azgalor @@ -200,7 +216,8 @@ bool AzgalorPullingBossTrigger::IsActive() bool AzgalorBossEngagedByMainTankTrigger::IsActive() { - return botAI->IsMainTank(bot) && AI_VALUE2(Unit*, "find target", "azgalor"); + return botAI->IsMainTank(bot) && + AI_VALUE2(Unit*, "find target", "azgalor"); } bool AzgalorMainTankIsPositioningBossTrigger::IsActive() @@ -223,7 +240,8 @@ bool AzgalorMainTankIsPositioningBossTrigger::IsActive() return azgalor->GetHealthPct() > 95.0f; TankPositionState tankState = GetAzgalorTankPositionState(botAI, bot); - return tankState == TankPositionState::Unknown || tankState == TankPositionState::MovingToTransition; + return tankState == TankPositionState::Unknown || + tankState == TankPositionState::MovingToTransition; } bool AzgalorBossCastsRainOfFireOnRangedTrigger::IsActive() @@ -232,7 +250,8 @@ bool AzgalorBossCastsRainOfFireOnRangedTrigger::IsActive() return false; Unit* azgalor = AI_VALUE2(Unit*, "find target", "azgalor"); - return azgalor && azgalor->GetVictim() != bot && !bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM)); + return azgalor && azgalor->GetVictim() != bot && + !bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM)); } bool AzgalorBossCastsRainOfFireOnMeleeTrigger::IsActive() @@ -241,32 +260,40 @@ bool AzgalorBossCastsRainOfFireOnMeleeTrigger::IsActive() return false; Unit* azgalor = AI_VALUE2(Unit*, "find target", "azgalor"); - if (!azgalor || azgalor->GetVictim() == bot || bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) + if (!azgalor || azgalor->GetVictim() == bot || + bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) return false; return IsBotInsideActiveAzgalorRainOfFire(bot, 16.0f); } -bool AzgalorBotIsDoomedTrigger::IsActive() { return bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM)); } +bool AzgalorBotIsDoomedTrigger::IsActive() +{ + return bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM)); +} bool AzgalorDoomguardsMustBeControlledTrigger::IsActive() { - if (!botAI->IsAssistTank(bot) || !AI_VALUE2(Unit*, "find target", "azgalor")) + if (!botAI->IsAssistTank(bot) || + !AI_VALUE2(Unit*, "find target", "azgalor")) return false; if (botAI->IsAssistTankOfIndex(bot, 0, true)) { - return AI_VALUE2(Unit*, "find target", "lesser doomguard") || AnyGroupMemberHasDoom(bot); + return AI_VALUE2(Unit*, "find target", "lesser doomguard") || + AnyGroupMemberHasDoom(bot); } if (botAI->IsAssistTankOfIndex(bot, 1, true)) { // Trigger for second assist tank only if first assist tank has Doom Player* firstAssistTank = GetGroupAssistTank(botAI, bot, 0); - if (firstAssistTank && !firstAssistTank->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) + if (firstAssistTank && + !firstAssistTank->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) return false; - return AI_VALUE2(Unit*, "find target", "lesser doomguard") || AnyGroupMemberHasDoom(bot); + return AI_VALUE2(Unit*, "find target", "lesser doomguard") || + AnyGroupMemberHasDoom(bot); } return false; @@ -302,7 +329,8 @@ bool ArchimondeBossEngagedByMainTankTrigger::IsActive() bool ArchimondeBossCastsFearTrigger::IsActive() { - if (bot->getClass() != CLASS_PRIEST && bot->getClass() != CLASS_SHAMAN) + if (bot->getClass() != CLASS_PRIEST && + bot->getClass() != CLASS_SHAMAN) return false; Unit* archimonde = AI_VALUE2(Unit*, "find target", "archimonde"); @@ -312,7 +340,8 @@ bool ArchimondeBossCastsFearTrigger::IsActive() bool ArchimondeBossCastsAirBurstTrigger::IsActive() { Unit* archimonde = AI_VALUE2(Unit*, "find target", "archimonde"); - if (!archimonde || archimonde->GetHealthPct() <= 10.0f || archimonde->GetVictim() == bot) + if (!archimonde || archimonde->GetHealthPct() <= 10.0f || + archimonde->GetVictim() == bot) return false; return !botAI->IsMainTank(bot); @@ -326,14 +355,18 @@ bool ArchimondeBossSummonedDoomfireTrigger::IsActive() // If I don't make an exception, bots actually refuse to enter the // Doomfire even when feared - return !bot->HasAura(static_cast(HyjalSummitSpells::SPELL_ARCHIMONDE_FEAR)); + return !bot->HasAura( + static_cast(HyjalSummitSpells::SPELL_ARCHIMONDE_FEAR)); } bool ArchimondeBotStoodInDoomfireTrigger::IsActive() { - if (bot->getClass() != CLASS_MAGE && bot->getClass() != CLASS_ROGUE && bot->getClass() != CLASS_PALADIN) + if (bot->getClass() != CLASS_MAGE && + bot->getClass() != CLASS_ROGUE && + bot->getClass() != CLASS_PALADIN) return false; - return bot->GetHealthPct() < 40.0f && (bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOMFIRE)) || - bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOMFIRE_DOT))); + return bot->GetHealthPct() < 40.0f && + (bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOMFIRE)) || + bot->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOMFIRE_DOT))); } diff --git a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.h b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.h index 01b39e9acd8..4eddaab3267 100644 --- a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.h +++ b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.h @@ -13,7 +13,8 @@ class HyjalSummitBotIsNotInCombatTrigger : public Trigger { public: - HyjalSummitBotIsNotInCombatTrigger(PlayerbotAI* botAI) : Trigger(botAI, "hyjal summit bot is not in combat") {} + HyjalSummitBotIsNotInCombatTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "hyjal summit bot is not in combat") {} bool IsActive() override; }; @@ -22,37 +23,32 @@ class HyjalSummitBotIsNotInCombatTrigger : public Trigger class RageWinterchillPullingBossTrigger : public Trigger { public: - RageWinterchillPullingBossTrigger(PlayerbotAI* botAI) : Trigger(botAI, "rage winterchill pulling boss") {} + RageWinterchillPullingBossTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "rage winterchill pulling boss") {} bool IsActive() override; }; class RageWinterchillBossEngagedByMainTankTrigger : public Trigger { public: - RageWinterchillBossEngagedByMainTankTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "rage winterchill boss engaged by main tank") - { - } + RageWinterchillBossEngagedByMainTankTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "rage winterchill boss engaged by main tank") {} bool IsActive() override; }; class RageWinterchillBossCastsDeathAndDecayTrigger : public Trigger { public: - RageWinterchillBossCastsDeathAndDecayTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "rage winterchill boss casts death and decay") - { - } + RageWinterchillBossCastsDeathAndDecayTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "rage winterchill boss casts death and decay") {} bool IsActive() override; }; class RageWinterchillBotIsStandingInDeathAndDecayTrigger : public Trigger { public: - RageWinterchillBotIsStandingInDeathAndDecayTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "rage winterchill bot is standing in death and decay") - { - } + RageWinterchillBotIsStandingInDeathAndDecayTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "rage winterchill bot is standing in death and decay") {} bool IsActive() override; }; @@ -61,51 +57,48 @@ class RageWinterchillBotIsStandingInDeathAndDecayTrigger : public Trigger class AnetheronPullingBossOrInfernalTrigger : public Trigger { public: - AnetheronPullingBossOrInfernalTrigger(PlayerbotAI* botAI) : Trigger(botAI, "anetheron pulling boss or infernal") {} + AnetheronPullingBossOrInfernalTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "anetheron pulling boss or infernal") {} bool IsActive() override; }; class AnetheronBossEngagedByMainTankTrigger : public Trigger { public: - AnetheronBossEngagedByMainTankTrigger(PlayerbotAI* botAI) : Trigger(botAI, "anetheron boss engaged by main tank") {} + AnetheronBossEngagedByMainTankTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "anetheron boss engaged by main tank") {} bool IsActive() override; }; class AnetheronBossCastsCarrionSwarmTrigger : public Trigger { public: - AnetheronBossCastsCarrionSwarmTrigger(PlayerbotAI* botAI) : Trigger(botAI, "anetheron boss casts carrion swarm") {} + AnetheronBossCastsCarrionSwarmTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "anetheron boss casts carrion swarm") {} bool IsActive() override; }; class AnetheronBotIsTargetedByInfernalTrigger : public Trigger { public: - AnetheronBotIsTargetedByInfernalTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "anetheron bot is targeted by infernal") - { - } + AnetheronBotIsTargetedByInfernalTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "anetheron bot is targeted by infernal") {} bool IsActive() override; }; class AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger : public Trigger { public: - AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "anetheron infernals need to be kept away from raid") - { - } + AnetheronInfernalsNeedToBeKeptAwayFromRaidTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "anetheron infernals need to be kept away from raid") {} bool IsActive() override; }; class AnetheronInfernalsContinueToSpawnTrigger : public Trigger { public: - AnetheronInfernalsContinueToSpawnTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "anetheron infernals continue to spawn") - { - } + AnetheronInfernalsContinueToSpawnTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "anetheron infernals continue to spawn") {} bool IsActive() override; }; @@ -114,48 +107,48 @@ class AnetheronInfernalsContinueToSpawnTrigger : public Trigger class KazrogalPullingBossTrigger : public Trigger { public: - KazrogalPullingBossTrigger(PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal pulling boss") {} + KazrogalPullingBossTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal pulling boss") {} bool IsActive() override; }; class KazrogalBossEngagedByMainTankTrigger : public Trigger { public: - KazrogalBossEngagedByMainTankTrigger(PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal boss engaged by main tank") {} + KazrogalBossEngagedByMainTankTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal boss engaged by main tank") {} bool IsActive() override; }; class KazrogalBossEngagedByAssistTanksTrigger : public Trigger { public: - KazrogalBossEngagedByAssistTanksTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "kaz'rogal boss engaged by assist tanks") - { - } + KazrogalBossEngagedByAssistTanksTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal boss engaged by assist tanks") {} bool IsActive() override; }; class KazrogalLowManaBotsNeedEscapePathTrigger : public Trigger { public: - KazrogalLowManaBotsNeedEscapePathTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "kaz'rogal low mana bots need escape path") - { - } + KazrogalLowManaBotsNeedEscapePathTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal low mana bots need escape path") {} bool IsActive() override; }; class KazrogalBotIsLowOnManaTrigger : public Trigger { public: - KazrogalBotIsLowOnManaTrigger(PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal bot is low on mana") {} + KazrogalBotIsLowOnManaTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal bot is low on mana") {} bool IsActive() override; }; class KazrogalMarkDealsShadowDamageTrigger : public Trigger { public: - KazrogalMarkDealsShadowDamageTrigger(PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal mark deals shadow damage") {} + KazrogalMarkDealsShadowDamageTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "kaz'rogal mark deals shadow damage") {} bool IsActive() override; }; @@ -164,70 +157,64 @@ class KazrogalMarkDealsShadowDamageTrigger : public Trigger class AzgalorPullingBossTrigger : public Trigger { public: - AzgalorPullingBossTrigger(PlayerbotAI* botAI) : Trigger(botAI, "azgalor pulling boss") {} + AzgalorPullingBossTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "azgalor pulling boss") {} bool IsActive() override; }; class AzgalorBossEngagedByMainTankTrigger : public Trigger { public: - AzgalorBossEngagedByMainTankTrigger(PlayerbotAI* botAI) : Trigger(botAI, "azgalor boss engaged by main tank") {} + AzgalorBossEngagedByMainTankTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "azgalor boss engaged by main tank") {} bool IsActive() override; }; class AzgalorMainTankIsPositioningBossTrigger : public Trigger { public: - AzgalorMainTankIsPositioningBossTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "azgalor main tank is positioning boss") - { - } + AzgalorMainTankIsPositioningBossTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "azgalor main tank is positioning boss") {} bool IsActive() override; }; class AzgalorBossCastsRainOfFireOnRangedTrigger : public Trigger { public: - AzgalorBossCastsRainOfFireOnRangedTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "azgalor boss casts rain of fire on ranged") - { - } + AzgalorBossCastsRainOfFireOnRangedTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "azgalor boss casts rain of fire on ranged") {} bool IsActive() override; }; class AzgalorBossCastsRainOfFireOnMeleeTrigger : public Trigger { public: - AzgalorBossCastsRainOfFireOnMeleeTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "azgalor boss casts rain of fire on melee") - { - } + AzgalorBossCastsRainOfFireOnMeleeTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "azgalor boss casts rain of fire on melee") {} bool IsActive() override; }; class AzgalorBotIsDoomedTrigger : public Trigger { public: - AzgalorBotIsDoomedTrigger(PlayerbotAI* botAI) : Trigger(botAI, "azgalor bot is doomed") {} + AzgalorBotIsDoomedTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "azgalor bot is doomed") {} bool IsActive() override; }; class AzgalorDoomguardsMustBeControlledTrigger : public Trigger { public: - AzgalorDoomguardsMustBeControlledTrigger(PlayerbotAI* botAI) - : Trigger(botAI, "azgalor doomguards must be controlled") - { - } + AzgalorDoomguardsMustBeControlledTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "azgalor doomguards must be controlled") {} bool IsActive() override; }; class AzgalorDoomguardsContinueToSpawnTrigger : public Trigger { public: - AzgalorDoomguardsContinueToSpawnTrigger(PlayerbotAI* botAI) : Trigger(botAI, "azgalor doomguards continue to spawn") - { - } + AzgalorDoomguardsContinueToSpawnTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "azgalor doomguards continue to spawn") {} bool IsActive() override; }; @@ -236,44 +223,48 @@ class AzgalorDoomguardsContinueToSpawnTrigger : public Trigger class ArchimondePullingBossTrigger : public Trigger { public: - ArchimondePullingBossTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde pulling boss") {} + ArchimondePullingBossTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "archimonde pulling boss") {} bool IsActive() override; }; class ArchimondeBossEngagedByMainTankTrigger : public Trigger { public: - ArchimondeBossEngagedByMainTankTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss engaged by main tank") - { - } + ArchimondeBossEngagedByMainTankTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss engaged by main tank") {} bool IsActive() override; }; class ArchimondeBossCastsFearTrigger : public Trigger { public: - ArchimondeBossCastsFearTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss casts fear") {} + ArchimondeBossCastsFearTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss casts fear") {} bool IsActive() override; }; class ArchimondeBossCastsAirBurstTrigger : public Trigger { public: - ArchimondeBossCastsAirBurstTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss casts air burst") {} + ArchimondeBossCastsAirBurstTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss casts air burst") {} bool IsActive() override; }; class ArchimondeBossSummonedDoomfireTrigger : public Trigger { public: - ArchimondeBossSummonedDoomfireTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss summoned doomfire") {} + ArchimondeBossSummonedDoomfireTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "archimonde boss summoned doomfire") {} bool IsActive() override; }; class ArchimondeBotStoodInDoomfireTrigger : public Trigger { public: - ArchimondeBotStoodInDoomfireTrigger(PlayerbotAI* botAI) : Trigger(botAI, "archimonde bot stood in doomfire") {} + ArchimondeBotStoodInDoomfireTrigger( + PlayerbotAI* botAI) : Trigger(botAI, "archimonde bot stood in doomfire") {} bool IsActive() override; }; diff --git a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.cpp b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.cpp index 9c5268c4261..061ea7d5c85 100644 --- a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.cpp +++ b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.cpp @@ -13,209 +13,210 @@ namespace HyjalSummitHelpers { -DeathAndDecayData* GetActiveWinterchillDeathAndDecay(uint32 instanceId) -{ - auto instanceIt = deathAndDecayPosition.find(instanceId); - if (instanceIt == deathAndDecayPosition.end()) - return nullptr; - - uint32 now = getMSTime(); - if (getMSTimeDiff(instanceIt->second.spawnTime, now) >= WINTERCHILL_DEATH_AND_DECAY_DURATION) + DeathAndDecayData* GetActiveWinterchillDeathAndDecay(uint32 instanceId) { - deathAndDecayPosition.erase(instanceIt); - return nullptr; - } + auto instanceIt = deathAndDecayPosition.find(instanceId); + if (instanceIt == deathAndDecayPosition.end()) + return nullptr; - return &instanceIt->second; -} + uint32 now = getMSTime(); + if (getMSTimeDiff(instanceIt->second.spawnTime, now) >= WINTERCHILL_DEATH_AND_DECAY_DURATION) + { + deathAndDecayPosition.erase(instanceIt); + return nullptr; + } -std::unordered_map* GetActiveAzgalorRainOfFire(uint32 instanceId) -{ - auto instanceIt = rainOfFirePosition.find(instanceId); - if (instanceIt == rainOfFirePosition.end()) - return nullptr; + return &instanceIt->second; + } - uint32 now = getMSTime(); - auto& dynObjMap = instanceIt->second; - for (auto it = dynObjMap.begin(); it != dynObjMap.end();) + std::unordered_map* GetActiveAzgalorRainOfFire(uint32 instanceId) { - if (getMSTimeDiff(it->second.spawnTime, now) >= AZGALOR_RAIN_OF_FIRE_DURATION) - it = dynObjMap.erase(it); - else - ++it; + auto instanceIt = rainOfFirePosition.find(instanceId); + if (instanceIt == rainOfFirePosition.end()) + return nullptr; + + uint32 now = getMSTime(); + auto& dynObjMap = instanceIt->second; + for (auto it = dynObjMap.begin(); it != dynObjMap.end(); ) + { + if (getMSTimeDiff(it->second.spawnTime, now) >= AZGALOR_RAIN_OF_FIRE_DURATION) + it = dynObjMap.erase(it); + else + ++it; + } + + if (dynObjMap.empty()) + { + rainOfFirePosition.erase(instanceIt); + return nullptr; + } + + return &dynObjMap; } - if (dynObjMap.empty()) + // General + + RangedGroups GetRangedGroups(PlayerbotAI* botAI, Player* bot) { - rainOfFirePosition.erase(instanceIt); - return nullptr; - } + RangedGroups result; + Group* group = bot->GetGroup(); + if (!group) + return result; - return &dynObjMap; -} + for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) + { + Player* member = ref->GetSource(); + if (!member || !botAI->IsRanged(member)) + continue; -// General + if (botAI->IsHeal(member)) + result.healers.push_back(member); + else + result.rangedDps.push_back(member); + } -RangedGroups GetRangedGroups(PlayerbotAI* botAI, Player* bot) -{ - RangedGroups result; - Group* group = bot->GetGroup(); - if (!group) return result; + } - for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) + std::pair GetBotCircleIndexAndCount(PlayerbotAI* botAI, Player* bot, + const RangedGroups& groups) { - Player* member = ref->GetSource(); - if (!member || !botAI->IsRanged(member)) - continue; - - if (botAI->IsHeal(member)) - result.healers.push_back(member); - else - result.rangedDps.push_back(member); + const std::vector& vec = botAI->IsHeal(bot) ? groups.healers : groups.rangedDps; + auto it = std::find(vec.begin(), vec.end(), bot); + size_t index = (it != vec.end()) ? std::distance(vec.begin(), it) : 0; + + return {index, vec.size()}; } - return result; -} + // Rage Winterchill -std::pair GetBotCircleIndexAndCount(PlayerbotAI* botAI, Player* bot, const RangedGroups& groups) -{ - const std::vector& vec = botAI->IsHeal(bot) ? groups.healers : groups.rangedDps; - auto it = std::find(vec.begin(), vec.end(), bot); - size_t index = (it != vec.end()) ? std::distance(vec.begin(), it) : 0; - - return {index, vec.size()}; -} + const Position WINTERCHILL_TANK_POSITION = { 5031.061f, -1784.521f, 1321.626f }; + std::unordered_map hasReachedWinterchillPosition; + std::unordered_map deathAndDecayPosition; -// Rage Winterchill + bool IsBotInsideActiveWinterchillDeathAndDecay(Player* bot, float radius) + { + if (!bot || !bot->GetMap()) + return false; -const Position WINTERCHILL_TANK_POSITION = {5031.061f, -1784.521f, 1321.626f}; -std::unordered_map hasReachedWinterchillPosition; -std::unordered_map deathAndDecayPosition; + DeathAndDecayData* data = GetActiveWinterchillDeathAndDecay(bot->GetMap()->GetInstanceId()); + if (!data) + return false; -bool IsBotInsideActiveWinterchillDeathAndDecay(Player* bot, float radius) -{ - if (!bot || !bot->GetMap()) - return false; + return bot->GetExactDist2d(data->position) < radius; + } - DeathAndDecayData* data = GetActiveWinterchillDeathAndDecay(bot->GetMap()->GetInstanceId()); - if (!data) - return false; + // Anetheron - return bot->GetExactDist2d(data->position) < radius; -} + const Position ANETHERON_TANK_POSITION = { 5033.177f, -1765.996f, 1324.195f }; + const Position ANETHERON_E_INFERNAL_POSITION = { 5016.578f, -1800.233f, 1323.070f }; + const Position ANETHERON_W_INFERNAL_POSITION = { 5048.911f, -1722.164f, 1321.408f }; + std::unordered_map hasReachedAnetheronPosition; -// Anetheron + Player* GetInfernoTarget(Unit* anetheron) + { + if (!anetheron) + return nullptr; -const Position ANETHERON_TANK_POSITION = {5033.177f, -1765.996f, 1324.195f}; -const Position ANETHERON_E_INFERNAL_POSITION = {5016.578f, -1800.233f, 1323.070f}; -const Position ANETHERON_W_INFERNAL_POSITION = {5048.911f, -1722.164f, 1321.408f}; -std::unordered_map hasReachedAnetheronPosition; + Spell* spell = anetheron->GetCurrentSpell(CURRENT_GENERIC_SPELL); + if (spell && spell->m_spellInfo->Id == + static_cast(HyjalSummitSpells::SPELL_INFERNO)) + { + Unit* spellTarget = spell->m_targets.GetUnitTarget(); + if (spellTarget && spellTarget->IsPlayer()) + return spellTarget->ToPlayer(); + } -Player* GetInfernoTarget(Unit* anetheron) -{ - if (!anetheron) return nullptr; + } - Spell* spell = anetheron->GetCurrentSpell(CURRENT_GENERIC_SPELL); - if (spell && spell->m_spellInfo->Id == static_cast(HyjalSummitSpells::SPELL_INFERNO)) + const Position& GetClosestInfernalTankPosition(Player* bot) { - Unit* spellTarget = spell->m_targets.GetUnitTarget(); - if (spellTarget && spellTarget->IsPlayer()) - return spellTarget->ToPlayer(); + const Position& east = ANETHERON_E_INFERNAL_POSITION; + const Position& west = ANETHERON_W_INFERNAL_POSITION; + return (bot->GetExactDist2d(east.GetPositionX(), east.GetPositionY()) <= + bot->GetExactDist2d(west.GetPositionX(), west.GetPositionY())) ? east : west; } - return nullptr; -} + // Kaz'rogal -const Position& GetClosestInfernalTankPosition(Player* bot) -{ - const Position& east = ANETHERON_E_INFERNAL_POSITION; - const Position& west = ANETHERON_W_INFERNAL_POSITION; - return (bot->GetExactDist2d(east.GetPositionX(), east.GetPositionY()) <= - bot->GetExactDist2d(west.GetPositionX(), west.GetPositionY())) - ? east - : west; -} + const Position KAZROGAL_TANK_TRANSITION_POSITION = { 5528.792f, -2636.486f, 1481.293f }; + const Position KAZROGAL_TANK_FINAL_POSITION = { 5511.514f, -2662.466f, 1480.288f }; + std::unordered_map kazrogalTankStep; + std::unordered_map isBelowManaThreshold; -// Kaz'rogal + TankPositionState GetKazrogalTankPositionState(PlayerbotAI* botAI, Player* bot) + { + Player* mainTank = GetGroupMainTank(botAI, bot); + if (!mainTank) + return TankPositionState::Unknown; -const Position KAZROGAL_TANK_TRANSITION_POSITION = {5528.792f, -2636.486f, 1481.293f}; -const Position KAZROGAL_TANK_FINAL_POSITION = {5511.514f, -2662.466f, 1480.288f}; -std::unordered_map kazrogalTankStep; -std::unordered_map isBelowManaThreshold; + auto it = kazrogalTankStep.find(mainTank->GetGUID()); + if (it != kazrogalTankStep.end()) + return it->second; -TankPositionState GetKazrogalTankPositionState(PlayerbotAI* botAI, Player* bot) -{ - Player* mainTank = GetGroupMainTank(botAI, bot); - if (!mainTank) return TankPositionState::Unknown; + } - auto it = kazrogalTankStep.find(mainTank->GetGUID()); - if (it != kazrogalTankStep.end()) - return it->second; + // Azgalor - return TankPositionState::Unknown; -} + const Position AZGALOR_TANK_TRANSITION_POSITION = { 5486.787f, -2696.215f, 1482.007f }; + const Position AZGALOR_TANK_FINAL_POSITION = { 5496.379f, -2675.265f, 1481.053f }; + const Position AZGALOR_DOOMGUARD_POSITION = { 5485.555f, -2731.659f, 1485.555f }; + std::unordered_map azgalorTankStep; + std::unordered_map> rainOfFirePosition; -// Azgalor + TankPositionState GetAzgalorTankPositionState(PlayerbotAI* botAI, Player* bot) + { + Player* mainTank = GetGroupMainTank(botAI, bot); + if (!mainTank) + return TankPositionState::Unknown; -const Position AZGALOR_TANK_TRANSITION_POSITION = {5486.787f, -2696.215f, 1482.007f}; -const Position AZGALOR_TANK_FINAL_POSITION = {5496.379f, -2675.265f, 1481.053f}; -const Position AZGALOR_DOOMGUARD_POSITION = {5485.555f, -2731.659f, 1485.555f}; -std::unordered_map azgalorTankStep; -std::unordered_map> rainOfFirePosition; + auto it = azgalorTankStep.find(mainTank->GetGUID()); + if (it != azgalorTankStep.end()) + return it->second; -TankPositionState GetAzgalorTankPositionState(PlayerbotAI* botAI, Player* bot) -{ - Player* mainTank = GetGroupMainTank(botAI, bot); - if (!mainTank) return TankPositionState::Unknown; + } - auto it = azgalorTankStep.find(mainTank->GetGUID()); - if (it != azgalorTankStep.end()) - return it->second; + bool IsBotInsideActiveAzgalorRainOfFire(Player* bot, float radius) + { + if (!bot || !bot->GetMap()) + return false; - return TankPositionState::Unknown; -} + std::unordered_map* dynObjMap = + GetActiveAzgalorRainOfFire(bot->GetMap()->GetInstanceId()); + if (!dynObjMap) + return false; -bool IsBotInsideActiveAzgalorRainOfFire(Player* bot, float radius) -{ - if (!bot || !bot->GetMap()) - return false; + for (auto const& entry : *dynObjMap) + { + if (bot->GetExactDist2d(entry.second.position) < radius) + return true; + } - std::unordered_map* dynObjMap = - GetActiveAzgalorRainOfFire(bot->GetMap()->GetInstanceId()); - if (!dynObjMap) return false; - - for (auto const& entry : *dynObjMap) - { - if (bot->GetExactDist2d(entry.second.position) < radius) - return true; } - return false; -} - -bool AnyGroupMemberHasDoom(Player* bot) -{ - if (Group* group = bot->GetGroup()) + bool AnyGroupMemberHasDoom(Player* bot) { - for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) + if (Group* group = bot->GetGroup()) { - Player* member = ref->GetSource(); - if (member && member->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) - return true; + for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) + { + Player* member = ref->GetSource(); + if (member && + member->HasAura(static_cast(HyjalSummitSpells::SPELL_DOOM))) + return true; + } } - } - return false; -} + return false; + } -// Archimonde + // Archimonde -const Position ARCHIMONDE_INITIAL_POSITION = {5640.502f, -3421.238f, 1587.453f}; -std::unordered_map> doomfireTrails; -std::unordered_map doomfireLastSampleTime; -} // namespace HyjalSummitHelpers + const Position ARCHIMONDE_INITIAL_POSITION = { 5640.502f, -3421.238f, 1587.453f }; + std::unordered_map> doomfireTrails; + std::unordered_map doomfireLastSampleTime; +} diff --git a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h index fe7514ed172..6dadc51eddf 100644 --- a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h +++ b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h @@ -16,112 +16,113 @@ namespace HyjalSummitHelpers { -enum class HyjalSummitSpells : uint32 -{ + enum class HyjalSummitSpells : uint32 + { + // Rage Winterchill + SPELL_DEATH_AND_DECAY = 31258, + + // Anetheron + SPELL_INFERNO = 31299, + + // Kaz'rogal + SPELL_MARK_OF_KAZROGAL = 31447, + + // Azgalor + SPELL_RAIN_OF_FIRE = 31340, + SPELL_DOOM = 31347, + + // Archimonde + SPELL_DOOMFIRE = 31944, // Damaging part of trail + SPELL_DOOMFIRE_DOT = 31969, // DoT after exiting trail + SPELL_ARCHIMONDE_FEAR = 31970, + SPELL_AIR_BURST = 32014, + + // Hunter + SPELL_MISDIRECTION = 35079, + + // Priest + SPELL_FEAR_WARD = 6346, + }; + + enum class HyjalSummitNpcs : uint32 + { + // Archimonde + NPC_DOOMFIRE = 18095, + }; + + enum class TankPositionState : uint8 + { + MovingToTransition = 0, + MovingToFinal = 1, + Positioned = 2, + Unknown = 255, + }; + + // General + constexpr uint32 HYJAL_SUMMIT_MAP_ID = 534; + struct RangedGroups + { + std::vector healers; + std::vector rangedDps; + }; + RangedGroups GetRangedGroups(PlayerbotAI* botAI, Player* bot); + std::pair GetBotCircleIndexAndCount(PlayerbotAI* botAI, Player* bot, + const RangedGroups& groups); + // Rage Winterchill - SPELL_DEATH_AND_DECAY = 31258, + extern const Position WINTERCHILL_TANK_POSITION; + extern std::unordered_map hasReachedWinterchillPosition; + constexpr uint32 WINTERCHILL_DEATH_AND_DECAY_DURATION = 20000; + struct DeathAndDecayData + { + Position position; + uint32 spawnTime; + }; + extern std::unordered_map deathAndDecayPosition; + DeathAndDecayData* GetActiveWinterchillDeathAndDecay(uint32 instanceId); + bool IsBotInsideActiveWinterchillDeathAndDecay(Player* bot, float radius); // Anetheron - SPELL_INFERNO = 31299, + extern const Position ANETHERON_TANK_POSITION; + extern const Position ANETHERON_E_INFERNAL_POSITION; + extern const Position ANETHERON_W_INFERNAL_POSITION; + extern std::unordered_map hasReachedAnetheronPosition; + Player* GetInfernoTarget(Unit* anetheron); + const Position& GetClosestInfernalTankPosition(Player* bot); // Kaz'rogal - SPELL_MARK_OF_KAZROGAL = 31447, + extern const Position KAZROGAL_TANK_TRANSITION_POSITION; + extern const Position KAZROGAL_TANK_FINAL_POSITION; + extern std::unordered_map kazrogalTankStep; + extern std::unordered_map isBelowManaThreshold; + TankPositionState GetKazrogalTankPositionState(PlayerbotAI* botAI, Player* bot); // Azgalor - SPELL_RAIN_OF_FIRE = 31340, - SPELL_DOOM = 31347, - - // Archimonde - SPELL_DOOMFIRE = 31944, // Damaging part of trail - SPELL_DOOMFIRE_DOT = 31969, // DoT after exiting trail - SPELL_ARCHIMONDE_FEAR = 31970, - SPELL_AIR_BURST = 32014, + extern const Position AZGALOR_TANK_TRANSITION_POSITION; + extern const Position AZGALOR_TANK_FINAL_POSITION; + extern const Position AZGALOR_DOOMGUARD_POSITION; + extern std::unordered_map azgalorTankStep; + constexpr uint32 AZGALOR_RAIN_OF_FIRE_DURATION = 10000; + struct RainOfFireData + { + Position position; + uint32 spawnTime; + }; + extern std::unordered_map> rainOfFirePosition; + TankPositionState GetAzgalorTankPositionState(PlayerbotAI* botAI, Player* bot); + std::unordered_map* GetActiveAzgalorRainOfFire(uint32 instanceId); + bool IsBotInsideActiveAzgalorRainOfFire(Player* bot, float radius); + bool AnyGroupMemberHasDoom(Player* bot); - // Hunter - SPELL_MISDIRECTION = 35079, - - // Priest - SPELL_FEAR_WARD = 6346, -}; - -enum class HyjalSummitNpcs : uint32 -{ // Archimonde - NPC_DOOMFIRE = 18095, -}; - -enum class TankPositionState : uint8 -{ - MovingToTransition = 0, - MovingToFinal = 1, - Positioned = 2, - Unknown = 255, -}; - -// General -constexpr uint32 HYJAL_SUMMIT_MAP_ID = 534; -struct RangedGroups -{ - std::vector healers; - std::vector rangedDps; -}; -RangedGroups GetRangedGroups(PlayerbotAI* botAI, Player* bot); -std::pair GetBotCircleIndexAndCount(PlayerbotAI* botAI, Player* bot, const RangedGroups& groups); - -// Rage Winterchill -extern const Position WINTERCHILL_TANK_POSITION; -extern std::unordered_map hasReachedWinterchillPosition; -constexpr uint32 WINTERCHILL_DEATH_AND_DECAY_DURATION = 20000; -struct DeathAndDecayData -{ - Position position; - uint32 spawnTime; -}; -extern std::unordered_map deathAndDecayPosition; -DeathAndDecayData* GetActiveWinterchillDeathAndDecay(uint32 instanceId); -bool IsBotInsideActiveWinterchillDeathAndDecay(Player* bot, float radius); - -// Anetheron -extern const Position ANETHERON_TANK_POSITION; -extern const Position ANETHERON_E_INFERNAL_POSITION; -extern const Position ANETHERON_W_INFERNAL_POSITION; -extern std::unordered_map hasReachedAnetheronPosition; -Player* GetInfernoTarget(Unit* anetheron); -const Position& GetClosestInfernalTankPosition(Player* bot); - -// Kaz'rogal -extern const Position KAZROGAL_TANK_TRANSITION_POSITION; -extern const Position KAZROGAL_TANK_FINAL_POSITION; -extern std::unordered_map kazrogalTankStep; -extern std::unordered_map isBelowManaThreshold; -TankPositionState GetKazrogalTankPositionState(PlayerbotAI* botAI, Player* bot); - -// Azgalor -extern const Position AZGALOR_TANK_TRANSITION_POSITION; -extern const Position AZGALOR_TANK_FINAL_POSITION; -extern const Position AZGALOR_DOOMGUARD_POSITION; -extern std::unordered_map azgalorTankStep; -constexpr uint32 AZGALOR_RAIN_OF_FIRE_DURATION = 10000; -struct RainOfFireData -{ - Position position; - uint32 spawnTime; -}; -extern std::unordered_map> rainOfFirePosition; -TankPositionState GetAzgalorTankPositionState(PlayerbotAI* botAI, Player* bot); -std::unordered_map* GetActiveAzgalorRainOfFire(uint32 instanceId); -bool IsBotInsideActiveAzgalorRainOfFire(Player* bot, float radius); -bool AnyGroupMemberHasDoom(Player* bot); - -// Archimonde -struct DoomfireTrailData -{ - Position position; - uint32 recordTime; -}; -extern const Position ARCHIMONDE_INITIAL_POSITION; -extern std::unordered_map> doomfireTrails; -extern std::unordered_map doomfireLastSampleTime; -} // namespace HyjalSummitHelpers + struct DoomfireTrailData + { + Position position; + uint32 recordTime; + }; + extern const Position ARCHIMONDE_INITIAL_POSITION; + extern std::unordered_map> doomfireTrails; + extern std::unordered_map doomfireLastSampleTime; +} #endif diff --git a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitScripts.cpp b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitScripts.cpp index 1f29ae5a810..a370e9bf42b 100644 --- a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitScripts.cpp +++ b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitScripts.cpp @@ -3,10 +3,10 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ +#include "RaidHyjalSummitHelpers.h" #include "AllCreatureScript.h" #include "DynamicObjectScript.h" #include "Playerbots.h" -#include "RaidHyjalSummitHelpers.h" #include "ScriptMgr.h" #include "Timer.h" @@ -44,9 +44,11 @@ class ArchimondeDoomfireTrailScript : public AllCreatureScript trail.push_back(data); constexpr uint32 TRAIL_DURATION = 18000; - trail.erase(std::remove_if(trail.begin(), trail.end(), [now](const DoomfireTrailData& d) - { return getMSTimeDiff(d.recordTime, now) > TRAIL_DURATION; }), - trail.end()); + trail.erase(std::remove_if(trail.begin(), trail.end(), + [now](const DoomfireTrailData& d) + { + return getMSTimeDiff(d.recordTime, now) > TRAIL_DURATION; + }), trail.end()); constexpr float DOOMFIRE_DANGER_RANGE = 10.0f; Map::PlayerList const& players = creature->GetMap()->GetPlayers(); @@ -94,7 +96,7 @@ class AzgalorRainOfFireScript : public DynamicObjectScript auto& instanceMap = rainOfFirePosition[instanceId]; ObjectGuid guid = dynobj->GetGUID(); - instanceMap.try_emplace(guid, RainOfFireData{dynobj->GetPosition(), now}); + instanceMap.try_emplace(guid, RainOfFireData{ dynobj->GetPosition(), now }); } }; @@ -111,7 +113,7 @@ class RageWinterchillDeathAndDecayScript : public DynamicObjectScript return; deathAndDecayPosition[dynobj->GetMap()->GetInstanceId()] = - DeathAndDecayData{dynobj->GetPosition(), getMSTime()}; + DeathAndDecayData{ dynobj->GetPosition(), getMSTime() }; } }; From d278714b030e1fffbdbee911d5f427efcce618a2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 21:44:28 +0000 Subject: [PATCH 3/3] Document Winterchill avoidance radii Agent-Logs-Url: https://github.com/brighton-chi/mod-playerbots/sessions/28459f39-4269-42c9-9b34-eb504d2897c1 Co-authored-by: brighton-chi <190869400+brighton-chi@users.noreply.github.com> --- src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp | 3 ++- .../HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp | 2 +- src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp | 2 +- src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h | 5 +++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp index 68f3461e785..bd87431f0c5 100644 --- a/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp +++ b/src/Ai/Raid/HyjalSummit/Action/RaidHyjalSummitActions.cpp @@ -174,7 +174,8 @@ bool RageWinterchillSpreadRangedInCircleAction::Execute(Event /*event*/) bool RageWinterchillMoveAwayFromDeathAndDecayAction::Execute(Event /*event*/) { Unit* winterchill = AI_VALUE2(Unit*, "find target", "rage winterchill"); - if (!winterchill || !IsBotInsideActiveWinterchillDeathAndDecay(bot, 17.0f)) + if (!winterchill || + !IsBotInsideActiveWinterchillDeathAndDecay(bot, WINTERCHILL_DEATH_AND_DECAY_ACTION_RADIUS)) return false; return MoveAway(winterchill, 5.0f); diff --git a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp index 17f089ad6cb..73b9d380826 100644 --- a/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp +++ b/src/Ai/Raid/HyjalSummit/Multiplier/RaidHyjalSummitMultipliers.cpp @@ -86,7 +86,7 @@ float RageWinterchillControlDeathAndDecayAvoidanceMultiplier::GetValue(Action* a if (botAI->IsTank(bot) || !AI_VALUE2(Unit*, "find target", "rage winterchill")) return 1.0f; - if (IsBotInsideActiveWinterchillDeathAndDecay(bot, 23.0f)) + if (IsBotInsideActiveWinterchillDeathAndDecay(bot, WINTERCHILL_DEATH_AND_DECAY_CONTROL_RADIUS)) { if (dynamic_cast(action)) return 0.0f; diff --git a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp index 012c7dc9bc9..32fde01e9a3 100644 --- a/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp +++ b/src/Ai/Raid/HyjalSummit/Trigger/RaidHyjalSummitTriggers.cpp @@ -50,7 +50,7 @@ bool RageWinterchillBotIsStandingInDeathAndDecayTrigger::IsActive() if (!AI_VALUE2(Unit*, "find target", "rage winterchill")) return false; - return IsBotInsideActiveWinterchillDeathAndDecay(bot, 16.0f); + return IsBotInsideActiveWinterchillDeathAndDecay(bot, WINTERCHILL_DEATH_AND_DECAY_TRIGGER_RADIUS); } // Anetheron diff --git a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h index 6dadc51eddf..4cb57bf9867 100644 --- a/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h +++ b/src/Ai/Raid/HyjalSummit/Util/RaidHyjalSummitHelpers.h @@ -73,6 +73,11 @@ namespace HyjalSummitHelpers extern const Position WINTERCHILL_TANK_POSITION; extern std::unordered_map hasReachedWinterchillPosition; constexpr uint32 WINTERCHILL_DEATH_AND_DECAY_DURATION = 20000; + // Match Azgalor-style escape thresholds: detect inside the effect, keep moving + // until slightly clear, and hold competing movement a bit longer to avoid churn. + constexpr float WINTERCHILL_DEATH_AND_DECAY_TRIGGER_RADIUS = 16.0f; + constexpr float WINTERCHILL_DEATH_AND_DECAY_ACTION_RADIUS = 17.0f; + constexpr float WINTERCHILL_DEATH_AND_DECAY_CONTROL_RADIUS = 23.0f; struct DeathAndDecayData { Position position;