Advertisement
Rochet2

Some boss Thump

Jun 13th, 2012
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.72 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. #define NPC_TIRION_TOC              88888
  4. #define SPELL_SHADOWVOID            55847
  5. #define SPELL_UNHOLY_AURA           17467
  6. #define SPELL_UNHOLY_GROWTH         40545
  7. #define SPELL_SHADOWBOLTVOLLEY      55850
  8.  
  9. class npc_herold_toc1 : public CreatureScript
  10. {
  11. public:
  12.     npc_herold_toc1() : CreatureScript("npc_herold_toc1") { }
  13.  
  14.     CreatureAI* GetAI(Creature* pCreature) const
  15.     {
  16.         return new npc_herold_tocAI(pCreature);
  17.     }
  18.  
  19.     struct npc_herold_tocAI : public ScriptedAI
  20.     {
  21.         npc_herold_tocAI(Creature * creature) : ScriptedAI(creature), Summons(me) { }
  22.  
  23.         uint32 ShadowVoid_Timer;
  24.         uint32 Abomination_Timer;
  25.         uint32 Geist_Timer;
  26.         uint32 UnholyAura_Timer;
  27.         uint32 ShadowboltVolley_Timer;
  28.         uint32 Phase;
  29.  
  30.         bool checkTirion;
  31.         SummonList Summons;
  32.         TempSummon* tirion;
  33.  
  34.         void Reset()
  35.         {
  36.             ShadowVoid_Timer = 20000;
  37.             Abomination_Timer = 13000;
  38.             Geist_Timer = 10000;
  39.             UnholyAura_Timer = 14000;
  40.             ShadowboltVolley_Timer = 3000;
  41.             Phase = 1;
  42.  
  43.             checkTirion = true;
  44.             Summons.DespawnAll();
  45.             tirion = me->SummonCreature(88888, 581.993042f, 139.784531f, 394.92639f, 4.7f, TEMPSUMMON_MANUAL_DESPAWN, 0);
  46.         }
  47.  
  48.         void EnterCombat(Unit* /*who*/)
  49.         {
  50.             me->MonsterYell("The Scarlet Onslaught will triumph!", LANG_UNIVERSAL, NULL);
  51.         }
  52.  
  53.         void KilledUnit(Unit * who)
  54.         {
  55.             me->MonsterSay("You never stood a chance against me, Champion...", LANG_UNIVERSAL, me->GetGUID());
  56.         }
  57.  
  58.         void JustDied(Unit * killer)
  59.         {
  60.             Summons.DespawnAll();
  61.             tirion = NULL;
  62.         }
  63.  
  64.         void UpdateAI(const uint32 uiDiff)
  65.         {
  66.             if(!UpdateVictim())
  67.                 return;
  68.  
  69.             if(checkTirion)
  70.             {
  71.                 if(tirion && tirion->isDead())
  72.                 {
  73.                     me->MonsterSay("You are NOTHING without your precious leader, champions!", LANG_UNIVERSAL, me->GetGUID());
  74.                     me->AddAura(70711, me);
  75.  
  76.                     checkTirion = false;
  77.                 }
  78.             }
  79.  
  80.             if (me->GetHealthPct() < 50 && Phase == 1)
  81.             {
  82.                 Phase = 2;
  83.                 me->MonsterYell("You have hardly weakened me, Champions... you really don't stand a chance!", LANG_UNIVERSAL, NULL);
  84.             }
  85.  
  86.             if (Phase == 1)
  87.             {
  88.                 if (ShadowboltVolley_Timer <= uiDiff)
  89.                 {
  90.                     DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
  91.                     ShadowboltVolley_Timer = 8450;
  92.                 }
  93.                 else ShadowboltVolley_Timer -= uiDiff;
  94.  
  95.                 if (ShadowVoid_Timer <= uiDiff)
  96.                 {
  97.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  98.                         DoCast(target, SPELL_SHADOWVOID);
  99.  
  100.                     ShadowVoid_Timer = 13500;
  101.                 } else ShadowVoid_Timer -= uiDiff;
  102.  
  103.                 if (UnholyAura_Timer <= uiDiff)
  104.                 {
  105.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  106.                         DoCast(target, SPELL_UNHOLY_AURA);
  107.  
  108.                     UnholyAura_Timer = 7000;
  109.                 } else UnholyAura_Timer -= uiDiff;
  110.  
  111.                 if (Geist_Timer <= uiDiff)
  112.                 {
  113.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  114.                         me->SummonCreature(88889, 590.1231f, 139.784531f, 394.92639f, 4.7f, TEMPSUMMON_MANUAL_DESPAWN, 0);
  115.                     Geist_Timer = 8000;
  116.                 } else Geist_Timer -= uiDiff;
  117.  
  118.                 if (Abomination_Timer <= uiDiff)
  119.                 {
  120.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  121.                         me->SummonCreature(88890, 581.993042f, 145.784531f, 394.92639f, 4.7f, TEMPSUMMON_MANUAL_DESPAWN, 0);
  122.                     Abomination_Timer = 15000;
  123.                 } else Abomination_Timer -= uiDiff;
  124.  
  125.             }
  126.  
  127.             if (Phase == 2)
  128.             {
  129.                 if (ShadowboltVolley_Timer <= uiDiff)
  130.                 {
  131.                     DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
  132.                     ShadowboltVolley_Timer = 5450;
  133.                 }
  134.                 else ShadowboltVolley_Timer -= uiDiff;
  135.  
  136.                 if (ShadowVoid_Timer <= uiDiff)
  137.                 {
  138.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  139.                         DoCast(target, SPELL_SHADOWVOID);
  140.  
  141.                     ShadowVoid_Timer = 8000;
  142.                 } else ShadowVoid_Timer -= uiDiff;
  143.  
  144.                 if (UnholyAura_Timer <= uiDiff)
  145.                 {
  146.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  147.                         DoCast(target, SPELL_UNHOLY_AURA);
  148.  
  149.                     UnholyAura_Timer = 7000;
  150.                 } else UnholyAura_Timer -= uiDiff;
  151.  
  152.                 if (Geist_Timer <= uiDiff)
  153.                 {
  154.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  155.                         me->SummonCreature(88889, 590.1231f, 139.784531f, 394.92639f, 4.7f, TEMPSUMMON_MANUAL_DESPAWN, 0);
  156.                     Geist_Timer = 8000;
  157.                 } else Geist_Timer -= uiDiff;
  158.  
  159.                 if (Abomination_Timer <=uiDiff)
  160.                 {
  161.                     if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
  162.                         me->SummonCreature(88890, 581.993042f, 145.784531f, 394.92639f, 4.7f, TEMPSUMMON_MANUAL_DESPAWN, 0);
  163.                     Abomination_Timer = 12000;
  164.                 } else Abomination_Timer -= uiDiff;
  165.  
  166.             }
  167.             DoMeleeAttackIfReady();
  168.         }
  169.  
  170.         void JustSummoned(Creature * summoned)
  171.         {
  172.             summoned->AI()->AttackStart(me);
  173.             Summons.Summon(summoned);
  174.         }
  175.     };
  176. };
  177.  
  178.  
  179.  
  180. class npc_tirion_toc2 : public CreatureScript
  181. {
  182. public:
  183.     npc_tirion_toc2() : CreatureScript("npc_tirion_toc2") { }
  184.  
  185.     struct npc_tirion_tocAI : public ScriptedAI
  186.     {
  187.         npc_tirion_tocAI(Creature * c) : ScriptedAI(c) { }
  188.  
  189.         void Reset()
  190.         {
  191.             me->SetReactState(REACT_PASSIVE);
  192.             me->AddAura(9454, me);
  193.             me->AddAura(71706, me);
  194.         }
  195.  
  196.         void UpdateAI(const uint32 diff)
  197.         {
  198.             if(!UpdateVictim())
  199.                 return;
  200.         }
  201.     };
  202.  
  203.     CreatureAI * GetAI(Creature * pCreature) const
  204.     {
  205.         return new npc_tirion_tocAI(pCreature);
  206.     }
  207. };
  208.  
  209. class npc_abomination_toc3 : public CreatureScript
  210. {
  211. public:
  212.     npc_abomination_toc3() : CreatureScript("npc_abomination_toc3") { }
  213.  
  214.     CreatureAI * GetAI(Creature * pCreature) const
  215.     {
  216.         return new npc_abomination_tocAI(pCreature);
  217.     }
  218.  
  219.     struct npc_abomination_tocAI : public ScriptedAI
  220.     {
  221.         npc_abomination_tocAI(Creature * c) : ScriptedAI(c) { }
  222.  
  223.         void Reset()
  224.         {
  225.             me->SetReactState(REACT_PASSIVE);
  226.             me->AddAura(17467, me);
  227.         }
  228.  
  229.         void EnterCombat(Unit* /*who*/)
  230.         {
  231.             me->MonsterSay("Mpphhhrglrgl...", LANG_UNIVERSAL, NULL);
  232.         }
  233.  
  234.         void UpdateAI(const uint32 diff)
  235.         {
  236.             if(!UpdateVictim())
  237.                 return;
  238.  
  239.             if (Unit* victim = me->getVictim())
  240.                 if (victim->GetEntry() == NPC_TIRION_TOC)
  241.                     DoMeleeAttackIfReady();
  242.         }
  243.     };
  244. };
  245.  
  246.  
  247.  
  248. class npc_geist_toc4 : public CreatureScript
  249. {
  250. public:
  251.     npc_geist_toc4() : CreatureScript("npc_geist_toc4") { }
  252.  
  253.     CreatureAI * GetAI(Creature * pCreature) const
  254.     {
  255.         return new npc_geist_tocAI(pCreature);
  256.     }
  257.  
  258.     struct npc_geist_tocAI : public ScriptedAI
  259.     {
  260.         npc_geist_tocAI(Creature * c) : ScriptedAI(c) { }
  261.  
  262.         void Reset()
  263.         {
  264.             me->SetReactState(REACT_PASSIVE);
  265.         }
  266.  
  267.         void EnterCombat(Unit* /*who*/)
  268.         {
  269.             me->MonsterSay("Mmmmmm... Tirion flavoured...", LANG_UNIVERSAL, NULL);
  270.         }
  271.  
  272.         void UpdateAI(const uint32 diff)
  273.         {
  274.             if(!UpdateVictim())
  275.                 return;
  276.  
  277.             if (Unit* victim = me->getVictim())
  278.                 if (victim->GetEntry() == NPC_TIRION_TOC)
  279.                     DoMeleeAttackIfReady();
  280.         }
  281.     };
  282. };
  283.  
  284. void TestScript()
  285. {
  286.     new npc_herold_toc1;
  287.     new npc_tirion_toc2;
  288.     new npc_abomination_toc3;
  289.     new npc_geist_toc4;
  290. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement