From e629d4c8267de338d4374c149e6ff55b7aa485bd Mon Sep 17 00:00:00 2001 From: Miraco Date: Sun, 23 Jun 2024 14:13:24 +0200 Subject: [PATCH] Add Combat delay for Nazan after landing Add Despawn/Respawn after 30 seconds to nazan and vazruden fight --- .../boss_nazan_and_vazruden.cpp | 3 +- .../hellfire_ramparts/hellfire_ramparts.cpp | 34 ++++++------------- .../hellfire_ramparts/hellfire_ramparts.h | 4 +-- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp b/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp index 180afa846c2..e01f409ab8c 100644 --- a/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp +++ b/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp @@ -204,7 +204,8 @@ struct boss_vazruden_heraldAI : public CombatAI m_creature->SetHover(false); m_creature->HandleEmote(EMOTE_ONESHOT_LAND); m_creature->SetCanFly(false); - HandleAttackDelay(); + m_creature->GetMotionMaster()->Clear(false, true); + ResetTimer(NAZAN_ATTACK_DELAY, 5000); break; } case POINT_ID_FLYING: diff --git a/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.cpp b/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.cpp index 9045a6a2f5b..1d2725b2025 100644 --- a/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.cpp +++ b/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.cpp @@ -25,7 +25,7 @@ EndScriptData */ #include "hellfire_ramparts.h" instance_ramparts::instance_ramparts(Map* pMap) : ScriptedInstance(pMap), - m_uiSentryCounter(0), m_sentryGroup(nullptr) + m_uiSentryCounter(0) { Initialize(); } @@ -38,21 +38,15 @@ void instance_ramparts::Initialize() void instance_ramparts::OnCreatureCreate(Creature* pCreature) { switch (pCreature->GetEntry()) - { - case NPC_VAZRUDEN_HERALD: + { case NPC_VAZRUDEN: m_npcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid(); break; - } -} - -void instance_ramparts::OnCreatureRespawn(Creature* creature) -{ - switch (creature->GetEntry()) - { case NPC_HELLFIRE_SENTRY: - if (CreatureGroup* group = creature->GetCreatureGroup()) - m_sentryGroup = group; + if (pCreature->IsTemporarySummon()) + m_VazrudenTemporaryGuids.push_back(pCreature->GetObjectGuid()); + else + m_VazrudenPermanentGuids.push_back(pCreature->GetDbGuid()); break; } } @@ -137,24 +131,18 @@ void instance_ramparts::DoFailVazruden() // Restore Sentries (counter and respawn them) m_uiSentryCounter = 0; - // respawns sentry group - m_sentryGroup->Spawn(true); - // Respawn or Reset Vazruden the herald + RespawnDbGuids(m_VazrudenPermanentGuids, 30); + if (Creature* pVazruden = GetSingleCreatureFromStorage(NPC_VAZRUDEN_HERALD)) { - if (!pVazruden->IsAlive()) - pVazruden->Respawn(); - else - { - if (ScriptedAI* pVazrudenAI = dynamic_cast(pVazruden->AI())) - pVazrudenAI->EnterEvadeMode(); - } + pVazruden->SetRespawnDelay(30, true); + pVazruden->ForcedDespawn(); } - // Despawn Vazruden if (Creature* pVazruden = GetSingleCreatureFromStorage(NPC_VAZRUDEN)) pVazruden->ForcedDespawn(); + } InstanceData* GetInstanceData_instance_ramparts(Map* pMap) diff --git a/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h b/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h index 5f842fc6695..3dce1080a3f 100644 --- a/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h +++ b/src/game/AI/ScriptDevAI/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h @@ -28,7 +28,6 @@ class instance_ramparts : public ScriptedInstance void Initialize() override; void OnCreatureCreate(Creature* pCreature) override; - void OnCreatureRespawn(Creature* creature) override; void OnObjectCreate(GameObject* pGo) override; void SetData(uint32 uiType, uint32 uiData) override; @@ -42,7 +41,8 @@ class instance_ramparts : public ScriptedInstance uint32 m_auiEncounter[MAX_ENCOUNTER]; uint32 m_uiSentryCounter; - CreatureGroup* m_sentryGroup; + std::vector m_VazrudenPermanentGuids; + GuidVector m_VazrudenTemporaryGuids; }; #endif