mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-06 12:27:48 +00:00
fix(Scripts/Hyjal): correctly despawn summoned creatures on Jaina/Thrall death (#18997)
* init * change logic despawning of bosses is not really done the normal way, but it's forced with a set amount of guids. So we simply need to register the summons as guids as well * small fixes * Delete creature_scripts.sql * Update boss_azgalor.cpp
This commit is contained in:
@@ -32,11 +32,6 @@ enum Spells
|
|||||||
SPELL_INFERNAL_IMMOLATION = 31304
|
SPELL_INFERNAL_IMMOLATION = 31304
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Misc
|
|
||||||
{
|
|
||||||
NPC_TOWERING_INFERNAL = 17818
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Texts
|
enum Texts
|
||||||
{
|
{
|
||||||
SAY_ONDEATH = 0,
|
SAY_ONDEATH = 0,
|
||||||
@@ -59,22 +54,6 @@ public:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
|
||||||
{
|
|
||||||
std::list<Creature* > infernalList;
|
|
||||||
me->GetCreatureListWithEntryInGrid(infernalList, NPC_TOWERING_INFERNAL, 100.0f);
|
|
||||||
if (infernalList.size() > 0)
|
|
||||||
{
|
|
||||||
for (Creature* infernal : infernalList)
|
|
||||||
{
|
|
||||||
infernal->DespawnOrUnsummon();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
infernalList.clear();
|
|
||||||
instance->SetData(DATA_RESET_ALLIANCE, 0);
|
|
||||||
me->DespawnOrUnsummon();
|
|
||||||
}
|
|
||||||
|
|
||||||
void JustEngagedWith(Unit * who) override
|
void JustEngagedWith(Unit * who) override
|
||||||
{
|
{
|
||||||
BossAI::JustEngagedWith(who);
|
BossAI::JustEngagedWith(who);
|
||||||
@@ -157,7 +136,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool _recentlySpoken;
|
bool _recentlySpoken;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_anetheron_sleep : public SpellScript
|
class spell_anetheron_sleep : public SpellScript
|
||||||
|
|||||||
@@ -30,11 +30,6 @@ enum Spells
|
|||||||
SPELL_BERSERK = 26662
|
SPELL_BERSERK = 26662
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Misc
|
|
||||||
{
|
|
||||||
NPC_LESSER_DOOMGUARD = 17864
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Texts
|
enum Texts
|
||||||
{
|
{
|
||||||
SAY_ONDEATH = 0,
|
SAY_ONDEATH = 0,
|
||||||
@@ -57,22 +52,6 @@ public:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
|
||||||
{
|
|
||||||
std::list<Creature* > doomguardList;
|
|
||||||
me->GetCreatureListWithEntryInGrid(doomguardList, NPC_LESSER_DOOMGUARD, 100.0f);
|
|
||||||
if (doomguardList.size() > 0)
|
|
||||||
{
|
|
||||||
for (Creature* doomguard : doomguardList)
|
|
||||||
{
|
|
||||||
doomguard->DespawnOrUnsummon();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
doomguardList.clear();
|
|
||||||
instance->SetData(DATA_RESET_HORDE, 0);
|
|
||||||
me->DespawnOrUnsummon();
|
|
||||||
}
|
|
||||||
|
|
||||||
void JustEngagedWith(Unit * who) override
|
void JustEngagedWith(Unit * who) override
|
||||||
{
|
{
|
||||||
BossAI::JustEngagedWith(who);
|
BossAI::JustEngagedWith(who);
|
||||||
@@ -137,7 +116,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool _recentlySpoken;
|
bool _recentlySpoken;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_azgalor_doom : public AuraScript
|
class spell_azgalor_doom : public AuraScript
|
||||||
|
|||||||
@@ -120,7 +120,11 @@ enum HyjalCreaturesIds
|
|||||||
NPC_KAZROGAL = 17888,
|
NPC_KAZROGAL = 17888,
|
||||||
NPC_AZGALOR = 17842,
|
NPC_AZGALOR = 17842,
|
||||||
NPC_ARCHIMONDE = 17968,
|
NPC_ARCHIMONDE = 17968,
|
||||||
NPC_WORLD_TRIGGER_TINY = 21987
|
NPC_WORLD_TRIGGER_TINY = 21987,
|
||||||
|
|
||||||
|
// Boss summons
|
||||||
|
NPC_TOWERING_INFERNAL = 17818,
|
||||||
|
NPC_LESSER_DOOMGUARD = 17864
|
||||||
};
|
};
|
||||||
|
|
||||||
enum HyjalGameobjectIds
|
enum HyjalGameobjectIds
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ public:
|
|||||||
trash = 0;
|
trash = 0;
|
||||||
_currentWave = 0;
|
_currentWave = 0;
|
||||||
_encounterNPCs.clear();
|
_encounterNPCs.clear();
|
||||||
|
_summonedNPCs.clear();
|
||||||
_baseAlliance.clear();
|
_baseAlliance.clear();
|
||||||
_baseHorde.clear();
|
_baseHorde.clear();
|
||||||
_infernalTargets.clear();
|
_infernalTargets.clear();
|
||||||
@@ -200,6 +201,13 @@ public:
|
|||||||
_encounterNPCs.insert(creature->GetGUID()); // Used for despawning on wipe
|
_encounterNPCs.insert(creature->GetGUID()); // Used for despawning on wipe
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NPC_TOWERING_INFERNAL:
|
||||||
|
case NPC_LESSER_DOOMGUARD:
|
||||||
|
if (creature->IsSummon())
|
||||||
|
{
|
||||||
|
_summonedNPCs.insert(creature->GetGUID());
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
InstanceScript::OnCreatureCreate(creature);
|
InstanceScript::OnCreatureCreate(creature);
|
||||||
}
|
}
|
||||||
@@ -233,6 +241,10 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NPC_TOWERING_INFERNAL:
|
||||||
|
case NPC_LESSER_DOOMGUARD:
|
||||||
|
_summonedNPCs.erase(unit->ToCreature()->GetGUID());
|
||||||
|
break;
|
||||||
case NPC_WINTERCHILL:
|
case NPC_WINTERCHILL:
|
||||||
case NPC_ANETHERON:
|
case NPC_ANETHERON:
|
||||||
case NPC_KAZROGAL:
|
case NPC_KAZROGAL:
|
||||||
@@ -402,6 +414,11 @@ public:
|
|||||||
if (Creature* creature = instance->GetCreature(guid))
|
if (Creature* creature = instance->GetCreature(guid))
|
||||||
creature->DespawnOrUnsummon();
|
creature->DespawnOrUnsummon();
|
||||||
|
|
||||||
|
// also force despawn boss summons
|
||||||
|
for (ObjectGuid const& guid : _summonedNPCs)
|
||||||
|
if (Creature* creature = instance->GetCreature(guid))
|
||||||
|
creature->DespawnOrUnsummon();
|
||||||
|
|
||||||
_scheduler.Schedule(300s, [this](TaskContext)
|
_scheduler.Schedule(300s, [this](TaskContext)
|
||||||
{
|
{
|
||||||
for (ObjectGuid const& guid : _baseAlliance)
|
for (ObjectGuid const& guid : _baseAlliance)
|
||||||
@@ -420,6 +437,11 @@ public:
|
|||||||
if (Creature* creature = instance->GetCreature(guid))
|
if (Creature* creature = instance->GetCreature(guid))
|
||||||
creature->DespawnOrUnsummon();
|
creature->DespawnOrUnsummon();
|
||||||
|
|
||||||
|
// also force despawn boss summons
|
||||||
|
for (ObjectGuid const& guid : _summonedNPCs)
|
||||||
|
if (Creature* creature = instance->GetCreature(guid))
|
||||||
|
creature->DespawnOrUnsummon();
|
||||||
|
|
||||||
_scheduler.Schedule(300s, [this](TaskContext)
|
_scheduler.Schedule(300s, [this](TaskContext)
|
||||||
{
|
{
|
||||||
for (ObjectGuid const& guid : _baseHorde)
|
for (ObjectGuid const& guid : _baseHorde)
|
||||||
@@ -455,6 +477,7 @@ public:
|
|||||||
case DATA_RESET_WAVES:
|
case DATA_RESET_WAVES:
|
||||||
_scheduler.CancelGroup(CONTEXT_GROUP_WAVES);
|
_scheduler.CancelGroup(CONTEXT_GROUP_WAVES);
|
||||||
_encounterNPCs.clear();
|
_encounterNPCs.clear();
|
||||||
|
_summonedNPCs.clear();
|
||||||
_currentWave = 0;
|
_currentWave = 0;
|
||||||
trash = 0;
|
trash = 0;
|
||||||
_bossWave = 0;
|
_bossWave = 0;
|
||||||
@@ -546,6 +569,7 @@ public:
|
|||||||
uint8 _retreat;
|
uint8 _retreat;
|
||||||
TaskScheduler _scheduler;
|
TaskScheduler _scheduler;
|
||||||
GuidSet _encounterNPCs;
|
GuidSet _encounterNPCs;
|
||||||
|
GuidSet _summonedNPCs;
|
||||||
GuidSet _baseAlliance;
|
GuidSet _baseAlliance;
|
||||||
GuidSet _baseHorde;
|
GuidSet _baseHorde;
|
||||||
GuidVector _infernalTargets;
|
GuidVector _infernalTargets;
|
||||||
|
|||||||
Reference in New Issue
Block a user