1. diff --git a/scripts/outland/netherstorm.cpp b/scripts/outland/netherstorm.cpp
  2. index 3134cae..a8ea3cc 100644
  3. --- a/scripts/outland/netherstorm.cpp
  4. +++ b/scripts/outland/netherstorm.cpp
  5. @@ -17,7 +17,7 @@
  6. /* ScriptData
  7. SDName: Netherstorm
  8. SD%Complete: 80
  9. -SDComment: Quest support: 10191, 10198, 10299, 10321, 10322, 10323, 10329, 10330, 10337, 10338, 10365(Shutting Down Manaforge), 10406, 10425, 10438, 10924.
  10. +SDComment: Quest support: 10191, 10198, 10299, 10310, 10321, 10322, 10323, 10329, 10330, 10337, 10338, 10365(Shutting Down Manaforge), 10406, 10425, 10438, 10924.
  11. SDCategory: Netherstorm
  12. EndScriptData */
  13. @@ -30,6 +30,7 @@ npc_maxx_a_million
  14. npc_zeppit
  15. npc_protectorate_demolitionist
  16. npc_captured_vanguard
  17. +npc_drijya
  18. EndContentData */
  19. #include "precompiled.h"
  20. @@ -1136,6 +1137,235 @@ bool QuestAccept_npc_captured_vanguard(Player* pPlayer, Creature* pCreature, con
  21. return true;
  22. }
  23. +/*######
  24. +## npc_drijya
  25. +######*/
  26. +
  27. +enum
  28. +{
  29. + SAY_DRIJYA_START = -1000963,
  30. + SAY_DRIJYA_1 = -1000964,
  31. + SAY_DRIJYA_2 = -1000965,
  32. + SAY_DRIJYA_3 = -1000966,
  33. + SAY_DRIJYA_4 = -1000967,
  34. + SAY_DRIJYA_5 = -1000968,
  35. + SAY_DRIJYA_6 = -1000969,
  36. + SAY_DRIJYA_7 = -1000970,
  37. + SAY_DRIJYA_COMPLETE = -1000971,
  38. +
  39. + NPC_EXPLODE_TRIGGER = 20296,
  40. + NPC_TERROR_IMP = 20399,
  41. + NPC_LEGION_TROOPER = 20402,
  42. + NPC_LEGION_DESTROYER = 20403,
  43. +
  44. + GO_SMOKE = 185318,
  45. + GO_FIRE = 185317,
  46. + GO_BIG_FIRE = 185319,
  47. +
  48. + QUEST_ID_WARP_GATE = 10310,
  49. +
  50. + MAX_TROOPERS = 9,
  51. + MAX_IMPS = 6,
  52. +};
  53. +
  54. +struct MANGOS_DLL_DECL npc_drijyaAI : public npc_escortAI
  55. +{
  56. + npc_drijyaAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); }
  57. +
  58. + uint8 m_uiSpawnCount;
  59. + uint32 m_uiSpawnImpTimer;
  60. + uint32 m_uiSpawnTrooperTimer;
  61. + uint32 m_uiSpawnDestroyerTimer;
  62. + uint32 m_uiDestroyingTimer;
  63. +
  64. + ObjectGuid m_explodeTriggerGuid;
  65. +
  66. + void Reset() override
  67. + {
  68. + if (!HasEscortState(STATE_ESCORT_ESCORTING))
  69. + {
  70. + m_uiSpawnCount = 0;
  71. + m_uiSpawnImpTimer = 0;
  72. + m_uiSpawnTrooperTimer = 0;
  73. + m_uiSpawnDestroyerTimer = 0;
  74. + m_uiDestroyingTimer = 0;
  75. + }
  76. + }
  77. +
  78. + void Aggro(Unit* pWho) override
  79. + {
  80. + if ((pWho->GetEntry() == NPC_TERROR_IMP || pWho->GetEntry() == NPC_LEGION_TROOPER) && urand(0, 1))
  81. + DoScriptText(SAY_DRIJYA_3, m_creature);
  82. + }
  83. +
  84. + void DoSpawnCreature(uint32 uiEntry)
  85. + {
  86. + if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_explodeTriggerGuid))
  87. + m_creature->SummonCreature(uiEntry, pTrigger->GetPositionX(), pTrigger->GetPositionY(), pTrigger->GetPositionZ(), pTrigger->GetOrientation(), TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 10000);
  88. + }
  89. +
  90. + void JustSummoned(Creature* pSummoned) override
  91. + {
  92. + switch (pSummoned->GetEntry())
  93. + {
  94. + case NPC_TERROR_IMP:
  95. + case NPC_LEGION_TROOPER:
  96. + case NPC_LEGION_DESTROYER:
  97. + pSummoned->AI()->AttackStart(m_creature);
  98. + break;
  99. + }
  100. + }
  101. +
  102. + void WaypointReached(uint32 uiPointId) override
  103. + {
  104. + switch (uiPointId)
  105. + {
  106. + case 0:
  107. + DoScriptText(SAY_DRIJYA_START, m_creature);
  108. + SetRun();
  109. + break;
  110. + case 1:
  111. + DoScriptText(SAY_DRIJYA_1, m_creature);
  112. + break;
  113. + case 5:
  114. + DoScriptText(SAY_DRIJYA_2, m_creature);
  115. + break;
  116. + case 7:
  117. + SetEscortPaused(true);
  118. + m_uiDestroyingTimer = 60000;
  119. + m_uiSpawnImpTimer = 15000;
  120. + m_uiSpawnCount = 0;
  121. + m_creature->HandleEmoteCommand(EMOTE_STATE_WORK);
  122. + if (Creature* pTrigger = GetClosestCreatureWithEntry(m_creature, NPC_EXPLODE_TRIGGER, 30.0f))
  123. + m_explodeTriggerGuid = pTrigger->GetObjectGuid();
  124. + break;
  125. + case 8:
  126. + // ToDo: respawn the fire and smoke
  127. + DoScriptText(SAY_DRIJYA_4, m_creature);
  128. + break;
  129. + case 12:
  130. + SetEscortPaused(true);
  131. + m_uiDestroyingTimer = 60000;
  132. + m_uiSpawnTrooperTimer = 15000;
  133. + m_uiSpawnCount = 0;
  134. + m_creature->HandleEmoteCommand(EMOTE_STATE_WORK);
  135. + break;
  136. + case 13:
  137. + // ToDo: respawn the fire and smoke
  138. + DoScriptText(SAY_DRIJYA_5, m_creature);
  139. + break;
  140. + case 17:
  141. + SetEscortPaused(true);
  142. + m_uiDestroyingTimer = 60000;
  143. + m_uiSpawnDestroyerTimer = 15000;
  144. + m_creature->HandleEmoteCommand(EMOTE_STATE_WORK);
  145. + break;
  146. + case 18:
  147. + // ToDo: respawn the fire and smoke and cast the explode visual spell
  148. + DoScriptText(SAY_DRIJYA_6, m_creature);
  149. + break;
  150. + case 19:
  151. + DoScriptText(SAY_DRIJYA_7, m_creature);
  152. + break;
  153. + case 22:
  154. + SetRun(false);
  155. + break;
  156. + case 26:
  157. + if (Player* pPlayer = GetPlayerForEscort())
  158. + {
  159. + DoScriptText(SAY_DRIJYA_COMPLETE, m_creature, pPlayer);
  160. + pPlayer->GroupEventHappens(QUEST_ID_WARP_GATE, m_creature);
  161. + }
  162. + break;
  163. + }
  164. + }
  165. +
  166. + void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override
  167. + {
  168. + if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER)
  169. + {
  170. + m_creature->SetFactionTemporary(FACTION_ESCORT_N_NEUTRAL_PASSIVE, TEMPFACTION_RESTORE_RESPAWN);
  171. + Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue), true);
  172. + }
  173. + }
  174. +
  175. + void UpdateEscortAI(const uint32 uiDiff) override
  176. + {
  177. + if (m_uiSpawnImpTimer)
  178. + {
  179. + if (m_uiSpawnImpTimer <= uiDiff)
  180. + {
  181. + DoSpawnCreature(NPC_TERROR_IMP);
  182. + ++m_uiSpawnCount;
  183. +
  184. + if (m_uiSpawnCount == MAX_IMPS)
  185. + m_uiSpawnImpTimer = 0;
  186. + else
  187. + m_uiSpawnImpTimer = 3500;
  188. + }
  189. + else
  190. + m_uiSpawnImpTimer -= uiDiff;
  191. + }
  192. +
  193. + if (m_uiSpawnTrooperTimer)
  194. + {
  195. + if (m_uiSpawnTrooperTimer <= uiDiff)
  196. + {
  197. + DoSpawnCreature(NPC_LEGION_TROOPER);
  198. + ++m_uiSpawnCount;
  199. +
  200. + if (m_uiSpawnCount == MAX_TROOPERS)
  201. + m_uiSpawnTrooperTimer = 0;
  202. + else
  203. + m_uiSpawnTrooperTimer = 3500;
  204. + }
  205. + else
  206. + m_uiSpawnTrooperTimer -= uiDiff;
  207. + }
  208. +
  209. + if (m_uiSpawnDestroyerTimer)
  210. + {
  211. + if (m_uiSpawnDestroyerTimer <= uiDiff)
  212. + {
  213. + DoSpawnCreature(NPC_LEGION_DESTROYER);
  214. + m_uiSpawnDestroyerTimer = 0;
  215. + }
  216. + else
  217. + m_uiSpawnDestroyerTimer -= uiDiff;
  218. + }
  219. +
  220. + if (m_uiDestroyingTimer)
  221. + {
  222. + if (m_uiDestroyingTimer <= uiDiff)
  223. + {
  224. + SetEscortPaused(false);
  225. + m_creature->HandleEmoteCommand(EMOTE_STATE_NONE);
  226. + m_uiDestroyingTimer = 0;
  227. + }
  228. + else
  229. + m_uiDestroyingTimer -= uiDiff;
  230. + }
  231. +
  232. + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
  233. + return;
  234. +
  235. + DoMeleeAttackIfReady();
  236. + }
  237. +};
  238. +
  239. +CreatureAI* GetAI_npc_drijya(Creature* pCreature)
  240. +{
  241. + return new npc_drijyaAI(pCreature);
  242. +}
  243. +
  244. +bool QuestAccept_npc_drijya(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
  245. +{
  246. + if (pQuest->GetQuestId() == QUEST_ID_WARP_GATE)
  247. + pCreature->AI()->SendAIEvent(AI_EVENT_START_ESCORT, pPlayer, pCreature, pQuest->GetQuestId());
  248. +
  249. + return true;
  250. +}
  251. +
  252. void AddSC_netherstorm()
  253. {
  254. Script* pNewScript;
  255. @@ -1187,4 +1417,10 @@ void AddSC_netherstorm()
  256. pNewScript->GetAI = &GetAI_npc_captured_vanguard;
  257. pNewScript->pQuestAcceptNPC = &QuestAccept_npc_captured_vanguard;
  258. pNewScript->RegisterSelf();
  259. +
  260. + pNewScript = new Script;
  261. + pNewScript->Name = "npc_drijya";
  262. + pNewScript->GetAI = &GetAI_npc_drijya;
  263. + pNewScript->pQuestAcceptNPC = &QuestAccept_npc_drijya;
  264. + pNewScript->RegisterSelf();
  265. }
  266. diff --git a/sql/mangos_scriptname_full.sql b/sql/mangos_scriptname_full.sql
  267. index 79c3d0b..4a09be9 100644
  268. --- a/sql/mangos_scriptname_full.sql
  269. +++ b/sql/mangos_scriptname_full.sql
  270. @@ -880,6 +880,7 @@ UPDATE creature_template SET ScriptName='npc_maxx_a_million' WHERE entry=19589;
  271. UPDATE creature_template SET ScriptName='npc_zeppit' WHERE entry=22484;
  272. UPDATE creature_template SET ScriptName='npc_protectorate_demolitionist' WHERE entry=20802;
  273. UPDATE creature_template SET ScriptName='npc_captured_vanguard' WHERE entry=20763;
  274. +UPDATE creature_template SET ScriptName='npc_drijya' WHERE entry=20281;
  275. /* */
  276. /* THE NEXUS */
  277. diff --git a/sql/scriptdev2_script_full.sql b/sql/scriptdev2_script_full.sql
  278. index 07da1a7..98ceaa1 100644
  279. --- a/sql/scriptdev2_script_full.sql
  280. +++ b/sql/scriptdev2_script_full.sql
  281. @@ -1037,7 +1037,17 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
  282. (-1000959,'This part of forest are very danger for us. We must be a careful!',0,0,0,0,'stinky ignatz SAY_STINKY_FIRST_STOP'),
  283. (-1000960,'Kill two monsters, who stay near Bogbean plant and then I gather a bogbean.',0,0,0,0,'stinky ignatz SAY_STINKY_2_MONSTERS'),
  284. (-1000961,'I am gathering a bogbean. It takes some time.',0,0,0,69,'stinky ignatz SAY_STINKY_GATHERING'),
  285. -(-1000962,'Thanks you for help.',0,0,0,0,'stinky ignatz SAY_STINKY_END');
  286. +(-1000962,'Thanks you for help.',0,0,0,0,'stinky ignatz SAY_STINKY_END'),
  287. +
  288. +(-1000963,'Very well. Before we head down there, take a moment to prepare yourself.',0,0,0,0,'drijya SAY_DRIJYA_START'),
  289. +(-1000964,'Let\'s proceed at a brisk pace.',0,0,0,0,'drijya SAY_DRIJYA_1'),
  290. +(-1000965,'We\'ll start at that first energy pylon, straight ahead. Remember, try to keep them off of me.',0,0,0,0,'drijya SAY_DRIJYA_2'),
  291. +(-1000966,'Keep them off me!',0,0,0,0,'drijya SAY_DRIJYA_3'),
  292. +(-1000967,'I\'m done with this pylon. On to the next.',0,0,0,0,'drijya SAY_DRIJYA_4'),
  293. +(-1000968,'Alright, pylon two down. Now for the heat manifold.',0,0,0,0,'drijya SAY_DRIJYA_5'),
  294. +(-1000969,'That should do it. The teleporter should blow any second now !',0,0,0,0,'drijya SAY_DRIJYA_6'),
  295. +(-1000970,'Ok, let\'s get out of here!',0,0,0,0,'drijya SAY_DRIJYA_7'),
  296. +(-1000971,'Thank you, $n! I couldn\'t have done it without you. You\'ll let Gahruj know?',0,0,0,0,'drijya SAY_DRIJYA_COMPLETE');
  297. -- -1 033 000 SHADOWFANG KEEP
  298. INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
  299. @@ -7454,4 +7464,34 @@ INSERT INTO script_waypoint VALUES
  300. (4880, 23, -2904.04, -3601.35, 34.969, 0, ''),
  301. (4880, 24, -2907.6, -3612.73, 34.2434, 10000, 'SAY_STINKY_END');
  302. +DELETE FROM script_waypoint WHERE entry=20281;
  303. +INSERT INTO script_waypoint VALUES
  304. +(20281, 0, 3096.416, 2801.408, 118.149, 10000, ''),
  305. +(20281, 1, 3096.516, 2801.065, 118.128, 0, ''),
  306. +(20281, 2, 3099.995, 2796.665, 118.118, 0, ''),
  307. +(20281, 3, 3098.759, 2786.174, 117.125, 0, ''),
  308. +(20281, 4, 3087.792, 2754.602, 115.441, 0, ''),
  309. +(20281, 5, 3080.718, 2730.793, 115.930, 9000, ''),
  310. +(20281, 6, 3060.235, 2731.306, 115.122, 0, ''),
  311. +(20281, 7, 3050.863, 2727.388, 114.054, 0, ''),
  312. +(20281, 8, 3052.113, 2728.104, 114.032, 8000, ''),
  313. +(20281, 9, 3055.008, 2724.972, 113.687, 0, ''),
  314. +(20281, 10, 3053.777, 2718.427, 113.684, 0, ''),
  315. +(20281, 11, 3028.622, 2693.375, 114.670, 0, ''),
  316. +(20281, 12, 3022.430, 2695.297, 113.406, 0, ''),
  317. +(20281, 13, 3024.591, 2694.684, 114.164, 8000, ''),
  318. +(20281, 14, 3025.463, 2700.755, 113.514, 0, ''),
  319. +(20281, 15, 3011.336, 2716.782, 113.691, 0, ''),
  320. +(20281, 16, 3010.882, 2726.991, 114.239, 0, ''),
  321. +(20281, 17, 3009.178, 2729.083, 114.324, 0, ''),
  322. +(20281, 18, 3011.358, 2727.707, 114.235, 25000, ''),
  323. +(20281, 19, 3012.583, 2728.452, 114.211, 0, ''),
  324. +(20281, 20, 3033.888, 2736.437, 114.369, 0, ''),
  325. +(20281, 21, 3071.492, 2741.502, 116.462, 0, ''),
  326. +(20281, 22, 3087.792, 2754.602, 115.441, 0, ''),
  327. +(20281, 23, 3094.505, 2770.198, 115.744, 0, ''),
  328. +(20281, 24, 3103.510, 2784.362, 116.857, 0, ''),
  329. +(20281, 25, 3099.995, 2796.665, 118.118, 0, ''),
  330. +(20281, 26, 3096.290, 2801.027, 118.096, 0, '');
  331. +
  332. -- EOF
  333. diff --git a/sql/updates/r9999_mangos.sql b/sql/updates/r9999_mangos.sql
  334. new file mode 100644
  335. index 0000000..22290ed
  336. --- /dev/null
  337. +++ b/sql/updates/r9999_mangos.sql
  338. @@ -0,0 +1 @@
  339. +UPDATE creature_template SET ScriptName='npc_drijya' WHERE entry=20281;
  340. diff --git a/sql/updates/r9999_scriptdev2.sql b/sql/updates/r9999_scriptdev2.sql
  341. new file mode 100644
  342. index 0000000..0efdd62
  343. --- /dev/null
  344. +++ b/sql/updates/r9999_scriptdev2.sql
  345. @@ -0,0 +1,41 @@
  346. +DELETE FROM script_texts WHERE entry BETWEEN -1000971 AND -1000963;
  347. +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
  348. +(-1000963,'Very well. Before we head down there, take a moment to prepare yourself.',0,0,0,0,'drijya SAY_DRIJYA_START'),
  349. +(-1000964,'Let\'s proceed at a brisk pace.',0,0,0,0,'drijya SAY_DRIJYA_1'),
  350. +(-1000965,'We\'ll start at that first energy pylon, straight ahead. Remember, try to keep them off of me.',0,0,0,0,'drijya SAY_DRIJYA_2'),
  351. +(-1000966,'Keep them off me!',0,0,0,0,'drijya SAY_DRIJYA_3'),
  352. +(-1000967,'I\'m done with this pylon. On to the next.',0,0,0,0,'drijya SAY_DRIJYA_4'),
  353. +(-1000968,'Alright, pylon two down. Now for the heat manifold.',0,0,0,0,'drijya SAY_DRIJYA_5'),
  354. +(-1000969,'That should do it. The teleporter should blow any second now !',0,0,0,0,'drijya SAY_DRIJYA_6'),
  355. +(-1000970,'Ok, let\'s get out of here!',0,0,0,0,'drijya SAY_DRIJYA_7'),
  356. +(-1000971,'Thank you, $n! I couldn\'t have done it without you. You\'ll let Gahruj know?',0,0,0,0,'drijya SAY_DRIJYA_COMPLETE');
  357. +
  358. +DELETE FROM script_waypoint WHERE entry=20281;
  359. +INSERT INTO script_waypoint VALUES
  360. +(20281, 0, 3096.416, 2801.408, 118.149, 10000, ''),
  361. +(20281, 1, 3096.516, 2801.065, 118.128, 0, ''),
  362. +(20281, 2, 3099.995, 2796.665, 118.118, 0, ''),
  363. +(20281, 3, 3098.759, 2786.174, 117.125, 0, ''),
  364. +(20281, 4, 3087.792, 2754.602, 115.441, 0, ''),
  365. +(20281, 5, 3080.718, 2730.793, 115.930, 9000, ''),
  366. +(20281, 6, 3060.235, 2731.306, 115.122, 0, ''),
  367. +(20281, 7, 3050.863, 2727.388, 114.054, 0, ''),
  368. +(20281, 8, 3052.113, 2728.104, 114.032, 8000, ''),
  369. +(20281, 9, 3055.008, 2724.972, 113.687, 0, ''),
  370. +(20281, 10, 3053.777, 2718.427, 113.684, 0, ''),
  371. +(20281, 11, 3028.622, 2693.375, 114.670, 0, ''),
  372. +(20281, 12, 3022.430, 2695.297, 113.406, 0, ''),
  373. +(20281, 13, 3024.591, 2694.684, 114.164, 8000, ''),
  374. +(20281, 14, 3025.463, 2700.755, 113.514, 0, ''),
  375. +(20281, 15, 3011.336, 2716.782, 113.691, 0, ''),
  376. +(20281, 16, 3010.882, 2726.991, 114.239, 0, ''),
  377. +(20281, 17, 3009.178, 2729.083, 114.324, 0, ''),
  378. +(20281, 18, 3011.358, 2727.707, 114.235, 25000, ''),
  379. +(20281, 19, 3012.583, 2728.452, 114.211, 0, ''),
  380. +(20281, 20, 3033.888, 2736.437, 114.369, 0, ''),
  381. +(20281, 21, 3071.492, 2741.502, 116.462, 0, ''),
  382. +(20281, 22, 3087.792, 2754.602, 115.441, 0, ''),
  383. +(20281, 23, 3094.505, 2770.198, 115.744, 0, ''),
  384. +(20281, 24, 3103.510, 2784.362, 116.857, 0, ''),
  385. +(20281, 25, 3099.995, 2796.665, 118.118, 0, ''),
  386. +(20281, 26, 3096.290, 2801.027, 118.096, 0, '');