aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp775
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp9
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h2
4 files changed, 550 insertions, 238 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index e57cbf4a390..f3d5697c672 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3041,6 +3041,7 @@ void SpellMgr::LoadDbcDataCorrections()
case 42611: // Shoot
case 61588: // Blazing Harpoon
case 52479: // Gift of the Harvester
+ case 48246: // Ball of Flame
spellInfo->MaxAffectedTargets = 1;
break;
case 41376: // Spite
@@ -3383,6 +3384,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->AreaGroupId = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel
break;
case 70602: // Corruption
+ case 48278: // Paralyze
spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS;
break;
case 70715: // Column of Frost (visual marker)
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
index 01cd36266d0..7280c3d5b82 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
@@ -20,66 +20,93 @@
enum Spells
{
- SPELL_CALL_FLAMES = 48258,
- SPELL_RITUAL_OF_THE_SWORD = 48276, //Effect #1 Teleport, Effect #2 Dummy
+ SPELL_SVALA_TRANSFORMING1 = 54140,
+ SPELL_SVALA_TRANSFORMING2 = 54205,
+ SPELL_TRANSFORMING_CHANNEL = 54142,
+
+ SPELL_CALL_FLAMES = 48258, // caster effect only, triggers event 17841
SPELL_SINSTER_STRIKE = 15667,
H_SPELL_SINSTER_STRIKE = 59409,
- SPELL_SVALA_TRANSFORMING1 = 54140,
- SPELL_SVALA_TRANSFORMING2 = 54205
+
+ SPELL_RITUAL_PREPARATION = 48267,
+ SPELL_RITUAL_OF_THE_SWORD = 48276,
+ SPELL_RITUAL_STRIKE_TRIGGER = 48331, // triggers 48277 & 59930, needs NPC_RITUAL_TARGET as spell_script_target
+ SPELL_RITUAL_DISARM = 54159,
+ SPELL_RITUAL_STRIKE_EFF_1 = 48277,
+ SPELL_RITUAL_STRIKE_EFF_2 = 59930,
+
+ SPELL_SUMMONED_VIS = 64446,
+ SPELL_RITUAL_CHANNELER_1 = 48271,
+ SPELL_RITUAL_CHANNELER_2 = 48274,
+ SPELL_RITUAL_CHANNELER_3 = 48275,
+
+ // Ritual Channeler spells
+ SPELL_PARALYZE = 48278,
+ SPELL_SHADOWS_IN_THE_DARK = 59407,
+
+ // Scourge Hulk spells
+ SPELL_MIGHTY_BLOW = 48697,
+ SPELL_VOLATILE_INFECTION = 56785,
+ H_SPELL_VOLATILE_INFECTION = 59228
};
-//not in db
+
enum Yells
{
- SAY_DIALOG_WITH_ARTHAS_1 = -1575015,
- SAY_DIALOG_WITH_ARTHAS_2 = -1575016,
- SAY_DIALOG_WITH_ARTHAS_3 = -1575017,
- SAY_AGGRO = -1575018,
- SAY_SLAY_1 = -1575019,
- SAY_SLAY_2 = -1575020,
- SAY_SLAY_3 = -1575021,
- SAY_DEATH = -1575022,
- SAY_SACRIFICE_PLAYER_1 = -1575023,
- SAY_SACRIFICE_PLAYER_2 = -1575024,
- SAY_SACRIFICE_PLAYER_3 = -1575025,
- SAY_SACRIFICE_PLAYER_4 = -1575026,
- SAY_SACRIFICE_PLAYER_5 = -1575027,
- SAY_DIALOG_OF_ARTHAS_1 = -1575028,
- SAY_DIALOG_OF_ARTHAS_2 = -1575029
+ // Svala
+ SAY_SVALA_INTRO_0 = 0,
+
+ // Svala Sorrowgrave
+ SAY_SVALA_INTRO_1 = 0,
+ SAY_SVALA_INTRO_2 = 1,
+ SAY_AGGRO = 2,
+ SAY_SLAY = 3,
+ SAY_DEATH = 4,
+ SAY_SACRIFICE_PLAYER = 5,
+
+ // Image of Arthas
+ SAY_DIALOG_OF_ARTHAS_1 = 0,
+ SAY_DIALOG_OF_ARTHAS_2 = 1
};
+
enum Creatures
{
CREATURE_ARTHAS = 29280, // Image of Arthas
CREATURE_SVALA_SORROWGRAVE = 26668, // Svala after transformation
CREATURE_SVALA = 29281, // Svala before transformation
- CREATURE_RITUAL_CHANNELER = 27281
+ CREATURE_RITUAL_CHANNELER = 27281,
+ CREATURE_SPECTATOR = 26667,
+ CREATURE_RITUAL_TARGET = 27327,
+ CREATURE_FLAME_BRAZIER = 27273,
+ CREATURE_SCOURGE_HULK = 26555
};
-enum ChannelerSpells
-{
- //ritual channeler's spells
- SPELL_PARALYZE = 48278,
- SPELL_SHADOWS_IN_THE_DARK = 59407
-};
-enum Misc
+
+enum Objects
{
- DATA_SVALA_DISPLAY_ID = 25944
+ OBJECT_UTGARDE_MIRROR = 191745
};
-enum IntroPhase
+
+enum SvalaPhase
{
IDLE,
INTRO,
- FINISHED
+ NORMAL,
+ SACRIFICING,
+ SVALADEAD
};
-enum CombatPhase
+
+#define DATA_INCREDIBLE_HULK 2043
+
+static const float spectatorWP[2][3] =
{
- NORMAL,
- SACRIFICING
+ {296.95f,-312.76f,86.36f},
+ {297.69f,-275.81f,86.36f}
};
static Position RitualChannelerPos[]=
{
- {296.42f, -355.01f, 90.94f, 0.0f},
- {302.36f, -352.01f, 90.54f, 0.0f},
- {291.39f, -350.89f, 90.54f, 0.0f}
+ {296.42f, -355.01f, 90.94f, 1.58f},
+ {302.36f, -352.01f, 90.54f, 2.20f},
+ {291.39f, -352.01f, 90.54f, 0.91f}
};
static Position ArthasPos = { 295.81f, -366.16f, 92.57f, 1.58f };
static Position SvalaPos = { 296.632f, -346.075f, 90.6307f, 1.58f };
@@ -96,31 +123,96 @@ public:
struct boss_svalaAI : public ScriptedAI
{
- boss_svalaAI(Creature* c) : ScriptedAI(c)
+ boss_svalaAI(Creature* creature) : ScriptedAI(creature), summons(creature)
{
- instance = c->GetInstanceScript();
+ instance = creature->GetInstanceScript();
+ Phase = IDLE;
+
+ me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RITUAL_STRIKE_EFF_1, true);
+ me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RITUAL_STRIKE_EFF_2, true);
}
- uint32 uiIntroTimer;
+ InstanceScript* instance;
+ SummonList summons;
+ SvalaPhase Phase;
+
+ Position pos;
+ float x, y, z;
- uint8 uiIntroPhase;
+ uint32 introTimer;
+ uint8 introPhase;
+ uint8 sacrePhase;
- IntroPhase Phase;
+ TempSummon* arthas;
+ uint64 arthasGUID;
- TempSummon* pArthas;
- uint64 uiArthasGUID;
+ uint32 sinsterStrikeTimer;
+ uint32 callFlamesTimer;
+ uint32 sacrificeTimer;
- InstanceScript* instance;
+ bool sacrificed;
void Reset()
{
- Phase = IDLE;
- uiIntroTimer = 1 * IN_MILLISECONDS;
- uiIntroPhase = 0;
- uiArthasGUID = 0;
+ sacrificed = false;
+ SetCombatMovement(true);
+
+ summons.DespawnAll();
+ me->RemoveAllAuras();
+
+ if (Phase > INTRO)
+ {
+ me->SetFlying(true);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ }
+
+ if (Phase > NORMAL)
+ Phase = NORMAL;
+
+ introTimer = 1 * IN_MILLISECONDS;
+ introPhase = 0;
+ arthasGUID = 0;
if (instance)
+ {
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
+ instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
+ }
+ }
+
+ void JustReachedHome()
+ {
+ if (Phase > INTRO)
+ {
+ me->SetFlying(false);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SetOrientation(1.58f);
+ me->SendMovementFlagUpdate();
+ }
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ Talk(SAY_AGGRO);
+
+ sinsterStrikeTimer = 7 * IN_MILLISECONDS;
+ callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
+
+ if (instance)
+ instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
+ }
+
+ void JustSummoned(Creature* summon)
+ {
+ if (summon->GetEntry() == CREATURE_RITUAL_CHANNELER)
+ summon->CastSpell(summon, SPELL_SUMMONED_VIS, true);
+
+ summons.Summon(summon);
+ }
+
+ void SummonedCreatureDespawn(Creature* summon)
+ {
+ summons.Despawn(summon);
}
void MoveInLineOfSight(Unit* who)
@@ -132,287 +224,500 @@ public:
{
Phase = INTRO;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ if (GameObject* mirror = GetClosestGameObjectWithEntry(me, OBJECT_UTGARDE_MIRROR, 100.0f))
+ mirror->SetGoState(GO_STATE_READY);
- if (Creature* pArthas = me->SummonCreature(CREATURE_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
+ if (Creature* arthas = me->SummonCreature(CREATURE_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
{
- pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- uiArthasGUID = pArthas->GetGUID();
+ arthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ arthasGUID = arthas->GetGUID();
}
}
}
+
+ void KilledUnit(Unit* victim)
+ {
+ if (victim != me)
+ Talk(SAY_SLAY);
+ }
+
+ void DamageTaken(Unit* attacker, uint32 &damage)
+ {
+ if (Phase == SVALADEAD)
+ {
+ if (attacker != me)
+ damage = 0;
+ return;
+ }
- void AttackStart(Unit* /*who*/) {}
+ if (damage >= me->GetHealth())
+ {
+ if (Phase == SACRIFICING)
+ SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
+
+ me->GetPosition(x, y, z);
+ z = me->GetMap()->GetHeight(x, y, z, true, 50);
+
+ if (me->GetPositionZ() > z)
+ {
+ damage = 0;
+ Phase = SVALADEAD;
+ me->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetHealth(1);
+
+ SetCombatMovement(false);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
+ me->GetMotionMaster()->MoveFall(z, 1);
+ }
+ }
+ }
+
+ void MovementInform(uint32 motionType, uint32 pointId)
+ {
+ if (motionType != POINT_MOTION_TYPE)
+ return;
+
+ if (pointId == 1)
+ {
+ me->Relocate(x, y, z, me->GetOrientation());
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+
+ void JustDied(Unit* killer)
+ {
+ summons.DespawnAll();
+
+ if (instance)
+ instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, DONE);
+
+ Talk(SAY_DEATH);
+ }
+
+ void SpellHitTarget(Unit* target, const SpellInfo* spell)
+ {
+ if (spell->Id == SPELL_RITUAL_STRIKE_EFF_1 && Phase != NORMAL && Phase != SVALADEAD)
+ {
+ Phase = NORMAL;
+ SetCombatMovement(true);
+
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300, true))
+ me->GetMotionMaster()->MoveChase(target);
+ }
+ }
void UpdateAI(const uint32 diff)
{
- if (Phase != INTRO)
+ if (Phase == IDLE)
+ return;
+
+ if (Phase == INTRO)
+ {
+ if (introTimer <= diff)
+ {
+ Creature* arthas = Unit::GetCreature(*me, arthasGUID);
+ if (!arthas)
+ return;
+
+ switch (introPhase)
+ {
+ case 0:
+ Talk(SAY_SVALA_INTRO_0);
+ ++introPhase;
+ introTimer = 8100;
+ break;
+ case 1:
+ arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_1);
+ ++introPhase;
+ introTimer = 10000;
+ break;
+ case 2:
+ arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false);
+ me->SetFlying(true);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ pos.Relocate(me);
+ pos.m_positionZ += 8.0f;
+ me->GetMotionMaster()->MoveTakeoff(0, pos, 3.30078125f);
+ // spectators flee event
+ if (instance)
+ {
+ std::list<Creature*> lspectatorList;
+ GetCreatureListWithEntryInGrid(lspectatorList, me, CREATURE_SPECTATOR, 100.0f);
+ for(std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr)
+ {
+ if ((*itr)->isAlive())
+ {
+ (*itr)->SetStandState(UNIT_STAND_STATE_STAND);
+ (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ (*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0][0], spectatorWP[0][1], spectatorWP[0][2]);
+ }
+ }
+ }
+ ++introPhase;
+ introTimer = 4200;
+ break;
+ case 3:
+ me->CastSpell(me, SPELL_SVALA_TRANSFORMING1, false);
+ ++introPhase;
+ introTimer = 6200;
+ break;
+ case 4:
+ me->CastSpell(me, SPELL_SVALA_TRANSFORMING2, false);
+ arthas->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
+ me->UpdateEntry(CREATURE_SVALA_SORROWGRAVE);
+ me->SetFacingToObject(arthas);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ ++introPhase;
+ introTimer = 3200;
+ break;
+ case 5:
+ Talk(SAY_SVALA_INTRO_1);
+ ++introPhase;
+ introTimer = 10000;
+ break;
+ case 6:
+ arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_2);
+ ++introPhase;
+ introTimer = 7200;
+ break;
+ case 7:
+ Talk(SAY_SVALA_INTRO_2);
+ me->SetOrientation(1.58f);
+ me->SendMovementFlagUpdate();
+ arthas->SetVisible(false);
+ ++introPhase;
+ introTimer = 13800;
+ break;
+ case 8:
+ me->SetFlying(false);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SendMovementFlagUpdate();
+ pos.Relocate(me);
+ pos.m_positionX = me->GetHomePosition().GetPositionX();
+ pos.m_positionY = me->GetHomePosition().GetPositionY();
+ pos.m_positionZ = 90.6065f;
+ me->GetMotionMaster()->MoveLand(0, pos, 6.247422f);
+ ++introPhase;
+ introTimer = 3000;
+ break;
+ case 9:
+ if (GameObject* mirror = GetClosestGameObjectWithEntry(me, OBJECT_UTGARDE_MIRROR, 100.0f))
+ mirror->SetGoState(GO_STATE_ACTIVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ arthas->DespawnOrUnsummon();
+ arthasGUID = 0;
+ Phase = NORMAL;
+ break;
+ }
+ } else introTimer -= diff;
+
return;
+ }
- if (uiIntroTimer <= diff)
+ if (Phase == NORMAL)
{
- Creature* pArthas = Unit::GetCreature(*me, uiArthasGUID);
- if (!pArthas)
+ //Return since we have no target
+ if (!UpdateVictim())
return;
- switch (uiIntroPhase)
+ if (me->IsWithinMeleeRange(me->getVictim()) && me->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING))
{
- case 0:
- DoScriptText(SAY_DIALOG_WITH_ARTHAS_1, me);
- ++uiIntroPhase;
- uiIntroTimer = 3500;
- break;
- case 1:
- DoScriptText(SAY_DIALOG_OF_ARTHAS_1, pArthas);
- ++uiIntroPhase;
- uiIntroTimer = 3500;
- break;
- case 2:
- DoScriptText(SAY_DIALOG_WITH_ARTHAS_2, me);
- ++uiIntroPhase;
- uiIntroTimer = 3500;
- break;
- case 3:
- DoScriptText(SAY_DIALOG_OF_ARTHAS_2, pArthas);
- ++uiIntroPhase;
- uiIntroTimer = 3500;
- break;
- case 4:
- DoScriptText(SAY_DIALOG_WITH_ARTHAS_3, me);
- DoCast(me, SPELL_SVALA_TRANSFORMING1);
- ++uiIntroPhase;
- uiIntroTimer = 2800;
- break;
- case 5:
- DoCast(me, SPELL_SVALA_TRANSFORMING2);
- ++uiIntroPhase;
- uiIntroTimer = 200;
- break;
- case 6:
- if (me->SummonCreature(CREATURE_SVALA_SORROWGRAVE, SvalaPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60*IN_MILLISECONDS))
+ me->SetFlying(false);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SendMovementFlagUpdate();
+ }
+
+ if (sinsterStrikeTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_SINSTER_STRIKE);
+ sinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
+ } else sinsterStrikeTimer -= diff;
+
+ if (callFlamesTimer <= diff)
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
+ {
+ DoCast(target, SPELL_CALL_FLAMES);
+ callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
+ }
+ } else callFlamesTimer -= diff;
+
+ if (!sacrificed)
+ {
+ if (HealthBelowPct(50))
+ {
+ if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true))
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- me->SetDisplayId(DATA_SVALA_DISPLAY_ID);
- pArthas->DespawnOrUnsummon();
- uiArthasGUID = 0;
- Phase = FINISHED;
+ if (instance)
+ instance->SetData64(DATA_SACRIFICED_PLAYER, sacrificeTarget->GetGUID());
+
+ Talk(SAY_SACRIFICE_PLAYER);
+
+ DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION);
+
+ SetCombatMovement(false);
+ me->SetFlying(true);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+
+ Phase = SACRIFICING;
+ sacrePhase = 0;
+ sacrificeTimer = 1 * IN_MILLISECONDS;
+
+ DoCast(me, SPELL_RITUAL_OF_THE_SWORD);
+ sacrificed = true;
}
- else
- Reset();
- break;
+ }
}
- } else uiIntroTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ else //SACRIFICING
+ {
+ if (sacrificeTimer <= diff)
+ {
+ switch (sacrePhase)
+ {
+ case 0:
+ // spawn ritual channelers
+ if (instance)
+ {
+ DoCast(me, SPELL_RITUAL_CHANNELER_1, true);
+ DoCast(me, SPELL_RITUAL_CHANNELER_2, true);
+ DoCast(me, SPELL_RITUAL_CHANNELER_3, true);
+ }
+ ++sacrePhase;
+ sacrificeTimer = 2 * IN_MILLISECONDS;
+ break;
+ case 1:
+ me->StopMoving();
+ me->GetMotionMaster()->MoveIdle();
+ me->InterruptNonMeleeSpells(true);
+ DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true);
+ ++sacrePhase;
+ sacrificeTimer = 200;
+ break;
+ case 2:
+ DoCast(me, SPELL_RITUAL_DISARM);
+ ++sacrePhase;
+ break;
+ case 3:
+ break;
+ }
+ }
+ else sacrificeTimer -= diff;
+ }
}
};
};
-class mob_ritual_channeler : public CreatureScript
+class npc_ritual_channeler : public CreatureScript
{
public:
- mob_ritual_channeler() : CreatureScript("mob_ritual_channeler") { }
+ npc_ritual_channeler() : CreatureScript("npc_ritual_channeler") { }
CreatureAI* GetAI(Creature* creature) const
{
- return new mob_ritual_channelerAI(creature);
+ return new npc_ritual_channelerAI(creature);
}
- struct mob_ritual_channelerAI : public Scripted_NoMovementAI
+ struct npc_ritual_channelerAI : public Scripted_NoMovementAI
{
- mob_ritual_channelerAI(Creature* c) :Scripted_NoMovementAI(c)
+ npc_ritual_channelerAI(Creature* c) :Scripted_NoMovementAI(c)
{
instance = c->GetInstanceScript();
}
InstanceScript* instance;
+ uint32 paralyzeTimer;
void Reset()
{
- DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
- }
-
- // called by svala sorrowgrave to set guid of victim
- void DoAction(const int32 /*action*/)
- {
+ paralyzeTimer = 1600;
if (instance)
- if (Unit* victim = me->GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)))
- DoCast(victim, SPELL_PARALYZE);
+ if (IsHeroic())
+ DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
}
-
- void EnterCombat(Unit* /*who*/)
+
+ void UpdateAI(const uint32 diff)
{
+ if (me->HasUnitState(UNIT_STAT_CASTING))
+ return;
+
+ if (paralyzeTimer <= diff)
+ {
+ if (instance)
+ if (Unit* victim = me->GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)))
+ DoCast(victim, SPELL_PARALYZE, false);
+
+ paralyzeTimer = 200;
+ }
+ else
+ paralyzeTimer -= diff;
}
};
-
};
-class boss_svala_sorrowgrave : public CreatureScript
+class npc_spectator : public CreatureScript
{
public:
- boss_svala_sorrowgrave() : CreatureScript("boss_svala_sorrowgrave") { }
+ npc_spectator() : CreatureScript("npc_spectator") { }
CreatureAI* GetAI(Creature* creature) const
{
- return new boss_svala_sorrowgraveAI(creature);
+ return new npc_spectatorAI(creature);
}
- struct boss_svala_sorrowgraveAI : public ScriptedAI
+ struct npc_spectatorAI : public ScriptedAI
{
- boss_svala_sorrowgraveAI(Creature* c) : ScriptedAI(c), summons(c)
+ npc_spectatorAI(Creature* c) : ScriptedAI(c) { }
+
+ void Reset() { }
+
+ void MovementInform(uint32 motionType, uint32 pointId)
{
- instance = c->GetInstanceScript();
+ if (motionType == POINT_MOTION_TYPE)
+ {
+ if (pointId == 1)
+ me->GetMotionMaster()->MovePoint(2,spectatorWP[1][0],spectatorWP[1][1],spectatorWP[1][2]);
+ else if (pointId == 2)
+ me->DespawnOrUnsummon(1000);
+ }
}
+ };
+};
- uint32 uiSinsterStrikeTimer;
- uint32 uiCallFlamesTimer;
- uint32 uiRitualOfSwordTimer;
- uint32 uiSacrificeTimer;
+class checkRitualTarget
+{
+ public:
+ explicit checkRitualTarget(Unit* _caster) : caster(_caster) { }
- CombatPhase Phase;
+ bool operator() (Unit* unit)
+ {
+ if (InstanceScript* instance = caster->GetInstanceScript())
+ if (instance->GetData64(DATA_SACRIFICED_PLAYER) == unit->GetGUID())
+ return false;
- SummonList summons;
+ return true;
+ }
- bool bSacrificed;
+ private:
+ Unit* caster;
+};
- InstanceScript* instance;
+class spell_paralyze_pinnacle : public SpellScriptLoader
+{
+ public:
+ spell_paralyze_pinnacle() : SpellScriptLoader("spell_paralyze_pinnacle") { }
- void Reset()
+ class spell_paralyze_pinnacle_SpellScript : public SpellScript
{
- uiSinsterStrikeTimer = 7 * IN_MILLISECONDS;
- uiCallFlamesTimer = 10 * IN_MILLISECONDS;
- uiRitualOfSwordTimer = 20 * IN_MILLISECONDS;
- uiSacrificeTimer = 8 * IN_MILLISECONDS;
-
- bSacrificed = false;
-
- Phase = NORMAL;
-
- DoTeleportTo(296.632f, -346.075f, 90.6307f);
- me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
+ PrepareSpellScript(spell_paralyze_pinnacle_SpellScript);
- summons.DespawnAll();
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove_if(checkRitualTarget(GetCaster()));
+ }
- if (instance)
+ void Register()
{
- instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
- instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
- }
+ };
- void EnterCombat(Unit* /*who*/)
+ SpellScript* GetSpellScript() const
{
- DoScriptText(SAY_AGGRO, me);
-
- if (instance)
- instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
+ return new spell_paralyze_pinnacle_SpellScript();
}
+};
- void JustSummoned(Creature* summon)
- {
- summons.Summon(summon);
- }
+class npc_scourge_hulk : public CreatureScript
+{
+ public:
+ npc_scourge_hulk() : CreatureScript("npc_scourge_hulk") { }
- void SummonedCreatureDespawn(Creature* summon)
+ struct npc_scourge_hulkAI : public ScriptedAI
{
- summons.Despawn(summon);
- }
+ npc_scourge_hulkAI(Creature* creature) : ScriptedAI(creature) { }
- void UpdateAI(const uint32 diff)
- {
- if (Phase == NORMAL)
+ uint32 mightyBlow;
+ uint32 volatileInfection;
+
+ void Reset()
+ {
+ mightyBlow = urand(4000, 9000);
+ volatileInfection = urand(10000, 14000);
+ killedByRitualStrike = false;
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ return type == DATA_INCREDIBLE_HULK ? killedByRitualStrike : 0;
+ }
+
+ void DamageTaken(Unit* attacker, uint32 &damage)
+ {
+ if (damage >= me->GetHealth() && attacker->GetEntry() == CREATURE_SVALA_SORROWGRAVE)
+ killedByRitualStrike = true;
+ }
+
+ void UpdateAI(uint32 const diff)
{
- //Return since we have no target
if (!UpdateVictim())
return;
- if (uiSinsterStrikeTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SINSTER_STRIKE);
- uiSinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
- } else uiSinsterStrikeTimer -= diff;
-
- if (uiCallFlamesTimer <= diff)
+ if (mightyBlow <= diff)
{
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- {
- DoCast(target, SPELL_CALL_FLAMES);
- uiCallFlamesTimer = urand(8 * IN_MILLISECONDS, 12 * IN_MILLISECONDS);
- }
- } else uiCallFlamesTimer -= diff;
+ if (Unit* victim = me->getVictim())
+ if (!victim->HasUnitState(UNIT_STAT_STUNNED)) // Prevent knocking back a ritual player
+ DoCast(victim, SPELL_MIGHTY_BLOW);
+ mightyBlow = urand(12000, 17000);
+ }
+ else
+ mightyBlow -= diff;
- if (!bSacrificed)
+ if (volatileInfection <= diff)
{
- if (uiRitualOfSwordTimer <= diff)
- {
- if (Unit* pSacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- {
- DoScriptText(RAND(SAY_SACRIFICE_PLAYER_1, SAY_SACRIFICE_PLAYER_2, SAY_SACRIFICE_PLAYER_3, SAY_SACRIFICE_PLAYER_4, SAY_SACRIFICE_PLAYER_5), me);
- DoCast(pSacrificeTarget, SPELL_RITUAL_OF_THE_SWORD);
- //Spell doesn't teleport
- DoTeleportPlayer(pSacrificeTarget, 296.632f, -346.075f, 90.63f, 4.6f);
- me->SetUnitMovementFlags(MOVEMENTFLAG_CAN_FLY);
- DoTeleportTo(296.632f, -346.075f, 120.85f);
- Phase = SACRIFICING;
- if (instance)
- {
- instance->SetData64(DATA_SACRIFICED_PLAYER, pSacrificeTarget->GetGUID());
-
- for (uint8 i = 0; i < 3; ++i)
- if (Creature* summon = me->SummonCreature(CREATURE_RITUAL_CHANNELER, RitualChannelerPos[i], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
- summon->AI()->DoAction(0);
- }
-
- bSacrificed = true;
- }
- } else uiRitualOfSwordTimer -= diff;
+ DoCastVictim(SPELL_VOLATILE_INFECTION);
+ volatileInfection = urand(13000, 17000);
}
+ else
+ volatileInfection -= diff;
DoMeleeAttackIfReady();
}
- else //SACRIFICING
- {
- if (uiSacrificeTimer <= diff)
- {
- Unit* pSacrificeTarget = instance ? Unit::GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)) : NULL;
- if (instance && !summons.empty() && pSacrificeTarget && pSacrificeTarget->isAlive())
- me->Kill(pSacrificeTarget, false); // durability damage?
-
- //go down
- Phase = NORMAL;
- pSacrificeTarget = NULL;
- me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- me->GetMotionMaster()->MoveChase(target);
- uiSacrificeTimer = 8 * IN_MILLISECONDS;
- }
- else uiSacrificeTimer -= diff;
- }
- }
+ private:
+ bool killedByRitualStrike;
+ };
- void KilledUnit(Unit* /*victim*/)
+ CreatureAI* GetAI(Creature* creature) const
{
- DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
+ return new npc_scourge_hulkAI(creature);
}
+};
- void JustDied(Unit* killer)
- {
- if (instance)
- {
- Creature* pSvala = Unit::GetCreature((*me), instance->GetData64(DATA_SVALA));
- if (pSvala && pSvala->isAlive())
- killer->Kill(pSvala);
+class achievement_incredible_hulk : public AchievementCriteriaScript
+{
+ public:
+ achievement_incredible_hulk() : AchievementCriteriaScript("achievement_incredible_hulk") { }
- instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, DONE);
- }
- DoScriptText(SAY_DEATH, me);
+ bool OnCheck(Player* /*player*/, Unit* target)
+ {
+ return target && target->IsAIEnabled && target->GetAI()->GetData(DATA_INCREDIBLE_HULK);
}
- };
-
};
void AddSC_boss_svala()
{
new boss_svala();
- new mob_ritual_channeler();
- new boss_svala_sorrowgrave();
+ new npc_ritual_channeler();
+ new npc_spectator();
+ new spell_paralyze_pinnacle();
+ new npc_scourge_hulk();
+ new achievement_incredible_hulk();
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp
index c5bc235da1f..cb596f284c5 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp
@@ -170,8 +170,12 @@ public:
void SetData64(uint32 type, uint64 data)
{
- if (type == DATA_SACRIFICED_PLAYER)
- uiSacrificedPlayer = data;
+ switch (type)
+ {
+ case DATA_SACRIFICED_PLAYER:
+ uiSacrificedPlayer = data;
+ break;
+ }
}
uint32 GetData(uint32 type)
@@ -201,6 +205,7 @@ public:
case DATA_MOB_ORB: return uiPalehoofOrb;
case DATA_SVALA: return uiSvala;
case DATA_GORTOK_PALEHOOF_SPHERE: return uiGortokPalehoofSphere;
+ case DATA_SACRIFICED_PLAYER: return uiSacrificedPlayer;
}
return 0;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
index 7d10483ca1d..872314ee25e 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
@@ -53,7 +53,7 @@ enum eCreatures
MOB_MASSIVE_JORMUNGAR = 26685,
MOB_FEROCIOUS_RHINO = 26686,
MOB_SVALA = 29281,
- MOB_PALEHOOF_ORB = 26688,
+ MOB_PALEHOOF_ORB = 26688
};
#endif