diff options
| -rw-r--r-- | sql/updates/world/2012_11_26_03_world_misc.sql | 115 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/icecrown.cpp | 373 |
2 files changed, 488 insertions, 0 deletions
diff --git a/sql/updates/world/2012_11_26_03_world_misc.sql b/sql/updates/world/2012_11_26_03_world_misc.sql new file mode 100644 index 00000000000..01ac81d4377 --- /dev/null +++ b/sql/updates/world/2012_11_26_03_world_misc.sql @@ -0,0 +1,115 @@ +-- The Battle For Crusaders' Pinnacle (13141) + +SET @SPELL_ITEM_BANNER := 58013; -- Plant Blessed Banner +SET @SPELL_TORCH := 58121; +SET @SPELL_TORCH_EFFECT := 58125; + +SET @NPC_BLESSED_BANNER := 30891; -- Blessed Banner of the Crusade +SET @NPC_CRUSADER_DALFORS := 31003; -- Crusader Lord Dalfors +SET @NPC_BATTLE_PRIEST := 30919; -- Argent Battle-priest +SET @NPC_MASON := 30900; -- Argent Mason +SET @NPC_TORCH_DUMMY := 31004; -- (Wave 0) Torch Dummy +SET @NPC_LK := 31013; -- The Lich King +SET @NPC_CAPTAIN := 30986; +SET @NPC_DRUDGE := 30984; +SET @NPC_PLAGEBRINGER := 30987; +SET @NPC_HALOF := 30989; + +SET @EVENT_SCRIPT := 20082; + +DELETE FROM `spell_target_position` WHERE `id`=@SPELL_ITEM_BANNER; +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(@SPELL_ITEM_BANNER,571,6418.42,422.97,511.11,0); + +UPDATE `creature_template` SET `faction_A`=2140,`faction_H`=2140,`ScriptName`='npc_blessed_banner' WHERE `entry`=@NPC_BLESSED_BANNER; +UPDATE `creature_template` SET `faction_A`=2131,`faction_H`=2131,`AIName`='SmartAI',`unit_flags`=32768,`equipment_id`=@NPC_CRUSADER_DALFORS WHERE `entry`=@NPC_CRUSADER_DALFORS; +UPDATE `creature_template` SET `faction_A`=2131,`faction_H`=2131,`AIName`='SmartAI',`unit_flags`=32768,`equipment_id`=@NPC_BATTLE_PRIEST WHERE `entry`=@NPC_BATTLE_PRIEST; +UPDATE `creature_template` SET `faction_A`=2070,`faction_H`=2070,`unit_flags`=32768,`AIName`='SmartAI',`equipment_id`=@NPC_MASON WHERE `entry`=@NPC_MASON; +UPDATE `creature_template` SET `unit_flags`=33554432,`InhabitType`=4,`AIName`='SmartAI',`flags_extra`=128 WHERE `entry`=@NPC_TORCH_DUMMY; +UPDATE `creature_template` SET `unit_flags`=33554432,`flags_extra`=128 WHERE `entry`=@NPC_LK; +UPDATE `creature_template` SET `faction_A`=2068,`faction_H`=2068,`unit_flags`=32768,`AIName`='SmartAI' WHERE `entry`=@NPC_CAPTAIN; +UPDATE `creature_template` SET `faction_A`=2068,`faction_H`=2068,`unit_flags`=32768,`AIName`='SmartAI' WHERE `entry`=@NPC_DRUDGE; +UPDATE `creature_template` SET `faction_A`=2068,`faction_H`=2068,`unit_flags`=32768,`AIName`='SmartAI' WHERE `entry`=@NPC_PLAGEBRINGER; +UPDATE `creature_template` SET `faction_A`=2068,`faction_H`=2068,`unit_flags`=32768 WHERE `entry`=@NPC_HALOF; + +DELETE FROM `creature_template_addon` WHERE `entry` IN (@NPC_BLESSED_BANNER,@NPC_CRUSADER_DALFORS,@NPC_BATTLE_PRIEST,@NPC_MASON); +INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(@NPC_BLESSED_BANNER, 0, 0x0, 0x1, '58026'), -- Blessing of the Crusade +(@NPC_CRUSADER_DALFORS,2786,0x0,0x1,'58110'), -- Threat Pulse +(@NPC_BATTLE_PRIEST,0,0x0,0x1,'58110'), -- Threat Pulse +(@NPC_MASON,0,0x0,0x1,''); + +DELETE FROM `creature_equip_template` WHERE `entry` IN (@NPC_CRUSADER_DALFORS,@NPC_BATTLE_PRIEST,@NPC_MASON); +INSERT INTO `creature_equip_template` (`entry`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(@NPC_CRUSADER_DALFORS,39290,40596,0), +(@NPC_BATTLE_PRIEST,42544,42543,0), +(@NPC_MASON,1906,2081,0); + +DELETE FROM `creature_text` WHERE `entry` IN (@NPC_BLESSED_BANNER,@NPC_CRUSADER_DALFORS,@NPC_LK); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@NPC_BLESSED_BANNER,0,0,'The Blessed Banner of the Crusade has been planted.\n Defend the banner from all attackers!',41,0,100,0,0,0,'Blessed Banner of the Crusade'), +(@NPC_CRUSADER_DALFORS,0,0,'BY THE LIGHT! Those damned monsters! Look at what they''ve done to our people!',12,0,100,5,0,0,'Crusader Lord Dalfors'), +(@NPC_CRUSADER_DALFORS,1,0,'Burn it down, boys. Burn it all down.',12,0,100,1,0,0,'Crusader Lord Dalfors'), +(@NPC_CRUSADER_DALFORS,2,0,'Let ''em come. They''ll pay for what they''ve done!',12,0,100,1,0,0,'Crusader Lord Dalfors'), +(@NPC_CRUSADER_DALFORS,3,0,'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!',14,0,100,71,0,0,'Crusader Lord Dalfors'), +(@NPC_LK,0,0,'Leave no survivors!',14,0,100,0,0,14793,'The Lich King'), +(@NPC_LK,1,0,'Cower before my terrible creations!',14,0,100,0,0,14800,'The Lich King'), +(@NPC_LK,2,0,'Feast my children! Feast upon the flesh of the living!',14,0,100,0,0,14801,'The Lich King'), +(@NPC_LK,3,0,'Lay down your arms and surrender your souls!',14,0,100,0,0,14802,'The Lich King'); + +DELETE FROM `event_scripts` WHERE `id`=@EVENT_SCRIPT; +INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `x`, `y`, `z`, `o`) VALUES +(@EVENT_SCRIPT,0,10,@NPC_BLESSED_BANNER,600000,6418.422,422.9706,511.1964,5.8119); + +SET @CGUID := 85714; -- need 18 (85714<->85731) +DELETE FROM `creature` WHERE `id` IN (@NPC_TORCH_DUMMY,@NPC_LK); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(@CGUID+0,@NPC_TORCH_DUMMY,571,1,128,6405.316,431.9516,518.2324,0.296706,120,0,0), +(@CGUID+1,@NPC_TORCH_DUMMY,571,1,128,6408.057,424.2077,511.3653,1.256637,120,0,0), +(@CGUID+2,@NPC_TORCH_DUMMY,571,1,128,6371.181,452.4539,513.5053,1.204277,120,0,0), +(@CGUID+3,@NPC_TORCH_DUMMY,571,1,128,6391.331,460.3002,511.3657,1.745329,120,0,0), +(@CGUID+4,@NPC_TORCH_DUMMY,571,1,128,6393.723,427.9692,538.7354,1.692969,120,0,0), +(@CGUID+5,@NPC_TORCH_DUMMY,571,1,128,6374.808,445.4873,517.7629,4.031711,120,0,0), +(@CGUID+6,@NPC_TORCH_DUMMY,571,1,128,6382.271,451.9008,537.9304,1.32645,120,0,0), +(@CGUID+7,@NPC_TORCH_DUMMY,571,1,128,6366.836,459.1225,530.3361,0.7330383,120,0,0), +(@CGUID+8,@NPC_TORCH_DUMMY,571,1,128,6372.479,447.4598,511.3725,0.2443461,120,0,0), +(@CGUID+9,@NPC_TORCH_DUMMY,571,1,128,6394.698,427.4731,523.7177,1.850049,120,0,0), +(@CGUID+10,@NPC_TORCH_DUMMY,571,1,128,6367.246,459.7583,518.8009,3.857178,120,0,0), +(@CGUID+11,@NPC_TORCH_DUMMY,571,1,128,6396.961,432.8676,533.744,3.176499,120,0,0), +(@CGUID+12,@NPC_TORCH_DUMMY,571,1,128,6403.202,464.2955,535.6572,3.857178,120,0,0), +(@CGUID+13,@NPC_TORCH_DUMMY,571,1,128,6401.721,464.4387,543.1727,2.199115,120,0,0), +(@CGUID+14,@NPC_TORCH_DUMMY,571,1,128,6392.169,475.7449,512.7209,0.6283185,120,0,0), +(@CGUID+15,@NPC_TORCH_DUMMY,571,1,128,6397.238,475.2313,529.652,4.328416,120,0,0), +(@CGUID+16,@NPC_TORCH_DUMMY,571,1,128,6389.221,474.0008,511.365,1.553343,120,0,0), +(@CGUID+17,@NPC_LK,571,1,128,6389.73,451.2743,513.3198,1.32645,120,0,0); + +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@NPC_TORCH_DUMMY,@NPC_MASON); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC_TORCH_DUMMY,0,0,0,8,0,100,0,@SPELL_TORCH,0,0,0,11,@SPELL_TORCH_EFFECT,0,0,0,0,0,1,0,0,0,0,0,0,0,'On spellhit - Cast Torch Visual'), +(@NPC_MASON,0,0,0,38,0,100,0,1,1,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'On data - Set phase 1'), +(@NPC_MASON,0,1,0,60,1,100,0,0,10000,10000,20000,11,@SPELL_TORCH,0,0,0,0,0,1,0,0,0,0,0,0,0,'On update - Cast spell Torch'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SPELL_TORCH) OR (`SourceTypeOrReferenceId`=17 AND `SourceEntry`=@SPELL_ITEM_BANNER); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,@SPELL_TORCH,0,0,31,0,3,@NPC_TORCH_DUMMY,0,0,0,'','Spell Torch targets Torch Dummy'), +(17,0,@SPELL_ITEM_BANNER,0,0,29,0,@NPC_BLESSED_BANNER,10,0,1,0,'','Cast Plant Blessed Banner if no banner is already spawned.'); + +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@NPC_CRUSADER_DALFORS,@NPC_BATTLE_PRIEST,@NPC_CAPTAIN,@NPC_DRUDGE,@NPC_PLAGEBRINGER); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- Crusader Lord Dalfors +(@NPC_CRUSADER_DALFORS,0,0,0,2,0,100,1,0,50,0,0,11,58053,0,0,0,0,0,1,0,0,0,0,0,0,0,'Cast Holy Light at 50% HP'), +(@NPC_CRUSADER_DALFORS,0,1,0,0,0,100,0,5000,8000,23000,29000,11,37554,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Shield'), +-- Argent Battle-priest +(@NPC_BATTLE_PRIEST,0,0,0,1,0,100,0,500,1000,600000,600000,11,58054,0,0,0,0,0,1,0,0,0,0,0,0,0,'Cast Blessing of Kings on Spawn'), +(@NPC_BATTLE_PRIEST,0,1,0,2,0,100,1,0,50,0,0,11,58053,0,0,0,0,0,1,0,0,0,0,0,0,0,'Cast Holy Light at 50% HP'), +(@NPC_BATTLE_PRIEST,0,2,0,14,0,100,0,50000,10,20000,30000,11,58053,0,0,0,0,0,7,0,0,0,0,0,0,0,'Cast Holy Light on Friendlies'), +-- Reanimated Captain +(@NPC_CAPTAIN,0,0,0,4,0,100,1,0,0,0,0,11,32674,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Avenger''s Shield on Aggro'), +(@NPC_CAPTAIN,0,1,0,0,0,100,0,5000,5000,17800,19800,11,58154,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Hammer of Injustice'), +(@NPC_CAPTAIN,0,2,0,2,0,100,1,0,45,0,0,11,58153,0,0,0,0,0,1,0,0,0,0,0,0,0,'Cast Unholy Light at 45% HP'), +(@NPC_CAPTAIN,0,3,0,14,0,100,0,4000,10,20000,30000,11,58153,0,0,0,0,0,7,0,0,0,0,0,0,0,'Cast Unholy Light on Friendlies'), +-- Scourge Drudge +(@NPC_DRUDGE,0,0,0,0,0,100,0,5000,5000,11300,14500,11,51917,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Cleave'), +(@NPC_DRUDGE,0,1,0,0,0,100,0,7000,9000,17800,20200,11,49678,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Flesh Rot'), +-- Hideous Plaguebringer +(@NPC_PLAGEBRINGER,0,0,0,0,0,100,0,3400,4600,11400,16500,11,38761,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcing Smash');
\ No newline at end of file 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(); } |
