aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_script_texts.sql15
-rw-r--r--sql/FULL/world_script_waypoints.sql42
-rw-r--r--sql/FULL/world_scripts_full.sql5
-rw-r--r--sql/updates/6406_world_scripts.sql63
-rw-r--r--src/bindings/scripts/scripts/eastern_kingdoms/stormwind_city.cpp400
5 files changed, 523 insertions, 2 deletions
diff --git a/sql/FULL/world_script_texts.sql b/sql/FULL/world_script_texts.sql
index 481525fe0b4..619703b20fc 100644
--- a/sql/FULL/world_script_texts.sql
+++ b/sql/FULL/world_script_texts.sql
@@ -398,6 +398,21 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`
(17077,-1000496,'%s lifts its head into the air, as if listening for something.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,2,0,0,'ancestral wolf EMOTE_WOLF_LIFT_HEAD'),
(17077,-1000497,'%s lets out a howl that rings across the mountains to the north and motions for you to follow.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,2,0,0,'ancestral wolf EMOTE_WOLF_HOWL'),
(17077,-1000498,'Welcome, kind spirit. What has brought you to us?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'ancestral wolf SAY_WOLF_WELCOME'),
+ (8856,-1000499,'By your command!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (7766,-1000450,'Wait here. Spybot will make Lescovar come out as soon as possible. Be ready! Attack only after you''ve overheard their conversation.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (8856,-1000451,'Good day to you both. I would speak to Lord Lescovar.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1756,-1000452,'Of course. He awaits you in the library.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (8856,-1000453,'Thank you. The Light be with you both.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (8856,-1000454,'Milord, your guest has arrived. He awaits your presence.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1754,-1000455,'Ah, thank you kindly. I will leave you to the library while I tend to this small matter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (8856,-1000456,'I shall use the time wisely, milord. Thank you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1754,-1000457,'It''s time for my meditation, leave me.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1756,-1000458,'Yes, sir!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1754,-1000459,'There you are. What news from Westfall?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1755,-1000460,'VanCleef sends word that the plans are underway. But he''s hear rumors about someone snooping about.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1754,-1000461,'Hmm, it could be that meddle Shaw. I will see what I can discover. Be off with you. I''ll contact you again soon.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (7766,-1000462,'That''s it! That''s what you were waiting for! KILL THEM!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,''),
+ (1755,-1000463,'The Defias shall succeed! No meek adventurer will stop us!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
-- -1 033 000 SHADOWFANG KEEP
(0,-1033000,'Follow me and I''ll open the courtyard door for you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,7,1,'prisoner ashcrombe SAY_FREE_AS'),
diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql
index b439723dd0c..525edb47840 100644
--- a/sql/FULL/world_script_waypoints.sql
+++ b/sql/FULL/world_script_waypoints.sql
@@ -1729,4 +1729,44 @@ INSERT INTO `script_waypoint` VALUES
(25208, 39, 4254.04, 6205.58, -0.186623, 0, ''),
(25208, 40, 4262.6, 6194.47, -0.145114, 0, ''),
(25208, 41, 4268.96, 6189.47, 0.0303093, 21000, '');
- \ No newline at end of file
+
+DELETE FROM `script_waypoint` WHERE `entry` = 1754;
+INSERT INTO `script_waypoint` VALUES
+ (1754, 1, -8334.89, 394.130, 122.274, 0, ''),
+ (1754, 2, -8335.58, 393.519, 122.275, 0, ''),
+ (1754, 3, -8352.99, 379.932, 122.275, 0, ''),
+ (1754, 4, -8356.65, 385.247, 122.275, 0, ''),
+ (1754, 5, -8364.29, 395.317, 122.275, 0, ''),
+ (1754, 6, -8361.75, 402.852, 122.275, 0, ''),
+ (1754, 7, -8359.94, 410.92, 122.275, 0, ''),
+ (1754, 8, -8362.84, 415.409, 122.275, 0, ''),
+ (1754, 9, -8370.42, 424.6, 122.275, 0, ''),
+ (1754, 10, -8380.45, 437.115, 122.275, 0, ''),
+ (1754, 11, -8386.37, 444.906, 122.275, 0, ''),
+ (1754, 12, -8388.5, 447.314, 123.275, 0, ''),
+ (1754, 13, -8390.25, 449.247, 124.275, 0, ''),
+ (1754, 14, -8392.84, 452.397, 123.761, 0, ''),
+ (1754, 15, -8397.52, 457.326, 123.761, 0, ''),
+ (1754, 16, -8402.42, 461.646, 123.761, 0, ''),
+ (1754, 17, -8409.52, 462.677, 123.761, 0, '');
+
+DELETE FROM `script_waypoint` WHERE `entry` = 8856;
+INSERT INTO `script_waypoint` VALUES
+ (8856, 1, -8409.34, 453.345, 123.761, 0, ''),
+ (8856, 2, -8409.52, 462.677, 123.761, 0, ''),
+ (8856, 3, -8402.42, 461.646, 123.761, 0, ''),
+ (8856, 4, -8397.52, 457.326, 123.761, 0, ''),
+ (8856, 5, -8392.84, 452.397, 123.761, 0, ''),
+ (8856, 6, -8390.25, 449.247, 124.275, 0, ''),
+ (8856, 7, -8388.5, 447.314, 123.275, 0, ''),
+ (8856, 8, -8386.37, 444.906, 122.275, 0, ''),
+ (8856, 9, -8380.45, 437.115, 122.275, 0, ''),
+ (8856, 10, -8370.42, 424.6, 122.275, 0, ''),
+ (8856, 11, -8362.84, 415.409, 122.275, 0, ''),
+ (8856, 12, -8359.94, 410.92, 122.275, 0, ''),
+ (8856, 13, -8361.75, 402.852, 122.275, 0, ''),
+ (8856, 14, -8364.29, 395.317, 122.275, 0, ''),
+ (8856, 15, -8356.65, 385.247, 122.275, 0, ''),
+ (8856, 16, -8352.99, 379.932, 122.275, 0, ''),
+ (8856, 17, -8335.58, 393.519, 122.275, 0, ''),
+ (8856, 18, -8334.89, 394.13, 122.274, 0, '');
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql
index 9892eb021a9..3e7b839d132 100644
--- a/sql/FULL/world_scripts_full.sql
+++ b/sql/FULL/world_scripts_full.sql
@@ -1025,6 +1025,11 @@ UPDATE `creature_template` SET `ScriptName`='npc_archmage_malin' WHERE `entry`=2
UPDATE `creature_template` SET `ScriptName`='npc_bartleby' WHERE `entry`=6090;
UPDATE `creature_template` SET `ScriptName`='npc_dashel_stonefist' WHERE `entry`=4961;
UPDATE `creature_template` SET `ScriptName`='npc_lady_katrana_prestor' WHERE `entry`=1749;
+UPDATE `creature_template` SET `ScriptName`='npc_tyrion' WHERE `entry`=7766;
+UPDATE `creature_template` SET `ScriptName`='npc_tyrion_spybot' WHERE `entry`=8856;
+UPDATE `creature_template` SET `ScriptName`='npc_lord_gregor_lescovar' WHERE `entry`=1754;
+UPDATE `creature_template` SET `ScriptName`='npc_marzon_silent_blade' WHERE `entry`=1755;
+
/* STRANGLETHORN VALE */
UPDATE `creature_template` SET `ScriptName`='mob_yenniku' WHERE `entry`=2530;
diff --git a/sql/updates/6406_world_scripts.sql b/sql/updates/6406_world_scripts.sql
new file mode 100644
index 00000000000..e832c8a368d
--- /dev/null
+++ b/sql/updates/6406_world_scripts.sql
@@ -0,0 +1,63 @@
+UPDATE `creature_template` SET `ScriptName`='npc_tyrion' WHERE `entry`=7766;
+UPDATE `creature_template` SET `ScriptName`='npc_tyrion_spybot' WHERE `entry`=8856;
+UPDATE `creature_template` SET `ScriptName`='npc_lord_gregor_lescovar' WHERE `entry`=1754;
+UPDATE `creature_template` SET `ScriptName`='npc_marzon_silent_blade' WHERE `entry`=1755;
+
+DELETE FROM `script_texts` WHERE `entry` IN (-1000499,-1000450,-1000451,-1000452,-1000453,-1000454,-1000455,-1000456,-1000457,-1000458,-1000459,-1000460,-1000461,-1000462,-1000463);
+INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`,`sound`,`type`,`language`,`emote`,`comment`) VALUES
+ (8856,-1000499,'By your command!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (7766,-1000450,'Wait here. Spybot will make Lescovar come out as soon as possible. Be ready! Attack only after you''ve overheard their conversation.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (8856,-1000451,'Good day to you both. I would speak to Lord Lescovar.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1756,-1000452,'Of course. He awaits you in the library.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (8856,-1000453,'Thank you. The Light be with you both.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (8856,-1000454,'Milord, your guest has arrived. He awaits your presence.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1754,-1000455,'Ah, thank you kindly. I will leave you to the library while I tend to this small matter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (8856,-1000456,'I shall use the time wisely, milord. Thank you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1754,-1000457,'It''s time for my meditation, leave me.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1756,-1000458,'Yes, sir!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1754,-1000459,'There you are. What news from Westfall?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1755,-1000460,'VanCleef sends word that the plans are underway. But he''s hear rumors about someone snooping about.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (1754,-1000461,'Hmm, it could be that meddle Shaw. I will see what I can discover. Be off with you. I''ll contact you again soon.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
+ (7766,-1000462,'That''s it! That''s what you were waiting for! KILL THEM!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,''),
+ (1755,-1000463,'The Defias shall succeed! No meek adventurer will stop us!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'');
+
+DELETE FROM `script_waypoint` WHERE `entry` = 1754;
+INSERT INTO `script_waypoint` VALUES
+ (1754, 1, -8334.89, 394.130, 122.274, 0, ''),
+ (1754, 2, -8335.58, 393.519, 122.275, 0, ''),
+ (1754, 3, -8352.99, 379.932, 122.275, 0, ''),
+ (1754, 4, -8356.65, 385.247, 122.275, 0, ''),
+ (1754, 5, -8364.29, 395.317, 122.275, 0, ''),
+ (1754, 6, -8361.75, 402.852, 122.275, 0, ''),
+ (1754, 7, -8359.94, 410.92, 122.275, 0, ''),
+ (1754, 8, -8362.84, 415.409, 122.275, 0, ''),
+ (1754, 9, -8370.42, 424.6, 122.275, 0, ''),
+ (1754, 10, -8380.45, 437.115, 122.275, 0, ''),
+ (1754, 11, -8386.37, 444.906, 122.275, 0, ''),
+ (1754, 12, -8388.5, 447.314, 123.275, 0, ''),
+ (1754, 13, -8390.25, 449.247, 124.275, 0, ''),
+ (1754, 14, -8392.84, 452.397, 123.761, 0, ''),
+ (1754, 15, -8397.52, 457.326, 123.761, 0, ''),
+ (1754, 16, -8402.42, 461.646, 123.761, 0, ''),
+ (1754, 17, -8409.52, 462.677, 123.761, 0, '');
+
+DELETE FROM `script_waypoint` WHERE `entry` = 8856;
+INSERT INTO `script_waypoint` VALUES
+ (8856, 1, -8409.34, 453.345, 123.761, 0, ''),
+ (8856, 2, -8409.52, 462.677, 123.761, 0, ''),
+ (8856, 3, -8402.42, 461.646, 123.761, 0, ''),
+ (8856, 4, -8397.52, 457.326, 123.761, 0, ''),
+ (8856, 5, -8392.84, 452.397, 123.761, 0, ''),
+ (8856, 6, -8390.25, 449.247, 124.275, 0, ''),
+ (8856, 7, -8388.5, 447.314, 123.275, 0, ''),
+ (8856, 8, -8386.37, 444.906, 122.275, 0, ''),
+ (8856, 9, -8380.45, 437.115, 122.275, 0, ''),
+ (8856, 10, -8370.42, 424.6, 122.275, 0, ''),
+ (8856, 11, -8362.84, 415.409, 122.275, 0, ''),
+ (8856, 12, -8359.94, 410.92, 122.275, 0, ''),
+ (8856, 13, -8361.75, 402.852, 122.275, 0, ''),
+ (8856, 14, -8364.29, 395.317, 122.275, 0, ''),
+ (8856, 15, -8356.65, 385.247, 122.275, 0, ''),
+ (8856, 16, -8352.99, 379.932, 122.275, 0, ''),
+ (8856, 17, -8335.58, 393.519, 122.275, 0, ''),
+ (8856, 18, -8334.89, 394.13, 122.274, 0, '');
diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/stormwind_city.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stormwind_city.cpp
index 5e495d6e1e6..ccf0b5582ab 100644
--- a/src/bindings/scripts/scripts/eastern_kingdoms/stormwind_city.cpp
+++ b/src/bindings/scripts/scripts/eastern_kingdoms/stormwind_city.cpp
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Stormwind_City
SD%Complete: 100
-SDComment: Quest support: 1640, 1447, 4185, 11223
+SDComment: Quest support: 1640, 1447, 4185, 11223, 434.
SDCategory: Stormwind City
EndScriptData */
@@ -26,9 +26,14 @@ npc_archmage_malin
npc_bartleby
npc_dashel_stonefist
npc_lady_katrana_prestor
+npc_tyrion
+npc_tyrion_spybot
+npc_marzon_silent_blade
+npc_lord_gregor_lescovar
EndContentData */
#include "precompiled.h"
+#include "escort_ai.h"
/*######
## npc_archmage_malin
@@ -236,6 +241,399 @@ bool GossipSelect_npc_lady_katrana_prestor(Player* pPlayer, Creature* pCreature,
return true;
}
+/*######
+## npc_lord_gregor_lescovar
+######*/
+
+enum eLordGregorLescovar
+{
+ SAY_LESCOVAR_2 = -1000457,
+ SAY_GUARD_2 = -1000458,
+ SAY_LESCOVAR_3 = -1000459,
+ SAY_MARZON_1 = -1000460,
+ SAY_LESCOVAR_4 = -1000461,
+ SAY_TYRION_2 = -1000462,
+ SAY_MARZON_2 = -1000463,
+
+ NPC_STORMWIND_ROYAL = 1756,
+ NPC_MARZON_BLADE = 1755,
+ NPC_TYRION = 7766,
+
+ QUEST_THE_ATTACK = 434
+};
+
+struct TRINITY_DLL_DECL npc_lord_gregor_lescovarAI : public npc_escortAI
+{
+ npc_lord_gregor_lescovarAI(Creature* pCreature) : npc_escortAI(pCreature)
+ {
+ pMarzon = NULL;
+ pTyrion = NULL;
+ pCreature->RestoreFaction();
+ }
+
+ uint32 uiTimer;
+ uint32 uiPhase;
+
+ Creature* pMarzon;
+ Creature* pTyrion;
+
+ void Reset()
+ {
+ uiTimer = 0;
+ uiPhase = 0;
+ }
+
+ void EnterEvadeMode()
+ {
+ m_creature->DisappearAndDie();
+
+ if (pMarzon && pMarzon->isAlive())
+ pMarzon->DisappearAndDie();
+ }
+
+ void EnterCombat(Unit* pWho)
+ {
+ if (pMarzon && pMarzon->isAlive() && !pMarzon->isInCombat())
+ pMarzon->AI()->AttackStart(pWho);
+ }
+
+ void WaypointReached(uint32 uiPointId)
+ {
+ switch(uiPointId)
+ {
+ case 14:
+ SetEscortPaused(true);
+ DoScriptText(SAY_LESCOVAR_2, m_creature);
+ uiTimer = 3000;
+ uiPhase = 1;
+ break;
+ case 16:
+ SetEscortPaused(true);
+ if (pMarzon = m_creature->SummonCreature(NPC_MARZON_BLADE,-8411.360352, 480.069733, 123.760895, 4.941504, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000))
+ pMarzon->GetMotionMaster()->MovePoint(0,-8408.000977, 468.611450, 123.759903);
+ uiTimer = 2000;
+ uiPhase = 4;
+ break;
+ }
+ }
+ //TO-DO: We don't have movemaps, also we can't make 2 npcs walks to one point propperly (and we can not use escort ai, because they are 2 different spawns and with same entry), because of it we make them, disappear.
+ void DoGuardsDisappearAndDie()
+ {
+ std::list<Creature*> GuardList;
+ m_creature->GetCreatureListWithEntryInGrid(GuardList,NPC_STORMWIND_ROYAL,8.0f);
+ if (!GuardList.empty())
+ {
+ for (std::list<Creature*>::iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
+ {
+ if (Creature* pGuard = *itr)
+ pGuard->DisappearAndDie();
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ if (uiPhase)
+ {
+ if (uiTimer <= uiDiff)
+ {
+ switch(uiPhase)
+ {
+ case 1:
+ if (Creature* pGuard = m_creature->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true))
+ DoScriptText(SAY_GUARD_2, pGuard);
+ uiTimer = 3000;
+ uiPhase = 2;
+ break;
+ case 2:
+ DoGuardsDisappearAndDie();
+ uiTimer = 2000;
+ uiPhase = 3;
+ break;
+ case 3:
+ SetEscortPaused(false);
+ uiTimer = 0;
+ uiPhase = 0;
+ break;
+ case 4:
+ DoScriptText(SAY_LESCOVAR_3, m_creature);
+ uiTimer = 0;
+ uiPhase = 0;
+ break;
+ case 5:
+ if (pMarzon)
+ DoScriptText(SAY_MARZON_1, pMarzon);
+ uiTimer = 3000;
+ uiPhase = 6;
+ break;
+ case 6:
+ DoScriptText(SAY_LESCOVAR_4, m_creature);
+ if (Player* pPlayer = GetPlayerForEscort())
+ pPlayer->AreaExploredOrEventHappens(QUEST_THE_ATTACK);
+ uiTimer = 2000;
+ uiPhase = 7;
+ break;
+ case 7:
+ if (Creature* pTyrion = m_creature->FindNearestCreature(NPC_TYRION, 20.0f, true))
+ DoScriptText(SAY_TYRION_2, pTyrion);
+ if (pMarzon)
+ pMarzon->setFaction(14);
+ m_creature->setFaction(14);
+ uiTimer = 0;
+ uiPhase = 0;
+ break;
+ }
+ } else uiTimer -= uiDiff;
+ }
+ npc_escortAI::UpdateAI(uiDiff);
+
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_lord_gregor_lescovar(Creature* pCreature)
+{
+ return new npc_lord_gregor_lescovarAI(pCreature);
+}
+
+/*######
+## npc_marzon_silent_blade
+######*/
+
+struct TRINITY_DLL_DECL npc_marzon_silent_bladeAI : public ScriptedAI
+{
+ npc_marzon_silent_bladeAI(Creature* pCreature) : ScriptedAI(pCreature)
+ {
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ }
+
+ void Reset()
+ {
+ m_creature->RestoreFaction();
+ }
+
+ void EnterCombat(Unit* pWho)
+ {
+ DoScriptText(SAY_MARZON_2, m_creature);
+ if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ {
+ if (pSummoner && pSummoner->isAlive() && !pSummoner->isInCombat())
+ CAST_CRE(pSummoner)->AI()->AttackStart(pWho);
+ }
+ }
+
+ void EnterEvadeMode()
+ {
+ m_creature->DisappearAndDie();
+
+ if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ {
+ if (pSummoner && pSummoner->isAlive())
+ CAST_CRE(pSummoner)->DisappearAndDie();
+ }
+ }
+
+ void MovementInform(uint32 uiType, uint32 uiId)
+ {
+ if (uiType != POINT_MOTION_TYPE)
+ return;
+
+ if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
+ {
+ CAST_AI(npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiTimer = 2000;
+ CAST_AI(npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiPhase = 5;
+ m_creature->ChangeOrient(0.0f, pSummoner);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_marzon_silent_blade(Creature* pCreature)
+{
+ return new npc_marzon_silent_bladeAI(pCreature);
+}
+
+/*######
+## npc_tyrion_spybot
+######*/
+
+enum eTyrionSpybot
+{
+ SAY_QUEST_ACCEPT_ATTACK = -1000499,
+ SAY_TYRION_1 = -1000450,
+ SAY_SPYBOT_1 = -1000451,
+ SAY_GUARD_1 = -1000452,
+ SAY_SPYBOT_2 = -1000453,
+ SAY_SPYBOT_3 = -1000454,
+ SAY_LESCOVAR_1 = -1000455,
+ SAY_SPYBOT_4 = -1000456,
+
+ NPC_PRIESTESS_TYRIONA = 7779,
+ NPC_LORD_GREGOR_LESCOVAR = 1754,
+};
+
+struct TRINITY_DLL_DECL npc_tyrion_spybotAI : public npc_escortAI
+{
+ npc_tyrion_spybotAI(Creature* pCreature) : npc_escortAI(pCreature) {}
+
+ uint32 uiTimer;
+ uint32 uiPhase;
+ Creature* pTyrion;
+ Creature* pLescovar;
+
+ void Reset()
+ {
+ pLescovar = NULL;
+ pTyrion = NULL;
+ uiTimer = 0;
+ uiPhase = 0;
+ }
+
+ void WaypointReached(uint32 uiPointId)
+ {
+ switch(uiPointId)
+ {
+ case 1:
+ if (pTyrion = m_creature->FindNearestCreature(NPC_TYRION, 10.0f, true))
+ m_creature->ChangeOrient(0.0f, pTyrion);
+ SetEscortPaused(true);
+ uiTimer = 2000;
+ uiPhase = 1;
+ break;
+ case 5:
+ SetEscortPaused(true);
+ DoScriptText(SAY_SPYBOT_1, m_creature);
+ uiTimer = 2000;
+ uiPhase = 5;
+ break;
+ case 17:
+ SetEscortPaused(true);
+ if (pLescovar = m_creature->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 20.0f, true))
+ pLescovar->ChangeOrient(0.0f, m_creature);
+ DoScriptText(SAY_SPYBOT_3, m_creature);
+ uiTimer = 3000;
+ uiPhase = 8;
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ if (uiPhase)
+ {
+ if (uiTimer <= uiDiff)
+ {
+ switch(uiPhase)
+ {
+ case 1:
+ DoScriptText(SAY_QUEST_ACCEPT_ATTACK, m_creature);
+ uiTimer = 3000;
+ uiPhase = 2;
+ break;
+ case 2:
+ if (pTyrion)
+ DoScriptText(SAY_TYRION_1, pTyrion);
+ uiTimer = 3000;
+ uiPhase = 3;
+ break;
+ case 3:
+ m_creature->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE);
+ uiTimer = 2000;
+ uiPhase = 4;
+ break;
+ case 4:
+ SetEscortPaused(false);
+ uiPhase = 0;
+ uiTimer = 0;
+ break;
+ case 5:
+ if (Creature* pGuard = m_creature->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true))
+ DoScriptText(SAY_GUARD_1, pGuard);
+ uiTimer = 3000;
+ uiPhase = 6;
+ break;
+ case 6:
+ DoScriptText(SAY_SPYBOT_2, m_creature);
+ uiTimer = 3000;
+ uiPhase = 7;
+ break;
+ case 7:
+ SetEscortPaused(false);
+ uiTimer = 0;
+ uiPhase = 0;
+ break;
+ case 8:
+ if (pLescovar)
+ DoScriptText(SAY_LESCOVAR_1, pLescovar);
+ uiTimer = 3000;
+ uiPhase = 9;
+ break;
+ case 9:
+ DoScriptText(SAY_SPYBOT_4, m_creature);
+ uiTimer = 3000;
+ uiPhase = 10;
+ break;
+ case 10:
+ if (pLescovar && pLescovar->isAlive())
+ {
+ if (Player* pPlayer = GetPlayerForEscort())
+ CAST_AI(npc_lord_gregor_lescovarAI,pLescovar->AI())->Start(false, false, pPlayer->GetGUID());
+ CAST_AI(npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f);
+ }
+ m_creature->DisappearAndDie();
+ uiTimer = 0;
+ uiPhase = 0;
+ break;
+ }
+ } else uiTimer -= uiDiff;
+ }
+ npc_escortAI::UpdateAI(uiDiff);
+
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_tyrion_spybot(Creature* pCreature)
+{
+ return new npc_tyrion_spybotAI(pCreature);
+}
+
+/*######
+## npc_tyrion
+######*/
+
+enum eTyrion
+{
+ NPC_TYRION_SPYBOT = 8856
+};
+
+bool QuestAccept_npc_tyrion(Player* pPlayer, Creature* pCreature, Quest const *pQuest)
+{
+ if (pQuest->GetQuestId() == QUEST_THE_ATTACK)
+ {
+ if (Creature* pSpybot = pCreature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true))
+ {
+ CAST_AI(npc_tyrion_spybotAI,pSpybot->AI())->Start(false, false, pPlayer->GetGUID());
+ CAST_AI(npc_tyrion_spybotAI,pSpybot->AI())->SetMaxPlayerDistance(200.0f);
+ }
+ return true;
+ }
+ return false;
+}
+
void AddSC_stormwind_city()
{
Script *newscript;