Skip to content

Commit

Permalink
Add Combat delay for Nazan after landing
Browse files Browse the repository at this point in the history
Add Despawn/Respawn after 30 seconds to nazan and vazruden fight
  • Loading branch information
miraco authored and killerwife committed Jun 24, 2024
1 parent 3b79213 commit e629d4c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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<ScriptedAI*>(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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -42,7 +41,8 @@ class instance_ramparts : public ScriptedInstance
uint32 m_auiEncounter[MAX_ENCOUNTER];

uint32 m_uiSentryCounter;
CreatureGroup* m_sentryGroup;
std::vector<uint32> m_VazrudenPermanentGuids;
GuidVector m_VazrudenTemporaryGuids;
};

#endif

0 comments on commit e629d4c

Please sign in to comment.