Advertisement
cyphric

Trinity core boss script

May 20th, 2011
1,895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.28 KB | None | 0 0
  1. /*
  2.  
  3.  
  4. First script by cyphric! AKA, Anton Hagelberg
  5.  
  6.  
  7. */
  8.  
  9.  
  10. #include "ScriptPCH.h"
  11.  
  12. enum eNums
  13. {
  14.     SPELL_ICEARMOR = 36881,
  15.     SPELL_FROSTBOLT = 59251,
  16.     SPELL_FIREBOLT = 57628,
  17.         SPELL_REINCARNATION = 20608
  18. };
  19.  
  20. class Skeletal : public CreatureScript
  21. {
  22. public:
  23.     Skeletal() : CreatureScript("Skeletal"){}
  24.  
  25.     CreatureAI* GetAI_Example(Creature* pCreature) const
  26.     {
  27.         return new SkeletalAI(pCreature);
  28.     }
  29.  
  30.     struct SkeletalAI : public ScriptedAI
  31.     {
  32.         SkeletalAI(Creature *c) : ScriptedAI(c) {}
  33.  
  34.         uint32 Icearmor_Timer;
  35.         uint32 Frostbolt_Timer;
  36.         uint32 Firebolt_Timer;
  37.  
  38.         uint32 Phase;
  39.  
  40.         void Reset()
  41.         {
  42.           Icearmor_Timer = 0;
  43.           Frostbolt_Timer = 0;
  44.           Firebolt_Timer = 5000;
  45.  
  46.           Phase = 1;
  47.         }
  48.        
  49.         void KilledUnit(Unit *)
  50.         {
  51.             me->MonsterYell("Hahaha, one down!", LANG_UNIVERSAL, NULL)
  52.         }
  53.  
  54.         void JustDied(Unit *)
  55.         {
  56.             me->MonsterYell("This ain't over yet!", LANG_UNIVERSAL, NULL)
  57.                         me->GetMaxHealth()*100 / me->GetMaxHealth()) <= 0)
  58.             if GetMaxHealth = 0 DoCast(me, SPELL_REINCARNATION);
  59.         }
  60.  
  61.         void EnterCombat(Unit *)
  62.         {
  63.             me->MonsterYell("How dare you defile my sleep?!", LANG_UNIVERSAL, NULL)
  64.         }
  65.  
  66.         void UpdateAI(const uint32 uiDiff)
  67.         {
  68.             if (!me->getVictim())
  69.             {
  70.                 if (Icearmor_Timer <= uidiff)
  71.                 {
  72.                     DoCast(me, SPELL_ICEARMOR);
  73.                     IceArmor_Timer = 18000000;
  74.                 }
  75.                 else
  76.                     IceArmor_Timer -= uiDiff;
  77.             }
  78.            
  79.  
  80.             if(!UpdateVictim())
  81.                 return;
  82.  
  83.             if (((me->GetMaxHealth()*100 / me->GetMaxHealth()) < 55) && (Phase == 1))
  84.             {
  85.                 Phase = 2;
  86.             }
  87.  
  88.             if (Phase == 1)
  89.             {
  90.  
  91.             if(Frostbolt_Timer <= uiDiff)
  92.             {
  93.                 DoCast(me->getVictim(), SPELL_FROSTBOLT);
  94.                 Frostbolt_Timer = 3000;
  95.             }
  96.             else
  97.                 Frostbolt_Timer -= uiDiff;
  98.            
  99.             if(Fireball_Timer <= uiDiff)
  100.             {
  101.                 if (Unit * pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
  102.                                      DoCast(pTarget, SPELL_FIREBAlL);
  103.            
  104.                 Fireball_Timer = 10000;
  105.             }
  106.             else
  107.                 Fireball_Timer -= uiDiff
  108.             }
  109.  
  110.             if (Phase == 2)
  111.             {
  112.                 if(Fireball_Timer <= uiDiff)
  113.                 {
  114.                     DoCast(me->getVictim(), SPELL_FIREBALL);
  115.                     Fireball_Timer = 3000;
  116.  
  117.                 }
  118.                 else
  119.                     Fireball_Timer -= uiDiff;
  120.             }
  121.             DoMeleeAttackIfReady();
  122.         }
  123.     };
  124. };
  125.  
  126. void AddSC_Skeletal()
  127. {
  128.     new Skeletal();
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement