aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp7
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp10
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp139
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp1098
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp13
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h114
6 files changed, 699 insertions, 682 deletions
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp
index f38b3882e7a..602f12065fa 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp
@@ -84,13 +84,6 @@ enum Spells
SPELL_BLAZE_BURN = 45246
};
-enum Creatures
-{
- GRAND_WARLOCK_ALYTHESS = 25166,
- MOB_SHADOW_IMAGE = 25214,
- LADY_SACROLASH = 25165
-};
-
struct boss_sacrolashAI : public ScriptedAI
{
boss_sacrolashAI(Creature *c) : ScriptedAI(c)
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp
index d45e29f916d..88ad2dbab11 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp
@@ -79,16 +79,6 @@ enum Spells
SPELL_CLOUD_SUMMON = 45884,
};
-enum Creatures
-{
- MOB_DEAD = 25268,
- MOB_FLIGHT_LEFT = 25357,
- MOB_FLIGHT_RIGHT = 25358,
- MOB_DEATH_CLOUD = 25703,
- MOB_VAPOR = 25265,
- MOB_VAPOR_TRAIL = 25267,
-};
-
enum PhaseFelmyst
{
PHASE_NONE,
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp
index 7b404d101bf..146771325eb 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp
@@ -1,18 +1,18 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
/* ScriptData
SDName: Boss_Kalecgos
@@ -24,68 +24,62 @@ EndScriptData */
#include "ScriptedPch.h"
#include "sunwell_plateau.h"
-enum Quotes
+enum Yells
{
//Kalecgos dragon form
- SAY_EVIL_AGGRO = -1580000,
- SAY_EVIL_SPELL1 = -1580001,
- SAY_EVIL_SPELL2 = -1580002,
- SAY_EVIL_SLAY1 = -1580003,
- SAY_EVIL_SLAY2 = -1580004,
- SAY_EVIL_ENRAGE = -1580005,
+ SAY_EVIL_AGGRO = -1580000,
+ SAY_EVIL_SPELL1 = -1580001,
+ SAY_EVIL_SPELL2 = -1580002,
+ SAY_EVIL_SLAY1 = -1580003,
+ SAY_EVIL_SLAY2 = -1580004,
+ SAY_EVIL_ENRAGE = -1580005,
//Kalecgos humanoid form
- SAY_GOOD_AGGRO = -1580006,
- SAY_GOOD_NEAR_DEATH = -1580007,
- SAY_GOOD_NEAR_DEATH2 = -1580008,
- SAY_GOOD_PLRWIN = -1580009,
+ SAY_GOOD_AGGRO = -1580006,
+ SAY_GOOD_NEAR_DEATH = -1580007,
+ SAY_GOOD_NEAR_DEATH2 = -1580008,
+ SAY_GOOD_PLRWIN = -1580009,
//Sathrovarr
- SAY_SATH_AGGRO = -1580010,
- SAY_SATH_DEATH = -1580011,
- SAY_SATH_SPELL1 = -1580012,
- SAY_SATH_SPELL2 = -1580013,
- SAY_SATH_SLAY1 = -1580014,
- SAY_SATH_SLAY2 = -1580015,
- SAY_SATH_ENRAGE = -1580016
+ SAY_SATH_AGGRO = -1580010,
+ SAY_SATH_DEATH = -1580011,
+ SAY_SATH_SPELL1 = -1580012,
+ SAY_SATH_SPELL2 = -1580013,
+ SAY_SATH_SLAY1 = -1580014,
+ SAY_SATH_SLAY2 = -1580015,
+ SAY_SATH_ENRAGE = -1580016,
};
-enum SpellIds
+enum Spells
{
- AURA_SUNWELL_RADIANCE = 45769,
- AURA_SPECTRAL_EXHAUSTION = 44867,
- AURA_SPECTRAL_REALM = 46021,
- AURA_SPECTRAL_INVISIBILITY = 44801,
- AURA_DEMONIC_VISUAL = 44800,
-
- SPELL_SPECTRAL_BLAST = 44869,
- SPELL_TELEPORT_SPECTRAL = 46019,
- SPELL_ARCANE_BUFFET = 45018,
- SPELL_FROST_BREATH = 44799,
- SPELL_TAIL_LASH = 45122,
-
- SPELL_BANISH = 44836,
- SPELL_TRANSFORM_KALEC = 44670,
- SPELL_ENRAGE = 44807,
-
- SPELL_CORRUPTION_STRIKE = 45029,
- SPELL_AGONY_CURSE = 45032,
- SPELL_SHADOW_BOLT = 45031,
-
- SPELL_HEROIC_STRIKE = 45026,
- SPELL_REVITALIZE = 45027
+ AURA_SUNWELL_RADIANCE = 45769,
+ AURA_SPECTRAL_EXHAUSTION = 44867,
+ AURA_SPECTRAL_REALM = 46021,
+ AURA_SPECTRAL_INVISIBILITY = 44801,
+ AURA_DEMONIC_VISUAL = 44800,
+
+ SPELL_SPECTRAL_BLAST = 44869,
+ SPELL_TELEPORT_SPECTRAL = 46019,
+ SPELL_ARCANE_BUFFET = 45018,
+ SPELL_FROST_BREATH = 44799,
+ SPELL_TAIL_LASH = 45122,
+
+ SPELL_BANISH = 44836,
+ SPELL_TRANSFORM_KALEC = 44670,
+ SPELL_ENRAGE = 44807,
+
+ SPELL_CORRUPTION_STRIKE = 45029,
+ SPELL_AGONY_CURSE = 45032,
+ SPELL_SHADOW_BOLT = 45031,
+
+ SPELL_HEROIC_STRIKE = 45026,
+ SPELL_REVITALIZE = 45027
};
-enum Creatures
-{
- MOB_KALECGOS = 24850,
- MOB_KALEC = 24891,
- MOB_SATHROVARR = 24892
-};
enum SWPActions
{
- DO_ENRAGE = 1,
- DO_BANISH = 2
+ DO_ENRAGE = 1,
+ DO_BANISH = 2,
};
#define GO_FAILED "You are unable to use this currently."
@@ -114,7 +108,7 @@ struct boss_kalecgosAI : public ScriptedAI
pInstance = c->GetInstanceData();
SathGUID = 0;
DoorGUID = 0;
- JustReseted = false;
+ bJustReset = false;
me->setActive(true);
SpellEntry *TempSpell = GET_SPELL(SPELL_SPECTRAL_BLAST);
if (TempSpell)
@@ -136,7 +130,7 @@ struct boss_kalecgosAI : public ScriptedAI
bool isFriendly;
bool isEnraged;
bool isBanished;
- bool JustReseted;
+ bool bJustReset;
uint64 SathGUID;
uint64 DoorGUID;
@@ -153,7 +147,7 @@ struct boss_kalecgosAI : public ScriptedAI
Sath->AI()->EnterEvadeMode();
me->setFaction(14);
- if (!JustReseted)//first reset at create
+ if (!bJustReset) //first reset at create
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
@@ -178,7 +172,7 @@ struct boss_kalecgosAI : public ScriptedAI
void EnterEvadeMode()
{
- JustReseted = true;
+ bJustReset = true;
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
ScriptedAI::EnterEvadeMode();
@@ -223,16 +217,16 @@ struct boss_kalecgosAI : public ScriptedAI
}
else
{
- if (JustReseted)
+ if (bJustReset)
{
if (ResetTimer <= diff)
{
- 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->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SetVisibility(VISIBILITY_ON);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
ResetTimer = 10000;
- JustReseted = false;
+ bJustReset = false;
} else ResetTimer -= diff;
return;
}
@@ -325,15 +319,14 @@ struct boss_kalecgosAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (JustReseted)//boss is invisible, don't attack
+ if (bJustReset)//boss is invisible, don't attack
return;
+
if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)))
{
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, attackRadius))
- {
AttackStart(who);
- }
}
}
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp
index 6e8ec122e9c..f1c3a769b28 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp
@@ -16,168 +16,148 @@
/* ScriptData
SDName: Boss_Kiljaeden
-SD%Complete: 70
-SDComment: Phase4, Phase5, Shadow Spike, Armageddon
+SD%Complete: 80
+SDComment: Sinister Reflection Model, Armageddon Visual, SAY_KJ_SHADOWSPIKE3, Emote, End Sequence
SDCategory: Sunwell_Plateau
EndScriptData */
-//TODO rewrite Amagedon
-//TODO Remove blue visual from Orbs on reset and if it is used
+//TODO rewrite Armageddon
#include "ScriptedPch.h"
#include "sunwell_plateau.h"
#include <math.h>
/*** Speech and sounds***/
-enum Speeches
+enum Yells
{
// These are used throughout Sunwell and Magisters(?). Players can hear this while running through the instances.
- SAY_KJ_OFFCOMBAT1 = -1580066,
- SAY_KJ_OFFCOMBAT2 = -1580067,
- SAY_KJ_OFFCOMBAT3 = -1580068,
- SAY_KJ_OFFCOMBAT4 = -1580069,
- SAY_KJ_OFFCOMBAT5 = -1580070,
+ SAY_KJ_OFFCOMBAT1 = -1580066,
+ SAY_KJ_OFFCOMBAT2 = -1580067,
+ SAY_KJ_OFFCOMBAT3 = -1580068,
+ SAY_KJ_OFFCOMBAT4 = -1580069,
+ SAY_KJ_OFFCOMBAT5 = -1580070,
// Encounter speech and sounds
- SAY_KJ_EMERGE = -1580071,
- SAY_KJ_SLAY1 = -1580072,
- SAY_KJ_SLAY2 = -1580073,
- SAY_KJ_REFLECTION1 = -1580074,
- SAY_KJ_REFLECTION2 = -1580075,
- SAY_KJ_DARKNESS1 = -1580076,
- SAY_KJ_DARKNESS2 = -1580077,
- SAY_KJ_DARKNESS3 = -1580078,
- SAY_KJ_PHASE3 = -1580079,
- SAY_KJ_PHASE4 = -1580080,
- SAY_KJ_PHASE5 = -1580081,
- SAY_KJ_DEATH = -1580093,
- EMOTE_KJ_DARKNESS = -1580094,
+ SAY_KJ_EMERGE = -1580071,
+ SAY_KJ_SLAY1 = -1580072,
+ SAY_KJ_SLAY2 = -1580073,
+ SAY_KJ_REFLECTION1 = -1580074,
+ SAY_KJ_REFLECTION2 = -1580075,
+ SAY_KJ_DARKNESS1 = -1580076,
+ SAY_KJ_DARKNESS2 = -1580077,
+ SAY_KJ_DARKNESS3 = -1580078,
+ SAY_KJ_PHASE3 = -1580079,
+ SAY_KJ_PHASE4 = -1580080,
+ SAY_KJ_PHASE5 = -1580081,
+ SAY_KJ_DEATH = -1580093,
+ EMOTE_KJ_DARKNESS = -1580094,
/*** Kalecgos - Anveena speech at the beginning of Phase 5; Anveena's sacrifice ***/
- SAY_KALECGOS_AWAKEN = -1580082,
- SAY_ANVEENA_IMPRISONED = -1580083,
- SAY_KALECGOS_LETGO = -1580084,
- SAY_ANVEENA_LOST = -1580085,
- SAY_KALECGOS_FOCUS = -1580086,
- SAY_ANVEENA_KALEC = -1580087,
- SAY_KALECGOS_FATE = -1580088,
- SAY_ANVEENA_GOODBYE = -1580089,
- SAY_KALECGOS_GOODBYE = -1580090,
- SAY_KALECGOS_ENCOURAGE = -1580091,
+ SAY_KALECGOS_AWAKEN = -1580082,
+ SAY_ANVEENA_IMPRISONED = -1580083,
+ SAY_KALECGOS_LETGO = -1580084,
+ SAY_ANVEENA_LOST = -1580085,
+ SAY_KALECGOS_FOCUS = -1580086,
+ SAY_ANVEENA_KALEC = -1580087,
+ SAY_KALECGOS_FATE = -1580088,
+ SAY_ANVEENA_GOODBYE = -1580089,
+ SAY_KALECGOS_GOODBYE = -1580090,
+ SAY_KALECGOS_ENCOURAGE = -1580091,
/*** Kalecgos says throughout the fight ***/
- SAY_KALECGOS_JOIN = -1580092,
- SAY_KALEC_ORB_READY1 = -1580095,
- SAY_KALEC_ORB_READY2 = -1580096,
- SAY_KALEC_ORB_READY3 = -1580097,
- SAY_KALEC_ORB_READY4 = -1580098
+ SAY_KALECGOS_JOIN = -1580092,
+ SAY_KALEC_ORB_READY1 = -1580095,
+ SAY_KALEC_ORB_READY2 = -1580096,
+ SAY_KALEC_ORB_READY3 = -1580097,
+ SAY_KALEC_ORB_READY4 = -1580098
};
/*** Spells used during the encounter ***/
-enum SpellIds
+enum Spells
{
/* Hand of the Deceiver's spells and cosmetics */
- SPELL_SHADOW_BOLT_VOLLEY = 45770, // ~30 yard range Shadow Bolt Volley for ~2k(?) damage
- SPELL_SHADOW_INFUSION = 45772, // They gain this at 20% - Immunity to Stun/Silence and makes them look angry!
- SPELL_FELFIRE_PORTAL = 46875, // Creates a portal that spawns Felfire Fiends (LIVE FOR THE SWARM!1 FOR THE OVERMIND!)
- SPELL_SHADOW_CHANNELING = 46757, // Channeling animation out of combat
+ SPELL_SHADOW_BOLT_VOLLEY = 45770, // ~30 yard range Shadow Bolt Volley for ~2k(?) damage
+ SPELL_SHADOW_INFUSION = 45772, // They gain this at 20% - Immunity to Stun/Silence and makes them look angry!
+ SPELL_FELFIRE_PORTAL = 46875, // Creates a portal that spawns Felfire Fiends (LIVE FOR THE SWARM!1 FOR THE OVERMIND!)
+ SPELL_SHADOW_CHANNELING = 46757, // Channeling animation out of combat
/* Volatile Felfire Fiend's spells */
- SPELL_FELFIRE_FISSION = 45779, // Felfire Fiends explode when they die or get close to target.
+ SPELL_FELFIRE_FISSION = 45779, // Felfire Fiends explode when they die or get close to target.
/* Kil'Jaeden's spells and cosmetics */
- SPELL_TRANS = 23188, // Surprisingly, this seems to be the right spell.. (Where is it used?)
- SPELL_REBIRTH = 44200, // Emerge from the Sunwell
- SPELL_SOUL_FLAY = 45442, // 9k Shadow damage over 3 seconds. Spammed throughout all the fight.
- SPELL_SOUL_FLAY_SLOW = 47106,
- SPELL_LEGION_LIGHTNING = 45664, // Chain Lightning, 4 targets, ~3k Shadow damage, 1.5k mana burn
- SPELL_FIRE_BLOOM = 45641, // Places a debuff on 5 raid members, which causes them to deal 2k Fire damage to nearby allies and selves. MIGHT NOT WORK
-
- SPELL_SINISTER_REFLECTION = 45785, // Summon shadow copies of 5 raid members that fight against KJ's enemies
- SPELL_COPY_WEAPON = 41055, // }
- SPELL_COPY_WEAPON2 = 41054, // }
- SPELL_COPY_OFFHAND = 45206, // }- Spells used in Sinister Reflection creation
- SPELL_COPY_OFFHAND_WEAPON = 45205, // }
-
- SPELL_SHADOW_SPIKE = 46680, // Bombard random raid members with Shadow Spikes (Very similar to Void Reaver orbs)
- SPELL_FLAME_DART = 45737, // Bombards the raid with flames every 3(?) seconds
- SPELL_DARKNESS_OF_A_THOUSAND_SOULS = 46605, // Begins a 8-second channeling, after which he will deal 50'000 damage to the raid
- SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE = 45657,
+ SPELL_TRANS = 23188, // Surprisingly, this seems to be the right spell.. (Where is it used?)
+ SPELL_REBIRTH = 44200, // Emerge from the Sunwell
+ SPELL_SOUL_FLAY = 45442, // 9k Shadow damage over 3 seconds. Spammed throughout all the fight.
+ SPELL_SOUL_FLAY_SLOW = 47106,
+ SPELL_LEGION_LIGHTNING = 45664, // Chain Lightning, 4 targets, ~3k Shadow damage, 1.5k mana burn
+ SPELL_FIRE_BLOOM = 45641, // Places a debuff on 5 raid members, which causes them to deal 2k Fire damage to nearby allies and selves. MIGHT NOT WORK
+ SPELL_DESTROY_ALL_DRAKES = 46707, // when he use it?
+
+ SPELL_SINISTER_REFLECTION = 45785, // Summon shadow copies of 5 raid members that fight against KJ's enemies//dont work
+ // 45892 // right one for SPELL_SINISTER_REFLECTION but no EffectScriptEffect
+ SPELL_COPY_WEAPON = 41055, // }
+ SPELL_COPY_WEAPON2 = 41054, // }
+ SPELL_COPY_OFFHAND = 45206, // }- Spells used in Sinister Reflection creation
+ SPELL_COPY_OFFHAND_WEAPON = 45205, // }
+
+ SPELL_SHADOW_SPIKE = 46680, // Bombard random raid members with Shadow Spikes (Very similar to Void Reaver orbs)
+ SPELL_FLAME_DART = 45737, // Bombards the raid with flames every 3(?) seconds
+ SPELL_DARKNESS_OF_A_THOUSAND_SOULS = 46605, // Begins a 8-second channeling, after which he will deal 50'000 damage to the raid
+ SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE = 45657,
/* Armageddon spells wrong visual */
- SPELL_ARMAGEDDON_TRIGGER = 45909, // Meteor spell trigger missile should cast Creature on himself
- SPELL_ARMAGEDDON_VISUAL = 45911, // Does the hellfire visual to indicate where the meteor missle lands
- SPELL_ARMAGEDDON_VISUAL2 = 45914, // Does the light visual to indicate where the meteor missle lands
- SPELL_ARMAGEDDON_VISUAL3 = 24207, // This shouldn't correct but same as seen on the movie
- SPELL_ARMAGEDDON_SUMMON_TRIGGER = 45921, // Summons the triggers that cast the spells on himself need random target select
- SPELL_ARMAGEDDON_DAMAGE = 45915, // This does the area damage
+ SPELL_ARMAGEDDON_TRIGGER = 45909, // Meteor spell trigger missile should cast Creature on himself
+ SPELL_ARMAGEDDON_VISUAL = 45911, // Does the hellfire visual to indicate where the meteor missle lands
+ SPELL_ARMAGEDDON_VISUAL2 = 45914, // Does the light visual to indicate where the meteor missle lands
+ SPELL_ARMAGEDDON_VISUAL3 = 24207, // This shouldn't correct but same as seen on the movie
+ SPELL_ARMAGEDDON_SUMMON_TRIGGER = 45921, // Summons the triggers that cast the spells on himself need random target select
+ SPELL_ARMAGEDDON_DAMAGE = 45915, // This does the area damage
/* Shield Orb Spells*/
- SPELL_SHADOW_BOLT = 45680, //45679 would be correct but triggers to often //TODO fix console error
+ SPELL_SHADOW_BOLT = 45680, //45679 would be correct but triggers to often //TODO fix console error
/* Anveena's spells and cosmetics (Or, generally, everything that has "Anveena" in name) */
- SPELL_ANVEENA_PRISON = 46367, // She hovers locked within a bubble
- SPELL_ANVEENA_ENERGY_DRAIN = 46410, // Sunwell energy glow animation (Control mob uses this)
- SPELL_SACRIFICE_OF_ANVEENA = 46474, // This is cast on Kil'Jaeden when Anveena sacrifices herself into the Sunwell
+ SPELL_ANVEENA_PRISON = 46367, // She hovers locked within a bubble
+ SPELL_ANVEENA_ENERGY_DRAIN = 46410, // Sunwell energy glow animation (Control mob uses this)
+ SPELL_SACRIFICE_OF_ANVEENA = 46474, // This is cast on Kil'Jaeden when Anveena sacrifices herself into the Sunwell
/* Sinister Reflection Spells */
- SPELL_SR_CURSE_OF_AGONY = 46190,
- SPELL_SR_SHADOW_BOLT = 47076,
+ SPELL_SR_CURSE_OF_AGONY = 46190,
+ SPELL_SR_SHADOW_BOLT = 47076,
- SPELL_SR_EARTH_SHOCK = 47071,
+ SPELL_SR_EARTH_SHOCK = 47071,
- SPELL_SR_FIREBALL = 47074,
+ SPELL_SR_FIREBALL = 47074,
- SPELL_SR_HEMORRHAGE = 45897,
+ SPELL_SR_HEMORRHAGE = 45897,
- SPELL_SR_HOLY_SHOCK = 38921,
- SPELL_SR_HAMMER_OF_JUSTICE = 37369,
+ SPELL_SR_HOLY_SHOCK = 38921,
+ SPELL_SR_HAMMER_OF_JUSTICE = 37369,
- SPELL_SR_HOLY_SMITE = 47077,
- SPELL_SR_RENEW = 47079,
+ SPELL_SR_HOLY_SMITE = 47077,
+ SPELL_SR_RENEW = 47079,
- SPELL_SR_SHOOT = 16496,
- SPELL_SR_MULTI_SHOT = 48098,
- SPELL_SR_WING_CLIP = 40652,
+ SPELL_SR_SHOOT = 16496,
+ SPELL_SR_MULTI_SHOT = 48098,
+ SPELL_SR_WING_CLIP = 40652,
- SPELL_SR_WHIRLWIND = 17207,
+ SPELL_SR_WHIRLWIND = 17207,
- SPELL_SR_MOONFIRE = 47072,
- //SPELL_SR_PLAGU STRIKE = 58843, Dk Spell!
+ SPELL_SR_MOONFIRE = 47072,
+ //SPELL_SR_PLAGU STRIKE = 58843, Dk Spell!
/*** Other Spells (used by players, etc) ***/
- SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT = 45839, // Possess the blue dragon from the orb to help the raid.
- SPELL_ENTROPIUS_BODY = 46819, // Visual for Entropius at the Epilogue
- SPELL_RING_OF_BLUE_FLAMES = 45825 //Cast this spell when the go is activated
+ SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT = 45839, // Possess the blue dragon from the orb to help the raid.
+ SPELL_ENTROPIUS_BODY = 46819, // Visual for Entropius at the Epilogue
+ SPELL_RING_OF_BLUE_FLAMES = 45825 //Cast this spell when the go is activated
};
-enum CreatureIds
-{
- CREATURE_ANVEENA = 26046, // Embodiment of the Sunwell
- CREATURE_KALECGOS = 25319, // Helps the raid throughout the fight
- CREATURE_PROPHET = 26246, // Outro
- CREATURE_KILJAEDEN = 25315, // Give it to 'em KJ!
- CREATURE_HAND_OF_THE_DECEIVER = 25588, // Adds found before KJ emerges
- CREATURE_FELFIRE_PORTAL = 25603, // Portal spawned be Hand of the Deceivers
- CREATURE_VOLATILE_FELFIRE_FIEND = 25598, // Fiends spawned by the above portal
- CREATURE_ARMAGEDDON_TARGET = 25735, // This mob casts meteor on itself.. I think
- CREATURE_SHIELD_ORB = 25502, // Shield orbs circle the room raining shadow bolts on raid
- CREATURE_THE_CORE_OF_ENTROPIUS = 26262, // Used in the ending cinematic?
- CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT = 25653, // NPC that players possess when using the Orb of the Blue Dragonflight
- CREATURE_SPIKE_TARGET1 = 30598, //Should summon these under Shadow Spike Channel on targets place
- CREATURE_SPIKE_TARGET2 = 30614,
- CREATURE_SINISTER_REFLECTION = 25708 //Sinister Relection spawnd on Phase swichtes
-};
-
-/*** GameObjects ***/
-#define GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT 188415
-
/*** Error messages ***/
#define ERROR_KJ_NOT_SUMMONED "TSCR ERROR: Unable to summon Kil'Jaeden for some reason"
/*** Others ***/
-#define FLOOR_Z 28.050388
-#define SHIELD_ORB_Z 45.000
+#define FLOOR_Z 28.050388
+#define SHIELD_ORB_Z 45.000
enum Phase
{
@@ -189,11 +169,12 @@ enum Phase
};
//Timers
-enum KilJaedenTimers {
- TIMER_KALEC_JOIN = 0,
-
+enum KilJaedenTimers
+{
+ TIMER_SPEECH = 0,
+
//Phase 2 Timer
- TIMER_SOUL_FLAY = 1,
+ TIMER_SOUL_FLAY = 1,
TIMER_LEGION_LIGHTNING = 2,
TIMER_FIRE_BLOOM = 3,
TIMER_SUMMON_SHILEDORB = 4,
@@ -209,7 +190,7 @@ enum KilJaedenTimers {
};
// Locations of the Hand of Deceiver adds
-float DeceiverLocations[3][3]=
+Position DeceiverLocations[3]=
{
{1682.045, 631.299, 5.936},
{1684.099, 618.848, 0.589},
@@ -219,17 +200,10 @@ float DeceiverLocations[3][3]=
// Locations, where Shield Orbs will spawn
float ShieldOrbLocations[4][2]=
{
- {1698.900, 627.870}, //middle pont of Sunwell
- {12, 3.14}, // First one spawns northeast of KJ
- {12, 3.14/0.7}, // Second one spawns southeast
- {12, 3.14*3.8} // Third one spawns (?)
-};
-
-float OrbLocations[4][5] = {
- (1694.48, 674.29, 28.0502, 4.86985),
- (1745.68, 621.823, 28.0505, 2.93777),
- (1704.14, 583.591, 28.1696, 1.59003),
- (1653.12, 635.41, 28.0932, 0.0977725),
+ {1698.900, 627.870}, // middle pont of Sunwell
+ {12, 3.14}, // First one spawns northeast of KJ
+ {12, 3.14/0.7}, // Second one spawns southeast
+ {12, 3.14*3.8} // Third one spawns (?)
};
struct Speech
@@ -237,68 +211,32 @@ struct Speech
int32 textid;
uint32 pCreature, timer;
};
-// TODO: Timers
-static Speech Sacrifice[]=
-{
- {SAY_KALECGOS_AWAKEN, CREATURE_KALECGOS, 5000},
- {SAY_ANVEENA_IMPRISONED, CREATURE_ANVEENA, 5000},
- {SAY_KALECGOS_LETGO, CREATURE_KALECGOS, 8000},
- {SAY_ANVEENA_LOST, CREATURE_ANVEENA, 5000},
- {SAY_KALECGOS_FOCUS, CREATURE_KALECGOS, 7000},
- {SAY_ANVEENA_KALEC, CREATURE_ANVEENA, 2000},
- {SAY_KALECGOS_FATE, CREATURE_KALECGOS, 3000},
- {SAY_ANVEENA_GOODBYE, CREATURE_ANVEENA, 6000},
- {SAY_KALECGOS_GOODBYE, CREATURE_KALECGOS, 12000},
- {SAY_KJ_PHASE5, CREATURE_KILJAEDEN, 8000},
- {SAY_KALECGOS_ENCOURAGE, CREATURE_KALECGOS, 5000}
-};
-class AllOrbsInGrid
+// Timers
+static Speech Speeches[]=
{
-public:
- AllOrbsInGrid() {}
- bool operator() (GameObject* pGo)
- {
- if (pGo->GetEntry() == GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT)
- return true;
- return false;
- }
+ //Kil Phase 1 -> Phase 2
+ {SAY_KJ_EMERGE, DATA_KILJAEDEN, 0},
+ {SAY_KALECGOS_JOIN, DATA_KALECGOS_KJ, 26000},
+ //Kil Phase 2 -> Phase 3
+ {SAY_KALECGOS_AWAKEN, DATA_KALECGOS_KJ, 10000},
+ {SAY_ANVEENA_IMPRISONED, DATA_ANVEENA, 5000},
+ {SAY_KJ_PHASE3, DATA_KILJAEDEN, 5000},
+ //Kil Phase 3 -> Phase 4
+ {SAY_KALECGOS_LETGO, DATA_KALECGOS_KJ, 10000},
+ {SAY_ANVEENA_LOST, DATA_ANVEENA, 8000},
+ {SAY_KJ_PHASE4, DATA_KILJAEDEN, 7000},
+ //Kil Phase 4 -> Phase 5
+ {SAY_KALECGOS_FOCUS, DATA_KALECGOS_KJ, 4000},
+ {SAY_ANVEENA_KALEC, DATA_ANVEENA, 11000},
+ {SAY_KALECGOS_FATE, DATA_KALECGOS_KJ, 2000},
+ {SAY_ANVEENA_GOODBYE, DATA_ANVEENA, 6000},
+ {SAY_KJ_PHASE5, DATA_KILJAEDEN, 5500},
+
+ // use in End sequence?
+ {SAY_KALECGOS_GOODBYE, DATA_KALECGOS_KJ, 12000},
};
-bool GOHello_go_orb_of_the_blue_flight(Player* pPlayer, GameObject* pGo)
-{
- if (pGo->GetUInt32Value(GAMEOBJECT_FACTION) == 35)
- {
- //ScriptedInstance* pInstance = pGo->GetInstanceData();
- //float x,y,z;
- //float dx,dy,dz;
- pGo->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
- pPlayer->CastSpell(pPlayer, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, true);
- pGo->SetUInt32Value(GAMEOBJECT_FACTION, 0);
- //if (pInstance)
- // Creature* Kalec = Unit::GetCreature(*pPlayer, pInstance->GetData64(DATA_KALECGOS_KJ));
- //Kalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
- //pGo->GetPosition(x,y,z);
- // this won't work. need rewritten
- /*
- for (uint8 i = 0; i < 4; ++i)
- {
- if (DynamicObject* Dyn = Kalec->GetDynObject(SPELL_RING_OF_BLUE_FLAMES))
- {
- Dyn->GetPosition(dx,dy,dz);
- if (x == dx && dy == y && dz == z)
- {
- Dyn->Delete();
- break;
- }
- }
- }
- */
- pGo->Refresh();
- }
- return true;
-}
-
//AI for Kalecgos
struct boss_kalecgos_kjAI : public ScriptedAI
{
@@ -307,171 +245,274 @@ struct boss_kalecgos_kjAI : public ScriptedAI
pInstance = c->GetInstanceData();
}
- uint64 OrbGUID[4];
ScriptedInstance* pInstance;
uint8 OrbsEmpowered;
uint8 EmpowerCount;
- bool Searched;
-
- void InitializeAI(){
- for (uint8 i = 0; i < 4; ++i)
- OrbGUID[i] = 0;
- FindOrbs();
+ void Reset()
+ {
OrbsEmpowered = 0;
EmpowerCount = 0;
me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setActive(true);
- Searched = false;
- FindOrbs();
- ScriptedAI::InitializeAI();
+ for (uint8 i = 0; i < 4; ++i)
+ if (GameObject* pOrb = GetOrb(i))
+ pOrb->SetGoType(GAMEOBJECT_TYPE_BUTTON);
}
- void Reset(){}
-
- void FindOrbs()
+ GameObject* GetOrb(int32 index)
{
- CellPair pair(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
- std::list<GameObject*> orbList;
- AllOrbsInGrid check;
- Trinity::GameObjectListSearcher<AllOrbsInGrid> searcher(me, orbList, check);
- TypeContainerVisitor<Trinity::GameObjectListSearcher<AllOrbsInGrid>, GridTypeMapContainer> visitor(searcher);
- cell.Visit(pair, visitor, *(me->GetMap()));
-
- if (orbList.empty())
- return;
+ if (!pInstance)
+ return NULL;
- uint8 i = 0;
- for (std::list<GameObject*>::const_iterator itr = orbList.begin(); itr != orbList.end(); ++itr, ++i){
- OrbGUID[i] = pInstance ? (*itr)->GetGUID() : 0;
+ switch(index)
+ {
+ case 0:
+ return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1));
+ case 1:
+ return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_2));
+ case 2:
+ return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_3));
+ case 3:
+ return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4));
}
+
+ return NULL;
}
void ResetOrbs()
{
me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
for (uint8 i = 0; i < 4; ++i)
- if (GameObject *pOrb = me->GetMap()->GetGameObject(OrbGUID[i]))
+ if (GameObject* pOrb = GetOrb(i))
pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 0);
}
void EmpowerOrb(bool all)
{
- if (!OrbGUID[OrbsEmpowered])
+ GameObject* pOrbEmpowered = GetOrb(OrbsEmpowered);
+ if (!pOrbEmpowered)
return;
- uint8 random = urand(0,3);
if (all)
{
me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
for (uint8 i = 0; i < 4; ++i)
{
- GameObject *pOrb = me->GetMap()->GetGameObject(OrbGUID[i]);
- if (!pOrb)
- return;
-
- pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
- pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35);
- pOrb->setActive(true);
- pOrb->Refresh();
+ if (GameObject* pOrb = GetOrb(i))
+ {
+ pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
+ pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35);
+ pOrb->setActive(true);
+ pOrb->Refresh();
+ }
}
+ DoScriptText(SAY_KALECGOS_ENCOURAGE, me);
}
else
{
- // this won't work
- /*
- float x,y,z, dx,dy,dz;
- Orb[random]->GetPosition(x,y,z);
- for (uint8 i = 0; i < 4; ++i){
- DynamicObject* Dyn = me->GetDynObject(SPELL_RING_OF_BLUE_FLAMES);
- if (Dyn){
- Dyn->GetPosition(dx,dy,dz);
- if (x == dx && dy == y && dz == z){
- Dyn->Delete();
- break;
- }
- }
- }*/
- if (OrbGUID[random])
- {
- if (GameObject* pOrb = me->GetMap()->GetGameObject(OrbGUID[random]))
+ if (GameObject* pOrb = GetOrb(urand(0,3)))
{
pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35);
pOrb->setActive(true);
pOrb->Refresh();
+
+ OrbsEmpowered = (OrbsEmpowered+1)%4;
+
+ ++EmpowerCount;
+ switch(EmpowerCount)
+ {
+ case 1: DoScriptText(SAY_KALEC_ORB_READY1, me); break;
+ case 2: DoScriptText(SAY_KALEC_ORB_READY2, me); break;
+ case 3: DoScriptText(SAY_KALEC_ORB_READY3, me); break;
+ case 4: DoScriptText(SAY_KALEC_ORB_READY4, me); break;
+ }
}
}
- ++OrbsEmpowered;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ }
+
+ void SetRingOfBlueFlames()
+ {
+ me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ for (uint8 i = 0; i < 4; ++i)
+ {
+ if (GameObject* pOrb = GetOrb(i))
+ {
+ if (pOrb->GetUInt32Value(GAMEOBJECT_FACTION) == 35)
+ {
+ pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES);
+ pOrb->setActive(true);
+ pOrb->Refresh();
+ }
+ }
}
- ++EmpowerCount;
+ }
+};
+
+CreatureAI* GetAI_boss_kalecgos_kj(Creature* pCreature)
+{
+ return new boss_kalecgos_kjAI (pCreature);
+}
+
+bool GOHello_go_orb_of_the_blue_flight(Player* pPlayer, GameObject* pGo)
+{
+ if (pGo->GetUInt32Value(GAMEOBJECT_FACTION) == 35)
+ {
+ ScriptedInstance* pInstance = pGo->GetInstanceData();
+ pPlayer->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
+ pPlayer->CastSpell(pPlayer, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false);
+ pGo->SetUInt32Value(GAMEOBJECT_FACTION, 0);
+
+ if (Creature* pKalec = Unit::GetCreature(*pPlayer, pInstance->GetData64(DATA_KALECGOS_KJ)))
+ CAST_AI(boss_kalecgos_kjAI, pKalec->AI())->SetRingOfBlueFlames();
+
+ pGo->Refresh();
+ }
+ return true;
+}
+
+//AI for Kil'jaeden Event Controller
+struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI
+{
+ mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), summons(me)
+ {
+ pInstance = c->GetInstanceData();
+ }
+
+ ScriptedInstance* pInstance;
+ SummonList summons;
+
+ bool bSummonedDeceivers;
+ bool bKiljaedenDeath;
+
+ uint32 uiRandomSayTimer;
+ uint32 phase;
+ uint8 deceiverDeathCount;
+
+ void InitializeAI()
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->addUnitState(UNIT_STAT_STUNNED);
- switch(EmpowerCount)
+ ScriptedAI::InitializeAI();
+ }
+
+ void Reset()
+ {
+ phase = PHASE_DECEIVERS;
+
+ if (Creature* pKalecKJ = Unit::GetCreature((*me), pInstance->GetData64(DATA_KALECGOS_KJ)))
+ CAST_AI(boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs();
+ deceiverDeathCount = 0;
+ bSummonedDeceivers = false;
+ bKiljaedenDeath = false;
+ uiRandomSayTimer = 30000;
+ summons.DespawnAll();
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ switch(summoned->GetEntry())
{
- case 1: DoScriptText(SAY_KALEC_ORB_READY1, me); break;
- case 2: DoScriptText(SAY_KALEC_ORB_READY2, me); break;
- case 3: DoScriptText(SAY_KALEC_ORB_READY3, me); break;
- case 4: DoScriptText(SAY_KALEC_ORB_READY4, me); break;
+ case CREATURE_HAND_OF_THE_DECEIVER:
+ summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false);
+ break;
+ case CREATURE_ANVEENA:
+ summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
+ summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true);
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ break;
+ case CREATURE_KILJAEDEN:
+ summoned->CastSpell(summoned, SPELL_REBIRTH, false);
+ summoned->AddThreat(me->getVictim(), 1.0f);
+ break;
}
+ summons.Summon(summoned);
}
- void UpdateAI(const uint32 /*diff*/)
+ void UpdateAI(const uint32 diff)
{
- if (!Searched)
+ if (uiRandomSayTimer < diff)
{
- FindOrbs();
- Searched = true;
+ if (pInstance && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED)
+ DoScriptText(RAND(SAY_KJ_OFFCOMBAT1,SAY_KJ_OFFCOMBAT2,SAY_KJ_OFFCOMBAT3,SAY_KJ_OFFCOMBAT4,SAY_KJ_OFFCOMBAT5), me);
+ uiRandomSayTimer = 30000;
+ } else uiRandomSayTimer -= diff;
+
+ if (!bSummonedDeceivers)
+ {
+ for (uint8 i = 0; i < 3; ++i)
+ me->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i], TEMPSUMMON_DEAD_DESPAWN, 0);
+
+ DoSpawnCreature(CREATURE_ANVEENA, 0, 0, 40, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
+ DoCast(me, SPELL_ANVEENA_ENERGY_DRAIN);
+ bSummonedDeceivers = true;
}
- if (OrbsEmpowered == 4)
- OrbsEmpowered = 0;
+ if (deceiverDeathCount > 2 && phase == PHASE_DECEIVERS)
+ {
+ me->RemoveAurasDueToSpell(SPELL_ANVEENA_ENERGY_DRAIN);
+ phase = PHASE_NORMAL;
+ DoSpawnCreature(CREATURE_KILJAEDEN, 0, 0,0, 0, TEMPSUMMON_MANUAL_DESPAWN, 0);
+ }
}
};
-CreatureAI* GetAI_boss_kalecgos_kj(Creature* pCreature)
+CreatureAI* GetAI_mob_kiljaeden_controller(Creature* pCreature)
{
- return new boss_kalecgos_kjAI (pCreature);
+ return new mob_kiljaeden_controllerAI (pCreature);
}
//AI for Kil'jaeden
struct boss_kiljaedenAI : public Scripted_NoMovementAI
{
- boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me)
+ boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), summons(me)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
- SummonList Summons;
+ SummonList summons;
uint8 Phase;
uint8 ActiveTimers;
+ uint32 SpeechTimer;
uint32 Timer[10];
uint32 WaitTimer;
+ uint8 speechCount;
+ uint8 speechPhaseEnd;
/* Boolean */
- bool IsKalecJoined;
bool IsInDarkness;
- bool TimerIsDeactiveted[10];
+ bool TimerIsDeactivated[10];
bool IsWaiting;
bool OrbActivated;
+ bool SpeechBegins;
+
+ void InitializeAI()
+ {
+ Scripted_NoMovementAI::InitializeAI();
+ }
void Reset()
{
- // TODO: Fix timers
- Timer[TIMER_KALEC_JOIN] = 26000;
+ TimerIsDeactivated[TIMER_SPEECH] = false;
+ Timer[TIMER_SPEECH] = 0;
//Phase 2 Timer
- Timer[TIMER_SOUL_FLAY] = 20000;
- Timer[TIMER_LEGION_LIGHTNING] = 40000;
- Timer[TIMER_FIRE_BLOOM] = 30000;
- Timer[TIMER_SUMMON_SHILEDORB] = 45000;
+ Timer[TIMER_SOUL_FLAY] = 11000;
+ Timer[TIMER_LEGION_LIGHTNING] = 30000;
+ Timer[TIMER_FIRE_BLOOM] = 20000;
+ Timer[TIMER_SUMMON_SHILEDORB] = 35000;
//Phase 3 Timer
Timer[TIMER_SHADOW_SPIKE] = 4000;
@@ -484,22 +525,30 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
ActiveTimers = 5;
WaitTimer = 0;
+ speechCount = 0;
+ SpeechTimer = 0;
- Phase = PHASE_DECEIVERS;
+ Phase = PHASE_NORMAL;
- IsKalecJoined = false;
IsInDarkness = false;
IsWaiting = false;
OrbActivated = false;
+ SpeechBegins = true;
+ if (pInstance)
+ {
+ if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ)))
+ pKalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ }
+ me->SetFloatValue(UNIT_FIELD_COMBATREACH, 12);
ChangeTimers(false, 0);
+ summons.DespawnAll();
}
void ChangeTimers(bool status, uint32 WTimer)
{
- for (uint8 i = 0; i < 10; ++i)
- TimerIsDeactiveted[i] = status;
- TimerIsDeactiveted[TIMER_KALEC_JOIN] = IsKalecJoined;
+ for (uint8 i = 1; i < ActiveTimers; ++i)
+ TimerIsDeactivated[i] = status;
if (WTimer > 0)
{
@@ -508,11 +557,11 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
}
if (OrbActivated)
- TimerIsDeactiveted[TIMER_ORBS_EMPOWER] = true;
+ TimerIsDeactivated[TIMER_ORBS_EMPOWER] = true;
if (Timer[TIMER_SHADOW_SPIKE] == 0)
- TimerIsDeactiveted[TIMER_SHADOW_SPIKE] = true;
+ TimerIsDeactivated[TIMER_SHADOW_SPIKE] = true;
if (Phase == PHASE_SACRIFICE)
- TimerIsDeactiveted[TIMER_SUMMON_SHILEDORB] = true;
+ TimerIsDeactivated[TIMER_SUMMON_SHILEDORB] = true;
}
void JustSummoned(Creature* summoned)
@@ -521,22 +570,25 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
{
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }else{
- summoned->SetLevel(me->getLevel());
+ // summoned->SetVisibility(VISIBILITY_OFF); //with this we cant see the armageddon visuals
}
+ else
+ summoned->SetLevel(me->getLevel());
+
summoned->setFaction(me->getFaction());
- Summons.Summon(summoned);
+ summons.Summon(summoned);
}
- void JustDied(Unit* /*killer*/)
+ void JustDied(Unit* killer)
{
DoScriptText(SAY_KJ_DEATH, me);
+ summons.DespawnAll();
if (pInstance)
pInstance->SetData(DATA_KILJAEDEN_EVENT, DONE);
}
- void KilledUnit(Unit* /*victim*/)
+ void KilledUnit(Unit* victim)
{
DoScriptText(RAND(SAY_KJ_SLAY1,SAY_KJ_SLAY2), me);
}
@@ -544,40 +596,58 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
void EnterEvadeMode()
{
Scripted_NoMovementAI::EnterEvadeMode();
- Summons.DespawnAll();
+ summons.DespawnAll();
// Reset the controller
if (pInstance)
- if (Creature* Control = CAST_CRE(Unit::GetUnit(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
- CAST_AI(Scripted_NoMovementAI, Control->AI())->Reset();
+ {
+ if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
+ CAST_AI(mob_kiljaeden_controllerAI, pControl->AI())->Reset();
+ }
}
- void EnterCombat(Unit* /*who*/)
+ void EnterCombat(Unit* who)
{
DoZoneInCombat();
- DoScriptText(SAY_KJ_EMERGE, me);
+ }
+
+ void EnterNextPhase()
+ {
+ SpeechBegins = true;
+ OrbActivated = false;
+ ChangeTimers(true, 0);//stop every cast Shadow spike will reactivate em all
+ TimerIsDeactivated[TIMER_SHADOW_SPIKE] = false;
+ Timer[TIMER_SHADOW_SPIKE] = 100;
+ // empowered orbs before darkness
+ Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 15000 : urand(10000,40000);
+ Timer[TIMER_ORBS_EMPOWER] = (Phase == PHASE_SACRIFICE) ? 10000 : 5000;
}
void CastSinisterReflection()
{
DoScriptText(RAND(SAY_KJ_REFLECTION1,SAY_KJ_REFLECTION2), me);
- DoCast(me, SPELL_SINISTER_REFLECTION, true);
for (uint8 i = 0; i < 4; ++i)
{
float x,y,z;
- Unit *pTarget = NULL;
+ Unit *pTarget;
for (uint8 z = 0; z < 6; ++z)
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0))break;
}
- pTarget->GetPosition(x,y,z);
- Creature* SinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (SinisterReflection)
- SinisterReflection->AI()->AttackStart(pTarget);
+ if (pTarget)
+ {
+ pTarget->GetPosition(x,y,z);
+ if (Creature* pSinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0))
+ {
+ pSinisterReflection->SetDisplayId(pTarget->GetDisplayId());
+ pSinisterReflection->AI()->AttackStart(pTarget);
+ }
+ }
}
}
+
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim() || Phase < PHASE_NORMAL)
@@ -594,40 +664,71 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
for (uint8 t = 0; t < ActiveTimers; ++t)
{
- if (Timer[t] < diff && !TimerIsDeactiveted[t])
+ if (Timer[t] < diff && !TimerIsDeactivated[t])
{
switch(t)
{
- case TIMER_KALEC_JOIN:
- if (Creature *pKalec = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0))
+ case TIMER_SPEECH:
+ if (SpeechBegins)
+ {
+ SpeechBegins=false;
+ switch(Phase)
+ {
+ case PHASE_NORMAL:
+ speechPhaseEnd=1;
+ break;
+ case PHASE_DARKNESS:
+ speechPhaseEnd=4;
+ break;
+ case PHASE_ARMAGEDDON:
+ speechPhaseEnd=7;
+ break;
+ case PHASE_SACRIFICE:
+ speechPhaseEnd=12;
+ break;
+ }
+ }
+ if (Speeches[speechCount].timer < SpeechTimer)
{
- DoScriptText(SAY_KALECGOS_JOIN, pKalec);
- IsKalecJoined = true;
- TimerIsDeactiveted[TIMER_KALEC_JOIN] = true;
+ SpeechTimer = 0;
+ if (Creature* pSpeechCreature = Unit::GetCreature(*me, pInstance->GetData64(Speeches[speechCount].pCreature)))
+ DoScriptText(Speeches[speechCount].textid, pSpeechCreature);
+ if (speechCount == 12)
+ if (Creature* pAnveena = Unit::GetCreature(*me, pInstance->GetData64(DATA_ANVEENA)))
+ pAnveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false);
+ // ChangeTimers(true, 10000); // Kil should do an emote while screaming without attacking for 10 seconds
+ if (speechCount == speechPhaseEnd)
+ TimerIsDeactivated[TIMER_SPEECH]=true;
+ speechCount++;
}
+ SpeechTimer += diff;
break;
case TIMER_SOUL_FLAY:
if (!me->IsNonMeleeSpellCasted(false))
{
+ DoCast(me->getVictim(), SPELL_SOUL_FLAY_SLOW, false);
DoCast(me->getVictim(), SPELL_SOUL_FLAY, false);
- me->getVictim()->CastSpell(me->getVictim(), SPELL_SOUL_FLAY_SLOW, true);
Timer[TIMER_SOUL_FLAY] = 3500;
}
break;
case TIMER_LEGION_LIGHTNING:
if (!me->IsNonMeleeSpellCasted(false))
{
- Unit *RandomPlayer = NULL;
+ Unit* pRandomPlayer;
+
me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
for (uint8 z = 0; z < 6; ++z)
{
- RandomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
- if (RandomPlayer && !RandomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break;
+ pRandomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
+ if (!pRandomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0))
+ break;
}
- if (RandomPlayer)
- DoCast(RandomPlayer, SPELL_LEGION_LIGHTNING, false);
+
+ if (pRandomPlayer)
+ DoCast(pRandomPlayer, SPELL_LEGION_LIGHTNING, false);
else
error_log("try to cast SPELL_LEGION_LIGHTNING on invalid target");
+
Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE
Timer[TIMER_SOUL_FLAY] = 2500;
}
@@ -655,10 +756,11 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
case TIMER_SHADOW_SPIKE: //Phase 3
if (!me->IsNonMeleeSpellCasted(false))
{
- DoCastAOE(SPELL_SHADOW_SPIKE, false);
- Timer[TIMER_SHADOW_SPIKE] = 0;
- TimerIsDeactiveted[TIMER_SHADOW_SPIKE] = true;
+ CastSinisterReflection();
+ DoCastAOE(SPELL_SHADOW_SPIKE, false);
ChangeTimers(true, 30000);
+ Timer[TIMER_SHADOW_SPIKE] = 0;
+ TimerIsDeactivated[TIMER_SPEECH] = false;
}
break;
case TIMER_FLAME_DART: //Phase 3
@@ -675,14 +777,14 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS, false);
ChangeTimers(true, 9000);
Timer[TIMER_DARKNESS] = 8750;
- TimerIsDeactiveted[TIMER_DARKNESS] = false;
+ TimerIsDeactivated[TIMER_DARKNESS] = false;
if (Phase == PHASE_SACRIFICE)
- TimerIsDeactiveted[TIMER_ARMAGEDDON] = false;
+ TimerIsDeactivated[TIMER_ARMAGEDDON] = false;
IsInDarkness = true;
}
else
{
- Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? urand(20000,35000) : urand(40000,70000);
+ Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 15000 : urand(40000,70000);
IsInDarkness = false;
DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE);
DoScriptText(RAND(SAY_KJ_DARKNESS1,SAY_KJ_DARKNESS2,SAY_KJ_DARKNESS3), me);
@@ -691,7 +793,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
}
break;
case TIMER_ORBS_EMPOWER: //Phase 3
- if (Creature *pKalec = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0))
+ if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ)))
{
switch (Phase)
{
@@ -703,16 +805,15 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
break;
}
}
- Timer[TIMER_ORBS_EMPOWER] = (Phase == PHASE_SACRIFICE) ? 45000 : 35000;
OrbActivated = true;
- TimerIsDeactiveted[TIMER_ORBS_EMPOWER] = true;
+ TimerIsDeactivated[TIMER_ORBS_EMPOWER] = true;
break;
case TIMER_ARMAGEDDON: //Phase 4
- Unit *pTarget = NULL;
+ Unit *pTarget;
for (uint8 z = 0; z < 6; ++z)
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
- if (pTarget && !pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break;
+ if (!pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break;
}
if (pTarget)
{
@@ -723,60 +824,52 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding
break;
}
- break;
}
}
- //Time runs over!
- for (uint8 i = 0; i < ActiveTimers; ++i)
- if (!TimerIsDeactiveted[i])
- {
- Timer[i] -= diff;
- if (((int32)Timer[i]) < 0) Timer[i] = 0;
- }
+ DoMeleeAttackIfReady();
+ //Time runs over!
+ for (uint8 i = 0; i < ActiveTimers; ++i)
+ if (!TimerIsDeactivated[i])
+ {
+ Timer[i] -= diff;
+ if (((int32)Timer[i]) < 0) Timer[i] = 0;
+ }
//Phase 3
- if (Phase <= PHASE_NORMAL)
+ if (Phase <= PHASE_NORMAL && !IsInDarkness)
{
- if (Phase == PHASE_NORMAL && ((me->GetHealth()*100 / me->GetMaxHealth()) < 85))
+ if (Phase == PHASE_NORMAL && HealthBelowPct(85))
{
- CastSinisterReflection();
- DoScriptText(SAY_KJ_PHASE3, me);
Phase = PHASE_DARKNESS;
- OrbActivated = false;
ActiveTimers = 9;
+ EnterNextPhase();
}
else return;
}
//Phase 4
- if (Phase <= PHASE_DARKNESS)
+ if (Phase <= PHASE_DARKNESS && !IsInDarkness)
{
- if (Phase == PHASE_DARKNESS && ((me->GetHealth()*100 / me->GetMaxHealth()) < 55))
+ if (Phase == PHASE_DARKNESS && HealthBelowPct(55))
{
- DoScriptText(SAY_KJ_PHASE4, me);
Phase = PHASE_ARMAGEDDON;
- OrbActivated = false;
ActiveTimers = 10;
+ EnterNextPhase();
}
else return;
}
//Phase 5 specific spells all we can
- if (Phase <= PHASE_ARMAGEDDON)
+ if (Phase <= PHASE_ARMAGEDDON && !IsInDarkness)
{
- if (Phase == PHASE_ARMAGEDDON && ((me->GetHealth()*100 / me->GetMaxHealth()) < 25))
+ if (Phase == PHASE_ARMAGEDDON && HealthBelowPct(25))
{
Phase = PHASE_SACRIFICE;
- if (pInstance)
- if (Creature* Anveena = Unit::GetCreature(*me, pInstance->GetData64(DATA_ANVEENA)))
- Anveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false);
- OrbActivated = false;
- ChangeTimers(true, 10000); // He shouldn't cast spells for ~10 seconds after Anveena's sacrifice. This will be done within Anveena's script
+ EnterNextPhase();
}
else return;
}
-
-}
+ }
};
CreatureAI* GetAI_boss_kiljaeden(Creature* pCreature)
@@ -784,98 +877,6 @@ CreatureAI* GetAI_boss_kiljaeden(Creature* pCreature)
return new boss_kiljaedenAI (pCreature);
}
-//AI for Kil'jaeden Event Controller
-struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI
-{
- mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me)
- {
- pInstance = c->GetInstanceData();
- }
-
- ScriptedInstance* pInstance;
- SummonList Summons;
-
- bool SummonedDeceivers;
- bool KiljaedenDeath;
-
- uint32 RandomSayTimer;
- uint32 Phase;
- uint8 DeceiverDeathCount;
-
- void InitializeAI()
- {
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->addUnitState(UNIT_STAT_STUNNED);
-
- ScriptedAI::InitializeAI();
- }
-
- void Reset()
- {
- Phase = PHASE_DECEIVERS;
- if (Creature *pKalecKJ = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0))
- CAST_AI(boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs();
- DeceiverDeathCount = 0;
- SummonedDeceivers = false;
- KiljaedenDeath = false;
- RandomSayTimer = 30000;
- Summons.DespawnAll();
- }
-
- void JustSummoned(Creature* summoned)
- {
- switch(summoned->GetEntry())
- {
- case CREATURE_HAND_OF_THE_DECEIVER:
- summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false);
- break;
- case CREATURE_ANVEENA:
- summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
- summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true);
- summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- break;
- case CREATURE_KILJAEDEN:
- summoned->CastSpell(summoned, SPELL_REBIRTH, false);
- CAST_AI(boss_kiljaedenAI, summoned->AI())->Phase=PHASE_NORMAL;
- summoned->AddThreat(me->getVictim(), 1.0f);
- break;
- }
- Summons.Summon(summoned);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (RandomSayTimer < diff && pInstance && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED)
- {
- DoScriptText(RAND(SAY_KJ_OFFCOMBAT1,SAY_KJ_OFFCOMBAT2,SAY_KJ_OFFCOMBAT3,SAY_KJ_OFFCOMBAT4,SAY_KJ_OFFCOMBAT5), me);
- RandomSayTimer = 30000;
- } else RandomSayTimer -= diff;
-
- if (!SummonedDeceivers)
- {
- for (uint8 i = 0; i < 3; ++i)
- me->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i][0], DeceiverLocations[i][1], FLOOR_Z, DeceiverLocations[i][2], TEMPSUMMON_DEAD_DESPAWN, 0);
-
- DoSpawnCreature(CREATURE_ANVEENA, 0, 0, 40, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
- DoCast(me, SPELL_ANVEENA_ENERGY_DRAIN);
- SummonedDeceivers = true;
- }
-
- if (DeceiverDeathCount > 2 && Phase == PHASE_DECEIVERS)
- {
- me->RemoveAurasDueToSpell(SPELL_ANVEENA_ENERGY_DRAIN);
- Phase = PHASE_NORMAL;
- DoSpawnCreature(CREATURE_KILJAEDEN, 0, 0,0, 0, TEMPSUMMON_MANUAL_DESPAWN, 0);
- }
- }
-};
-
-CreatureAI* GetAI_mob_kiljaeden_controller(Creature* pCreature)
-{
- return new mob_kiljaeden_controllerAI (pCreature);
-}
-
//AI for Hand of the Deceiver
struct mob_hand_of_the_deceiverAI : public ScriptedAI
{
@@ -883,6 +884,7 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
+
ScriptedInstance* pInstance;
uint32 ShadowBoltVolleyTimer;
@@ -908,19 +910,19 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI
if (pInstance)
{
pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS);
- if (Creature* Control = CAST_CRE(Unit::GetUnit(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
- Control->AddThreat(who, 1.0f);
+ if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
+ pControl->AddThreat(who, 1.0f);
}
me->InterruptNonMeleeSpells(true);
}
- void JustDied(Unit* /*killer*/)
+ void JustDied(Unit* killer)
{
if (!pInstance)
return;
- if (Creature* Control = CAST_CRE(Unit::GetUnit(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
- ++(CAST_AI(mob_kiljaeden_controllerAI, Control->AI())->DeceiverDeathCount);
+ if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
+ ++(CAST_AI(mob_kiljaeden_controllerAI, pControl->AI())->deceiverDeathCount);
}
void UpdateAI(const uint32 diff)
@@ -932,26 +934,29 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI
return;
// Gain Shadow Infusion at 20% health
- if (((me->GetHealth()*100 / me->GetMaxHealth()) < 20) && !me->HasAura(SPELL_SHADOW_INFUSION, 0))
+ if (HealthBelowPct(20) && !me->HasAura(SPELL_SHADOW_INFUSION, 0))
DoCast(me, SPELL_SHADOW_INFUSION, true);
// Shadow Bolt Volley - Shoots Shadow Bolts at all enemies within 30 yards, for ~2k Shadow damage.
- if (ShadowBoltVolleyTimer <= diff){
+ if (ShadowBoltVolleyTimer <= diff)
+ {
DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
ShadowBoltVolleyTimer = 12000;
- } else ShadowBoltVolleyTimer -= diff;
+ }
+ else
+ ShadowBoltVolleyTimer -= diff;
// Felfire Portal - Creatres a portal, that spawns Volatile Felfire Fiends, which do suicide bombing.
- if (FelfirePortalTimer <= diff){
- Creature* Portal = DoSpawnCreature(CREATURE_FELFIRE_PORTAL, 0, 0,0, 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
- if (Portal)
+ if (FelfirePortalTimer <= diff)
+ {
+ if (Creature* pPortal = DoSpawnCreature(CREATURE_FELFIRE_PORTAL, 0, 0,0, 0, TEMPSUMMON_TIMED_DESPAWN, 20000))
{
- std::list<HostileReference*>::const_iterator itr;
+ std::list<HostileReference*>::iterator itr;
for (itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
{
Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pUnit)
- Portal->AddThreat(pUnit, 1.0f);
+ pPortal->AddThreat(pUnit, 1.0f);
}
}
FelfirePortalTimer = 20000;
@@ -971,20 +976,14 @@ struct mob_felfire_portalAI : public Scripted_NoMovementAI
{
mob_felfire_portalAI(Creature* c) : Scripted_NoMovementAI(c) {}
- uint32 SpawnFiendTimer;
+ uint32 uiSpawnFiendTimer;
- void InitializeAI()
+ void Reset()
{
- SpawnFiendTimer = 5000;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- ScriptedAI::InitializeAI();
+ uiSpawnFiendTimer = 5000;
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE);
}
- // TODO: Timers
- void Reset() {}
-
void JustSummoned(Creature* summoned)
{
summoned->setFaction(me->getFaction());
@@ -996,13 +995,12 @@ struct mob_felfire_portalAI : public Scripted_NoMovementAI
if (!UpdateVictim())
return;
- if (SpawnFiendTimer <= diff)
+ if (uiSpawnFiendTimer <= diff)
{
- Creature* Fiend = DoSpawnCreature(CREATURE_VOLATILE_FELFIRE_FIEND, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000);
- if (Fiend)
- Fiend->AddThreat(SelectUnit(SELECT_TARGET_RANDOM,0), 100000.0f);
- SpawnFiendTimer = urand(4000,8000);
- } else SpawnFiendTimer -= diff;
+ if (Creature* pFiend = DoSpawnCreature(CREATURE_VOLATILE_FELFIRE_FIEND, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000))
+ pFiend->AddThreat(SelectUnit(SELECT_TARGET_RANDOM,0), 100000.0f);
+ uiSpawnFiendTimer = urand(4000,8000);
+ } else uiSpawnFiendTimer -= diff;
}
};
@@ -1016,17 +1014,17 @@ struct mob_volatile_felfire_fiendAI : public ScriptedAI
{
mob_volatile_felfire_fiendAI(Creature* c) : ScriptedAI(c) {}
- uint32 ExplodeTimer;
+ uint32 uiExplodeTimer;
- bool LockedTarget;
+ bool bLockedTarget;
void Reset()
{
- ExplodeTimer = 2000;
- LockedTarget = false;
+ uiExplodeTimer = 2000;
+ bLockedTarget = false;
}
- void DamageTaken(Unit * /*done_by*/, uint32 &damage)
+ void DamageTaken(Unit *done_by, uint32 &damage)
{
if (damage > me->GetHealth())
DoCast(me, SPELL_FELFIRE_FISSION, true);
@@ -1037,17 +1035,17 @@ struct mob_volatile_felfire_fiendAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (!LockedTarget)
+ if (!bLockedTarget)
{
me->AddThreat(me->getVictim(), 10000000.0f);
- LockedTarget = true;
+ bLockedTarget = true;
}
- if (ExplodeTimer)
+ if (uiExplodeTimer)
{
- if (ExplodeTimer <= diff)
- ExplodeTimer = 0;
- else ExplodeTimer -= diff;
+ if (uiExplodeTimer <= diff)
+ uiExplodeTimer = 0;
+ else uiExplodeTimer -= diff;
}
else if (me->IsWithinDistInMap(me->getVictim(), 3)) // Explode if it's close enough to it's target
{
@@ -1067,41 +1065,41 @@ struct mob_armageddonAI : public Scripted_NoMovementAI
{
mob_armageddonAI(Creature* c) : Scripted_NoMovementAI(c) {}
- uint8 Spell;
- uint32 Timer;
+ uint8 spell;
+ uint32 uiTimer;
void Reset()
{
- Spell = 0;
- Timer = 0;
+ spell = 0;
+ uiTimer = 0;
}
void UpdateAI(const uint32 diff)
{
- if (Timer <= diff)
+ if (uiTimer <= diff)
{
- switch(Spell)
+ switch(spell)
{
case 0:
DoCast(me, SPELL_ARMAGEDDON_VISUAL, true);
- ++Spell;
+ ++spell;
break;
case 1:
DoCast(me, SPELL_ARMAGEDDON_VISUAL2, true);
- Timer = 9000;
- ++Spell;
+ uiTimer = 9000;
+ ++spell;
break;
case 2:
DoCast(me, SPELL_ARMAGEDDON_TRIGGER, true);
- ++Spell;
- Timer = 5000;
+ ++spell;
+ uiTimer = 5000;
break;
case 3:
me->Kill(me);
me->RemoveCorpse();
break;
}
- } else Timer -=diff;
+ } else uiTimer -=diff;
}
};
@@ -1118,35 +1116,32 @@ struct mob_shield_orbAI : public ScriptedAI
pInstance = c->GetInstanceData();
}
- bool PointReached;
- bool Clockwise;
- uint32 Timer;
- uint32 CheckTimer;
ScriptedInstance* pInstance;
+
+ bool bPointReached;
+ bool bClockwise;
+ uint32 uiTimer;
+ uint32 uiCheckTimer;
float x, y, r, c, mx, my;
- void InitializeAI()
+ void Reset()
{
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- PointReached = true;
- Timer = urand(500,1000);
- CheckTimer = 1000;
+ bPointReached = true;
+ uiTimer = urand(500,1000);
+ uiCheckTimer = 1000;
r = 17;
c = 0;
mx = ShieldOrbLocations[0][0];
my = ShieldOrbLocations[0][1];
- Clockwise = urand(0,1);
-
- ScriptedAI::InitializeAI();
+ bClockwise = urand(0,1);
}
- void Reset(){}
-
void UpdateAI(const uint32 diff)
{
- if (PointReached)
+ if (bPointReached)
{
- if (Clockwise)
+ if (bClockwise)
{
y = my - r * sin(c);
x = mx - r * cos(c);
@@ -1156,36 +1151,36 @@ struct mob_shield_orbAI : public ScriptedAI
y = my + r * sin(c);
x = mx + r * cos(c);
}
- PointReached = false;
- CheckTimer = 1000;
+ bPointReached = false;
+ uiCheckTimer = 1000;
me->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z);
c += M_PI/32;
- if (c > 2*M_PI) c = 0;
+ if (c >= 2*M_PI) c = 0;
}
else
{
- if (CheckTimer <= diff)
+ if (uiCheckTimer <= diff)
{
DoTeleportTo(x,y,SHIELD_ORB_Z);
- PointReached = true;
- } else CheckTimer -= diff;
-
+ bPointReached = true;
+ }
+ else uiCheckTimer -= diff;
}
- if (Timer <= diff)
+ if (uiTimer <= diff)
{
if (Unit* random = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0))
DoCast(random, SPELL_SHADOW_BOLT, false);
- Timer = urand(500,1000);
- } else Timer -= diff;
+ uiTimer = urand(500,1000);
+ } else uiTimer -= diff;
}
- void MovementInform(uint32 type, uint32 /*id*/)
+ void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE)
return;
- PointReached = true;
+ bPointReached = true;
}
};
@@ -1199,24 +1194,26 @@ struct mob_sinster_reflectionAI : public ScriptedAI
{
mob_sinster_reflectionAI(Creature* c) : ScriptedAI(c) {}
- uint8 Class;
- uint32 Timer[3];
+ uint8 victimClass;
+ uint32 uiTimer[3];
void Reset()
{
- Timer[0] = 0;
- Timer[1] = 0;
- Timer[2] = 0;
- Class = 0;
+ uiTimer[0] = 0;
+ uiTimer[1] = 0;
+ uiTimer[2] = 0;
+ victimClass = 0;
}
void UpdateAI(const uint32 diff)
{
+ if (!UpdateVictim())
+ return;
- if (Class == 0)
+ if ((victimClass == 0) && me->getVictim())
{
- Class = me->getVictim()->getClass();
- switch (Class)
+ victimClass = me->getVictim()->getClass();
+ switch (victimClass)
{
case CLASS_DRUID:
break;
@@ -1242,113 +1239,112 @@ struct mob_sinster_reflectionAI : public ScriptedAI
}
}
- switch(Class){
+ switch(victimClass) {
case CLASS_DRUID:
- if (Timer[1] <= diff)
+ if (uiTimer[1] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_MOONFIRE, false);
- Timer[1] = 3000;
+ uiTimer[1] = urand(2000,4000);
}
DoMeleeAttackIfReady();
break;
case CLASS_HUNTER:
- if (Timer[1] <= diff)
+ if (uiTimer[1] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false);
- Timer[1] = 9000;
+ uiTimer[1] = urand(8000,10000);
}
- if (Timer[2] <= diff)
+ if (uiTimer[2] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_SHOOT, false);
- Timer[2] = 5000;
+ uiTimer[2] = urand(4000,6000);
}
if (me->IsWithinMeleeRange(me->getVictim(), 6))
{
- if (Timer[3] <= diff)
+ if (uiTimer[0] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false);
- Timer[3] = 7000;
+ uiTimer[0] = urand(6000,8000);
}
DoMeleeAttackIfReady();
}
break;
case CLASS_MAGE:
- if (Timer[1] <= diff)
+ if (uiTimer[1] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_FIREBALL, false);
- Timer[1] = 3000;
+ uiTimer[1] = urand(2000,4000);
}
DoMeleeAttackIfReady();
break;
case CLASS_WARLOCK:
- if (Timer[1] <= diff)
+ if (uiTimer[1] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_SHADOW_BOLT, false);
- Timer[1] = 4000;
+ uiTimer[1] = urand(3000,5000);
}
- if (Timer[2] <= diff)
+ if (uiTimer[2] <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SR_CURSE_OF_AGONY, true);
- Timer[2] = 3000;
+ uiTimer[2] = urand(2000,4000);
}
DoMeleeAttackIfReady();
break;
case CLASS_WARRIOR:
- if (Timer[1] <= diff)
+ if (uiTimer[1] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_WHIRLWIND, false);
- Timer[1] = 10000;
+ uiTimer[1] = urand(9000,11000);
}
DoMeleeAttackIfReady();
break;
case CLASS_PALADIN:
- if (Timer[1] <= diff)
+ if (uiTimer[1] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false);
- Timer[1] = 7000;
+ uiTimer[1] = urand(6000,8000);
}
- if (Timer[2] <= diff)
+ if (uiTimer[2] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_HOLY_SHOCK, false);
- Timer[2] = 3000;
+ uiTimer[2] = urand(2000,4000);
}
DoMeleeAttackIfReady();
break;
case CLASS_PRIEST:
- if (Timer[1] <= diff)
+ if (uiTimer[1] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_HOLY_SMITE, false);
- Timer[1] = 5000;
+ uiTimer[1] = urand(4000,6000);
}
- if (Timer[2] <= diff)
+ if (uiTimer[2] <= diff)
{
DoCast(me, SPELL_SR_RENEW, false);
- Timer[2] = 7000;
+ uiTimer[2] = urand(6000,8000);
}
DoMeleeAttackIfReady();
break;
case CLASS_SHAMAN:
- if (Timer[1] <= diff)
+ if (uiTimer[1] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_EARTH_SHOCK, false);
- Timer[1] = 5000;
+ uiTimer[1] = urand(4000,6000);
}
DoMeleeAttackIfReady();
break;
case CLASS_ROGUE:
- if (Timer[1] <= diff)
+ if (uiTimer[1] <= diff)
{
DoCast(me->getVictim(), SPELL_SR_HEMORRHAGE, true);
- Timer[1] = 5000;
+ uiTimer[1] = urand(4000,6000);
}
DoMeleeAttackIfReady();
break;
}
debug_log("Sinister-Timer");
for (uint8 i = 0; i < 3; ++i)
- Timer[i] -= diff;
+ uiTimer[i] -= diff;
}
-
};
CreatureAI* GetAI_mob_sinster_reflection(Creature* pCreature)
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp
index 9d11232e086..9dca453ade6 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp
@@ -70,19 +70,6 @@ enum Spells
SPELL_BLACKHOLE_GROW = 46228
};
-enum Creatures
-{
- CREATURE_DARKNESS = 25879,
- CREATURE_DARK_FIENDS = 25744,
- CREATURE_BERSERKER = 25798,
- CREATURE_FURY_MAGE = 25799,
- CREATURE_VOID_SENTINEL = 25772,
- CREATURE_VOID_SPAWN = 25824,
- CREATURE_BLACK_HOLE = 25855,
- BOSS_MURU = 25741,
- BOSS_ENTROPIUS = 25840
-};
-
enum BossTimers{
TIMER_DARKNESS = 0,
TIMER_HUMANOIDES = 1,
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h b/src/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h
index f955e8c7e17..9f1a2480c96 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h
@@ -6,32 +6,90 @@
#define DEF_SUNWELLPLATEAU_H
/*** Encounters ***/
-#define DATA_KALECGOS_EVENT 1
-#define DATA_BRUTALLUS_EVENT 2
-#define DATA_FELMYST_EVENT 3
-#define DATA_EREDAR_TWINS_EVENT 4
-#define DATA_MURU_EVENT 5
-#define DATA_KILJAEDEN_EVENT 6
-
-/*** Creatures ***/
-#define DATA_KALECGOS_DRAGON 7
-#define DATA_KALECGOS_HUMAN 8
-#define DATA_SATHROVARR 9
-#define DATA_BRUTALLUS 10
-#define DATA_MADRIGOSA 11
-#define DATA_FELMYST 12
-#define DATA_ALYTHESS 13
-#define DATA_SACROLASH 14
-#define DATA_MURU 15
-#define DATA_KILJAEDEN 16
-#define DATA_KILJAEDEN_CONTROLLER 17
-#define DATA_ANVEENA 18
-#define DATA_KALECGOS_KJ 19
-
-/*** GameObjects ***/
-#define DATA_GO_FORCEFIELD 20
-
-/*** Misc ***/
-#define DATA_PLAYER_GUID 21
-#endif
+enum Data
+{
+ DATA_KALECGOS_EVENT,
+ DATA_BRUTALLUS_EVENT,
+ DATA_FELMYST_EVENT,
+ DATA_EREDAR_TWINS_EVENT,
+ DATA_MURU_EVENT,
+ DATA_KILJAEDEN_EVENT,
+};
+
+enum Data64
+{
+ /*** Creatures ***/
+ DATA_KALECGOS_DRAGON,
+ DATA_KALECGOS_HUMAN,
+ DATA_SATHROVARR,
+ DATA_BRUTALLUS,
+ DATA_MADRIGOSA,
+ DATA_FELMYST,
+ DATA_ALYTHESS,
+ DATA_SACROLASH,
+ DATA_MURU,
+ DATA_KILJAEDEN,
+ DATA_KILJAEDEN_CONTROLLER,
+ DATA_ANVEENA,
+ DATA_KALECGOS_KJ,
+
+ /*** GameObjects ***/
+ DATA_GO_FORCEFIELD,
+ DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1,
+ DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_2,
+ DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_3,
+ DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4,
+
+ /*** Misc ***/
+ DATA_PLAYER_GUID,
+};
+
+enum Creatures
+{
+ BOSS_MURU = 25741,
+ BOSS_ENTROPIUS = 25840,
+ MOB_KALECGOS = 24850,
+ MOB_KALEC = 24891,
+ MOB_SATHROVARR = 24892,
+
+ MOB_DEAD = 25268,
+ MOB_FLIGHT_LEFT = 25357,
+ MOB_FLIGHT_RIGHT = 25358,
+ MOB_DEATH_CLOUD = 25703,
+ MOB_VAPOR = 25265,
+ MOB_VAPOR_TRAIL = 25267,
+ MOB_GRAND_WARLOCK_ALYTHESS = 25166,
+ MOB_SHADOW_IMAGE = 25214,
+ MOB_LADY_SACROLASH = 25165,
+
+ CREATURE_ANVEENA = 26046, // Embodiment of the Sunwell
+ CREATURE_KALECGOS = 25319, // Helps the raid throughout the fight
+ CREATURE_PROPHET = 26246, // Outro
+ CREATURE_KILJAEDEN = 25315, // Give it to 'em KJ!
+ CREATURE_HAND_OF_THE_DECEIVER = 25588, // Adds found before KJ emerges
+ CREATURE_FELFIRE_PORTAL = 25603, // Portal spawned be Hand of the Deceivers
+ CREATURE_VOLATILE_FELFIRE_FIEND = 25598, // Fiends spawned by the above portal
+ CREATURE_ARMAGEDDON_TARGET = 25735, // This mob casts meteor on itself.. I think
+ CREATURE_SHIELD_ORB = 25502, // Shield orbs circle the room raining shadow bolts on raid
+ CREATURE_THE_CORE_OF_ENTROPIUS = 26262, // Used in the ending cinematic?
+ CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT = 25653, // NPC that players possess when using the Orb of the Blue Dragonflight
+ CREATURE_SPIKE_TARGET1 = 30598, // Should summon these under Shadow Spike Channel on targets place
+ CREATURE_SPIKE_TARGET2 = 30614,
+ CREATURE_SINISTER_REFLECTION = 25708, // Sinister Relection spawnd on Phase swichtes
+
+ CREATURE_DARKNESS = 25879,
+ CREATURE_DARK_FIENDS = 25744,
+ CREATURE_BERSERKER = 25798,
+ CREATURE_FURY_MAGE = 25799,
+ CREATURE_VOID_SENTINEL = 25772,
+ CREATURE_VOID_SPAWN = 25824,
+ CREATURE_BLACK_HOLE = 25855,
+};
+
+enum GameObjects
+{
+ GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT = 188415,
+};
+
+#endif