midoking

Boss Script 2

Jan 12th, 2013
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.11 KB | None | 0 0
  1. /*
  2. http://www.ac-web.org/forums/showthread.php?156428-Custom-Boss-c
  3. * Made By Ghostcrawler336 From www.ac-web.org
  4. */
  5. /* ScriptData
  6. SDName: Custom_Boss
  7. SD%Complete: %60
  8. EndScriptData */    
  9.      
  10. #include "ScriptPCH.h"
  11.      
  12. enum Yells
  13. {
  14.     SAY_AGGRO                   = -1603278,
  15.     SAY_ENRAGE                  = -1189002,
  16.     SAY_KILL                    = -1189003
  17. };
  18.  
  19. enum Emotes
  20. {
  21.     EMOTE_ENRAGE                = -1189004
  22. };
  23.  
  24. enum Spells
  25. {
  26.     SPELL_RUSHINGCHARGE         = 8260,
  27.     SPELL_BARKSKIN              =22812,
  28.     SPELL_MANGLE                =48566,
  29.     SPELL_RAKE                  =1822,
  30.     SPELL_MOONKIN               =62795,
  31.     SPELL_FRENZY                = 8269,
  32.     SPELL_CAT_FORM              =768
  33. };
  34.      
  35. class Custom_Boss : public CreatureScript
  36. {
  37. public:
  38.    Custom_Boss() : CreatureScript("Custom_Boss") { }
  39.  
  40.     CreatureAI* GetAI(Creature* creature) const
  41.     {
  42.         return new Custom_BossAI(creature);
  43.     }
  44.  
  45.     struct Custom_BossAI : public ScriptedAI
  46.     {
  47.         Custom_BossAI(Creature* creature) : ScriptedAI(creature) {}
  48.  
  49.         bool Enrage;
  50.  
  51.         uint32 BARKSKIN_Timer;
  52.         uint32 MANGLE_Timer;
  53.         uint32 RAKE_Timer;
  54.        
  55.         void Reset()
  56.         {
  57.             Enrage = false;
  58.            BARKSKIN_Timer = 25000;
  59.            MANGLE_Timer = 3000;
  60.            RAKE_Timer = 6000;
  61.            
  62.  }
  63.  
  64.  
  65.                 void EnterCombat(Unit* /*who*/)
  66.         {
  67.            DoScriptText(SAY_AGGRO, me);
  68.             DoCast(me, SPELL_RUSHINGCHARGE);
  69.             DoCast(me, SPELL_CAT_FORM);
  70.         }
  71.  
  72.          void KilledUnit(Unit* /*victim*/)
  73.          {
  74.              DoScriptText(SAY_AGGRO, me);
  75.              DoScriptText(SAY_KILL, me);
  76.          }
  77.          
  78.                  void UpdateAI(const uint32 diff)
  79.         {
  80.             if (!UpdateVictim())
  81.                 return;
  82.  
  83.             //If we are <25% hp goes Enraged
  84.             if (!Enrage && !HealthAbovePct(25) && !me->IsNonMeleeSpellCasted(false))
  85.             {
  86.                 DoScriptText(EMOTE_ENRAGE, me);
  87.                 DoCast(me, SPELL_FRENZY);
  88.                 Enrage = true;
  89.             }
  90.            
  91.         //If we are <60% hp goes MoonKin
  92.             if (!HealthAbovePct(60) && !me->IsNonMeleeSpellCasted(false))
  93.             {
  94.                 DoCast(me, SPELL_MOONKIN);
  95.             }
  96.  
  97.             //BARKSKIN_Timer
  98.             if (BARKSKIN_Timer <= diff)
  99.             {
  100.                 DoCast(me->getVictim(), SPELL_BARKSKIN);
  101.                 BARKSKIN_Timer = 9000;
  102.             }
  103.             else BARKSKIN_Timer -= diff;
  104.  
  105.             // MANGLE_Timer
  106.             if (MANGLE_Timer <= diff)
  107.             {
  108.                 DoCast(me->getVictim(), SPELL_MANGLE);
  109.                 MANGLE_Timer = 3000;
  110.             }
  111.             else MANGLE_Timer -= diff;
  112.            
  113.               DoMeleeAttackIfReady();
  114.              
  115.              
  116.              
  117.               // RAKE_Timer
  118.             if (RAKE_Timer <= diff)
  119.             {
  120.                 DoCast(me->getVictim(), SPELL_RAKE);
  121.                 RAKE_Timer = 4000;
  122.             }
  123.             else RAKE_Timer -= diff;
  124.  
  125.             DoMeleeAttackIfReady();
  126.  
  127.            
  128.         }
  129.     };
  130. };
  131.  
  132. void AddSC_Custom_Boss()
  133. {
  134.     new Custom_Boss();
  135. }
Advertisement
Add Comment
Please, Sign In to add comment