Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. #define EMOTE_FRENZY -1409001
  4.  
  5. #define SPELL_FRENZY 19451
  6. #define SPELL_MAGMASPIT 19449 //This is actually a buff he gives himself
  7. #define SPELL_PANIC 19408
  8. #define SPELL_BLASTNOVA 30616
  9. #define SPELL_LAVABOMB_ALT 19428 //This is the spell that the lava bomb casts
  10.  
  11. #define EMOTE_BLASTNOVA -1544013
  12.  
  13. struct boss_magmadarAI : public ScriptedAI
  14. {
  15. boss_magmadarAI(Creature *c) : ScriptedAI(c) {}
  16.  
  17. uint32 Frenzy_Timer;
  18. uint32 Panic_Timer;
  19. uint32 Lavabomb_Timer;
  20. uint32 BlastNova_Timer;
  21.  
  22. void Reset()
  23. {
  24. Frenzy_Timer = 30000;
  25. Panic_Timer = 20000;
  26. BlastNova_Timer = 60000;
  27. Lavabomb_Timer = 12000;
  28.  
  29. DoCast(me, SPELL_MAGMASPIT, true);
  30. }
  31.  
  32. void EnterCombat(Unit * /*who*/)
  33. {
  34. }
  35.  
  36. void UpdateAI(const uint32 diff)
  37. {
  38. if (!UpdateVictim())
  39. return;
  40.  
  41. //Frenzy_Timer
  42. if (Frenzy_Timer <= diff)
  43. {
  44. DoScriptText(EMOTE_FRENZY, me);
  45. DoCast(me, SPELL_FRENZY);
  46. Frenzy_Timer = 15000;
  47. } else Frenzy_Timer -= diff;
  48.  
  49. //Panic_Timer
  50. if (Panic_Timer <= diff)
  51. {
  52. DoCastVictim( SPELL_PANIC);
  53. Panic_Timer = 35000;
  54. } else Panic_Timer -= diff;
  55.  
  56. if (BlastNova_Timer <= diff)
  57. {
  58. // to avoid earthquake interruption
  59. if (!me->hasUnitState(UNIT_STAT_STUNNED))
  60. {
  61. DoScriptText(EMOTE_BLASTNOVA, me);
  62. DoCast(me, SPELL_BLASTNOVA);
  63. BlastNova_Timer = 60000;
  64. }
  65. } else BlastNova_Timer -= diff;
  66.  
  67. //Lavabomb_Timer
  68. if (Lavabomb_Timer <= diff)
  69. {
  70. if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
  71. DoCast(pTarget, SPELL_LAVABOMB_ALT);
  72.  
  73. Lavabomb_Timer = 12000;
  74. } else Lavabomb_Timer -= diff;
  75.  
  76. DoMeleeAttackIfReady();
  77. }
  78. };
  79. CreatureAI* GetAI_boss_magmadar(Creature* pCreature)
  80. {
  81. return new boss_magmadarAI (pCreature);
  82. }
  83.  
  84. void AddSC_boss_magmadar()
  85. {
  86. Script *newscript;
  87. newscript = new Script;
  88. newscript->Name = "boss_magmadar";
  89. newscript->GetAI = &GetAI_boss_magmadar;
  90. newscript->RegisterSelf();
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement