Core/Scripts: Improvements to Trial of the Crusader

*Fixed creature_text errors.
*Icehowl now works properly
*Fixed waypoints so creatures don't enter the arena through the wall,
Lich King now spawns at a proper place, after you start a new fight
corpse of a the previous boss despawns (chest also after you start
valkyries).

Closes #7415
This commit is contained in:
Stalker-Riddick
2012-08-21 15:19:42 +01:00
committed by Nay
parent e3052f8d16
commit a84ac50f1c
8 changed files with 46 additions and 22 deletions
@@ -0,0 +1,3 @@
-- Added trigger flags to triggers
UPDATE `creature_template` SET `flags_extra` = flags_extra | 128 WHERE `entry` = 34862;
UPDATE `creature_template` SET `unit_flags` = unit_flags | 256 WHERE `entry` = 34862;
@@ -207,7 +207,7 @@ public:
{ {
if (!m_bIntro) if (!m_bIntro)
{ {
DoScriptText(SAY_INTRO, me); Talk(SAY_INTRO);
m_bIntro = false; m_bIntro = false;
} }
} }
@@ -225,7 +225,7 @@ public:
void JustDied(Unit* /*killer*/) void JustDied(Unit* /*killer*/)
{ {
Summons.DespawnAll(); Summons.DespawnAll();
DoScriptText(SAY_DEATH, me); Talk(SAY_DEATH);
if (instance) if (instance)
instance->SetData(TYPE_ANUBARAK, DONE); instance->SetData(TYPE_ANUBARAK, DONE);
} }
@@ -242,7 +242,7 @@ public:
break; break;
case NPC_SPIKE: case NPC_SPIKE:
summoned->CombatStart(target); summoned->CombatStart(target);
DoScriptText(EMOTE_SPIKE, me, target); Talk(EMOTE_SPIKE, target->GetGUID());
break; break;
} }
Summons.Summon(summoned); Summons.Summon(summoned);
@@ -260,7 +260,7 @@ public:
void EnterCombat(Unit* /*who*/) void EnterCombat(Unit* /*who*/)
{ {
DoScriptText(SAY_AGGRO, me); Talk(SAY_AGGRO);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetInCombatWithZone(); me->SetInCombatWithZone();
if (instance) if (instance)
@@ -405,8 +405,8 @@ public:
{ {
m_bReachedPhase3 = true; m_bReachedPhase3 = true;
DoCastAOE(SPELL_LEECHING_SWARM); DoCastAOE(SPELL_LEECHING_SWARM);
DoScriptText(EMOTE_LEECHING_SWARM, me); Talk(EMOTE_LEECHING_SWARM);
DoScriptText(SAY_LEECHING_SWARM, me); Talk(SAY_LEECHING_SWARM);
} }
if (m_uiBerserkTimer <= uiDiff && !me->HasAura(SPELL_BERSERK)) if (m_uiBerserkTimer <= uiDiff && !me->HasAura(SPELL_BERSERK))
@@ -161,7 +161,7 @@ public:
void JustDied(Unit* /*killer*/) void JustDied(Unit* /*killer*/)
{ {
Summons.DespawnAll(); Summons.DespawnAll();
DoScriptText(SAY_DEATH, me); Talk(SAY_DEATH);
if (instance) if (instance)
instance->SetData(TYPE_JARAXXUS, DONE); instance->SetData(TYPE_JARAXXUS, DONE);
} }
@@ -176,7 +176,7 @@ public:
me->SetInCombatWithZone(); me->SetInCombatWithZone();
if (instance) if (instance)
instance->SetData(TYPE_JARAXXUS, IN_PROGRESS); instance->SetData(TYPE_JARAXXUS, IN_PROGRESS);
DoScriptText(SAY_AGGRO, me); Talk(SAY_AGGRO);
} }
void UpdateAI(const uint32 uiDiff) void UpdateAI(const uint32 uiDiff)
@@ -186,8 +186,8 @@ public:
if (m_uiSummonInfernalEruptionTimer <= uiDiff) if (m_uiSummonInfernalEruptionTimer <= uiDiff)
{ {
DoScriptText(EMOTE_INFERNAL_ERUPTION, me); Talk(EMOTE_INFERNAL_ERUPTION);
DoScriptText(SAY_INFERNAL_ERUPTION, me); Talk(SAY_INFERNAL_ERUPTION);
DoCast(SPELL_INFERNAL_ERUPTION); DoCast(SPELL_INFERNAL_ERUPTION);
m_uiSummonInfernalEruptionTimer = 2*MINUTE*IN_MILLISECONDS; m_uiSummonInfernalEruptionTimer = 2*MINUTE*IN_MILLISECONDS;
} else m_uiSummonInfernalEruptionTimer -= uiDiff; } else m_uiSummonInfernalEruptionTimer -= uiDiff;
@@ -217,8 +217,8 @@ public:
{ {
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true))
{ {
DoScriptText(EMOTE_INCINERATE, me, target); Talk(EMOTE_INCINERATE, target->GetGUID());
DoScriptText(SAY_INCINERATE, me); Talk(SAY_INCINERATE);
DoCast(target, SPELL_INCINERATE_FLESH); DoCast(target, SPELL_INCINERATE_FLESH);
} }
m_uiIncinerateFleshTimer = urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS); m_uiIncinerateFleshTimer = urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS);
@@ -234,7 +234,7 @@ public:
{ {
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true))
{ {
DoScriptText(EMOTE_LEGION_FLAME, me, target); Talk(EMOTE_LEGION_FLAME, target->GetGUID());
DoCast(target, SPELL_LEGION_FLAME); DoCast(target, SPELL_LEGION_FLAME);
} }
m_uiLegionFlameTimer = 30*IN_MILLISECONDS; m_uiLegionFlameTimer = 30*IN_MILLISECONDS;
@@ -905,6 +905,8 @@ public:
if (m_uiMassiveCrashTimer <= diff) if (m_uiMassiveCrashTimer <= diff)
{ {
me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 10.0f, 20.0f); // 1: Middle of the room me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 10.0f, 20.0f); // 1: Middle of the room
SetCombatMovement(false);
me->AttackStop();
m_uiStage = 7; //Invalid (Do nothing more than move) m_uiStage = 7; //Invalid (Do nothing more than move)
m_uiMassiveCrashTimer = 30*IN_MILLISECONDS; m_uiMassiveCrashTimer = 30*IN_MILLISECONDS;
} else m_uiMassiveCrashTimer -= diff; } else m_uiMassiveCrashTimer -= diff;
@@ -913,22 +915,28 @@ public:
break; break;
case 1: case 1:
DoCastAOE(SPELL_MASSIVE_CRASH); DoCastAOE(SPELL_MASSIVE_CRASH);
me->StopMoving();
me->AttackStop();
m_uiStage = 2; m_uiStage = 2;
break; break;
case 2: case 2:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
{ {
me->StopMoving();
me->AttackStop();
m_uiTrampleTargetGUID = target->GetGUID(); m_uiTrampleTargetGUID = target->GetGUID();
me->SetTarget(m_uiTrampleTargetGUID); me->SetTarget(m_uiTrampleTargetGUID);
m_bTrampleCasted = false; m_bTrampleCasted = false;
SetCombatMovement(false); //SetCombatMovement(false);
me->GetMotionMaster()->MoveIdle(); //me->GetMotionMaster()->MoveIdle();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_uiTrampleTimer = 4*IN_MILLISECONDS; m_uiTrampleTimer = 4*IN_MILLISECONDS;
m_uiStage = 3; m_uiStage = 3;
} else m_uiStage = 6; } else m_uiStage = 6;
break; break;
case 3: case 3:
me->StopMoving();
me->AttackStop();
if (m_uiTrampleTimer <= diff) if (m_uiTrampleTimer <= diff)
{ {
if (Unit* target = Unit::GetPlayer(*me, m_uiTrampleTargetGUID)) if (Unit* target = Unit::GetPlayer(*me, m_uiTrampleTargetGUID))
@@ -941,12 +949,14 @@ public:
me->GetMotionMaster()->MoveJump(2*me->GetPositionX()-m_fTrampleTargetX, me->GetMotionMaster()->MoveJump(2*me->GetPositionX()-m_fTrampleTargetX,
2*me->GetPositionY()-m_fTrampleTargetY, 2*me->GetPositionY()-m_fTrampleTargetY,
me->GetPositionZ(), me->GetPositionZ(),
10.0f, 20.0f); // 2: Hop Backwards 20.0f, 30.0f); // 2: Hop Backwards
m_uiStage = 7; //Invalid (Do nothing more than move) m_uiStage = 7; //Invalid (Do nothing more than move)
} else m_uiStage = 6; } else m_uiStage = 6;
} else m_uiTrampleTimer -= diff; } else m_uiTrampleTimer -= diff;
break; break;
case 4: case 4:
me->StopMoving();
me->AttackStop();
Talk(EMOTE_TRAMPLE_START, m_uiTrampleTargetGUID); Talk(EMOTE_TRAMPLE_START, m_uiTrampleTargetGUID);
me->GetMotionMaster()->MoveCharge(m_fTrampleTargetX, m_fTrampleTargetY, m_fTrampleTargetZ+2, 42, 1); me->GetMotionMaster()->MoveCharge(m_fTrampleTargetX, m_fTrampleTargetY, m_fTrampleTargetZ+2, 42, 1);
me->SetTarget(0); me->SetTarget(0);
@@ -254,7 +254,7 @@ struct boss_twin_baseAI : public ScriptedAI
void JustDied(Unit* /*killer*/) void JustDied(Unit* /*killer*/)
{ {
DoScriptText(SAY_DEATH, me); Talk(SAY_DEATH);
if (instance) if (instance)
{ {
if (Creature* pSister = GetSister()) if (Creature* pSister = GetSister())
@@ -296,7 +296,7 @@ struct boss_twin_baseAI : public ScriptedAI
instance->SetData(TYPE_VALKIRIES, IN_PROGRESS); instance->SetData(TYPE_VALKIRIES, IN_PROGRESS);
} }
DoScriptText(SAY_AGGRO, me); Talk(SAY_AGGRO);
DoCast(me, m_uiSurgeSpellId); DoCast(me, m_uiSurgeSpellId);
} }
@@ -384,7 +384,7 @@ struct boss_twin_baseAI : public ScriptedAI
if (!m_bIsBerserk && m_uiBerserkTimer <= uiDiff) if (!m_bIsBerserk && m_uiBerserkTimer <= uiDiff)
{ {
DoCast(me, SPELL_BERSERK); DoCast(me, SPELL_BERSERK);
DoScriptText(SAY_BERSERK, me); Talk(SAY_BERSERK);
m_bIsBerserk = true; m_bIsBerserk = true;
} }
else else
@@ -244,10 +244,18 @@ class instance_trial_of_the_crusader : public InstanceMapScript
switch (type) switch (type)
{ {
case TYPE_JARAXXUS: case TYPE_JARAXXUS:
// Cleanup Icehowl
if (Creature* icehowl = instance->GetCreature(IcehowlGUID))
icehowl->DespawnOrUnsummon();
if (data == DONE) if (data == DONE)
EventStage = 2000; EventStage = 2000;
break; break;
case TYPE_CRUSADERS: case TYPE_CRUSADERS:
// Cleanup Jaraxxus
if (Creature* jaraxxus = instance->GetCreature(JaraxxusGUID))
jaraxxus->DespawnOrUnsummon();
if (Creature* fizzlebang = instance->GetCreature(FizzlebangGUID))
fizzlebang->DespawnOrUnsummon();
switch (data) switch (data)
{ {
case IN_PROGRESS: case IN_PROGRESS:
@@ -267,6 +275,9 @@ class instance_trial_of_the_crusader : public InstanceMapScript
} }
break; break;
case TYPE_VALKIRIES: case TYPE_VALKIRIES:
// Cleanup chest
if (GameObject* cache = instance->GetGameObject(CrusadersCacheGUID))
cache->Delete();
switch (data) switch (data)
{ {
case FAIL: case FAIL:
@@ -789,7 +789,7 @@ class npc_tirion_toc : public CreatureScript
case 5005: case 5005:
m_uiUpdateTimer = 8000; m_uiUpdateTimer = 8000;
instance->SetData(TYPE_EVENT, 5010); instance->SetData(TYPE_EVENT, 5010);
me->SummonCreature(NPC_LICH_KING_1, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5); me->SummonCreature(NPC_LICH_KING_1, ToCCommonLoc[2].GetPositionX(), ToCCommonLoc[2].GetPositionY(), ToCCommonLoc[2].GetPositionZ(), 5);
break; break;
case 5020: case 5020:
Talk(SAY_STAGE_4_03); Talk(SAY_STAGE_4_03);
@@ -53,8 +53,8 @@ const Position ToCCommonLoc[]=
{563.833008f, 195.244995f, 394.585561f, 0}, // 5 - Center {563.833008f, 195.244995f, 394.585561f, 0}, // 5 - Center
{573.5f, 180.5f, 395.14f, 0}, // 6 Move 0 Right {573.5f, 180.5f, 395.14f, 0}, // 6 Move 0 Right
{553.5f, 180.5f, 395.14f, 0}, // 7 Move 0 Left {553.5f, 180.5f, 395.14f, 0}, // 7 Move 0 Left
{585.5f, 170.0f, 395.14f, 0}, // 8 Move 1 Right {573.0f, 170.0f, 395.14f, 0}, // 8 Move 1 Right
{545.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left {555.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left
{563.8f, 216.1f, 395.1f, 0}, // 10 Behind the door {563.8f, 216.1f, 395.1f, 0}, // 10 Behind the door
{575.042358f, 195.260727f, 395.137146f, 0}, // 5 {575.042358f, 195.260727f, 395.137146f, 0}, // 5