From e68c5a76c6ab2fa7faebc67054c37647cd1757ea Mon Sep 17 00:00:00 2001 From: kadeshar Date: Tue, 20 May 2025 17:24:45 +0200 Subject: [PATCH] - Added Auriaya fall from floor protection (#1318) --- .../raids/ulduar/RaidUlduarActionContext.h | 2 ++ .../raids/ulduar/RaidUlduarActions.cpp | 20 +++++++++++++++++++ src/strategy/raids/ulduar/RaidUlduarActions.h | 8 ++++++++ .../raids/ulduar/RaidUlduarStrategy.cpp | 7 +++++++ .../raids/ulduar/RaidUlduarTriggerContext.h | 2 ++ .../raids/ulduar/RaidUlduarTriggers.cpp | 11 ++++++++++ .../raids/ulduar/RaidUlduarTriggers.h | 12 ++++++++++- 7 files changed, 61 insertions(+), 1 deletion(-) diff --git a/src/strategy/raids/ulduar/RaidUlduarActionContext.h b/src/strategy/raids/ulduar/RaidUlduarActionContext.h index 2c8ceaad..1dc10cc2 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActionContext.h +++ b/src/strategy/raids/ulduar/RaidUlduarActionContext.h @@ -37,6 +37,7 @@ public: creators["kologarn eyebeam action"] = &RaidUlduarActionContext::kologarn_eyebeam_action; creators["kologarn rti target action"] = &RaidUlduarActionContext::kologarn_rti_target_action; creators["kologarn crunch armor action"] = &RaidUlduarActionContext::kologarn_crunch_armor_action; + creators["auriaya fall from floor action"] = &RaidUlduarActionContext::auriaya_fall_from_floor_action; creators["hodir move snowpacked icicle"] = &RaidUlduarActionContext::hodir_move_snowpacked_icicle; creators["hodir biting cold jump"] = &RaidUlduarActionContext::hodir_biting_cold_jump; creators["hodir frost resistance action"] = &RaidUlduarActionContext::hodir_frost_resistance_action; @@ -77,6 +78,7 @@ private: static Action* kologarn_eyebeam_action(PlayerbotAI* ai) { return new KologarnEyebeamAction(ai); } static Action* kologarn_rti_target_action(PlayerbotAI* ai) { return new KologarnRtiTargetAction(ai); } static Action* kologarn_crunch_armor_action(PlayerbotAI* ai) { return new KologarnCrunchArmorAction(ai); } + static Action* auriaya_fall_from_floor_action(PlayerbotAI* ai) { return new AuriayaFallFromFloorAction(ai); } static Action* hodir_move_snowpacked_icicle(PlayerbotAI* ai) { return new HodirMoveSnowpackedIcicleAction(ai); } static Action* hodir_biting_cold_jump(PlayerbotAI* ai) { return new HodirBitingColdJumpAction(ai); } static Action* hodir_frost_resistance_action(PlayerbotAI* ai) { return new BossFrostResistanceAction(ai, "hodir"); } diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.cpp b/src/strategy/raids/ulduar/RaidUlduarActions.cpp index bcbe678a..443cd275 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActions.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarActions.cpp @@ -1485,6 +1485,23 @@ bool KologarnCrunchArmorAction::Execute(Event event) return true; } +bool AuriayaFallFromFloorAction::Execute(Event event) +{ + Player* master = botAI->GetMaster(); + + if (!master) + return false; + + return bot->TeleportTo(bot->GetMapId(), master->GetPositionX(), master->GetPositionY(), master->GetPositionZ(), + master->GetOrientation()); +} + +bool AuriayaFallFromFloorAction::isUseful() +{ + AuriayaFallFromFloorTrigger auriayaFallFromFloorTrigger(botAI); + return auriayaFallFromFloorTrigger.IsActive(); +} + bool HodirMoveSnowpackedIcicleAction::isUseful() { // Check boss and it is alive @@ -2096,6 +2113,9 @@ bool ThorimFallFromFloorAction::Execute(Event event) { Player* master = botAI->GetMaster(); + if (!master) + return false; + return bot->TeleportTo(bot->GetMapId(), master->GetPositionX(), master->GetPositionY(), master->GetPositionZ(), master->GetOrientation()); } diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.h b/src/strategy/raids/ulduar/RaidUlduarActions.h index a2022b42..01867806 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActions.h +++ b/src/strategy/raids/ulduar/RaidUlduarActions.h @@ -185,6 +185,14 @@ public: bool isUseful() override; }; +class AuriayaFallFromFloorAction : public Action +{ +public: + AuriayaFallFromFloorAction(PlayerbotAI* botAI) : Action(botAI, "auriaya fall from floor action") {} + bool Execute(Event event) override; + bool isUseful() override; +}; + class HodirBitingColdJumpAction : public MovementAction { public: diff --git a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp b/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp index 1eda1560..f18ee9d6 100644 --- a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp @@ -107,6 +107,13 @@ void RaidUlduarStrategy::InitTriggers(std::vector& triggers) "kologarn crunch armor trigger", NextAction::array(0, new NextAction("kologarn crunch armor action", ACTION_RAID), nullptr))); + // + // Auriaya + // + triggers.push_back(new TriggerNode( + "auriaya fall from floor trigger", + NextAction::array(0, new NextAction("auriaya fall from floor action", ACTION_RAID), nullptr))); + // // Hodir // diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h b/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h index aa3a4d4f..220730f0 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h +++ b/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h @@ -38,6 +38,7 @@ public: creators["kologarn rti target trigger"] = &RaidUlduarTriggerContext::kologarn_rti_target_trigger; creators["kologarn crunch armor trigger"] = &RaidUlduarTriggerContext::kologarn_crunch_armor_trigger; creators["kologarn attack dps target trigger"] = &RaidUlduarTriggerContext::kologarn_attack_dps_target_trigger; + creators["auriaya fall from floor trigger"] = &RaidUlduarTriggerContext::auriaya_fall_from_floor_trigger; creators["hodir biting cold"] = &RaidUlduarTriggerContext::hodir_biting_cold; creators["hodir near snowpacked icicle"] = &RaidUlduarTriggerContext::hodir_near_snowpacked_icicle; creators["hodir frost resistance trigger"] = &RaidUlduarTriggerContext::hodir_frost_resistance_trigger; @@ -80,6 +81,7 @@ private: static Trigger* kologarn_rti_target_trigger(PlayerbotAI* ai) { return new KologarnRtiTargetTrigger(ai); } static Trigger* kologarn_crunch_armor_trigger(PlayerbotAI* ai) { return new KologarnCrunchArmorTrigger(ai); } static Trigger* kologarn_attack_dps_target_trigger(PlayerbotAI* ai) { return new KologarnAttackDpsTargetTrigger(ai); } + static Trigger* auriaya_fall_from_floor_trigger(PlayerbotAI* ai) { return new AuriayaFallFromFloorTrigger(ai); } static Trigger* hodir_biting_cold(PlayerbotAI* ai) { return new HodirBitingColdTrigger(ai); } static Trigger* hodir_near_snowpacked_icicle(PlayerbotAI* ai) { return new HodirNearSnowpackedIcicleTrigger(ai); } static Trigger* hodir_frost_resistance_trigger(PlayerbotAI* ai) { return new BossFrostResistanceTrigger(ai, "hodir"); } diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp b/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp index bc2f949a..30700c3c 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp @@ -487,6 +487,17 @@ bool KologarnCrunchArmorTrigger::IsActive() return bot->HasAura(SPELL_CRUNCH_ARMOR); } +bool AuriayaFallFromFloorTrigger::IsActive() +{ + // Check boss and it is alive + Unit* boss = AI_VALUE2(Unit*, "find target", "auriaya"); + if (!boss || !boss->IsAlive()) + return false; + + // Check if bot is on the floor + return bot->GetPositionZ() < ULDUAR_AURIAYA_AXIS_Z_PATHING_ISSUE_DETECT; +} + bool HodirBitingColdTrigger::IsActive() { Unit* boss = AI_VALUE2(Unit*, "find target", "hodir"); diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.h b/src/strategy/raids/ulduar/RaidUlduarTriggers.h index 04c93825..39b0c64d 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggers.h +++ b/src/strategy/raids/ulduar/RaidUlduarTriggers.h @@ -74,7 +74,7 @@ const float ULDUAR_KOLOGARN_AXIS_Z_PATHING_ISSUE_DETECT = 420.0f; const float ULDUAR_KOLOGARN_EYEBEAM_RADIUS = 3.0f; const float ULDUAR_THORIM_AXIS_Z_FLOOR_THRESHOLD = 429.6094f; const float ULDUAR_THORIM_AXIS_Z_PATHING_ISSUE_DETECT = 410.0f; - +const float ULDUAR_AURIAYA_AXIS_Z_PATHING_ISSUE_DETECT = 410.0f; const Position ULDUAR_THORIM_NEAR_ARENA_CENTER = Position(2134.9854f, -263.11853f, 419.8465f); const Position ULDUAR_THORIM_NEAR_ENTRANCE_POSITION = Position(2172.4355f, -258.27957f, 418.47162f); @@ -240,6 +240,16 @@ public: bool IsActive() override; }; +// +// Auriaya +// +class AuriayaFallFromFloorTrigger : public Trigger +{ +public: + AuriayaFallFromFloorTrigger(PlayerbotAI* ai) : Trigger(ai, "auriaya fall from floor trigger") {} + bool IsActive() override; +}; + // // Hodir //