Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.08 KB | None | 0 0
  1. /*
  2. * Copyright (C) 2017-2018 AshamaneProject <https://github.com/AshamaneProject>
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License as published by the
  6. * Free Software Foundation; either version 2 of the License, or (at your
  7. * option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17.  
  18. #include "AreaTrigger.h"
  19. #include "AreaTriggerAI.h"
  20. #include "ScriptedCreature.h"
  21. #include "ScriptMgr.h"
  22. #include "SpellAuras.h"
  23. #include "SpellScript.h"
  24. #include "tomb_of_sargeras.h"
  25.  
  26. enum BossSpells
  27. {
  28. BUFF_EGVINE = 236420,
  29.  
  30. // bombs
  31. SPELL_CAST_BOMBS = 235267,
  32. AURA_BOBM = 235117,
  33.  
  34. // teleportation boss
  35. SPELL_TELEPORT = 0,
  36. SPELL_STUN = 248812,
  37. AURA_SHIELD = 235028,
  38. FRAGMENTS = 236061,
  39.  
  40. // buff for players
  41. BUFF_WHITE = 235534,
  42. BUFF_INFUSION = 235538,
  43.  
  44. // cast wrath of the crators
  45. SPELL_CAST_WRATH_OF_THE_CREATORS = 234891,
  46. SPELL_TRIGGER_WHITE = 234917,
  47. SPELL_TRIGGER_INFUSION_FEL = 236433,
  48. AURA_WRATH_OF_THE_CREATORS = 237339,
  49. SPELL_EXTINGUISH_LIFE = 238475,
  50.  
  51. // cast infusion
  52. SPELL_INFUSION = 235271,
  53. AURA_WHITE = 235213,
  54. AURA_FEL_INFUSION = 235240,
  55.  
  56. // hammers
  57. SPELL_HAMMER_OF_OBLITERATION = 241636,
  58. SPELL_HAMMER_OF_CREATION = 241635,
  59.  
  60. SPELL_BERSERK = 64238
  61. };
  62.  
  63. enum BossYells
  64. {
  65. BOSS_PULL = 0,
  66. BOSS_DEAD = 1,
  67. BOSS_TELEPORT = 2,
  68. BOSS_KILL_PLAYERS_INFUSION = 3,
  69. BOSS_KILL_PLAYERS_WHITE = 4,
  70. BOSS_CAST_DEBUFF_ONE = 5,
  71. BOSS_CAST_DEBUFF_TWO = 6,
  72. BOSS_CAST_WRATH_OF_THE_CREATORS = 7,
  73. BOSS_10_PCT_HP = 8,
  74. BOSS_EVADE = 9
  75. };
  76.  
  77. enum Events
  78. {
  79. EVENT_INFUSION = 0,
  80. EVENT_CAST_BOMBS = 1,
  81. EVENT_AURA_BOMBS = 2,
  82. EVENT_HUMMER = 3,
  83. EVENT_TELEPORT = 4,
  84. EVENT_TELEPORT_PHASE = 5,
  85. EVENT_BERSERK = 6
  86. };
  87.  
  88. // 118289
  89. class boss_maiden_of_vigilance : public CreatureScript
  90. {
  91. public:
  92. boss_maiden_of_vigilance() : CreatureScript("boss_maiden_of_vigilance") { }
  93.  
  94. CreatureAI* GetAI(Creature* creature) const
  95. {
  96. return new boss_maiden_of_vigilanceAI(creature);
  97. }
  98.  
  99. struct boss_maiden_of_vigilanceAI : public ScriptedAI
  100. {
  101. boss_maiden_of_vigilanceAI(Creature* creature) : ScriptedAI(creature)
  102. {
  103. Reset();
  104. }
  105.  
  106. void EnterEvadeMode(EvadeReason why) override
  107. {
  108. ScriptedAI::EnterEvadeMode(why);
  109. Reset();
  110. Talk(BOSS_EVADE);
  111. }
  112.  
  113. void JustDied(Unit* killer) override
  114. {
  115. Talk(BOSS_DEAD);
  116. Reset();
  117. }
  118.  
  119. void Reset() override
  120. {
  121. events.Reset();
  122. phase = false;
  123. castSpell = false;
  124. molot = false;
  125. me->SetReactState(REACT_DEFENSIVE);
  126. }
  127.  
  128. void EnterCombat(Unit* who) override
  129. {
  130. Reset();
  131. Talk(BOSS_PULL);
  132. EventOneStart();
  133. }
  134.  
  135. void EventOneStart()
  136. {
  137. events.Reset();
  138. events.ScheduleEvent(EVENT_INFUSION, Seconds(10));
  139. events.ScheduleEvent(EVENT_HUMMER, Seconds(12));
  140. events.ScheduleEvent(EVENT_CAST_BOMBS, Seconds(22));
  141. events.ScheduleEvent(EVENT_TELEPORT, Seconds(40));
  142. events.ScheduleEvent(EVENT_BERSERK, Minutes(8));
  143. }
  144.  
  145. void SayDebuff(bool phase)
  146. {
  147. if (phase)
  148. Talk(BOSS_CAST_DEBUFF_ONE);
  149. else
  150. Talk(BOSS_CAST_DEBUFF_TWO);
  151. }
  152.  
  153. void UpdateAI(uint32 diff) override
  154. {
  155. if (!UpdateVictim())
  156. return;
  157.  
  158. events.Update(diff);
  159.  
  160. while (uint32 eventId = events.ExecuteEvent())
  161. {
  162. switch (eventId)
  163. {
  164. case EVENT_BERSERK:
  165. {
  166. DoCastSelf(SPELL_BERSERK);
  167. break;
  168. }
  169.  
  170. case EVENT_CAST_BOMBS:
  171. {
  172. DoCastSelf(SPELL_CAST_BOMBS);
  173. events.ScheduleEvent(EVENT_AURA_BOMBS, Seconds(2));
  174. break;
  175. }
  176.  
  177. case EVENT_AURA_BOMBS:
  178. {
  179. UnitList targetList;
  180. SelectTargetList(targetList, 3, SELECT_TARGET_RANDOM, 200.0f, true);
  181. for (Unit* target : targetList)
  182. DoCast(target, AURA_BOBM, true);
  183. break;
  184. }
  185.  
  186. case EVENT_HUMMER:
  187. {
  188. if (molot)
  189. {
  190. DoCast(SelectTarget(SELECT_TARGET_TOPAGGRO), SPELL_HAMMER_OF_OBLITERATION);
  191. molot = false;
  192. }
  193. else
  194. {
  195. DoCast(SelectTarget(SELECT_TARGET_TOPAGGRO), SPELL_HAMMER_OF_CREATION);
  196. molot = true;
  197. }
  198. events.ScheduleEvent(EVENT_HUMMER, Seconds(18));
  199. break;
  200. }
  201.  
  202. case EVENT_INFUSION:
  203. {
  204. Talk(BOSS_CAST_WRATH_OF_THE_CREATORS);
  205. DoCast(SPELL_INFUSION);
  206. DoCastSelf(SPELL_BERSERK);
  207. break;
  208. }
  209.  
  210. case EVENT_TELEPORT:
  211. {
  212.  
  213. break;
  214. }
  215.  
  216. case EVENT_TELEPORT_PHASE:
  217. {
  218.  
  219. break;
  220. }
  221.  
  222. }
  223. }
  224.  
  225. if (HealthBelowPct(10))
  226. Talk(BOSS_10_PCT_HP);
  227.  
  228. if (me->GetAuraCount(AURA_WRATH_OF_THE_CREATORS) == 30)
  229. DoCastAOE(SPELL_EXTINGUISH_LIFE);
  230.  
  231. DoMeleeAttackIfReady();
  232. }
  233.  
  234. private:
  235. bool phase = false;
  236. bool castSpell = false;
  237. bool molot = false;
  238. };
  239. };
  240.  
  241. // 118640 & 118643
  242. class fragments : public CreatureScript
  243. {
  244. public:
  245. fragments() : CreatureScript("fragments") { }
  246.  
  247. CreatureAI* GetAI(Creature* creature) const
  248. {
  249. return new fragmentsAI(creature);
  250. }
  251.  
  252. struct fragmentsAI : public ScriptedAI
  253. {
  254. fragmentsAI(Creature* creature) : ScriptedAI(creature)
  255. {
  256. Initialize();
  257. }
  258.  
  259. void Initialize()
  260. {
  261.  
  262. }
  263.  
  264. void UpdateAI(uint32 diff)
  265. {
  266. if (!UpdateVictim())
  267. return;
  268.  
  269. events.Update(diff);
  270. }
  271.  
  272. };
  273. };
  274.  
  275. class spell_cast wrath_of_the_crators : public SpellScript
  276. {
  277. PrepareSpellScript(spell_cast wrath_of_the_crators);
  278.  
  279.  
  280.  
  281. void Register() override
  282. {
  283.  
  284. }
  285.  
  286. };
  287.  
  288. void AddSC_boss_maiden_of_vigilance()
  289. {
  290. new boss_maiden_of_vigilance();
  291. new fragments();
  292.  
  293. RegisterSpellScript(spell_cast wrath_of_the_crators);
  294. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement