Scripts/Icecrown Citadel: Replace instance check with a safer one, this way if failed the creature is not idle
This commit is contained in:
@@ -75,7 +75,7 @@ struct ScriptedAI : public CreatureAI
|
||||
void SpellHit(Unit* /*caster*/, SpellEntry const* /*spell*/) {}
|
||||
|
||||
// Called when spell hits a target
|
||||
void SpellHitTarget(Unit * /*target*/, SpellEntry const* /*spell*/) {}
|
||||
void SpellHitTarget(Unit* /*target*/, SpellEntry const* /*spell*/) {}
|
||||
|
||||
//Called at waypoint reached or PointMovement end
|
||||
void MovementInform(uint32 /*type*/, uint32 /*id*/) {}
|
||||
|
||||
@@ -181,14 +181,6 @@ class boss_blood_council_controller : public CreatureScript
|
||||
{
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
@@ -370,7 +362,7 @@ class boss_blood_council_controller : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_blood_council_controllerAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_blood_council_controllerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -393,9 +385,7 @@ class boss_prince_keleseth_icc : public CreatureScript
|
||||
if (data->curhealth)
|
||||
spawnHealth = data->curhealth;
|
||||
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
if (!me->isDead())
|
||||
JustRespawned();
|
||||
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
@@ -569,7 +559,7 @@ class boss_prince_keleseth_icc : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_prince_kelesethAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_prince_kelesethAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -594,9 +584,7 @@ class boss_prince_taldaram_icc : public CreatureScript
|
||||
if (data->curhealth)
|
||||
spawnHealth = data->curhealth;
|
||||
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
if (!me->isDead())
|
||||
JustRespawned();
|
||||
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
@@ -776,7 +764,7 @@ class boss_prince_taldaram_icc : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_prince_taldaramAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_prince_taldaramAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -799,9 +787,7 @@ class boss_prince_valanar_icc : public CreatureScript
|
||||
if (data->curhealth)
|
||||
spawnHealth = data->curhealth;
|
||||
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
if (!me->isDead())
|
||||
JustRespawned();
|
||||
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
@@ -1000,7 +986,7 @@ class boss_prince_valanar_icc : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_prince_valanarAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_prince_valanarAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1017,14 +1003,6 @@ class npc_blood_queen_lana_thel : public CreatureScript
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
@@ -1101,7 +1079,7 @@ class npc_blood_queen_lana_thel : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_blood_queen_lana_thelAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_blood_queen_lana_thelAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1186,7 +1164,7 @@ class npc_ball_of_flame : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_ball_of_flameAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_ball_of_flameAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1253,7 +1231,7 @@ class npc_kinetic_bomb : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_kinetic_bombAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_kinetic_bombAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1351,7 +1329,7 @@ class npc_dark_nucleus : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_dark_nucleusAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_dark_nucleusAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -132,14 +132,6 @@ class boss_blood_queen_lana_thel : public CreatureScript
|
||||
{
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
@@ -472,7 +464,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_blood_queen_lana_thelAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_blood_queen_lana_thelAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -248,14 +248,6 @@ class boss_deathbringer_saurfang : public CreatureScript
|
||||
fallenChampionCount = 0;
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
@@ -550,7 +542,7 @@ class boss_deathbringer_saurfang : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_deathbringer_saurfangAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_deathbringer_saurfangAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -592,11 +584,8 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
Talk(SAY_INTRO_HORDE_1);
|
||||
events.SetPhase(PHASE_INTRO_H);
|
||||
events.ScheduleEvent(EVENT_INTRO_HORDE_3, 18500, 0, PHASE_INTRO_H);
|
||||
if (instance)
|
||||
{
|
||||
deathbringerSaurfangGUID = instance->GetData64(DATA_DEATHBRINGER_SAURFANG);
|
||||
instance->HandleGameObject(instance->GetData64(GO_SAURFANG_S_DOOR), true);
|
||||
}
|
||||
deathbringerSaurfangGUID = instance->GetData64(DATA_DEATHBRINGER_SAURFANG);
|
||||
instance->HandleGameObject(instance->GetData64(GO_SAURFANG_S_DOOR), true);
|
||||
if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID))
|
||||
deathbringer->AI()->DoAction(PHASE_INTRO_H);
|
||||
break;
|
||||
@@ -769,7 +758,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_high_overlord_saurfangAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_high_overlord_saurfangAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -810,11 +799,8 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
Talk(SAY_INTRO_ALLIANCE_1);
|
||||
events.ScheduleEvent(EVENT_INTRO_ALLIANCE_4, 2500+17500+9500, 0, PHASE_INTRO_A);
|
||||
if (instance)
|
||||
{
|
||||
deathbringerSaurfangGUID = instance->GetData64(DATA_DEATHBRINGER_SAURFANG);
|
||||
instance->HandleGameObject(instance->GetData64(GO_SAURFANG_S_DOOR), true);
|
||||
}
|
||||
deathbringerSaurfangGUID = instance->GetData64(DATA_DEATHBRINGER_SAURFANG);
|
||||
instance->HandleGameObject(instance->GetData64(GO_SAURFANG_S_DOOR), true);
|
||||
if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID))
|
||||
deathbringer->AI()->DoAction(PHASE_INTRO_A);
|
||||
break;
|
||||
@@ -923,7 +909,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_muradin_bronzebeard_iccAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_muradin_bronzebeard_iccAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -968,7 +954,7 @@ class npc_saurfang_event : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_saurfang_eventAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_saurfang_eventAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -87,14 +87,6 @@ class boss_festergut : public CreatureScript
|
||||
gasDummyGUID = 0;
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
@@ -281,7 +273,7 @@ class boss_festergut : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_festergutAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_festergutAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -337,8 +329,7 @@ class npc_stinky_icc : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*who*/)
|
||||
{
|
||||
uint64 festergutGUID = instance ? instance->GetData64(DATA_FESTERGUT) : 0;
|
||||
if (Creature* festergut = me->GetCreature(*me, festergutGUID))
|
||||
if (Creature* festergut = me->GetCreature(*me, instance->GetData64(DATA_FESTERGUT)))
|
||||
if (festergut->isAlive())
|
||||
festergut->AI()->Talk(SAY_STINKY_DEAD);
|
||||
}
|
||||
@@ -350,7 +341,7 @@ class npc_stinky_icc : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_stinky_iccAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_stinky_iccAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -220,14 +220,6 @@ class boss_lady_deathwhisper : public CreatureScript
|
||||
dominateMindCount = RAID_MODE<uint8>(0, 1, 1, 3);
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
@@ -628,7 +620,7 @@ class boss_lady_deathwhisper : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_lady_deathwhisperAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_lady_deathwhisperAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -707,7 +699,7 @@ class npc_cult_fanatic : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_cult_fanaticAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_cult_fanaticAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -793,7 +785,7 @@ class npc_cult_adherent : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new npc_cult_adherentAI(pCreature);
|
||||
return GetIcecrownCitadelAI<npc_cult_adherentAI>(pCreature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -833,7 +825,7 @@ class npc_vengeful_shade : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_vengeful_shadeAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_vengeful_shadeAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -953,7 +945,7 @@ class npc_darnavan : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_darnavanAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_darnavanAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -93,14 +93,6 @@ class boss_lord_marrowgar : public CreatureScript
|
||||
boneSlice = false;
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
@@ -260,7 +252,7 @@ class boss_lord_marrowgar : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_lord_marrowgarAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_lord_marrowgarAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -334,7 +326,7 @@ class npc_coldflame : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_coldflameAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_coldflameAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -392,7 +384,7 @@ class npc_bone_spike : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_bone_spikeAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_bone_spikeAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -190,14 +190,6 @@ class boss_professor_putricide : public CreatureScript
|
||||
phase = PHASE_NONE;
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (!(events.GetPhaseMask() & PHASE_MASK_NOT_SELF))
|
||||
@@ -690,7 +682,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_professor_putricideAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_professor_putricideAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -751,7 +743,7 @@ class npc_volatile_ooze : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_volatile_oozeAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_volatile_oozeAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -88,14 +88,6 @@ class boss_rotface : public CreatureScript
|
||||
infectionCooldown = 14000;
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
@@ -237,7 +229,7 @@ class boss_rotface : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_rotfaceAI(creature);
|
||||
return GetIcecrownCitadelAI<boss_rotfaceAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -287,7 +279,7 @@ class npc_little_ooze : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_little_oozeAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_little_oozeAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -298,7 +290,7 @@ class npc_big_ooze : public CreatureScript
|
||||
|
||||
struct npc_big_oozeAI : public ScriptedAI
|
||||
{
|
||||
npc_big_oozeAI(Creature* creature) : ScriptedAI(creature)
|
||||
npc_big_oozeAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -311,16 +303,14 @@ class npc_big_ooze : public CreatureScript
|
||||
DoCast(me, SPELL_GREEN_ABOMINATION_HITTIN__YA_PROC, true);
|
||||
events.ScheduleEvent(EVENT_STICKY_OOZE, 5000);
|
||||
// register in Rotface's summons - not summoned with Rotface as owner
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
|
||||
rotface->AI()->JustSummoned(me);
|
||||
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
|
||||
rotface->AI()->JustSummoned(me);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
|
||||
rotface->AI()->SummonedCreatureDespawn(me);
|
||||
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
|
||||
rotface->AI()->SummonedCreatureDespawn(me);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
@@ -355,11 +345,12 @@ class npc_big_ooze : public CreatureScript
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
InstanceScript* instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_big_oozeAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_big_oozeAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -414,8 +405,7 @@ class npc_precious_icc : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*who*/)
|
||||
{
|
||||
uint64 rotfaceGUID = instance ? instance->GetData64(DATA_ROTFACE) : 0;
|
||||
if (Creature* rotface = Unit::GetCreature(*me, rotfaceGUID))
|
||||
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
|
||||
if (rotface->isAlive())
|
||||
rotface->AI()->Talk(SAY_PRECIOUS_DIES);
|
||||
}
|
||||
@@ -427,7 +417,7 @@ class npc_precious_icc : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_precious_iccAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_precious_iccAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -31,36 +31,36 @@
|
||||
enum Texts
|
||||
{
|
||||
// Highlord Tirion Fordring (at Light's Hammer)
|
||||
SAY_TIRION_INTRO_1 = 0,
|
||||
SAY_TIRION_INTRO_2 = 1,
|
||||
SAY_TIRION_INTRO_3 = 2,
|
||||
SAY_TIRION_INTRO_4 = 3,
|
||||
SAY_TIRION_INTRO_H_5 = 4,
|
||||
SAY_TIRION_INTRO_A_5 = 5,
|
||||
SAY_TIRION_INTRO_1 = 0,
|
||||
SAY_TIRION_INTRO_2 = 1,
|
||||
SAY_TIRION_INTRO_3 = 2,
|
||||
SAY_TIRION_INTRO_4 = 3,
|
||||
SAY_TIRION_INTRO_H_5 = 4,
|
||||
SAY_TIRION_INTRO_A_5 = 5,
|
||||
|
||||
// The Lich King (at Light's Hammer)
|
||||
SAY_LK_INTRO_1 = 0,
|
||||
SAY_LK_INTRO_2 = 1,
|
||||
SAY_LK_INTRO_3 = 2,
|
||||
SAY_LK_INTRO_4 = 3,
|
||||
SAY_LK_INTRO_5 = 4,
|
||||
SAY_LK_INTRO_1 = 0,
|
||||
SAY_LK_INTRO_2 = 1,
|
||||
SAY_LK_INTRO_3 = 2,
|
||||
SAY_LK_INTRO_4 = 3,
|
||||
SAY_LK_INTRO_5 = 4,
|
||||
|
||||
// Highlord Bolvar Fordragon (at Light's Hammer)
|
||||
SAY_BOLVAR_INTRO_1 = 0,
|
||||
SAY_BOLVAR_INTRO_1 = 0,
|
||||
|
||||
// High Overlord Saurfang (at Light's Hammer)
|
||||
SAY_SAURFANG_INTRO_1 = 15,
|
||||
SAY_SAURFANG_INTRO_2 = 16,
|
||||
SAY_SAURFANG_INTRO_3 = 17,
|
||||
SAY_SAURFANG_INTRO_4 = 18,
|
||||
SAY_SAURFANG_INTRO_1 = 15,
|
||||
SAY_SAURFANG_INTRO_2 = 16,
|
||||
SAY_SAURFANG_INTRO_3 = 17,
|
||||
SAY_SAURFANG_INTRO_4 = 18,
|
||||
|
||||
// Muradin Bronzebeard (at Light's Hammer)
|
||||
SAY_MURADIN_INTRO_1 = 13,
|
||||
SAY_MURADIN_INTRO_2 = 14,
|
||||
SAY_MURADIN_INTRO_3 = 15,
|
||||
SAY_MURADIN_INTRO_1 = 13,
|
||||
SAY_MURADIN_INTRO_2 = 14,
|
||||
SAY_MURADIN_INTRO_3 = 15,
|
||||
|
||||
// Rotting Frost Giant
|
||||
EMOTE_DEATH_PLAGUE_WARNING = 0,
|
||||
EMOTE_DEATH_PLAGUE_WARNING = 0,
|
||||
};
|
||||
|
||||
enum Spells
|
||||
@@ -152,9 +152,6 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript
|
||||
// of The Damned SAI
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (type == DATA_DAMNED_KILLS && data == 1)
|
||||
{
|
||||
if (++_damnedKills == 2)
|
||||
@@ -338,7 +335,7 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_highlord_tirion_fordringAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_highlord_tirion_fordringAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -410,7 +407,7 @@ class npc_rotting_frost_giant : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_rotting_frost_giantAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_rotting_frost_giantAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -459,7 +456,7 @@ class npc_frost_freeze_trap : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_frost_freeze_trapAI(creature);
|
||||
return GetIcecrownCitadelAI<npc_frost_freeze_trapAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#define ICECROWN_CITADEL_H_
|
||||
|
||||
#include "SpellScript.h"
|
||||
#include "Map.h"
|
||||
#include "Creature.h"
|
||||
|
||||
#define ICCScriptName "instance_icecrown_citadel"
|
||||
|
||||
@@ -370,4 +372,14 @@ class spell_trigger_spell_from_caster : public SpellScriptLoader
|
||||
uint32 _triggerId;
|
||||
};
|
||||
|
||||
template<class AI>
|
||||
CreatureAI* GetIcecrownCitadelAI(Creature* creature)
|
||||
{
|
||||
if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
|
||||
if (instance->GetInstanceScript())
|
||||
if (instance->GetScriptId() == GetScriptId(ICCScriptName))
|
||||
return new AI(creature);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // ICECROWN_CITADEL_H_
|
||||
|
||||
Reference in New Issue
Block a user