From fb839823af506ec4a4250d6c692666444dca2bce Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 26 May 2024 23:44:10 +0800 Subject: [PATCH] [Raid] Sync with azerothcore (update the core before pull this commit) --- .../raids/naxxramas/RaidNaxxActions.cpp | 6 ++-- .../raids/naxxramas/RaidNaxxBossHelper.h | 31 ++++++++++--------- .../raids/naxxramas/RaidNaxxMultipliers.cpp | 4 +-- .../raids/naxxramas/RaidNaxxTriggers.cpp | 4 +-- .../raids/naxxramas/RaidNaxxTriggers.h | 4 +-- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/strategy/raids/naxxramas/RaidNaxxActions.cpp b/src/strategy/raids/naxxramas/RaidNaxxActions.cpp index ebebeb4b..152f0ae1 100644 --- a/src/strategy/raids/naxxramas/RaidNaxxActions.cpp +++ b/src/strategy/raids/naxxramas/RaidNaxxActions.cpp @@ -46,7 +46,7 @@ uint32 GrobbulusRotateAction::GetCurrWaypoint() if (!boss) { return false; } - auto* boss_ai = dynamic_cast(boss->GetAI()); + auto* boss_ai = dynamic_cast(boss->GetAI()); EventMap* eventMap = &boss_ai->events; const uint32 event_time = eventMap->GetNextEventTime(2); return (event_time / 15000) % intervals; @@ -57,7 +57,7 @@ bool HeiganDanceAction::CalculateSafe() { if (!boss) { return false; } - boss_heigan::boss_heiganAI* boss_ai = dynamic_cast(boss->GetAI()); + auto* boss_ai = dynamic_cast(boss->GetAI()); EventMap* eventMap = &boss_ai->events; uint32 curr_phase = boss_ai->currentPhase; uint32 curr_erupt = eventMap->GetNextEventTime(3); @@ -638,7 +638,7 @@ bool AnubrekhanPositionAction::Execute(Event event) if (!boss) { return false; } - boss_anubrekhan::boss_anubrekhanAI* boss_ai = dynamic_cast(boss->GetAI()); + auto* boss_ai = dynamic_cast(boss->GetAI()); if (!boss_ai) { return false; } diff --git a/src/strategy/raids/naxxramas/RaidNaxxBossHelper.h b/src/strategy/raids/naxxramas/RaidNaxxBossHelper.h index 35b59e35..6c2089e2 100644 --- a/src/strategy/raids/naxxramas/RaidNaxxBossHelper.h +++ b/src/strategy/raids/naxxramas/RaidNaxxBossHelper.h @@ -5,6 +5,7 @@ #include "AiObjectContext.h" #include "EventMap.h" #include "Log.h" +#include "NamedObjectContext.h" #include "ObjectGuid.h" #include "Player.h" #include "PlayerbotAI.h" @@ -68,14 +69,14 @@ class GenericBossHelper : public AiObject { uint32 _timer = 0; }; -class KelthuzadBossHelper: public GenericBossHelper { +class KelthuzadBossHelper: public GenericBossHelper { public: KelthuzadBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "kel'thuzad") {} const std::pair center = {3716.19f, -5106.58f}; const std::pair tank_pos = {3709.19f, -5104.86f}; const std::pair assist_tank_pos = {3746.05f, -5112.74f}; bool IsPhaseOne() { - return _event_map->GetNextEventTime(KELTHUZAD_EVENT_PHASE_2) != 0; + return _event_map->GetNextEventTime(Kelthuzad::KELTHUZAD_EVENT_PHASE_2) != 0; } bool IsPhaseTwo() { return !IsPhaseOne(); @@ -96,12 +97,12 @@ class KelthuzadBossHelper: public GenericBossHelper { +class RazuviousBossHelper: public GenericBossHelper { public: RazuviousBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "instructor razuvious") {} }; -class SapphironBossHelper: public GenericBossHelper { +class SapphironBossHelper: public GenericBossHelper { public: const std::pair mainTankPos = {3512.07f, -5274.06f}; const std::pair center = {3517.31f, -5253.74f}; @@ -111,7 +112,7 @@ class SapphironBossHelper: public GenericBossHelperGetNextEventTime(EVENT_GROUND); + uint32 nextEventGround = _event_map->GetNextEventTime(Sapphiron::EVENT_GROUND); if (nextEventGround && nextEventGround != lastEventGround) lastEventGround = nextEventGround; return true; @@ -123,10 +124,10 @@ class SapphironBossHelper: public GenericBossHelperGetNextEventTime(EVENT_FLIGHT_START) - _timer) >= EVENT_FLIGHT_INTERVAL - POSITION_TIME_AFTER_LANDED; + return (_event_map->GetNextEventTime(Sapphiron::EVENT_FLIGHT_START) - _timer) >= EVENT_FLIGHT_INTERVAL - POSITION_TIME_AFTER_LANDED; } bool WaitForExplosion() { - return _event_map->GetNextEventTime(EVENT_FLIGHT_SPELL_EXPLOSION); + return _event_map->GetNextEventTime(Sapphiron::EVENT_FLIGHT_SPELL_EXPLOSION); } bool FindPosToAvoidChill(std::vector &dest) { Aura* aura = botAI->GetAura("chill", bot); @@ -172,7 +173,7 @@ class SapphironBossHelper: public GenericBossHelper { +class GluthBossHelper: public GenericBossHelper { public: const std::pair mainTankPos25 = {3331.48f, -3109.06f}; const std::pair mainTankPos10 = {3278.29f, -3162.06f}; @@ -185,7 +186,7 @@ class GluthBossHelper: public GenericBossHelper { const float decimatedZombiePct = 10.0f; GluthBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "gluth") {} bool BeforeDecimate() { - uint32 decimate = _event_map->GetNextEventTime(GLUTH_EVENT_DECIMATE); + uint32 decimate = _event_map->GetNextEventTime(Gluth::GLUTH_EVENT_DECIMATE); return decimate && decimate - _timer <= 3000; } bool JustStartCombat() { @@ -193,14 +194,14 @@ class GluthBossHelper: public GenericBossHelper { } }; -class LoathebBossHelper: public GenericBossHelper { +class LoathebBossHelper: public GenericBossHelper { public: const std::pair mainTankPos = {2877.57f, -3967.00f}; const std::pair rangePos = {2896.96f, -3980.61f}; LoathebBossHelper(PlayerbotAI *botAI): GenericBossHelper(botAI, "loatheb") {} }; -class FourhorsemanBossHelper: public GenericBossHelper { +class FourhorsemanBossHelper: public GenericBossHelper { public: const float posZ = 241.27f; const std::pair attractPos[2] = {{2502.03f, -2910.90f}, {2484.61f, -2947.07f}}; // left (sir zeliek), right (lady blaumeux) @@ -217,12 +218,12 @@ class FourhorsemanBossHelper: public GenericBossHelper(lady->GetAI()); + ladyAI = dynamic_cast(lady->GetAI()); if (!ladyAI) { return true; } ladyEvent = &ladyAI->events; - const uint32 voidZone = ladyEvent->GetNextEventTime(EVENT_SECONDARY_SPELL); + const uint32 voidZone = ladyEvent->GetNextEventTime(FourHorsemen::EVENT_SECONDARY_SPELL); if (voidZone && lastEventVoidZone != voidZone) { voidZoneCounter++; voidZoneCounter %= 8; @@ -291,13 +292,13 @@ class FourhorsemanBossHelper: public GenericBossHelper { +class ThaddiusBossHelper: public GenericBossHelper { public: const std::pair tankPosFeugen = {3522.94f, -3002.60f}; const std::pair tankPosStalagg = {3436.14f, -2919.98f}; diff --git a/src/strategy/raids/naxxramas/RaidNaxxMultipliers.cpp b/src/strategy/raids/naxxramas/RaidNaxxMultipliers.cpp index ff9fc212..b22dc604 100644 --- a/src/strategy/raids/naxxramas/RaidNaxxMultipliers.cpp +++ b/src/strategy/raids/naxxramas/RaidNaxxMultipliers.cpp @@ -26,7 +26,7 @@ float HeiganDanceMultiplier::GetValue(Action* action) return 1.0f; } - boss_heigan::boss_heiganAI* boss_ai = dynamic_cast(boss->GetAI()); + auto* boss_ai = dynamic_cast(boss->GetAI()); EventMap* eventMap = &boss_ai->events; uint32 curr_phase = boss_ai->currentPhase; uint32 curr_dance = eventMap->GetNextEventTime(4); @@ -266,7 +266,7 @@ float GluthGenericMultiplier::GetValue(Action* action) } if (dynamic_cast(action)) { Unit* target = AI_VALUE(Unit*, "current target"); - if (target && target->GetEntry() == NPC_ZOMBIE_CHOW) { + if (target && target->GetEntry() == Gluth::NPC_ZOMBIE_CHOW) { return 0.0f; } } diff --git a/src/strategy/raids/naxxramas/RaidNaxxTriggers.cpp b/src/strategy/raids/naxxramas/RaidNaxxTriggers.cpp index 1a815bf5..dbfa6545 100644 --- a/src/strategy/raids/naxxramas/RaidNaxxTriggers.cpp +++ b/src/strategy/raids/naxxramas/RaidNaxxTriggers.cpp @@ -215,5 +215,5 @@ bool ThaddiusPhaseThaddiusTrigger::IsActive() return helper.IsPhaseThaddius(); } -template bool BossEventTrigger::IsActive(); -template bool BossPhaseTrigger::IsActive(); \ No newline at end of file +template bool BossEventTrigger::IsActive(); +template bool BossPhaseTrigger::IsActive(); \ No newline at end of file diff --git a/src/strategy/raids/naxxramas/RaidNaxxTriggers.h b/src/strategy/raids/naxxramas/RaidNaxxTriggers.h index 4b07cc80..3c8e983e 100644 --- a/src/strategy/raids/naxxramas/RaidNaxxTriggers.h +++ b/src/strategy/raids/naxxramas/RaidNaxxTriggers.h @@ -61,7 +61,7 @@ protected: uint32 phase_mask; }; -class GrobbulusCloudTrigger : public BossEventTrigger +class GrobbulusCloudTrigger : public BossEventTrigger { public: GrobbulusCloudTrigger(PlayerbotAI* ai): BossEventTrigger(ai, 15931, 2, "grobbulus cloud event") { } @@ -109,7 +109,7 @@ class KelthuzadTrigger : public Trigger KelthuzadBossHelper helper; }; -class AnubrekhanTrigger : public BossPhaseTrigger +class AnubrekhanTrigger : public BossPhaseTrigger { public: AnubrekhanTrigger(PlayerbotAI* ai) : BossPhaseTrigger(ai, "anub'rekhan", 0, "anub'rekhan trigger") {}