Guest User

Untitled

a guest
Jan 5th, 2012
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.40 KB | None | 0 0
  1. diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
  2. --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
  3. +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
  4. @@ -41,12 +41,15 @@
  5. _jainaOrSylvanas1GUID = 0;
  6. _jainaOrSylvanas2GUID = 0;
  7. _teamInInstance = 0;
  8. + _tyrannusEventStart = NOT_STARTED;
  9. }
  10.  
  11. void OnPlayerEnter(Player* player)
  12. {
  13. if (!_teamInInstance)
  14. _teamInInstance = player->GetTeam();
  15. + if(GetData(DATA_TYRANNUS_START) != DONE)
  16. + SetData(DATA_TYRANNUS_START, IN_PROGRESS);
  17. }
  18.  
  19. void OnCreatureCreate(Creature* creature)
  20. @@ -198,6 +201,8 @@
  21. {
  22. case DATA_TEAM_IN_INSTANCE:
  23. return _teamInInstance;
  24. + case DATA_TYRANNUS_START:
  25. + return _tyrannusEventStart;
  26. default:
  27. break;
  28. }
  29. @@ -231,7 +236,12 @@
  30.  
  31. return 0;
  32. }
  33. -
  34. +
  35. + void SetData(uint32 type, uint32 data)
  36. + {
  37. + if(type == DATA_TYRANNUS_START)
  38. + _tyrannusEventStart = data;
  39. + }
  40. std::string GetSaveData()
  41. {
  42. OUT_SAVE_INST_DATA;
  43. @@ -288,6 +298,7 @@
  44. uint64 _jainaOrSylvanas2GUID;
  45.  
  46. uint32 _teamInInstance;
  47. + uint8 _tyrannusEventStart;
  48. };
  49.  
  50. InstanceScript* GetInstanceScript(InstanceMap* map) const
  51.  
  52.  
  53.  
  54.  
  55. diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
  56. --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
  57. +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
  58. @@ -306,6 +306,700 @@
  59. }
  60. };
  61.  
  62. +/*
  63. +Script Complete: 100%
  64. +Name: Start Pit Of Saron
  65. +Author: Cemak
  66. +*/
  67. +enum SAYTyrranusEvent
  68. +{
  69. + SAY_TYRRANUS_1 = -1658074,
  70. + SAY_TYRRANUS_2 = -1658075,
  71. + SAY_TYRRANUS_3 = -1658078,
  72. + SAY_TYRRANUS_4 = -1658082,
  73. +
  74. + SAY_SYLVANAS_1 = -1658076,
  75. + SAY_SYLVANAS_2 = -1658080,
  76. + SAY_SYLVANAS_3 = -1658085,
  77. + SAY_SYLVANAS_4 = -1658087,
  78. +
  79. + SAY_JAINA_1 = -1658077,
  80. + SAY_JAINA_2 = -1658081,
  81. + SAY_JAINA_3 = -1658084,
  82. + SAY_JAINA_4 = -1658086,
  83. +
  84. + SAY_SOUND = 16750,
  85. +};
  86. +
  87. +enum SPELLSTyrranusEvent
  88. +{
  89. + SPELL_NECROMANTIC_POWER = 69347,
  90. + SPELL_DEATH_ARMY_VISUAL = 67693,
  91. + SPELL_BLIZZARD_JAINA = 70132,
  92. + SPELL_ICE_LANCE_JAINA = 70464,
  93. + SPELL_SHADOW_BOLT_SYLVANAS = 70512,
  94. + SPELL_MULTI_SHOT_SYLVANAS = 70513,
  95. +};
  96. +
  97. +struct startPosition
  98. +{
  99. + uint32 entry[2];
  100. + Position movePosition;
  101. +} startPositions[] =
  102. +{
  103. + { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE }, { 445.286f, 214.251f, 528.71f, 0.375996f } },
  104. + { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE }, { 447.246f, 208.189f, 528.71f, 0.0264938f } },
  105. + { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE }, { 437.81f, 231.115f, 528.708f, 0.525224f } },
  106. + { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE }, { 437.444f, 225.798f, 528.712f, 0.36029f } },
  107. + { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE }, { 438.941f, 221.784f, 528.708f, 0.30924f } },
  108. + { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE }, { 440.384f, 216.785f, 528.71f, 0.203211f } },
  109. + { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE }, { 441.479f, 211.472f, 528.709f,0.203211f } },
  110. + { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE }, { 443.986f, 222.103f, 528.709f,6.27373f } },
  111. + { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE }, { 448.944f, 204.945f, 528.709f,0.0258984f } },
  112. + { { NPC_CHAMPION_2_ALLIANCE, NPC_CHAMPION_2_HORDE }, { 446.613f, 211.37f, 528.709f,0.360472f } },
  113. + { { NPC_CHAMPION_2_ALLIANCE, NPC_CHAMPION_2_HORDE }, { 442.647f, 204.635f, 528.707f,0.0887308f } },
  114. + { { NPC_CHAMPION_2_ALLIANCE, NPC_CHAMPION_2_HORDE }, { 435.054f, 207.61f, 528.707f,0.173361f } },
  115. + { { NPC_CHAMPION_2_ALLIANCE, NPC_CHAMPION_2_HORDE }, { 434.568f, 210.389f, 528.707f,0.173361f } },
  116. + { { NPC_CHAMPION_2_ALLIANCE, NPC_CHAMPION_2_HORDE }, { 443.458f, 226.623f, 528.709f,0.232266f } },
  117. + { { NPC_CHAMPION_2_ALLIANCE, NPC_CHAMPION_2_HORDE }, { 435.593f, 204.535f, 528.728f,0.173361f } },
  118. + { { NPC_CHAMPION_2_ALLIANCE, NPC_CHAMPION_3_HORDE }, { 442.47f, 208.153f, 528.706f,0.259756f } },
  119. + { { NPC_CHAMPION_2_ALLIANCE, NPC_CHAMPION_3_HORDE }, { 441.333f, 233.866f, 528.709f,0.255828f } },
  120. + { { NPC_CHAMPION_2_ALLIANCE, NPC_CHAMPION_3_HORDE }, { 442.124f, 230.78f, 528.709f,0.244047f } },
  121. +
  122. + { { NPC_KORLAEN, NPC_KORALEN }, { 432.386f, 212.979f, 528.709f, 0.237168f } },
  123. + { { NPC_ELANDRA, NPC_KILARA }, { 431.65f, 216.976f, 528.709f, 0.20104f } },
  124. + { { NPC_JAINA_PART1, NPC_SYLVANAS_PART1 }, { 438.84f, 213.502f, 528.709f, 0.1900f } },
  125. +
  126. + { { 0, 0 }, { 0.0f, 0.0f, 0.0f, 0.0f } }
  127. +};
  128. +
  129. +class pitofsaron_start : public CreatureScript
  130. +{
  131. +public:
  132. + pitofsaron_start() : CreatureScript("pitofsaron_start") { }
  133. +
  134. + CreatureAI* GetAI(Creature* pCreature) const
  135. + {
  136. + return new pitofsaron_startAI(pCreature);
  137. + }
  138. +
  139. + struct pitofsaron_startAI : public ScriptedAI
  140. + {
  141. + pitofsaron_startAI(Creature *c) : ScriptedAI(c)
  142. + {
  143. + instance = c->GetInstanceScript();
  144. + Reset();
  145. + }
  146. +
  147. + void Reset()
  148. + {
  149. + StartPhase = 0;
  150. + StartTimer = 5000;
  151. + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
  152. + me->SetReactState(REACT_PASSIVE);
  153. + event = true;
  154. + }
  155. +
  156. + void UpdateAI(const uint32 diff)
  157. + {
  158. + if(instance->GetData(DATA_TYRANNUS_START) == IN_PROGRESS && event)
  159. + {
  160. + if (StartTimer <= diff)
  161. + {
  162. + switch (StartPhase)
  163. + {
  164. + case 0:
  165. + if (Creature* sTyrannus = me->FindNearestCreature(NPC_TYRANNUS_EVENTS, 50.0f, true))
  166. + {
  167. + sTyrannus->SetFlying(true);
  168. + DoScriptText(SAY_TYRRANUS_1, sTyrannus);
  169. +
  170. + int32 entryIndex;
  171. + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
  172. + entryIndex = 0;
  173. + else
  174. + entryIndex = 1;
  175. +
  176. + Position spawnPoint = {427.36f, 212.636f, 529.47f, 6.2564f};
  177. +
  178. + for (int8 i = 0; startPositions[i].entry[entryIndex] != 0; ++i)
  179. + {
  180. + if (Creature* summon = me->SummonCreature(startPositions[i].entry[entryIndex], spawnPoint, TEMPSUMMON_DEAD_DESPAWN))
  181. + summon->GetMotionMaster()->MovePoint(0, startPositions[i].movePosition);
  182. + }
  183. + }
  184. + ++StartPhase;
  185. + StartTimer = 5000;
  186. + break;
  187. + case 1:
  188. + if (Creature* sTyrannus = me->FindNearestCreature(NPC_TYRANNUS_EVENTS, 50.0f, true))
  189. + DoScriptText(SAY_TYRRANUS_2, sTyrannus);
  190. + ++StartPhase;
  191. + StartTimer = 15000;
  192. + break;
  193. + case 2:
  194. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  195. + DoScriptText(SAY_SYLVANAS_1, me);
  196. + else if(me->GetEntry() == NPC_JAINA_PART1)
  197. + DoScriptText(SAY_JAINA_1, me);
  198. +
  199. + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
  200. + {
  201. + GetCreatureListWithEntryInGrid(Champion1, me, NPC_CHAMPION_1_ALLIANCE, 150.0f);
  202. + for(std::list<Creature*>::iterator itr = Champion1.begin(); itr != Champion1.end(); ++itr)
  203. + {
  204. + Creature *sChampions = *itr;
  205. + if (!sChampions)
  206. + continue;
  207. +
  208. + if (sChampions->isAlive())
  209. + if (Creature* sNecrolyte = me->FindNearestCreature(367880, 150.0f, true))
  210. + {
  211. + sChampions->Attack(sNecrolyte, true);
  212. + sChampions->GetMotionMaster()->MoveChase(sNecrolyte);
  213. + }
  214. + }
  215. +
  216. + GetCreatureListWithEntryInGrid(Champion2, me, NPC_CHAMPION_2_ALLIANCE, 150.0f);
  217. + for(std::list<Creature*>::iterator itr = Champion2.begin(); itr != Champion2.end(); ++itr)
  218. + {
  219. + Creature *sChampions = *itr;
  220. + if (!sChampions)
  221. + continue;
  222. +
  223. + if (sChampions->isAlive())
  224. + if (Creature* sNecrolyte = me->FindNearestCreature(36788, 150.0f, true))
  225. + {
  226. + sChampions->Attack(sNecrolyte, true);
  227. + sChampions->GetMotionMaster()->MoveChase(sNecrolyte);
  228. + }
  229. + }
  230. + }
  231. + else
  232. + {
  233. + GetCreatureListWithEntryInGrid(Champion1, me, NPC_CHAMPION_1_HORDE, 150.0f);
  234. + for(std::list<Creature*>::iterator itr = Champion1.begin(); itr != Champion1.end(); ++itr)
  235. + {
  236. + Creature *sChampions = *itr;
  237. + if (!sChampions)
  238. + continue;
  239. +
  240. + if (sChampions->isAlive())
  241. + if (Creature* sNecrolyte = me->FindNearestCreature(367880, 150.0f, true))
  242. + {
  243. + sChampions->Attack(sNecrolyte, true);
  244. + sChampions->GetMotionMaster()->MoveChase(sNecrolyte);
  245. + }
  246. + }
  247. +
  248. + GetCreatureListWithEntryInGrid(Champion2, me, NPC_CHAMPION_2_HORDE, 150.0f);
  249. + for(std::list<Creature*>::iterator itr = Champion2.begin(); itr != Champion2.end(); ++itr)
  250. + {
  251. + Creature *sChampions = *itr;
  252. + if (!sChampions)
  253. + continue;
  254. +
  255. + if (sChampions->isAlive())
  256. + if (Creature* sNecrolyte = me->FindNearestCreature(36788, 150.0f, true))
  257. + {
  258. + sChampions->Attack(sNecrolyte, true);
  259. + sChampions->GetMotionMaster()->MoveChase(sNecrolyte);
  260. + }
  261. + }
  262. +
  263. + GetCreatureListWithEntryInGrid(Champion3, me, NPC_CHAMPION_3_HORDE, 150.0f);
  264. + for(std::list<Creature*>::iterator itr = Champion3.begin(); itr != Champion3.end(); ++itr)
  265. + {
  266. + Creature *sChampions = *itr;
  267. + if (!sChampions)
  268. + continue;
  269. +
  270. + if (sChampions->isAlive())
  271. + if (Creature* sNecrolyte = me->FindNearestCreature(36788, 150.0f, true))
  272. + {
  273. + sChampions->Attack(sNecrolyte, true);
  274. + sChampions->GetMotionMaster()->MoveChase(sNecrolyte);
  275. + }
  276. + }
  277. + }
  278. + ++StartPhase;
  279. + StartTimer = 1000;
  280. + break;
  281. + case 3:
  282. + if (Creature* sTyrannus = me->FindNearestCreature(NPC_TYRANNUS_EVENTS, 150.0f, true))
  283. + DoScriptText(SAY_TYRRANUS_3, sTyrannus);
  284. + ++StartPhase;
  285. + StartTimer = 2000;
  286. + break;
  287. + case 4:
  288. + if (Creature* sTyrannus = me->FindNearestCreature(NPC_TYRANNUS_EVENTS, 150.0f, true))
  289. + DoPlaySoundToSet(sTyrannus, SAY_SOUND);
  290. +
  291. + for(std::list<Creature*>::iterator itr = Champion1.begin(); itr != Champion1.end(); ++itr)
  292. + {
  293. + Creature *sChampions = *itr;
  294. + if (!sChampions)
  295. + continue;
  296. +
  297. + if (sChampions->isAlive())
  298. + {
  299. + sChampions->AttackStop();
  300. + sChampions->GetMotionMaster()->MoveFall(476.96f, 0);
  301. + }
  302. + }
  303. +
  304. + for(std::list<Creature*>::iterator itr = Champion2.begin(); itr != Champion2.end(); ++itr)
  305. + {
  306. + Creature *sChampions = *itr;
  307. + if (!sChampions)
  308. + continue;
  309. +
  310. + if (sChampions->isAlive())
  311. + {
  312. + sChampions->AttackStop();
  313. + sChampions->GetMotionMaster()->MoveFall(497.59f, 0);
  314. + }
  315. + }
  316. +
  317. + for(std::list<Creature*>::iterator itr = Champion3.begin(); itr != Champion3.end(); ++itr)
  318. + {
  319. + Creature *sChampions = *itr;
  320. + if (!sChampions)
  321. + continue;
  322. +
  323. + if (sChampions->isAlive())
  324. + {
  325. + sChampions->AttackStop();
  326. + sChampions->GetMotionMaster()->MoveFall(497.59f, 0);
  327. + }
  328. + }
  329. + ++StartPhase;
  330. + StartTimer = 5000;
  331. + break;
  332. + case 5:
  333. + if (Creature* sTyrannus = me->FindNearestCreature(NPC_TYRANNUS_EVENTS, 50.0f, true))
  334. + sTyrannus->CastSpell(sTyrannus, SPELL_NECROMANTIC_POWER, false);
  335. +
  336. + for(std::list<Creature*>::iterator itr = Champion1.begin(); itr != Champion1.end(); ++itr)
  337. + {
  338. + Creature *sChampions = *itr;
  339. + if (!sChampions)
  340. + continue;
  341. +
  342. + if (sChampions->isAlive())
  343. + sChampions->Kill(sChampions, false);
  344. + }
  345. +
  346. + for(std::list<Creature*>::iterator itr = Champion2.begin(); itr != Champion2.end(); ++itr)
  347. + {
  348. + Creature *sChampions = *itr;
  349. + if (!sChampions)
  350. + continue;
  351. +
  352. + if (sChampions->isAlive())
  353. + sChampions->Kill(sChampions, false);
  354. + }
  355. +
  356. + for(std::list<Creature*>::iterator itr = Champion3.begin(); itr != Champion3.end(); ++itr)
  357. + {
  358. + Creature *sChampions = *itr;
  359. + if (!sChampions)
  360. + continue;
  361. +
  362. + if (sChampions->isAlive())
  363. + sChampions->Kill(sChampions, false);
  364. + }
  365. +
  366. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  367. + DoScriptText(SAY_SYLVANAS_2, me);
  368. + else if(me->GetEntry() == NPC_JAINA_PART1)
  369. + DoScriptText(SAY_JAINA_2, me);
  370. + ++StartPhase;
  371. + StartTimer = 5000;
  372. + break;
  373. + case 6:
  374. + for(std::list<Creature*>::iterator itr = Champion1.begin(); itr != Champion1.end(); ++itr)
  375. + {
  376. + Creature *sChampions = *itr;
  377. + if (!sChampions)
  378. + continue;
  379. +
  380. + sChampions->Respawn();
  381. + sChampions->CastSpell(sChampions, SPELL_DEATH_ARMY_VISUAL, true);
  382. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  383. + sChampions->UpdateEntry(36796, ALLIANCE);
  384. + else
  385. + sChampions->UpdateEntry(36796, HORDE);
  386. + sChampions->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
  387. + sChampions->SetReactState(REACT_PASSIVE);
  388. + }
  389. +
  390. + for(std::list<Creature*>::iterator itr = Champion2.begin(); itr != Champion2.end(); ++itr)
  391. + {
  392. + Creature *sChampions = *itr;
  393. + if (!sChampions)
  394. + continue;
  395. +
  396. + sChampions->Respawn();
  397. + sChampions->CastSpell(sChampions, SPELL_DEATH_ARMY_VISUAL, true);
  398. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  399. + sChampions->UpdateEntry(36796, ALLIANCE);
  400. + else
  401. + sChampions->UpdateEntry(36796, HORDE);
  402. + sChampions->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
  403. + sChampions->SetReactState(REACT_PASSIVE);
  404. + }
  405. +
  406. + for(std::list<Creature*>::iterator itr = Champion3.begin(); itr != Champion3.end(); ++itr)
  407. + {
  408. + Creature *sChampions = *itr;
  409. + if (!sChampions)
  410. + continue;
  411. +
  412. + sChampions->Respawn();
  413. + sChampions->CastSpell(sChampions, SPELL_DEATH_ARMY_VISUAL, true);
  414. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  415. + sChampions->UpdateEntry(36796, ALLIANCE);
  416. + else
  417. + sChampions->UpdateEntry(36796, HORDE);
  418. + sChampions->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
  419. + sChampions->SetReactState(REACT_PASSIVE);
  420. + }
  421. +
  422. + if (Creature* sTyrannus = me->FindNearestCreature(NPC_TYRANNUS_EVENTS, 50.0f, true))
  423. + DoScriptText(SAY_TYRRANUS_4, sTyrannus);
  424. +
  425. + for(std::list<Creature*>::iterator itr = Champion1.begin(); itr != Champion1.end(); ++itr)
  426. + {
  427. + Creature *sChampions = *itr;
  428. + if (!sChampions)
  429. + continue;
  430. +
  431. + if (Creature* pHelper = me->FindNearestCreature(NPC_KORALEN, 150.0f, true))
  432. + {
  433. + sChampions->Attack(pHelper, true);
  434. + sChampions->GetMotionMaster()->MoveChase(pHelper);
  435. + }
  436. + else if (Creature* pHelper = me->FindNearestCreature(NPC_KORLAEN, 150.0f, true))
  437. + {
  438. + sChampions->Attack(pHelper, true);
  439. + sChampions->GetMotionMaster()->MoveChase(pHelper);
  440. + }
  441. + }
  442. +
  443. + for(std::list<Creature*>::iterator itr = Champion2.begin(); itr != Champion2.end(); ++itr)
  444. + {
  445. + Creature *sChampions = *itr;
  446. + if (!sChampions)
  447. + continue;
  448. +
  449. + if (Creature* pHelper = me->FindNearestCreature(NPC_KORALEN, 150.0f, true))
  450. + {
  451. + sChampions->Attack(pHelper, true);
  452. + sChampions->GetMotionMaster()->MoveChase(pHelper);
  453. + }
  454. + else if (Creature* pHelper = me->FindNearestCreature(NPC_KORLAEN, 150.0f, true))
  455. + {
  456. + sChampions->Attack(pHelper, true);
  457. + sChampions->GetMotionMaster()->MoveChase(pHelper);
  458. + }
  459. + }
  460. +
  461. + for(std::list<Creature*>::iterator itr = Champion3.begin(); itr != Champion3.end(); ++itr)
  462. + {
  463. + Creature *sChampions = *itr;
  464. + if (!sChampions)
  465. + continue;
  466. +
  467. + if (Creature* pHelper = me->FindNearestCreature(NPC_KORALEN, 150.0f, true))
  468. + {
  469. + sChampions->Attack(pHelper, true);
  470. + sChampions->GetMotionMaster()->MoveChase(pHelper);
  471. + }
  472. + else if (Creature* pHelper = me->FindNearestCreature(NPC_KORLAEN, 150.0f, true))
  473. + {
  474. + sChampions->Attack(pHelper, true);
  475. + sChampions->GetMotionMaster()->MoveChase(pHelper);
  476. + }
  477. + }
  478. + ++StartPhase;
  479. + StartTimer = 3000;
  480. + break;
  481. + case 7:
  482. + for(std::list<Creature*>::iterator itr = Champion1.begin(); itr != Champion1.end(); ++itr)
  483. + {
  484. + Creature *sChampions = *itr;
  485. + if (!sChampions)
  486. + continue;
  487. +
  488. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  489. + me->CastSpell(sChampions, SPELL_MULTI_SHOT_SYLVANAS, true);
  490. + else
  491. + me->CastSpell(sChampions, SPELL_BLIZZARD_JAINA, true);
  492. + }
  493. +
  494. + for(std::list<Creature*>::iterator itr = Champion2.begin(); itr != Champion2.end(); ++itr)
  495. + {
  496. + Creature *sChampions = *itr;
  497. + if (!sChampions)
  498. + continue;
  499. +
  500. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  501. + me->CastSpell(sChampions, SPELL_MULTI_SHOT_SYLVANAS, true);
  502. + else
  503. + me->CastSpell(sChampions, SPELL_BLIZZARD_JAINA, true);
  504. + }
  505. +
  506. + for(std::list<Creature*>::iterator itr = Champion3.begin(); itr != Champion3.end(); ++itr)
  507. + {
  508. + Creature *sChampions = *itr;
  509. + if (!sChampions)
  510. + continue;
  511. +
  512. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  513. + me->CastSpell(sChampions, SPELL_MULTI_SHOT_SYLVANAS, true);
  514. + else
  515. + me->CastSpell(sChampions, SPELL_BLIZZARD_JAINA, true);
  516. + }
  517. + ++StartPhase;
  518. + StartTimer = 500;
  519. + break;
  520. + case 8:
  521. + for(std::list<Creature*>::iterator itr = Champion1.begin(); itr != Champion1.end(); ++itr)
  522. + {
  523. + Creature *sChampions = *itr;
  524. + if (!sChampions)
  525. + continue;
  526. +
  527. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  528. + me->CastSpell(sChampions, SPELL_SHADOW_BOLT_SYLVANAS, true);
  529. + else
  530. + me->CastSpell(sChampions, SPELL_ICE_LANCE_JAINA, true);
  531. + }
  532. +
  533. + for(std::list<Creature*>::iterator itr = Champion2.begin(); itr != Champion2.end(); ++itr)
  534. + {
  535. + Creature *sChampions = *itr;
  536. + if (!sChampions)
  537. + continue;
  538. +
  539. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  540. + me->CastSpell(sChampions, SPELL_SHADOW_BOLT_SYLVANAS, true);
  541. + else
  542. + me->CastSpell(sChampions, SPELL_ICE_LANCE_JAINA, true);
  543. + }
  544. +
  545. + for(std::list<Creature*>::iterator itr = Champion3.begin(); itr != Champion3.end(); ++itr)
  546. + {
  547. + Creature *sChampions = *itr;
  548. + if (!sChampions)
  549. + continue;
  550. +
  551. + if(me->GetEntry() == NPC_SYLVANAS_PART1)
  552. + me->CastSpell(sChampions, SPELL_SHADOW_BOLT_SYLVANAS, true);
  553. + else
  554. + me->CastSpell(sChampions, SPELL_ICE_LANCE_JAINA, true);
  555. + }
  556. + ++StartPhase;
  557. + StartTimer = 500;
  558. + break;
  559. + case 9:
  560. + for(std::list<Creature*>::iterator itr = Champion1.begin(); itr != Champion1.end(); ++itr)
  561. + {
  562. + Creature *sChampions = *itr;
  563. + if (!sChampions)
  564. + continue;
  565. + me->Kill(sChampions, false);
  566. + }
  567. +
  568. + for(std::list<Creature*>::iterator itr = Champion2.begin(); itr != Champion2.end(); ++itr)
  569. + {
  570. + Creature *sChampions = *itr;
  571. + if (!sChampions)
  572. + continue;
  573. +
  574. + me->Kill(sChampions, false);
  575. + }
  576. +
  577. + for(std::list<Creature*>::iterator itr = Champion3.begin(); itr != Champion3.end(); ++itr)
  578. + {
  579. + Creature *sChampions = *itr;
  580. + if (!sChampions)
  581. + continue;
  582. +
  583. + me->Kill(sChampions, false);
  584. + }
  585. + ++StartPhase;
  586. + StartTimer = 3000;
  587. + break;
  588. + case 10:
  589. + if(me->GetEntry() == NPC_JAINA_PART1)
  590. + DoScriptText(SAY_JAINA_3, me);
  591. + else
  592. + DoScriptText(SAY_SYLVANAS_3, me);
  593. + ++StartPhase;
  594. + StartTimer = 10000;
  595. + break;
  596. + case 11:
  597. + if(me->GetEntry() == NPC_JAINA_PART1)
  598. + DoScriptText(SAY_JAINA_4, me);
  599. + else
  600. + DoScriptText(SAY_SYLVANAS_4, me);
  601. + ++StartPhase;
  602. + StartTimer = 10000;
  603. + break;
  604. + case 12:
  605. + if (Creature* sTyrannus = me->FindNearestCreature(NPC_TYRANNUS_EVENTS, 150.0f, true))
  606. + sTyrannus->GetMotionMaster()->MovePoint(0, 938.125f, 93.928f, 585.39f);
  607. + instance->SetData(DATA_TYRANNUS_START, DONE);
  608. + event = false;
  609. + ++StartPhase;
  610. + StartTimer = 10000;
  611. + break;
  612. + return;
  613. + }
  614. + } else StartTimer -= diff;
  615. + }
  616. + }
  617. +
  618. + private:
  619. + InstanceScript* instance;
  620. + std::list<Creature*> Champion1;
  621. + std::list<Creature*> Champion2;
  622. + std::list<Creature*> Champion3;
  623. + uint32 StartTimer;
  624. + uint8 StartPhase;
  625. + bool event;
  626. + };
  627. +};
  628. +
  629. +
  630. +
  631. +/*Порабощенные солдаты*/
  632. +
  633. +class ball_and_chain : public GameObjectScript
  634. +{
  635. +public:
  636. + ball_and_chain() : GameObjectScript("ball_and_chain") { }
  637. +
  638. + bool OnGossipHello(Player* player, GameObject* pGO)
  639. + {
  640. + if (player->getFaction() == HORDE)
  641. + {
  642. + Creature* pHordeSlave = pGO->FindNearestCreature(36770, 1.0f);
  643. + if (pHordeSlave)
  644. + {
  645. + pHordeSlave->MonsterTextEmote("делает жест рукой, как бы поднимая бокал за ваше здоровье", player->GetGUID());
  646. + pHordeSlave->GetMotionMaster()->MovePoint(0, 427.36f, 212.636f, 529.47f);
  647. + pHordeSlave->DisappearAndDie();
  648. + }
  649. + }
  650. + else
  651. + {
  652. + Creature* pAllianceSlave = pGO->FindNearestCreature(36764, 1.0f);
  653. + if (pAllianceSlave)
  654. + {
  655. + pAllianceSlave->MonsterTextEmote("делает жест рукой, как бы поднимая бокал за ваше здоровье", player->GetGUID());
  656. + pAllianceSlave->GetMotionMaster()->MovePoint(0, 427.36f, 212.636f, 529.47f);
  657. + pAllianceSlave->DisappearAndDie();
  658. + }
  659. + }
  660. + return true;
  661. + }
  662. +};
  663. +
  664. +/*Порабощенные солдаты, нападение Горгульи */
  665. +
  666. +class npc_slave_p : public CreatureScript
  667. +{
  668. +public:
  669. + npc_slave_p() : CreatureScript("npc_slave_p") { }
  670. +
  671. + CreatureAI* GetAI(Creature* pCreature) const
  672. + {
  673. + return new npc_slave_pAI(pCreature);
  674. + }
  675. +
  676. + struct npc_slave_pAI : public ScriptedAI
  677. + {
  678. + npc_slave_pAI(Creature *c) : ScriptedAI(c)
  679. + {
  680. + instance = c->GetInstanceScript();
  681. + Reset();
  682. + }
  683. +
  684. + void Reset()
  685. + {
  686. + Stage = 0;
  687. + Time = 4000;
  688. + }
  689. +
  690. + void UpdateAI(const uint32 diff)
  691. + {
  692. + if (Time <= diff)
  693. + {
  694. + switch (Stage)
  695. + {
  696. + case 0:
  697. + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
  698. + {
  699. + GetCreatureListWithEntryInGrid(gargoyle, me, 36896, 50.0f);
  700. + for(std::list<Creature*>::iterator itr = gargoyle.begin(); itr != gargoyle.end(); ++itr)
  701. + {
  702. + Creature *sGargoyle = *itr;
  703. + if (!sGargoyle)
  704. + continue;
  705. +
  706. + if (sGargoyle->isAlive())
  707. + if (Creature* sSlave = me->FindNearestCreature(36771, 50.0f, true))
  708. + {
  709. + if(sGargoyle->isAlive())
  710. + {
  711. + sGargoyle->Attack(sSlave, true);
  712. + sGargoyle->GetMotionMaster()->MoveChase(sSlave);
  713. + DoPlaySoundToSet(sSlave, 17152);
  714. + sSlave->Kill(sSlave);
  715. + }
  716. + }
  717. + }
  718. + }
  719. + else
  720. + {
  721. + GetCreatureListWithEntryInGrid(gargoyle, me, 36896, 50.0f);
  722. + for(std::list<Creature*>::iterator itr = gargoyle.begin(); itr != gargoyle.end(); ++itr)
  723. + {
  724. + Creature *sGargoyle = *itr;
  725. + if (!sGargoyle)
  726. + continue;
  727. +
  728. + if (sGargoyle->isAlive())
  729. + if (Creature* sSlave = me->FindNearestCreature(36765, 50.0f, true))
  730. + {
  731. + if(sSlave->isAlive())
  732. + {
  733. + sGargoyle->Attack(sSlave, true);
  734. + sGargoyle->GetMotionMaster()->MoveChase(sSlave);
  735. + sSlave->Kill(sSlave);
  736. + }
  737. + }
  738. + }
  739. + }
  740. + ++Stage;
  741. + Time = 4000;
  742. + break;
  743. +
  744. + }
  745. + }else Time -= diff;
  746. + }
  747. +
  748. + private:
  749. + InstanceScript* instance;
  750. + std::list<Creature*> gargoyle;
  751. + uint32 Time;
  752. + uint8 Stage;
  753. + };
  754. +};
  755. +
  756. void AddSC_pit_of_saron()
  757. {
  758. new mob_ymirjar_flamebearer();
  759. @@ -313,4 +1007,7 @@
  760. new mob_iceborn_protodrake();
  761. new mob_geist_ambusher();
  762. new spell_trash_mob_glacial_strike();
  763. -}
  764. + new pitofsaron_start();
  765. + new ball_and_chain();
  766. + new npc_slave_p();
  767. +}
  768. \ No newline at end of file
  769.  
  770.  
  771.  
  772.  
  773. diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h
  774. --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h
  775. +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h
  776. @@ -35,6 +35,7 @@
  777. DATA_JAINA_SYLVANAS_2 = 6, // GUID of either Jaina or Sylvanas part 2, depending on team, as it's the same spawn.
  778. DATA_TYRANNUS_EVENT = 7,
  779. DATA_TEAM_IN_INSTANCE = 8,
  780. + DATA_TYRANNUS_START = 9,
  781. };
  782.  
  783. enum CreatureIds
Advertisement
Add Comment
Please, Sign In to add comment