aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/icecrown.cpp373
1 files changed, 373 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp
index 030df23028c..dc450a8fea4 100644
--- a/src/server/scripts/Northrend/icecrown.cpp
+++ b/src/server/scripts/Northrend/icecrown.cpp
@@ -494,6 +494,378 @@ class npc_tournament_training_dummy : public CreatureScript
};
+// Battle for Crusaders' Pinnacle
+enum BlessedBanner
+{
+ SPELL_BLESSING_OF_THE_CRUSADE = 58026,
+ SPELL_THREAT_PULSE = 58113,
+ SPELL_CRUSADERS_SPIRE_VICTORY = 58084,
+ SPELL_TORCH = 58121,
+
+ NPC_BLESSED_BANNER = 30891,
+ NPC_CRUSADER_LORD_DALFORS = 31003,
+ NPC_ARGENT_BATTLE_PRIEST = 30919,
+ NPC_ARGENT_MASON = 30900,
+ NPC_REANIMATED_CAPTAIN = 30986,
+ NPC_SCOURGE_DRUDGE = 30984,
+ NPC_HIDEOUS_PLAGEBRINGER = 30987,
+ NPC_HALOF_THE_DEATHBRINGER = 30989,
+ NPC_LK = 31013,
+
+ BANNER_SAY = 0, // "The Blessed Banner of the Crusade has been planted.\n Defend the banner from all attackers!"
+ DALFORS_SAY_PRE_1 = 0, // "BY THE LIGHT! Those damned monsters! Look at what they've done to our people!"
+ DALFORS_SAY_PRE_2 = 1, // "Burn it down, boys. Burn it all down."
+ DALFORS_SAY_START = 2, // "Let 'em come. They'll pay for what they've done!"
+ DALFORS_YELL_FINISHED = 3, // "We've done it, lads! We've taken the pinnacle from the Scourge! Report to Father Gustav at once and tell him the good news! We're gonna get to buildin' and settin' up! Go!"
+ LK_TALK_1 = 0, // "Leave no survivors!"
+ LK_TALK_2 = 1, // "Cower before my terrible creations!"
+ LK_TALK_3 = 2, // "Feast my children! Feast upon the flesh of the living!"
+ LK_TALK_4 = 3, // "Lay down your arms and surrender your souls!"
+
+ EVENT_SPAWN = 1,
+ EVENT_INTRO_1 = 2,
+ EVENT_INTRO_2 = 3,
+ EVENT_INTRO_3 = 4,
+ EVENT_MASON_ACTION = 5,
+ EVENT_START_FIGHT = 6,
+ EVENT_WAVE_SPAWN = 7,
+ EVENT_HALOF = 8,
+ EVENT_ENDED = 9,
+};
+
+Position const DalforsPos[3] =
+{
+ {6458.703f, 403.858f, 490.498f, 3.1205f}, // Dalfors spawn point
+ {6422.950f, 423.335f, 510.451f, 0.0f}, // Dalfors intro pos
+ {6426.343f, 420.515f, 508.650f, 0.0f}, // Dalfors fight pos
+};
+
+Position const Priest1Pos[2] =
+{
+ {6462.025f, 403.681f, 489.721f, 3.1007f}, // priest1 spawn point
+ {6421.480f, 423.576f, 510.781f, 5.7421f}, // priest1 intro pos
+};
+
+Position const Priest2Pos[2] =
+{
+ {6463.969f, 407.198f, 489.240f, 2.2689f}, // priest2 spawn point
+ {6419.778f, 421.404f, 510.972f, 5.7421f}, // priest2 intro pos
+};
+
+Position const Priest3Pos[2] =
+{
+ {6464.371f, 400.944f, 489.186f, 6.1610f}, // priest3 spawn point
+ {6423.516f, 425.782f, 510.774f, 5.7421f}, // priest3 intro pos
+};
+
+Position const Mason1Pos[3] =
+{
+ {6462.929f, 409.826f, 489.392f, 3.0968f}, // mason1 spawn point
+ {6428.163f, 421.960f, 508.297f, 0.0f}, // mason1 intro pos
+ {6414.335f, 454.904f, 511.395f, 2.8972f}, // mason1 action pos
+};
+
+Position const Mason2Pos[3] =
+{
+ {6462.650f, 405.670f, 489.576f, 2.9414f}, // mason2 spawn point
+ {6426.250f, 419.194f, 508.219f, 0.0f}, // mason2 intro pos
+ {6415.014f, 446.849f, 511.395f, 3.1241f}, // mason2 action pos
+};
+
+Position const Mason3Pos[3] =
+{
+ {6462.646f, 401.218f, 489.601f, 2.7864f}, // mason3 spawn point
+ {6423.855f, 416.598f, 508.305f, 0.0f}, // mason3 intro pos
+ {6417.070f, 438.824f, 511.395f, 3.6651f}, // mason3 action pos
+};
+
+class npc_blessed_banner : public CreatureScript
+{
+public:
+ npc_blessed_banner() : CreatureScript("npc_blessed_banner") { }
+
+ struct npc_blessed_bannerAI : public Scripted_NoMovementAI
+ {
+ npc_blessed_bannerAI(Creature* creature) : Scripted_NoMovementAI(creature) , Summons(me)
+ {
+ HalofSpawned = false;
+ PhaseCount = 0;
+ Summons.DespawnAll();
+ }
+
+ EventMap events;
+
+ bool HalofSpawned;
+
+ uint32 PhaseCount;
+
+ SummonList Summons;
+
+ uint64 guidDalfors;
+ uint64 guidPriest[3];
+ uint64 guidMason[3];
+ uint64 guidHalof;
+
+ void Reset()
+ {
+ me->setRegeneratingHealth(false);
+ DoCast(SPELL_THREAT_PULSE);
+ me->AI()->Talk(BANNER_SAY);
+ events.ScheduleEvent(EVENT_SPAWN,3000);
+ }
+
+ void EnterCombat(Unit* /*who*/) {}
+
+ void MoveInLineOfSight(Unit* /*who*/) {}
+
+ void JustSummoned(Creature* Summoned)
+ {
+ Summons.Summon(Summoned);
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ Summons.DespawnAll();
+ me->DespawnOrUnsummon();
+ }
+
+ void UpdateAI(uint32 const diff)
+ {
+ events.Update(diff);
+
+ switch (events.ExecuteEvent())
+ {
+ case EVENT_SPAWN:
+ {
+ if (Creature* Dalfors = DoSummon(NPC_CRUSADER_LORD_DALFORS, DalforsPos[0]))
+ {
+ guidDalfors = Dalfors->GetGUID();
+ Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[1]);
+ }
+ if (Creature* Priest1 = DoSummon(NPC_ARGENT_BATTLE_PRIEST, Priest1Pos[0]))
+ {
+ guidPriest[0] = Priest1->GetGUID();
+ Priest1->GetMotionMaster()->MovePoint(0, Priest1Pos[1]);
+ }
+ if (Creature* Priest2 = DoSummon(NPC_ARGENT_BATTLE_PRIEST, Priest2Pos[0]))
+ {
+ guidPriest[1] = Priest2->GetGUID();
+ Priest2->GetMotionMaster()->MovePoint(0, Priest2Pos[1]);
+ }
+ if (Creature* Priest3 = DoSummon(NPC_ARGENT_BATTLE_PRIEST, Priest3Pos[0]))
+ {
+ guidPriest[2] = Priest3->GetGUID();
+ Priest3->GetMotionMaster()->MovePoint(0, Priest3Pos[1]);
+ }
+ if (Creature* Mason1 = DoSummon(NPC_ARGENT_MASON, Mason1Pos[0]))
+ {
+ guidMason[0] = Mason1->GetGUID();
+ Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[1]);
+ }
+ if (Creature* Mason2 = DoSummon(NPC_ARGENT_MASON, Mason2Pos[0]))
+ {
+ guidMason[1] = Mason2->GetGUID();
+ Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[1]);
+ }
+ if (Creature* Mason3 = DoSummon(NPC_ARGENT_MASON, Mason3Pos[0]))
+ {
+ guidMason[2] = Mason3->GetGUID();
+ Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[1]);
+ }
+ events.ScheduleEvent(EVENT_INTRO_1,15000);
+ }
+ break;
+ case EVENT_INTRO_1:
+ {
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ Dalfors->AI()->Talk(DALFORS_SAY_PRE_1);
+ events.ScheduleEvent(EVENT_INTRO_2,5000);
+ }
+ break;
+ case EVENT_INTRO_2:
+ {
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ {
+ Dalfors->SetFacingTo(6.215f);
+ Dalfors->AI()->Talk(DALFORS_SAY_PRE_2);
+ }
+ events.ScheduleEvent(EVENT_INTRO_3,5000);
+ }
+ break;
+ case EVENT_INTRO_3:
+ {
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ {
+ Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[2]);
+ Dalfors->SetHomePosition(DalforsPos[2]);
+ }
+ if (Creature* Priest1 = me->GetCreature(*me,guidPriest[0]))
+ {
+ Priest1->SetFacingTo(5.7421f);
+ Priest1->SetHomePosition(Priest1Pos[1]);
+ }
+ if (Creature* Priest2 = me->GetCreature(*me,guidPriest[1]))
+ {
+ Priest2->SetFacingTo(5.7421f);
+ Priest2->SetHomePosition(Priest2Pos[1]);
+ }
+ if (Creature* Priest3 = me->GetCreature(*me,guidPriest[2]))
+ {
+ Priest3->SetFacingTo(5.7421f);
+ Priest3->SetHomePosition(Priest3Pos[1]);
+ }
+ if (Creature* Mason1 = me->GetCreature(*me,guidMason[0]))
+ {
+ Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[2]);
+ Mason1->SetHomePosition(Mason1Pos[2]);
+ }
+ if (Creature* Mason2 = me->GetCreature(*me,guidMason[1]))
+ {
+ Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[2]);
+ Mason2->SetHomePosition(Mason2Pos[2]);
+ }
+ if (Creature* Mason3 = me->GetCreature(*me,guidMason[2]))
+ {
+ Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[2]);
+ Mason3->SetHomePosition(Mason3Pos[2]);
+ }
+ events.ScheduleEvent(EVENT_START_FIGHT,5000);
+ events.ScheduleEvent(EVENT_MASON_ACTION,15000);
+ }
+ break;
+ case EVENT_MASON_ACTION:
+ {
+ if (Creature* Mason1 = me->GetCreature(*me,guidMason[0]))
+ {
+ Mason1->SetFacingTo(2.8972f);
+ Mason1->AI()->SetData(1,1); // triggers SAI actions on npc
+ }
+ if (Creature* Mason2 = me->GetCreature(*me,guidMason[1]))
+ {
+ Mason2->SetFacingTo(3.1241f);
+ Mason2->AI()->SetData(1,1); // triggers SAI actions on npc
+ }
+ if (Creature* Mason3 = me->GetCreature(*me,guidMason[2]))
+ {
+ Mason3->SetFacingTo(3.6651f);
+ Mason3->AI()->SetData(1,1); // triggers SAI actions on npc
+ }
+ }
+ break;
+ case EVENT_START_FIGHT:
+ {
+ if(Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
+ LK->AI()->Talk(LK_TALK_1);
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ Dalfors->AI()->Talk(DALFORS_SAY_START);
+ events.ScheduleEvent(EVENT_WAVE_SPAWN,1000);
+ }
+ break;
+ case EVENT_WAVE_SPAWN:
+ {
+ if (PhaseCount == 3)
+ {
+ if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
+ LK->AI()->Talk(LK_TALK_2);
+ }
+ else if (PhaseCount == 6)
+ {
+ if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
+ LK->AI()->Talk(LK_TALK_3);
+ }
+ if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason3Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (urand(0,1) == 0)
+ {
+ if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER,Mason1Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER,Mason2Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ }
+ else
+ {
+ if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN,Mason1Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN,Mason2Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ }
+
+ PhaseCount++;
+
+ if (PhaseCount < 8)
+ events.ScheduleEvent(EVENT_WAVE_SPAWN,urand(10000,20000));
+ else
+ events.ScheduleEvent(EVENT_HALOF,urand(10000,20000));
+ }
+ break;
+ case EVENT_HALOF:
+ {
+ if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
+ LK->AI()->Talk(LK_TALK_4);
+ if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason1Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason2Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (Creature* tempsum = DoSummon(NPC_HALOF_THE_DEATHBRINGER,DalforsPos[0]))
+ {
+ HalofSpawned = true;
+ guidHalof = tempsum->GetGUID();
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ }
+ break;
+ case EVENT_ENDED:
+ {
+ Summons.DespawnAll();
+ me->DespawnOrUnsummon();
+ }
+ break;
+ }
+
+ if (PhaseCount == 8)
+ if (Creature* Halof = me->GetCreature(*me,guidHalof))
+ if (Halof->isDead())
+ {
+ DoCast(me,SPELL_CRUSADERS_SPIRE_VICTORY,true);
+ Summons.DespawnEntry(NPC_HIDEOUS_PLAGEBRINGER);
+ Summons.DespawnEntry(NPC_REANIMATED_CAPTAIN);
+ Summons.DespawnEntry(NPC_SCOURGE_DRUDGE);
+ Summons.DespawnEntry(NPC_HALOF_THE_DEATHBRINGER);
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ Dalfors->AI()->Talk(DALFORS_YELL_FINISHED);
+ events.ScheduleEvent(EVENT_ENDED,10000);
+ }
+ }
+ };
+
+ CreatureAI *GetAI(Creature *creature) const
+ {
+ return new npc_blessed_bannerAI(creature);
+ }
+};
+
void AddSC_icecrown()
{
new npc_arete;
@@ -502,4 +874,5 @@ void AddSC_icecrown()
new npc_guardian_pavilion;
new npc_vereth_the_cunning;
new npc_tournament_training_dummy;
+ new npc_blessed_banner();
}