diff --git a/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp b/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp index e2fe3cbe6..5b470ee5c 100644 --- a/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp +++ b/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp @@ -99,8 +99,12 @@ bool RaidOnyxiaMoveToSafeZoneAction::Execute(Event /*event*/) if (bot->IsWithinDist2d(bestZone->pos.GetPositionX(), bestZone->pos.GetPositionY(), bestZone->radius)) return false; // Already safe + // Stop current spell first + bot->AttackStop(); + bot->InterruptNonMeleeSpells(false); + // bot->Yell("Moving to Safe Zone!", LANG_UNIVERSAL); - return MoveTo(bot->GetMapId(), bestZone->pos.GetPositionX(), bestZone->pos.GetPositionY(), bot->GetPositionZ(), + return MoveTo(bot->GetMapId(), bestZone->pos.GetPositionX(), bestZone->pos.GetPositionY(), bestZone->pos.GetPositionZ(), false, false, false, false, MovementPriority::MOVEMENT_COMBAT); } diff --git a/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.h b/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.h index 3943aaf60..d5b8eafd9 100644 --- a/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.h +++ b/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.h @@ -2,7 +2,6 @@ #ifndef _PLAYERBOT_RAIDONYXIAACTIONS_H_ #define _PLAYERBOT_RAIDONYXIAACTIONS_H_ -#include "Action.h" #include "AttackAction.h" #include "GenericSpellActions.h" #include "MovementActions.h" @@ -45,42 +44,45 @@ public: bool Execute(Event event) override; private: - std::vector GetSafeZonesForBreath(uint32 spellId) + static std::vector GetSafeZonesForBreath(uint32 spellId) { - // Define your safe zone coordinates based on the map - // Example assumes Onyxia's lair map coordinates - float z = bot->GetPositionZ(); // Stay at current height + // Safe zone coordinates based on the map + // Assumes Onyxia's lair map coordinates switch (spellId) { case 17086: // N to S case 18351: // S to N - return {SafeZone{Position(-10.0f, -180.0f, z), 5.0f}, - SafeZone{Position(-20.0f, -250.0f, z), 5.0f}}; // Bottom Safe Zone + return { + SafeZone{Position(-10.0f, -180.0f, -87.0f), 5.0f}, + SafeZone{Position(-20.0f, -250.0f, -88.0f), 5.0f} + }; // Bottom Safe Zone case 18576: // E to W case 18609: // W to E return { - SafeZone{Position(20.0f, -210.0f, z), 5.0f}, - SafeZone{Position(-75.0f, -210.0f, z), 5.0f}, + SafeZone{Position(20.0f, -210.0f, -85.5f), 5.0f}, + SafeZone{Position(-75.0f, -210.0f, -83.4f), 5.0f}, }; // Left Safe Zone case 18564: // SE to NW case 18584: // NW to SE return { - SafeZone{Position(-60.0f, -195.0f, z), 5.0f}, - SafeZone{Position(10.0f, -240.0f, z), 5.0f}, + SafeZone{Position(-60.0f, -195.0f, -85.0f), 5.0f}, + SafeZone{Position(10.0f, -240.0f, -85.9f), 5.0f}, }; // NW Safe Zone case 18596: // SW to NE case 18617: // NE to SW return { - SafeZone{Position(7.0f, -185.0f, z), 5.0f}, - SafeZone{Position(-60.0f, -240.0f, z), 5.0f}, + SafeZone{Position(7.0f, -185.0f, -86.2f), 5.0f}, + SafeZone{Position(-60.0f, -240.0f, -85.2f), 5.0f}, }; // NE Safe Zone default: - return {SafeZone{Position(0.0f, 0.0f, z), 5.0f}}; // Fallback center - shouldn't ever happen + return { + SafeZone{Position(-40.0f, -214.0f, -86.6f), 5.0f} + }; // Fallback center - shouldn't ever happen } } };