Guest User

Untitled

a guest
Nov 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2. #include "ScriptedCreature.h"
  3. #include "SpellScript.h"
  4. #include "SpellAuraEffects.h"
  5.  
  6. #define SAY_AGGRO "YOU tread upon the sacrosanct! Mortals have no place amidst the clouds."
  7. #define SAY_RANDOM "BACK to the earth with you!"
  8. #define SAY_RANDOM_1 "BACK to the earth with you!"
  9. #define SAY_CAST_FIELD "Al'Akir, your servant calls for aid!"
  10. #define SAY_DEATH "The winds take me!"
  11.  
  12. enum Spells
  13. {
  14. // Assad
  15. SPELL_STORM = 86930, //Supremacy of the Storm
  16. SPELL_CLING_H = 87618, //Static Cling
  17. SPELL_FIELD = 86911, //Unstable Grounding Field
  18. SPELL_CHAIN_N = 87622, //Chain Lightning
  19. SPELL_CHAIN_H = 93993, //Chain Lightning
  20. // Etoile tombe-ciel
  21. SPELL_BARRAGE_N = 87854,
  22. SPELL_BARRAGE_H = 92756,
  23. };
  24.  
  25. enum Creatures
  26. {
  27. NPC_SKYFALL_STAR = 45932,
  28. };
  29.  
  30. enum Events
  31. {
  32. EVENT_STORM,
  33. EVENT_CLING,
  34. EVENT_FIELD,
  35. EVENT_CHAIN,
  36. EVENT_SUMMON,
  37. EVENT_SAY,
  38. EVENT_BARRAGE,
  39. };
  40.  
  41. #define MAX_SUMMON_POS 5
  42.  
  43. const float SummonPos[MAX_SUMMON_POS][4] =
  44. {
  45. {2728.12f, -3544.43f, 261.91f, 6.04f},
  46. {2729.05f, -3544.47f, 261.91f, 5.58f},
  47. {2728.24f, -3465.08f, 264.20f, 3.56f},
  48. {2704.11f, -3456.81f, 265.53f, 4.51f},
  49. {2663.56f, -3464.43f, 262.66f, 5.20f},
  50. };
  51.  
  52. /********
  53. ** Assad
  54. *********/
  55. class boss_assad: public CreatureScript
  56. {
  57. public:
  58. boss_assad() : CreatureScript("boss_assad") { }
  59.  
  60. struct boss_assadAI : public ScriptedAI
  61. {
  62. boss_assadAI(Creature * pCreature) : ScriptedAI(pCreature) {}
  63.  
  64. InstanceScript* pInstance;
  65. EventMap events;
  66.  
  67. void EnterCombat(Unit * /*who*/)
  68. {
  69. EnterPhaseGround();
  70. me->MonsterYell(SAY_AGGRO, 0, 0);
  71. }
  72.  
  73. void JustDied(Unit* /*killer*/)
  74. {
  75. me->MonsterYell(SAY_DEATH, 0, 0);
  76. summons.DespawnAll();
  77. }
  78.  
  79. void JustSummoned(Creature *summon)
  80. {
  81. if (summon->GetEntry() == NPC_SKYFALL_STAR)
  82. summon->AI()->AttackStart(me);
  83. summons.Summon(summon);
  84. }
  85.  
  86. void SummonStar(uint32 entry, uint32 num)
  87. {
  88. for (uint32 i = 0; i < num; ++i)
  89. {
  90. uint32 pos = rand()%MAX_SUMMON_POS;
  91. me->SummonCreature(entry, SummonPos[pos][0], SummonPos[pos][1], SummonPos[pos][2],
  92. SummonPos[pos][3], TEMPSUMMON_CORPSE_DESPAWN, 60000);
  93. }
  94. }
  95.  
  96. void EnterPhaseGround()
  97. {
  98. events.ScheduleEvent(EVENT_STORM, 50000);
  99. events.ScheduleEvent(EVENT_CLING, 60000);
  100. events.ScheduleEvent(EVENT_FIELD, 30000);
  101. events.ScheduleEvent(EVENT_CHAIN, 20000);
  102. events.ScheduleEvent(EVENT_SUMMON, 30000);
  103. events.ScheduleEvent(EVENT_SAY, 45000);
  104. }
  105.  
  106. void UpdateAI(const uint32 diff)
  107. {
  108. if (!UpdateVictim())
  109. return;
  110.  
  111. events.Update(diff);
  112.  
  113. while (uint32 eventId = events.ExecuteEvent())
  114. {
  115. switch(eventId)
  116. {
  117. case EVENT_SAY:
  118. me->MonsterYell(SAY_RANDOM, 0, 0);
  119. events.ScheduleEvent(EVENT_SAY, 45000);
  120. return;
  121. case EVENT_CLING:
  122. DoCastAOE(SPELL_CLING_H);
  123. events.ScheduleEvent(EVENT_CLING, 60000);
  124. return;
  125. case EVENT_FIELD:
  126. me->MonsterYell(SAY_CAST_FIELD, 0, 0);
  127. DoCast(me->getVictim(), SPELL_FIELD);
  128. events.ScheduleEvent(EVENT_FIELD, 30000);
  129. return;
  130. case EVENT_STORM:
  131. DoCast(me->getVictim(), SPELL_STORM);
  132. events.ScheduleEvent(EVENT_STORM, 50000);
  133. return;
  134. case EVENT_CHAIN:
  135. if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
  136. DoCast(DUNGEON_MODE(SPELL_CHAIN_N,SPELL_CHAIN_H));
  137. events.ScheduleEvent(EVENT_CHAIN, 20000);
  138. return;
  139. case EVENT_SUMMON:
  140. SummonStar(NPC_SKYFALL_STAR, 0, TEMPSUMMON_DEAD_DESPAWN);
  141. events.ScheduleEvent(EVENT_SUMMON, 30000);
  142. return;
  143. }
  144. }
  145. DoMeleeAttackIfReady();
  146. }
  147. };
  148.  
  149. CreatureAI* GetAI(Creature* creature) const
  150. {
  151. return new boss_assadAI(creature);
  152. }
  153. };
  154.  
  155. /**************
  156. ** Skyfall Star
  157. ***************/
  158. class mob_star: public CreatureScript
  159. {
  160. public:
  161. mob_star() : CreatureScript("mob_star") { }
  162.  
  163. struct mob_starAI : public ScriptedAI
  164. {
  165. mob_starAI(Creature * pCreature) : ScriptedAI(pCreature) {}
  166.  
  167. EventMap events;
  168.  
  169. void EnterCombat(Unit * /*who*/)
  170. {
  171. EnterPhaseGround();
  172. }
  173.  
  174. void EnterPhaseGround()
  175. {
  176. events.ScheduleEvent(EVENT_BARRAGE, 5000);
  177. }
  178.  
  179. void UpdateAI(const uint32 uiDiff)
  180. {
  181. if (!UpdateVictim())
  182. return;
  183.  
  184. events.Update(diff);
  185.  
  186. while (uint32 eventId = events.ExecuteEvent())
  187. {
  188. switch(eventId)
  189. {
  190. case EVENT_BARRAGE:
  191. if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
  192. DoCast(pTarget, DUNGEON_MODE(SPELL_BARRAGE_N,SPELL_BARRAGE_H))
  193. events.ScheduleEvent(EVENT_BARRAGE, 5000);
  194. return;
  195. }
  196. }
  197. }
  198. };
  199.  
  200. CreatureAI* GetAI(Creature* creature) const
  201. {
  202. return new mob_starAI(creature);
  203. }
  204. };
  205.  
  206. void AddSC_boss_assad()
  207. {
  208. new boss_assad();
  209. new mob_star();
  210. };
Add Comment
Please, Sign In to add comment