Guest User

Untitled

a guest
Jun 14th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.21 KB | None | 0 0
  1. /***********************
  2. * Scripted by Jinung
  3. * for Shindo'Rei
  4. * Core 4.0.6
  5. *
  6. * The Bastion of Twilight
  7. * boss_halfus - Halfus Wyrmbreaker
  8. *
  9. ***********************/
  10.  
  11. #include"ScriptPCH.h"
  12. #include"WorldPacket.h"
  13. #include"bastion_of_wilight.h"
  14. #include"ScriptMgr.h"
  15. #include"ScriptedCreature.h"
  16. #include"SpellScript.h"
  17. #include"SpellAuraEffects.h"
  18. #include"Unit.h"
  19.  
  20.  
  21. enum Spells
  22. {
  23. Frienzied = 83693, //Marche
  24. Frienziedhm = 86161, //A TEST
  25. Shadow = 38627, //Marche
  26. Shadowhm = 86167, //A TEST (ou test 86168)
  27. Barrage = 83721, //Spell scripted (A TEST)
  28. Scorching = 86164, //Spell scripted (A TEST)
  29. Firebalz = 61909, //Spell scripted (A TEST)
  30. Roar = 86170, //Spell scripted (A TEST)
  31. Malevolent = 39171, //Marche
  32. Malevolenthm = 86158, //A TEST
  33. Berzerk = 26662, //Marche
  34. Unresponsive = 86022, //Marche
  35. Stone = 83603, //Marche
  36. Poison = 83609, //A TEST
  37. Barrageanim = 83720, //Marche
  38. Netherblind = 83611, //A TEST
  39. Cyclonewind = 84092, //A TEST
  40. Aoe_Flames = 74040, //Marche
  41. };
  42.  
  43. enum NPC
  44. {
  45. mob_proto = 44687, //Add du boss (Toujours présent)
  46.  
  47. mob_storm = 44650,
  48. mob_slate = 44652,
  49. mob_nether = 44645,
  50. mob_time = 44797,
  51. mob_emerald = 44641,
  52.  
  53. mobs_scorching = 987654322, //custom
  54. };
  55.  
  56. enum VAR
  57. {
  58. uint32 Hftimer;
  59. uint32 Hfspecial;
  60. uint32 Hfvar;
  61.  
  62. Hfvar = 0;
  63. Hftimer = 0;
  64. };
  65.  
  66. class boss_halfus_wyrmbreacker : public CreatureScript
  67. {
  68. public:
  69. boss_halfus_wyrmbreacker() : CreatureScript("boss_halfus_wyrmbreacker"){}
  70.  
  71. CreatureAI* GetAI(Creature* pCreature) const
  72. {
  73. return new boss_halfus_wyrmbreackerAI(pCreature);
  74. }
  75.  
  76. struct boss_halfus_wyrmbreackerAI : public ScriptedAI
  77. {
  78. //imperatif a chaque Boss
  79. boss_halfus_wyrmbreackerAI(Creature* pCreature) : ScriptedAI(pCreature)
  80. {
  81. pMap = me->GetMap();
  82. pInstance = pCreature->GetInstanceScript();
  83. }
  84.  
  85. InstanceScript *pInstance;
  86.  
  87. bool check_in;
  88. Map* pMap;
  89.  
  90.  
  91. uint32 Shadow_timer;
  92.  
  93. uint32 Berzerk_timer;
  94. uint32 roar_timer;
  95. uint32 Stone_timer;
  96.  
  97. uint32 Phase;
  98.  
  99.  
  100. //Fonction Reset
  101. void Reset()
  102. {
  103.  
  104.  
  105. ///Coordonnée Spawn à implémenter: X=-295.889069 Y=-718.576355 Z=888.086852 (DU BOSS ! IMPORTANT!!!!)
  106.  
  107. // les DATA sont dans le .h de l'instance
  108. if (pInstance && (pInstance->GetData(DATA_HALFUS) != DONE && !check_in))
  109. pInstance->SetData(DATA_HALFUS, NOT_STARTED);
  110. check_in = false;
  111.  
  112. ///////////////////////////////////////////////////////////////////
  113. // HEALTH! //Lichen -> Formule DB!!!
  114. // 32,356,000 (10-player mode)
  115. // 51,530,000 (10-player Heroic mode)
  116. // 115,950,000 (25-player mode)
  117. // 184,667,000 (25-player Heroic mode)
  118. ////////////////////////////////////////////////////////////////////
  119.  
  120. me->SummonCreature(mob_storm , -279.158752, -662.997131, 888.090454, 1.0f);
  121. me->SummonCreature(mob_slate , -276.262177, -695.767517, 888.086853, 1.0f);
  122. me->SummonCreature(mob_nether, -334.892822, -699.750183, 888.103699, 1.0f);
  123. me->SummonCreature(mob_time , -325.493347, -730.392883, 888.086975, 1.0f);
  124. me->SummonCreature(mob_emerald , -342.414001, -722.228943, 888.092773, 1.0f);
  125.  
  126. me->SummonCreature(mob_proto , -278.409760, -719.387512, 903.714539, 1.0f);
  127.  
  128. roar_timer = 1000000000000000000000000;
  129.  
  130. Berzerk_timer = 360000; //6 min to enrage || repoussé à 8 min si vraiment trop "dure"
  131.  
  132. //Raid en mode NORMAL!!!
  133. if(GetDifficulty() = RAID_DIFFICULTY_10MAN_NORMAL || GetDifficulty() = RAID_DIFFICULTY_25MAN_NORMAL)
  134. {
  135. switch(urand(1,10)) //10 events différents (3 dragons réveillé sur 5 en nm)
  136. {
  137. if(IsHeroic())
  138. {
  139. return;
  140. }
  141.  
  142. case 1: mob_storm_rider->Docast(Unresponsive, true);
  143. mob_slate_dragon->Docast(Unresponsive, true);
  144.  
  145. Shadow_timer = 1000000000000000000; //inf
  146. Stone_timer = 1000000000000000000;
  147.  
  148. DoCast(me, Netherblind, true);
  149.  
  150. break;
  151.  
  152. case 2: mob_storm_rider->Docast(Unresponsive, true);
  153. mob_nether_scion->Docast(Unresponsive, true);
  154. //
  155. Shadow_timer = 1000000000000000000;
  156. Stone_timer = 35000;
  157.  
  158. //
  159. //
  160. break;
  161.  
  162. case 3: mob_storm_rider->DoCast(Unresponsive, true);
  163. mob_time_warden->Docast(Unresponsive, true);
  164. //
  165. Shadow_timer = 1000000000000000000;
  166. Stone_timer = 35000;
  167. DoCast(me, Netherblind, true);
  168. //
  169. break;
  170.  
  171. case 4: mob_storm_rider->Docast(Unresponsive, true);
  172. mob_orphaned_whelp->Docast(Unresponsive, true);
  173. //
  174. Shadow_timer = 1000000000000000000;
  175. Stone_timer = 35000;
  176.  
  177. DoCast(me, Netherblind, true);
  178.  
  179. break;
  180.  
  181. case 5: mob_nether_scion->Docast(Unresponsive, true);
  182. mob_slate_dragon->Docast(Unresponsive, true);
  183. //
  184. Shadow_timer = 12000;
  185. Stone_timer = 1000000000000000000;
  186. DoCast(me, Cyclonewind, true);
  187. break;
  188.  
  189. case 6: mob_time_warden->Docast(Unresponsive, true);
  190. mob_slate_dragon->Docast(Unresponsive, true);
  191. //
  192. Shadow_timer = 12000;
  193. Stone_timer = 1000000000000000000;
  194. DoCast(me, Netherblind, true);
  195. DoCast(me, Cyclonewind, true);
  196. break;
  197.  
  198. case 7: mob_orphaned_whelp->Docast(Unresponsive, true);
  199. mob_slate_dragon->Docast(Unresponsive, true);
  200. //
  201. Shadow_timer = 12000;
  202. Stone_timer = 1000000000000000000;
  203. DoCast(me, Netherblind, true);
  204. DoCast(me, Cyclonewind, true);
  205. break;
  206.  
  207. case 8: mob_nether_scion->Docast(Unresponsive, true);
  208. mob_orphaned_whelp->Docast(Unresponsive, true);
  209. //
  210. Shadow_timer = 12000;
  211. Stone_timer = 35000;
  212. DoCast(me, Cyclonewind, true);
  213. //
  214. break;
  215.  
  216. case 9: mob_orphaned_whelp->Docast(Unresponsive, true);
  217. mob_time_warden->Docast(Unresponsive, true);
  218. //
  219. Shadow_timer = 12000;
  220. Stone_timer = 35000;
  221. DoCast(me, Netherblind, true);
  222. DoCast(me, Cyclonewind, true);
  223. break;
  224.  
  225. case 10: mob_nether_scion->DoCast(Unresponsive, true);
  226. mob_time_warden->DoCast(Unresponsive, true);
  227. //
  228. Shadow_timer = 12000;
  229. Stone_timer = 35000;
  230. DoCast(me, Cyclonewind, true);
  231. //
  232. break;
  233. }
  234. }
  235. else //RAID EN MODE HEROÏQUE!
  236. {
  237. Shadow_timer = 12000;
  238. Stone_timer = 35000;
  239. DoCast(me, Cyclonewind, true);
  240. DoCast(me, Netherblind, true);
  241. }
  242.  
  243. Phase = 1
  244.  
  245.  
  246.  
  247. me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true); //Prot
  248. me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); //Prot
  249. me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_SILENCE, true); //Prot
  250. me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true); //Prot
  251. me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_FEAR, true); //Prot
  252. me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CHARM, true); //Prot
  253. me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true); //Prot
  254. me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_ROOT, true); //Prot
  255. me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); //Prot
  256.  
  257. }
  258.  
  259. void KilledUnit(Unit* /*Killed*/)
  260. {
  261. switch(urand(0,1))
  262. {
  263.  
  264. case 0:me->MonsterYell("The burden of the damned falls upon you!",LANG_UNIVERSAL,NULL);
  265. break;
  266.  
  267. case 1:me->MonsterYell("The wyrms will eat well tonight! ",LANG_UNIVERSAL,NULL);
  268. break;
  269.  
  270. }
  271. }
  272.  
  273. void JustDied(Unit* /*Kill*/)
  274. {
  275. switch(urand(1,1000))
  276. {
  277. default:me->MonsterYell("Flesh and sinew, weak but proud. Dare they part the Master's shroud? They stumble fumble groping blind, Finding fate and chaos intertwined.",LANG_UNIVERSAL,NULL);
  278. break;
  279. case 666:me->MonsterYell("Jinung est-ce toi?",LANG_UNIVERSAL,NULL);
  280. break;
  281. }
  282. if (pInstance)
  283. pInstance->SetData(DATA_HALFUS, DONE);
  284.  
  285. if(Hfspecial = 1) //Hf id = 5300
  286. {
  287. Map::PlayerList const &players = pMap->GetPlayers();
  288. for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
  289. itr->getSource()->CompletedAchievement(5300);
  290. }
  291.  
  292. if (GetDifficulty() != RAID_DIFFICULTY_10MAN_NORMAL && GetDifficulty() != RAID_DIFFICULTY_25MAN_NORMAL) //Achievement en hero UNIQUEMENT
  293. {
  294. AchievementEntry const *AchievHero = GetAchievementStore()->LookupEntry(5118);
  295. if (AchievHero)
  296. {
  297. if (pMap && pMap->IsRaid())
  298. {
  299. Map::PlayerList const &players = pMap->GetPlayers();
  300. for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
  301.  
  302. itr->getSource()->CompletedAchievement(AchievHero);
  303. }
  304. }
  305. }
  306.  
  307. }
  308.  
  309. void EnterCombat(Unit* /*Ent*/)
  310. {
  311. me->MonsterYell("Cho'gall will have your heads! ALL OF THEM!",LANG_UNIVERSAL,NULL);
  312. if (pInstance)
  313. pInstance->SetData(DATA_HALFUS, IN_PROGRESS);
  314.  
  315. DoZoneInCombat();
  316.  
  317. mob_proto_behemoth->DoZoneInCombat(); //Marche?
  318. }
  319.  
  320. //Fonction Update
  321. void UpdateAI(const uint32 uiDiff)
  322. {
  323. if (!UpdateVictim())
  324. return;
  325.  
  326. //Malevolent en 4 modes
  327. if(mob_slate_dragon->HasAura(86022, false) && mob_slate_draon->IsAlive())
  328. { if(IsHeroic())
  329. {
  330. DoCast(me, Malevolenthm, true);
  331. }
  332. else
  333. DoCast(me, Malevolent, true);
  334. }
  335.  
  336. if(mob_nether_scion->HasAura(86022, false) && mob_nether_scion->IsAlive())
  337. {
  338. if(IsHeroic())
  339. {
  340. DoCast(me, Frienziedhm, true);
  341. }
  342. else
  343. DoCast(me, Frienzied, true);
  344. }
  345.  
  346. if(mob_nether_scion->HasAura(86022, false))
  347. {
  348. DoCast(me, Netherblind, true); //A TEST
  349. }
  350.  
  351. if(mob_storm_rider->HasAura(86022, false))
  352. {
  353. DoCast(me, Cyclonewind, true); //A TEST
  354. }
  355. //Shadow
  356.  
  357. if(Shadow_timer <= uiDiff)
  358. {
  359. if(IsHeroic())
  360. DoCast(me, Shadowhm, true);
  361. else
  362. DoCast(me, Shadow, true);
  363. }
  364. else
  365. Shadow_timer -= uiDiff;
  366.  
  367.  
  368. if(Stone_timer <= uiDiff)
  369. {
  370. DoCast(me, Stone, true);
  371. }
  372. else
  373. Stone_timer -= uiDiff;
  374.  
  375. //Phases
  376.  
  377. if(me->GetHealthPct() <= 50 && Phase = 1)
  378.  
  379. {
  380. Phase = 2;
  381. }
  382.  
  383.  
  384. if(Phase = 2)
  385. {
  386. roar_timer = 27000; //27s à ajuster!
  387. }
  388.  
  389. if(Berzerk_timer <= uiDiff)
  390. {
  391. DoCast(me, Berz);
  392. }
  393. else
  394. Berzerk_timer -= uiDiff;
  395.  
  396. DoMeleeAttackIfReady();
  397.  
  398. }
  399.  
  400. };
  401. };
  402.  
  403. class mob_storm_rider : public CreatureScript
  404. {
  405. public:
  406. mob_storm_rider() : CreatureScript("mob_storm_rider") { }
  407.  
  408. CreatureAI* GetAI(Creature* creature) const
  409. {
  410. return new mob_storm_riderAI (creature);
  411. }
  412.  
  413. struct mob_storm_riderAI : public ScriptedAI
  414. {
  415. mob_storm_riderAI(Creature* creature) : ScriptedAI(creature) { }
  416.  
  417. uint32 Notinevent;
  418.  
  419. void Reset()
  420. {
  421. if(me->HasAura(86022, true))
  422. Notinevent = 1;
  423. }
  424.  
  425. void EnterCombat(Unit* /*pWho*/)
  426. {
  427. if(Notinevent = 1)
  428. {
  429. me->DespawnOrUnsummon();
  430. }
  431.  
  432. boss_halfus_wyrmbreacker->DoZoneInCombat();
  433. }
  434.  
  435. void JustDied(Unit* /*Killer*/)
  436. {
  437. if(Hfvar = 1 && Hftimer <= 10000)
  438. Hfspecial = 1;
  439. else
  440. Hftimer = 10000;
  441. }
  442.  
  443. void UpdateAI(const uint32 Diff)
  444. {
  445. if (!UpdateVictim())
  446. return;
  447. if(me->HasAura(86022, true))
  448. Notinevent = 1;
  449.  
  450. if(Hftimer <= 10000)
  451. Hfvar = 1;
  452. else
  453. {
  454. Hftimer -= Diff;
  455. Hfvar = 0;
  456. }
  457.  
  458. DoMeleeAttackIfReady();
  459. }
  460. };
  461. };
  462.  
  463. class mob_slate_dragon : public CreatureScript
  464. {
  465. public:
  466. mob_slate_dragon() : CreatureScript("mob_slate_dragon") { }
  467.  
  468. CreatureAI* GetAI(Creature* creature) const
  469. {
  470. return new mob_slate_dragonAI (creature);
  471. }
  472.  
  473. struct mob_slate_dragonAI : public ScriptedAI
  474. {
  475. mob_slate_dragonAI(Creature* creature) : ScriptedAI(creature) { }
  476.  
  477. uint32 Notinevent;
  478. uint32 Hftimer;
  479. uint32 Hfspecial;
  480.  
  481. void Reset()
  482. {
  483. if(me->HasAura(86022, true))
  484. Notinevent = 1;
  485. }
  486.  
  487. void EnterCombat(Unit* /*pWho*/)
  488. {
  489. boss_halfus_wyrmbreacker->DoZoneInCombat();
  490. if(Notinevent = 1)
  491. {
  492. me->DespawnOrUnsummon();
  493. }
  494. }
  495.  
  496. void JustDied(Unit* /*Killer*/)
  497. {
  498. if(Hfvar = 1 && Hftimer <= 10000)
  499. Hfspecial = 1;
  500. else
  501. Hftimer = 10000;
  502. }
  503.  
  504. void UpdateAI(const uint32 Diff)
  505. {
  506. if (!UpdateVictim())
  507. return;
  508. if(me->HasAura(86022, true))
  509. Notinevent = 1;
  510.  
  511. if(Hftimer <= 10000)
  512. Hfvar = 1;
  513. else
  514. {
  515. Hftimer -= Diff;
  516. Hfvar = 0;
  517. }
  518.  
  519. DoMeleeAttackIfReady();
  520. }
  521. };
  522. };
  523.  
  524. class mob_orphaned_whelp : public CreatureScript
  525. {
  526. public:
  527. mob_orphaned_whelp() : CreatureScript("mob_orphaned_whelp") { }
  528.  
  529. CreatureAI* GetAI(Creature* creature) const
  530. {
  531. return new mob_orphaned_whelpAI (creature);
  532. }
  533.  
  534. struct mob_orphaned_whelpAI : public ScriptedAI
  535. {
  536. mob_orphaned_whelpAI(Creature* creature) : ScriptedAI(creature) { }
  537.  
  538. uint32 Notinevent;
  539. uint32 Hftimer;
  540. uint32 Hfspecial;
  541.  
  542. void Reset()
  543. {
  544. if(me->HasAura(86022, true))
  545. Notinevent = 1;
  546. }
  547.  
  548. void EnterCombat(Unit* /*pWho*/)
  549. {
  550.  
  551.  
  552. if(Notinevent = 1)
  553. {
  554. me->DespawnOrUnsummon();
  555. }
  556. boss_halfus_wyrmbreacker->DoZoneInCombat();
  557. }
  558.  
  559. void JustDied(Unit* /*Killer*/)
  560. {
  561. if(Hfvar = 1 && Hftimer <= 10000)
  562. Hfspecial = 1;
  563. else
  564. Hftimer = 10000;
  565. }
  566.  
  567. void UpdateAI(const uint32 Diff)
  568. {
  569. if (!UpdateVictim())
  570. return;
  571. if(me->HasAura(86022, true))
  572. Notinevent = 1;
  573.  
  574. if(Hftimer <= 10000)
  575. Hfvar = 1;
  576. else
  577. {
  578. Hftimer -= Diff;
  579. Hfvar = 0;
  580. }
  581.  
  582. DoMeleeAttackIfReady();
  583. }
  584. };
  585. };
  586.  
  587. class mob_time_warden : public CreatureScript
  588. {
  589. public:
  590. mob_time_warden() : CreatureScript("mob_time_warden") { }
  591.  
  592. CreatureAI* GetAI(Creature* creature) const
  593. {
  594. return new mob_time_wardenAI (creature);
  595. }
  596.  
  597. struct mob_time_wardenAI : public ScriptedAI
  598. {
  599. mob_time_wardenAI(Creature* creature) : ScriptedAI(creature) { }
  600.  
  601. uint32 Notinevent;
  602. uint32 Hftimer;
  603. uint32 Hfspecial;
  604.  
  605. void Reset()
  606. {
  607. if(me->HasAura(86022, true))
  608. Notinevent = 1;
  609. }
  610.  
  611. void EnterCombat(Unit* /*pWho*/)
  612. {
  613. if(Notinevent = 1)
  614. {
  615. me->DespawnOrUnsummon();
  616. }
  617. boss_halfus_wyrmbreacker->DoZoneInCombat();
  618. }
  619.  
  620. void JustDied(Unit* /*Killer*/)
  621. {
  622. if(Hfvar = 1 && Hftimer <= 10000)
  623. Hfspecial = 1;
  624. else
  625. Hftimer = 10000;
  626. }
  627.  
  628. void UpdateAI(const uint32 Diff)
  629. {
  630. if (!UpdateVictim())
  631. return;
  632. if(me->HasAura(86022, true))
  633. Notinevent = 1;
  634.  
  635. if(Hftimer <= 10000)
  636. Hfvar = 1;
  637. else
  638. {
  639. Hftimer -= Diff;
  640. Hfvar = 0;
  641. }
  642.  
  643. DoMeleeAttackIfReady();
  644. }
  645. };
  646. };
  647.  
  648. class mob_nether_scion : public CreatureScript
  649. {
  650. public:
  651. mob_nether_scion() : CreatureScript("mob_nether_scion") { }
  652.  
  653. CreatureAI* GetAI(Creature* creature) const
  654. {
  655. return new mob_nether_scionAI (creature);
  656. }
  657.  
  658. struct mob_nether_scionAI : public ScriptedAI
  659. {
  660. mob_nether_scionAI(Creature* creature) : ScriptedAI(creature) { }
  661.  
  662. uint32 Notinevent;
  663. uint32 Hftimer;
  664. uint32 Hfspecial;
  665.  
  666. void Reset()
  667. {
  668. if(me->HasAura(86022, true))
  669. Notinevent = 1;
  670. }
  671.  
  672. void EnterCombat(Unit* /*pWho*/)
  673. {
  674. if(Notinevent = 1)
  675. {
  676. me->DespawnOrUnsummon();
  677. }
  678. boss_halfus_wyrmbreacker->DoZoneInCombat();
  679. }
  680.  
  681. void JustDied(Unit* /*Killer*/)
  682. {
  683. if(Hfvar = 1 && Hftimer <= 10000)
  684. Hfspecial = 1;
  685. else
  686. Hftimer = 10000;
  687. }
  688.  
  689. void UpdateAI(const uint32 Diff)
  690. {
  691. if (!UpdateVictim())
  692. return;
  693. if(me->HasAura(86022, true))
  694. Notinevent = 1;
  695.  
  696. if(Hftimer <= 10000)
  697. Hfvar = 1;
  698. else
  699. {
  700. Hftimer -= Diff;
  701. Hfvar = 0;
  702. }
  703.  
  704. DoMeleeAttackIfReady();
  705. }
  706. };
  707. };
  708.  
  709. class mob_proto_behemoth : public CreatureScript
  710. {
  711. public:
  712. mob_proto_behemoth() : CreatureScript("mob_proto_behemoth") { }
  713.  
  714. CreatureAI* GetAI(Creature* creature) const
  715. {
  716. pMap = me->GetMap();
  717. return new mob_proto_behemothAI (creature);
  718. }
  719. Map* pMap;
  720.  
  721. uint32 Barrage_timer;
  722. uint32 Scorching_timer;
  723. uint32 Firebalz_timer;
  724. uint32 alreadydone;
  725.  
  726. struct mob_proto_behemothAI : public ScriptedAI
  727. {
  728. mob_proto_behemothAI(Creature* creature) : ScriptedAI(creature) { }
  729.  
  730.  
  731. void Reset()
  732. {
  733. if(mob_time_warden->HasAura(86022, true))
  734. {
  735. Barrage_timer = 100000000000000000;
  736. }
  737. else
  738. Barrage_timer = 10000;
  739.  
  740. if(mob_orphaned_whelp->HasAura(86022, true))
  741. {
  742. Scorching_timer = 100000000000000000;
  743. }
  744. else
  745. Scorching_timer = 20000;
  746.  
  747. Firebalz_timer = 9000;
  748. }
  749.  
  750. void EnterCombat(Unit* /*pWho*/)
  751. {
  752.  
  753. DoZoneInCombat();
  754. boss_halfus_wyrmbreacker->DoZoneInCombat();
  755.  
  756. }
  757.  
  758. void JustDied(Unit* /*Killer*/)
  759. {
  760.  
  761. }
  762.  
  763. void UpdateAI(const uint32 uiDiff)
  764. {
  765. if(Firebalz_timer <= uiDiff)
  766. { Unit* ptarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 5000, true);
  767. DoCast(ptarget, spell_damagecompensator, true);
  768. }
  769. else
  770. Firebalz_timer -= uiDiff;
  771.  
  772. if(Scorching_timer <= uiDiff)
  773. {
  774. me->SummonCreature(mob_scorching , -320.712708 , --683.584473, 888.100525, 1.0f);
  775. }
  776. else
  777. Scorching_timer -= uiDiff;
  778.  
  779. if(Barrage_timer <= uiDiff)
  780. {
  781. Map::PlayerList const &players = pMap->GetPlayers();
  782. for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); +2itr)
  783. {
  784. DoCast(itr, Barrageanim, true);
  785.  
  786. for(uint32 i = 0, i <= 900, i++) //Attente de l'anime
  787. {
  788. //Nothing
  789. }
  790.  
  791. DoCast(itr, Barrage, true);
  792.  
  793. }
  794. }
  795. else
  796. Barrage_timer -= uiDiff;
  797.  
  798. if(me->IsAlive(true))
  799. { if(alreadydone = 0)
  800. { if(mob_emerald->IsAlive())
  801. for(uint i = 0, i <6, i++)
  802. DoCast(me, Poison, true);
  803. alreadydone = 1
  804.  
  805. }
  806. // Map::CreatureList const &players = pMap->GetCreature(mob_orphaned_whelp);
  807. // for (Map::CreatureList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
  808. // {
  809. // DoCast(me, Poison, true);
  810. // alreadydone = 1
  811. // }
  812. }
  813.  
  814.  
  815.  
  816. //Don't melee or range (IMPORTANT)
  817. }
  818. };
  819.  
  820. };
  821.  
  822. class spell_damagecompensator : public SpellScriptLoader
  823. {
  824. public:
  825. spell_damagecompensator() : SpellScriptLoader("spell_damagecompensator") { }
  826.  
  827. class spell_damagecompensator_AuraScript : public AuraScript
  828. {
  829. PrepareAuraScript(spell_damagecompensator_AuraScript)
  830.  
  831. enum Spells
  832. {
  833. Firebalz = 61909,
  834. };
  835.  
  836. bool Load()
  837. {
  838. //Si caster = player, ne s'active pas.
  839. if (Unit * caster = GetCaster())
  840. if (caster->GetTypeId() == TYPEID_PLAYER)
  841. return false;
  842. return true;
  843. }
  844.  
  845.  
  846. void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/)
  847. {
  848. Unit * caster = GetCaster();
  849. Unit *ptarget = caster->SelectTarget(SELECT_TARGET_RANDOM, 0, 5000);
  850.  
  851. DoCast(ptarget, Firebalz, true);
  852. caster->DealDamage(ptarget, urand(16000, 23000));
  853.  
  854. }
  855.  
  856.  
  857.  
  858.  
  859. void Register()
  860. {
  861.  
  862. OnEffectApply += AuraEffectApplyFn(spell_damagecompensator_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
  863.  
  864.  
  865. }
  866. };
  867.  
  868. AuraScript *GetAuraScript() const
  869. {
  870. return new spell_damagecompensator_AuraScript();
  871. }
  872. };
  873.  
  874. class spell_roardamage : public SpellScriptLoader
  875. {
  876. public:
  877. spell_roardamage() : SpellScriptLoader("spell_roardamage") { }
  878.  
  879. AuraScript *GetAuraScript() const
  880. {
  881. pMap = me->GetMap();
  882. return new spell_roardamage_AuraScript();
  883. }
  884.  
  885. class spell_roardamage_AuraScript : public AuraScript
  886. {
  887. PrepareAuraScript(spell_roardamage_AuraScript)
  888.  
  889.  
  890. Map* pMap;
  891.  
  892. enum Spells
  893. {
  894. // SPELL_X = ,
  895. };
  896.  
  897. bool Load()
  898. {
  899. //Si caster = player, ne s'active pas.
  900. if (Unit * caster = GetCaster())
  901. if (caster->GetTypeId() == TYPEID_PLAYER)
  902. return false;
  903. return true;
  904. }
  905.  
  906.  
  907. void HandleEffectCalcAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & canBeRecalculated)
  908. {
  909. sLog->outString("Amount of Aura Effect is being calculated now!");
  910. // we're setting amount to 3
  911. amount = 3;
  912. // amount will be never recalculated
  913. canBeRecalculated = false;
  914. }
  915.  
  916. void HandleEffectCalcPeriodic(AuraEffect const * /*aurEff*/, bool & isPeriodic, int32 & amplitude)
  917. {
  918. sLog->outString("Periodic data of Aura Effect is being calculated now!");
  919. // we're setting aura to be periodic and tick every 2 seconds
  920. isPeriodic = true;
  921. amplitude = 1600;
  922. }
  923.  
  924. void HandleEffectPeriodic(AuraEffect const * /*aurEff*/)
  925. {
  926. Map *pMap;
  927. if(IsHeroic())
  928. {
  929. Unit * caster = GetCaster();
  930. Map::PlayerList const &players = pMap->GetPlayers();
  931. for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
  932. {
  933.  
  934. DealDamage(itr, urand(9500, 10500));
  935. itr->KnockBackFrom(caster->GetPositionX(), caster->GetPositionY(), 25.0, 25.0); //Speed à régler 5.0 = xy ; 2.0 = z
  936. itr->ApplyAura(SPELL_AURA_MOD_STUN, 2000, true); //Stun 2s
  937.  
  938. }
  939. return;
  940. }
  941. else
  942. {
  943. Unit * caster = GetCaster();
  944. Map::PlayerList const &players = pMap->GetPlayers();
  945. for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
  946. {
  947. DealDamage(itr, urand(7600, 8400));
  948. itr->KnockBackFrom(caster->GetPositionX(), caster->GetPositionY(), 25.0, 25.0); //Speed à régler 5.0 = xy ; 2.0 = z
  949. itr->ApplyAura(SPELL_AURA_MOD_STUN, 2000, true); //Stun 2s
  950.  
  951. }
  952. return;
  953. }
  954. }
  955.  
  956.  
  957. void Register()
  958. {
  959.  
  960. OnEffectPeriodic += AuraEffectPeriodicFn(spell_roardamage_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
  961. DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_roardamage_AuraScript::HandleEffectCalcAmount, EFFECT_0, SPELL_AURA_DUMMY);
  962. DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_roardamage_AuraScript::HandleEffectCalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
  963.  
  964. }
  965. };
  966.  
  967. };
  968.  
  969. class mobs_scorching : public CreatureScript
  970. {
  971. public:
  972. mobs_scorching() : CreatureScript("mobs_scorching") { }
  973.  
  974. CreatureAI* GetAI(Creature* creature) const
  975. { pMap = me->GetMap();
  976. return new mobs_scorchingAI (creature);
  977. }
  978.  
  979. struct mobs_scorchingAI : public ScriptedAI
  980. {
  981. mobs_scorchingAI(Creature* creature) : ScriptedAI(creature) { }
  982.  
  983. Map* pMap;
  984.  
  985. uint32 Aoe_Flames_timer;
  986. uint32 Spawn_timer;
  987.  
  988. void Reset()
  989. {
  990.  
  991. Aoe_Flames_timer = 1000;
  992. Spawn_timer = 5250;
  993. }
  994.  
  995. void EnterCombat(Unit* /*pWho*/) { }
  996.  
  997. void JustDied(Unit* /*Killer*/) { }
  998.  
  999. void UpdateAI(const uint32 Diff)
  1000. {
  1001. if (!UpdateVictim())
  1002. return;
  1003.  
  1004. if(Aoe_Flames_timer <= Diff)
  1005. {
  1006. Map::PlayerList const &players = pMap->GetPlayers();
  1007. for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); +2itr)
  1008. {
  1009. if(me->IsWithinDistInMap(itr->getSource(), 20.0f))
  1010. {
  1011. DoCast(itr, Aoe_Flames, true)
  1012. }
  1013. }
  1014. }
  1015. else Aoe_Flames_timer -= Diff;
  1016.  
  1017.  
  1018. if(Spawn_timer <= Diff)
  1019. {
  1020. me->DespawnOrUnsummon();
  1021. }
  1022. else Spawn_timer -= uiDiff;
  1023. //Do not attack
  1024. }
  1025. };
  1026. };
  1027.  
  1028. void AddSC_boss_halfus_wyrmbreacker()
  1029. {
  1030. new boss_halfus_wyrmbreacker();
  1031. new mob_storm_rider();
  1032. new mob_slate_dragon();
  1033. new mob_nether_scion();
  1034. new mob_orphaned_whelp();
  1035. new mob_time_warden();
  1036. new mob_proto_behemoth();
  1037. new spell_damagecompensator();
  1038. new spell_roardamage();
  1039. new mobs_scorching();
  1040. }
Add Comment
Please, Sign In to add comment