Advertisement
Rochet2

SomeBoss

May 6th, 2012
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.22 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. enum eNums
  4. {
  5.     SPELL_SOULSTORM = 68872,
  6.     SPELL_SHADOWBLAST = 70866,
  7.     SPELL_SHADOWBOLTVOLLEY = 55850,
  8.     SPELL_SHADOWVOID = 55847,
  9.     SPELL_RIBBONOFSOULS = 32422,
  10.     SPELL_TELEPORT = 68988
  11. };
  12.  
  13. #define EMOTE_GHOULS      "Tharaman begins to summon Unstable Voidwraiths!"
  14. #define EMOTE_REVEAL      "Tharaman reveals his true form!"
  15. #define EMOTE_INSIDE      "Tharaman begins to cast soulstorm. Run in!"
  16.  
  17. class boss_tharaman : public CreatureScript
  18. {
  19. public:
  20.     boss_tharaman() : CreatureScript("boss_tharaman"){}
  21.  
  22.     CreatureAI* GetAI_Example(Creature* pCreature) const
  23.     {
  24.         return new boss_tharamanAI(pCreature);
  25.     }
  26.     struct boss_tharamanAI : public ScriptedAI
  27.     {
  28.         boss_tharamanAI(Creature *c) : ScriptedAI(c) {}
  29.  
  30.         uint32 RibbonofSouls_Timer;
  31.         uint32 Soulstorm_Timer;
  32.         uint32 ShadowboltVolley_Timer;
  33.         uint32 ShadowVoid_Timer;
  34.         uint32 ShadowBlast_Timer;
  35.         uint32 Aod_Timer;
  36.         uint32 Phase;
  37.  
  38.         void Reset()
  39.         {
  40.             RibbonofSouls_Timer = 5000;
  41.             ShadowboltVolley_Timer = 10000;
  42.             ShadowVoid_Timer = 20000;
  43.             ShadowBlast_Timer = 0;
  44.             Soulstorm_Timer = 1000;
  45.             Aod_Timer = 2000;
  46.  
  47.             Phase = 0;
  48.         }
  49.  
  50.         void KilledUnit(Unit * /*victim*/)
  51.         {
  52.             me->MonsterYell("You cannot escape the clutch of the void!", LANG_UNIVERSAL, NULL);
  53.         }
  54.  
  55.         void JustDied(Unit * /*victim*/)
  56.         {
  57.             me->MonsterYell("Let the void...consume me...", LANG_UNIVERSAL, NULL);
  58.         }
  59.  
  60.         void EnterCombat(Unit * /*who*/)
  61.         {
  62.             me->MonsterYell("You fools. You think you can silence the void?", LANG_UNIVERSAL, NULL);
  63.         }
  64.  
  65.         void UpdateAI(const uint32 uiDiff)
  66.         {
  67.             if (!me->getVictim())
  68.                 return;
  69.  
  70.             if (!UpdateVictim())
  71.                 return;
  72.  
  73.             if (me->GetHealthPct() < 60 && Phase == 1)
  74.             {
  75.                 me->MonsterYell("Witness...Witness the power of the void!", LANG_UNIVERSAL, NULL);
  76.                 DoCast(me, SPELL_TELEPORT);
  77.                 me->MonsterTextEmote(EMOTE_INSIDE, 0, true);
  78.             }
  79.  
  80.             if (me->GetHealthPct() < 35 && Phase == 2)
  81.             {
  82.                 me->RemoveAurasDueToSpell(SPELL_SOULSTORM);
  83.                 me->SetDisplayId(19338);
  84.                 me->MonsterTextEmote(EMOTE_REVEAL, 0, true);
  85.                 me->MonsterYell("You know nothing... NOTHING of my limitless power!", LANG_UNIVERSAL, NULL);
  86.             }
  87.  
  88.  
  89.             if (Phase == 0)
  90.             {
  91.                 if (RibbonofSouls_Timer <=uiDiff)
  92.                 {
  93.                     DoCast(me->getVictim(), SPELL_RIBBONOFSOULS);
  94.                     RibbonofSouls_Timer = 5000;
  95.                 }
  96.                 else
  97.                 {
  98.                     RibbonofSouls_Timer -= uiDiff;
  99.                 }
  100.                 if (ShadowboltVolley_Timer <=uiDiff)
  101.                 {
  102.                     DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
  103.                     ShadowboltVolley_Timer = 12500;
  104.                 }
  105.                 else
  106.                 {
  107.                     ShadowboltVolley_Timer -= uiDiff;
  108.                 }
  109.                 if (ShadowVoid_Timer <= uiDiff)
  110.                 {
  111.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  112.                         DoCast(target, SPELL_SHADOWVOID);
  113.  
  114.                     ShadowVoid_Timer = 20000;  
  115.                 }
  116.                 else
  117.                 {
  118.                     ShadowVoid_Timer -= uiDiff;
  119.                 }
  120.                 if (RibbonofSouls_Timer <=uiDiff)
  121.                 {
  122.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  123.                         DoCast(target, SPELL_RIBBONOFSOULS);
  124.  
  125.                     RibbonofSouls_Timer = 5000;
  126.                 }
  127.                 else
  128.                 {
  129.                     RibbonofSouls_Timer -= uiDiff;
  130.                 }
  131.             }
  132.  
  133.             if (Phase == 1)
  134.             {
  135.                 if (ShadowBlast_Timer <= uiDiff)
  136.                 {
  137.                     DoCast(me->getVictim(), SPELL_SHADOWBLAST);
  138.                     ShadowBlast_Timer = 1000000;
  139.                 }
  140.                 else
  141.                 {
  142.                     ShadowBlast_Timer -= uiDiff;
  143.                 }
  144.                 if (Soulstorm_Timer <= uiDiff)
  145.                 {
  146.                     DoCast(me->getVictim(), SPELL_SOULSTORM);
  147.                     Soulstorm_Timer = 1000000;
  148.                 }
  149.                 else
  150.                 {
  151.                     Soulstorm_Timer -= uiDiff;
  152.                 }
  153.                 if (Aod_Timer <=uiDiff)
  154.                 {
  155.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  156.                         me->SummonCreature(18869, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 220000);
  157.                     me->MonsterSay("Rise and feed...", LANG_UNIVERSAL, NULL);
  158.                     Aod_Timer = 2000;
  159.                 }
  160.                 else
  161.                 {
  162.                     Aod_Timer -= uiDiff;
  163.                 }
  164.                 if (ShadowVoid_Timer <= uiDiff)
  165.                 {
  166.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  167.                         DoCast(target, SPELL_SHADOWVOID);
  168.  
  169.                     ShadowVoid_Timer = 20000;  
  170.                 }
  171.                 else
  172.                 {
  173.                     ShadowVoid_Timer -= uiDiff;
  174.                 }
  175.             }
  176.  
  177.             if (Phase == 2)
  178.             {
  179.                 if (RibbonofSouls_Timer <=uiDiff)
  180.                 {
  181.                     DoCast(me->getVictim(), SPELL_RIBBONOFSOULS);
  182.                     RibbonofSouls_Timer = 5000;
  183.                 }
  184.                 else
  185.                 {
  186.                     RibbonofSouls_Timer -= uiDiff;
  187.                 }
  188.                 if (ShadowboltVolley_Timer <=uiDiff)
  189.                 {
  190.                     DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
  191.                     ShadowboltVolley_Timer = 12500;
  192.                 }
  193.                 else
  194.                 {
  195.                     ShadowboltVolley_Timer -= uiDiff;
  196.                 }
  197.                 if (ShadowVoid_Timer <= uiDiff)
  198.                 {
  199.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  200.                         DoCast(target, SPELL_SHADOWVOID);
  201.  
  202.                     ShadowVoid_Timer = 20000;  
  203.                 }
  204.                 else
  205.                 {
  206.                     ShadowVoid_Timer -= uiDiff;
  207.                 }
  208.                 if (RibbonofSouls_Timer <=uiDiff)
  209.                 {
  210.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  211.                         DoCast(target, SPELL_RIBBONOFSOULS);
  212.  
  213.                     RibbonofSouls_Timer = 5000;
  214.                 }
  215.                 else
  216.                 {
  217.                     RibbonofSouls_Timer -= uiDiff;
  218.                 }
  219.  
  220.                 if (me->HasAura(SPELL_SOULSTORM))
  221.                     return;
  222.             }
  223.             DoMeleeAttackIfReady();
  224.         };
  225.     };
  226. };
  227.  
  228. void AddSC_boss_tharaman()
  229. {
  230.     new boss_tharaman();
  231. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement