Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.05 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2. //definice toho co bude boss rikat , nutne nahrat sql do DB
  3.  
  4. #define SAY_AGGRO                  -8388608
  5. #define SAY_CLONE                   -8388609
  6. #define SAY_KILL_PLAYER             -8388610
  7. // definice toho co boss bude  castit
  8. #define SPELL_BLADE_TEMPEST         75125
  9. #define SPELL_CLEAVE                40504
  10. #define SPELL_SUMMON_CLONE          74511
  11. #define SPELL_REPEPELING_WAVE       74509
  12. #define SPELL_ENERVATING_BRAND      74502
  13.  
  14.  
  15. class boss_Baltharus : public CreatureScript
  16. {
  17. public:
  18.  boss_Baltharus() : CreatureScript("boss_Baltharus") { }
  19.  
  20.     struct boss_BaltharusAI : public ScriptedAI
  21.     {
  22.         boss_BaltharusAI(Creature *c) : ScriptedAI(c) {}
  23.        
  24.         uint32 BladeTempest;
  25.         uint32 Cleave;
  26.         uint32 SummonClone;
  27.         uint32 RepepelingWave;
  28.         uint32 EnervatingBrand;
  29.         bool Clone;
  30.    
  31.         void Reset()
  32.         {
  33.        BladeTempest = 15000; //timer 1
  34.        Cleave = 40000; //zatim testovaci hodnota
  35.        SummonClone = 0; // tady je nula protoze to probehne pri 50% hp
  36.        RepepelingWave = 60000; //testovaci hodnota
  37.        EnervatingBrand = 90000;
  38.         }
  39.  
  40.         void EnterCombat(Unit* /*who*/)
  41.         {
  42.          Clone = false;
  43.          me->MonsterYell("Ah, the entertainment has arrived.", LANG_UNIVERSAL, NULL);
  44.         }
  45.  
  46.         void KilledUnit(Unit* /*victim*/)
  47.         {
  48.          me->MonsterYell("This world has enough heroes.", LANG_UNIVERSAL, NULL);
  49.         }
  50.  
  51.        
  52.        
  53.         void UpdateAI(const uint32 diff)
  54.         {
  55.                 if (!UpdateVictim())
  56.                     return;
  57.  
  58.             if (Cleave <= diff)
  59.             {
  60.                 DoCast(me->getVictim(), SPELL_CLEAVE , true);
  61.                 Cleave = 40000;
  62.             }
  63.             else
  64.                 Cleave -= diff;
  65.  
  66.             if (BladeTempest <= diff)
  67.             {
  68.                 DoCast(me->getVictim(), SPELL_BLADE_TEMPEST, true);
  69.                
  70.                 BladeTempest = 15000;
  71.             }
  72.             else
  73.                 BladeTempest -= diff;    
  74.  
  75.           if(HealthBelowPct(50) && !Clone)
  76.            {
  77.    
  78.              Clone = true;
  79.              DoCast(me->getVictim(), SPELL_SUMMON_CLONE, true);
  80.            
  81.  
  82.             }
  83.  
  84.               if (RepepelingWave <= diff)
  85.             {
  86.                 DoCast(me->getVictim(), SPELL_REPEPELING_WAVE, true);
  87.                
  88.                 RepepelingWave = 60000;
  89.             }
  90.             else
  91.                  RepepelingWave -= diff;    
  92.              
  93.               if (EnervatingBrand <= diff)
  94.             {
  95.                 DoCast(me->getVictim(), SPELL_ENERVATING_BRAND, true);
  96.                
  97.                 EnervatingBrand = 90000;
  98.             }
  99.             else
  100.                 EnervatingBrand -= diff;    
  101.  
  102.  
  103.             DoMeleeAttackIfReady(); //
  104.         }
  105.     };
  106.  
  107.  CreatureAI* GetAI(Creature* pCreature) const
  108.     {
  109.         return new boss_BaltharusAI (pCreature);
  110.     }
  111.  
  112. };
  113. void AddSC_boss_Baltharus()
  114. {
  115.     new boss_Baltharus();
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement