kusanagy

custom_bosses

Oct 15th, 2016
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 26.38 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. enum LikantropoSpells
  4. {
  5.     ENRAGE = 48138,
  6.     FRENZY = 48142,
  7.     MORTAL_WOUND = 59265,
  8.     WORGEN_BITE = 55266,
  9.     WORGEN_CALL = 53095,
  10.     DECREPIT_FEVER = 54098,
  11.     //SUMMON_WORGEN = 27020
  12. };
  13.  
  14. // Likantropo yells
  15. #define SAY_LIKANTROPO_AGGRO "Invasores! Seréis mis esclavos"
  16. #define SAY_LIKANTROPO_SLAY "Me estoy enojando"
  17. #define SAY_LIKANTROPO_DEATH "Nooooo! Esto es imposible ..."
  18. #define SAY_LIKANTROPO_MORPH "¿No te vas a arrepentir?"
  19.  
  20. enum LavaBoostSpells
  21. {
  22.     HEALING_WAVE = 51586,
  23.     LIGHTNING_BOLT = 59024,
  24.     BLOODLUST = 41185,
  25.     LIGHTNING_SHIELD = 59025,
  26.     SUMMON_AIR_ELEMENTAL = 30418,
  27.     LAVA_BURST = 59519,
  28.     CHAIN_LIGHTNING = 54531,
  29.     FLAME_SHOCK = 43303,
  30.     EARTH_SHOCK = 43305,
  31.     LIGHTNING_RING = 59848
  32. };
  33.  
  34. // Lava Boost yells
  35. #define SAY_LAVA_AGGRO "¿Te atreves a desafiar la furia de los elementos?"
  36. #define SAY_LAVA_SLAY "Impactante!"
  37. #define SAY_LAVA_DEATH "Naturaleza... ¿Por qué me dejaste?"
  38. #define SAY_LAVA_BLOOD "Sed de sangre!"
  39.  
  40. enum QuelNagasSpells
  41. {
  42.     SPELL_MAGIC_BARRIER = 38112,
  43.     SPELL_TOXIC_SPORES = 38575,
  44.     TOXIC_SPORES_TRIGGER = 22207,
  45.     SUMMONED_MURLOC = 27649,
  46.     SPELL_POISON_BOLT_VOLLEY = 54098,
  47.     SPELL_ENTANGLE = 38316,
  48.     SPELL_WRATH = 20698
  49. };
  50.  
  51. // Quel'Nagas yells
  52. #define SAY_NAGAS_AGGRO "Váis a mirar hacia el abismo!"
  53. #define SAY_NAGAS_SLAY "¿Sabes mantener el ritmo?"
  54. #define SAY_NAGAS_DEATH "No puedo creerlo!"
  55. #define SAY_NAGAS_SUMMON "Murlocs!"
  56.  
  57. enum SylvanasSpells
  58. {
  59.     SPELL_MULTISHOT = 40872,
  60.     SPELL_VOLLEY = 38633,
  61.     SUMMONED_SNAKE = 29444,
  62.     SPELL_BOLT_VOLLEY = 34780,
  63.     SPELL_BEWITCHING_AURA = 29486,
  64.     SPELL_REJUVENATION = 71142,
  65.     SPELL_ICE_TRAP = 71249,
  66.     SPELL_AURA_ROT = 25818
  67. };
  68.  
  69. // Might of Sylvanas yells
  70. #define SAY_SYLVANAS_AGGRO "El Quel'dorei nunca perecerá!"
  71. #define SAY_SYLVANAS_SLAY "Shorel'aran!"
  72. #define SAY_SYLVANAS_DEATH "Volveré!"
  73. #define SAY_SYLVANAS_ICE "¿Un poco complaciente de la muerte?"
  74.  
  75. enum TrollzillaSpells
  76. {
  77.     SPELL_FRENZY = 28131,
  78.     SPELL_CLEAVE = 33480,
  79.     SPELL_FIRE_SHIELD = 30513,
  80.     SPELL_WAR_STOMP = 56427,
  81.     SUMMON_FIRE_ELEMENTAL = 30416
  82. };
  83.  
  84. // Trollzilla yells
  85. #define SAY_TROLLZILLA_AGGRO "Yo ... tú ... destruir ..."
  86. #define SAY_TROLLZILLA_SLAY "Hakkar Fr ... vosotros ... "
  87. #define SAY_TROLLZILLA_DEATH "Hakk ... aaaa ... rrr .... "
  88. #define SAY_TROLLZILLA_FRENZY "Yo ... lentamente ... enojado!"
  89.  
  90. enum PerotharnSpells
  91. {
  92.     STORM_OF_GRIEF = 59772,
  93.     SHADOW_BURST = 34436,
  94.     PIERCING_SHADOW = 36698,
  95.     SHADOW_FLAME = 22539,
  96.     HARVEST_SOUL = 28679,
  97.     SHADOW_BOLT = 41957
  98. };
  99.  
  100. // Perotharn yells
  101. #define SAY_PEROTHARN_AGGRO "Vas a ver como te convierto en un regalo!"
  102. #define SAY_PEROTHARN_SLAY "Pronto serás uno de nosotros!"
  103. #define SAY_PEROTHARN_DEATH "Maestro ... perdóname ... te he fallado"
  104. #define SAY_PEROTHARN_SOUL "Maestro, aquí vienen sus almas!"
  105.  
  106. enum UznamSpells
  107. {
  108.     EARTHQUAKE = 46240,
  109.     WHIRLWIND = 52027,
  110.     SHOCK_OF_SORROW = 50760,
  111.     ENTROPIC_AURA = 36784,
  112.     AURAL_SHOCK = 14538
  113. };
  114.  
  115. // Uznam yells
  116. #define SAY_UZNAM_AGGRO "¿Quién ha profanado mi santuario?"
  117. #define SAY_UZNAM_SLAY "Usted fue un trofeo digno, eh!."
  118. #define SAY_UZNAM_DEATH "He resucitado? Parece que aun siento sangre por mis venas"
  119. #define SAY_UZNAM_SPECIAL "Estoy un poco cansado..."
  120. #define EMOTE_WHIRL "Los estómagos empiezan a atormentarse!"
  121.  
  122.  
  123. /*#########
  124. # Likantropo
  125. #########*/
  126.  
  127. class npc_likantropo : public CreatureScript
  128. {
  129. public:
  130.     npc_likantropo() : CreatureScript("npc_likantropo") { }
  131.  
  132.     CreatureAI* GetAI(Creature* pCreature) const
  133.     {
  134.         return new npc_likantropoAI (pCreature);
  135.     }
  136.  
  137.     struct npc_likantropoAI : public ScriptedAI
  138.     {
  139.         npc_likantropoAI(Creature *pCreature) : ScriptedAI(pCreature){}
  140.  
  141.         uint32 EnrageTimer;
  142.         uint32 WoundTimer;
  143.         uint32 BiteTimer;
  144.         uint32 FeverTimer;
  145.         bool Enraged;
  146.         bool Worgen;
  147.  
  148.         void Reset()
  149.         {
  150.             me->RestoreDisplayId();
  151.             EnrageTimer = 15000;
  152.             WoundTimer = 5000;
  153.             BiteTimer = 45000;
  154.             FeverTimer = 12000;
  155.             Enraged = false;
  156.             Worgen = false;
  157.         }
  158.  
  159.         void EnterCombat(Unit* /*who*/)
  160.         {
  161.             me->Yell(SAY_LIKANTROPO_AGGRO, LANG_UNIVERSAL, 0);
  162.         }
  163.  
  164.         void KilledUnit(Unit* victim)
  165.         {
  166.             me->Yell(SAY_LIKANTROPO_SLAY, LANG_UNIVERSAL, 0);
  167.             // In caso di morte di un pg, evoca un worgen dal suo corpo <3 ale
  168.            // if (victim->GetTypeId() == TYPEID_PLAYER)
  169.                // victim->SummonCreature(SUMMON_WORGEN, victim->GetPositionX(), victim->GetPositionY(), victim->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
  170.         }
  171.  
  172.         void JustDied(Unit* /*killer*/)
  173.         {
  174.             me->Yell(SAY_LIKANTROPO_DEATH, LANG_UNIVERSAL, 0);
  175.             me->RestoreDisplayId();
  176.         }
  177.  
  178.         void UpdateAI(uint32 diff)
  179.         {
  180.             if (!UpdateVictim())
  181.                 return;
  182.  
  183.             // Piccoli Enrage (durata 8 secondi) che raddoppiano il danno ogni 20 sec circa
  184.             if (EnrageTimer <= diff)
  185.             {
  186.                 DoCast(me, ENRAGE);
  187.                 EnrageTimer = urand(20000,25000);
  188.             } else EnrageTimer -= diff;
  189.  
  190.             // Ogni 5 sec applica uno stack di wound che riduce del 5% le cure (max 15 stack)
  191.             if (WoundTimer <= diff)
  192.             {
  193.                 DoCast(me->GetVictim(), MORTAL_WOUND);
  194.                 WoundTimer = 5000;
  195.             } else WoundTimer -= diff;
  196.  
  197.             // Ogni 20 sec applica un disease che riduce del 50% gli hp e fa 3k ogni 3 sec per 21 sec
  198.             if (FeverTimer <= diff)
  199.             {
  200.                 DoCastAOE(DECREPIT_FEVER);
  201.                 FeverTimer = 20000;
  202.             } else FeverTimer -= diff;
  203.  
  204.             // Ogni 45 secondi Whirlwind che colpisce ad area facendo il danno normale
  205.             // e contemporaneamente trasforma un target a caso in Worgen, disattivandogli le spell
  206.             if (BiteTimer <= diff)
  207.             {
  208.                 DoCast(me, WORGEN_BITE);
  209.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1))
  210.                     me->AddAura(WORGEN_CALL, pTarget);
  211.                 BiteTimer = 45000;
  212.             } else BiteTimer -= diff;
  213.  
  214.             // Ad 80% hp si trasforma in Worgen
  215.             if (HealthBelowPct(80) && !Worgen)
  216.             {
  217.                 me->SetDisplayId(26787);
  218.                 me->Yell(SAY_LIKANTROPO_MORPH, LANG_UNIVERSAL, 0);
  219.                 DoCast(me, ENRAGE);
  220.                 EnrageTimer = urand(25000,35000);
  221.                 Worgen = true;
  222.             }
  223.  
  224.             // Enrage a 15% di vita (aumenta 50% attack speed e 50% damage)
  225.             if (HealthBelowPct(15) && !Enraged)
  226.             {
  227.                 DoCast(me, FRENZY);
  228.                 Enraged = true;
  229.             }
  230.  
  231.             DoMeleeAttackIfReady();
  232.         }
  233.     };
  234.  
  235. };
  236.  
  237.  
  238. /*#########
  239. # Lava Boost
  240. #########*/
  241.  
  242. class npc_lava_boost : public CreatureScript
  243. {
  244. public:
  245.     npc_lava_boost() : CreatureScript("npc_lava_boost") { }
  246.  
  247.     CreatureAI* GetAI(Creature* pCreature) const
  248.     {
  249.         return new npc_lava_boostAI (pCreature);
  250.     }
  251.  
  252.     struct npc_lava_boostAI : public ScriptedAI
  253.     {
  254.         npc_lava_boostAI(Creature *pCreature) : ScriptedAI(pCreature){}
  255.  
  256.         uint32 ChainTimer;
  257.         uint32 LavaTimer;
  258.         uint32 FlameTimer;
  259.         uint32 ShockTimer;
  260.         bool Haste;
  261.         bool Healed;
  262.  
  263.         void Reset()
  264.         {
  265.             ChainTimer = 8000;
  266.             LavaTimer = 15000;
  267.             FlameTimer = 4000;
  268.             ShockTimer = 20000;
  269.             Haste = false;
  270.             Healed = false;
  271.         }
  272.  
  273.         void EnterCombat(Unit* /*who*/)
  274.         {
  275.             me->Yell(SAY_LAVA_AGGRO, LANG_UNIVERSAL, 0);
  276.         }
  277.  
  278.         void KilledUnit(Unit* victim)
  279.         {
  280.             me->Yell(SAY_LAVA_SLAY, LANG_UNIVERSAL, 0);
  281.         }
  282.  
  283.         void JustDied(Unit* /*killer*/)
  284.         {
  285.             me->Yell(SAY_LAVA_DEATH, LANG_UNIVERSAL, 0);
  286.         }
  287.  
  288.         void UpdateAI(uint32 diff)
  289.         {
  290.             if (!UpdateVictim())
  291.                 return;
  292.  
  293.             // Chain Lightning ogni 10/15 sec
  294.             if (ChainTimer <= diff)
  295.             {
  296.                 me->InterruptNonMeleeSpells(false);
  297.                 DoCast(me->GetVictim(), CHAIN_LIGHTNING);
  298.                 ChainTimer = urand(10000,15000);
  299.             } else ChainTimer -= diff;
  300.  
  301.             // Ogni 15 sec casta Lava Burst su un target random da 8/10k
  302.             if (LavaTimer <= diff)
  303.             {
  304.                 me->InterruptNonMeleeSpells(false);
  305.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1))
  306.                     DoCast(pTarget, LAVA_BURST);
  307.                 DoCast(me, LIGHTNING_SHIELD);
  308.                 LavaTimer = 15000;
  309.             } else LavaTimer -= diff;
  310.  
  311.             // Ogni 20 sec casta Earth Shock su un target random
  312.             if (ShockTimer <= diff)
  313.             {
  314.                 me->InterruptNonMeleeSpells(false);
  315.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1))
  316.                     DoCast(pTarget, EARTH_SHOCK);
  317.                 DoCast(me, LIGHTNING_RING);
  318.                 ShockTimer = 20000;
  319.             } else ShockTimer -= diff;
  320.  
  321.             // Ogni 12 sec applica Flame Shock sul tank
  322.             if (FlameTimer <= diff)
  323.             {
  324.                 me->InterruptNonMeleeSpells(false);
  325.                 DoCast(me->GetVictim(), FLAME_SHOCK);
  326.                 FlameTimer = 12000;
  327.             } else FlameTimer -= diff;
  328.  
  329.             // A 25% hp si cura con Healing Wave (solo una volta)
  330.             if (HealthBelowPct(25) && !Healed)
  331.             {
  332.                 me->InterruptNonMeleeSpells(false);
  333.                 DoCast(me, HEALING_WAVE);
  334.                 ChainTimer = 8000;
  335.                 LavaTimer = 10000;
  336.                 FlameTimer = 4000;
  337.                 ShockTimer = 15000;
  338.                 Healed = true;
  339.             }
  340.  
  341.             // Bloodlust a 50% di vita e Summon Air Elemental
  342.             if (HealthBelowPct(50) && !Haste)
  343.             {
  344.                 me->InterruptNonMeleeSpells(false);
  345.                 DoCast(me, BLOODLUST);
  346.                 me->Yell(SAY_LAVA_BLOOD, LANG_UNIVERSAL, 0);
  347.                 me->SummonCreature(SUMMON_AIR_ELEMENTAL, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
  348.                 Haste = true;
  349.             }
  350.  
  351.             DoSpellAttackIfReady(LIGHTNING_BOLT);
  352.         }
  353.     };
  354.  
  355. };
  356.  
  357.  
  358. /*#########
  359. # Quel'Nagas
  360. #########*/
  361.  
  362. class npc_quel_nagas : public CreatureScript
  363. {
  364. public:
  365.     npc_quel_nagas() : CreatureScript("npc_quel_nagas") { }
  366.  
  367.     CreatureAI* GetAI(Creature* pCreature) const
  368.     {
  369.         return new npc_quel_nagasAI (pCreature);
  370.     }
  371.  
  372.     struct npc_quel_nagasAI : public ScriptedAI
  373.     {
  374.         npc_quel_nagasAI(Creature *pCreature) : ScriptedAI(pCreature){}
  375.  
  376.         uint32 Phase2Timer;
  377.         uint32 Phase1Timer;
  378.         uint32 SporeTimer;
  379.         uint32 PoisonTimer;
  380.         uint32 RootTimer;
  381.         bool Phase1;
  382.  
  383.         void Reset()
  384.         {
  385.             Phase2Timer = 60000;
  386.             Phase1Timer = 90000;
  387.             SporeTimer = 6000;
  388.             PoisonTimer = 15000;
  389.             RootTimer = 25000;
  390.             Phase1 = true;
  391.         }
  392.  
  393.         void EnterCombat(Unit* /*who*/)
  394.         {
  395.             me->Yell(SAY_NAGAS_AGGRO, LANG_UNIVERSAL, 0);
  396.         }
  397.  
  398.         void KilledUnit(Unit* victim)
  399.         {
  400.             me->Yell(SAY_NAGAS_SLAY, LANG_UNIVERSAL, 0);
  401.         }
  402.  
  403.         void JustDied(Unit* /*killer*/)
  404.         {
  405.             me->Yell(SAY_NAGAS_DEATH, LANG_UNIVERSAL, 0);
  406.         }
  407.  
  408.         void UpdateAI(uint32 diff)
  409.         {
  410.             if (!UpdateVictim())
  411.                 return;
  412.  
  413.             // Summon Phase
  414.             if (Phase2Timer <= diff)
  415.             {
  416.                 Phase1 = false;
  417.                 me->InterruptNonMeleeSpells(false);
  418.                 me->SetReactState(REACT_PASSIVE);
  419.                 me->AttackStop();
  420.                 me->RemoveAllAuras();
  421.                 // In Fase 2 evoca 3 Murloc
  422.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0))
  423.                     for (uint8 i = 1; i <= 3; i++)
  424.                     {
  425.                         me->SummonCreature(SUMMONED_MURLOC, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
  426.                     }
  427.                 me->AddAura(SPELL_MAGIC_BARRIER, me);
  428.                 me->Yell(SAY_NAGAS_SUMMON, LANG_UNIVERSAL, 0);
  429.                 Phase2Timer = 90000;
  430.             } else Phase2Timer -= diff;
  431.  
  432.             // Normal Phase
  433.             if (Phase1Timer <= diff)
  434.             {
  435.                 Phase1 = true;
  436.                 me->InterruptNonMeleeSpells(false);
  437.                 me->SetReactState(REACT_AGGRESSIVE);
  438.                 me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
  439.                 DoZoneInCombat();
  440.                 if (me->getThreatManager().isThreatListEmpty())
  441.                     EnterEvadeMode();
  442.                 Phase1Timer = 90000;
  443.             } else Phase1Timer -= diff;
  444.  
  445.             if (Phase1)
  446.             {
  447.                 // Ogni 15 sec lancia una spora velenosa ai piedi di un player random
  448.                 if (SporeTimer <= diff)
  449.                 {
  450.                     me->InterruptNonMeleeSpells(false);
  451.                     if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
  452.                     {
  453.                         Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
  454.                         if (trig)
  455.                         {
  456.                             trig->setFaction(14);
  457.                             trig->CastSpell(trig, SPELL_TOXIC_SPORES,true);
  458.                         }
  459.                     }
  460.                     SporeTimer = 15000;
  461.                 } else SporeTimer -= diff;
  462.  
  463.                 // Poison ad area ogni 10 sec
  464.                 if (PoisonTimer <= diff)
  465.                 {
  466.                     me->InterruptNonMeleeSpells(false);
  467.                     DoCastAOE(SPELL_POISON_BOLT_VOLLEY);
  468.                     PoisonTimer = 10000;
  469.                 } else PoisonTimer -= diff;
  470.  
  471.                 // Radici su un target random ogni 25 sec
  472.                 if (RootTimer <= diff)
  473.                 {
  474.                     me->InterruptNonMeleeSpells(false);
  475.                     if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
  476.                         DoCast(pTarget, SPELL_ENTANGLE);
  477.                     RootTimer = 25000;
  478.                 } else RootTimer -= diff;
  479.             }
  480.  
  481.             DoSpellAttackIfReady(SPELL_WRATH);
  482.         }
  483.     };
  484.  
  485. };
  486.  
  487.  
  488. /*#########
  489. # Might of Sylvanas
  490. #########*/
  491.  
  492. class npc_might_of_sylvanas : public CreatureScript
  493. {
  494. public:
  495.     npc_might_of_sylvanas() : CreatureScript("npc_might_of_sylvanas") { }
  496.  
  497.     CreatureAI* GetAI(Creature* pCreature) const
  498.     {
  499.         return new npc_might_of_sylvanasAI (pCreature);
  500.     }
  501.  
  502.     struct npc_might_of_sylvanasAI : public ScriptedAI
  503.     {
  504.         npc_might_of_sylvanasAI(Creature *pCreature) : ScriptedAI(pCreature){}
  505.  
  506.         uint32 MultiTimer;
  507.         uint32 VolleyTimer;
  508.         uint32 SnakeTimer;
  509.         uint32 PoisonTimer;
  510.         uint32 TrapTimer;
  511.         uint32 HealTimer;
  512.         bool Haste;
  513.         bool Healed;
  514.  
  515.         void Reset()
  516.         {
  517.             MultiTimer = 2000;
  518.             VolleyTimer = 15000;
  519.             SnakeTimer = 5000;
  520.             PoisonTimer = 12000;
  521.             TrapTimer = 20000;
  522.             HealTimer = 25000;
  523.             Haste = false;
  524.             Healed = false;
  525.         }
  526.  
  527.         void EnterCombat(Unit* /*who*/)
  528.         {
  529.             me->Yell(SAY_SYLVANAS_AGGRO, LANG_UNIVERSAL, 0);
  530.             me->AddAura(SPELL_BEWITCHING_AURA, me);
  531.             me->AddAura(SPELL_AURA_ROT, me);
  532.         }
  533.  
  534.         void KilledUnit(Unit* victim)
  535.         {
  536.             me->Yell(SAY_SYLVANAS_SLAY, LANG_UNIVERSAL, 0);
  537.         }
  538.  
  539.         void JustDied(Unit* /*killer*/)
  540.         {
  541.             me->Yell(SAY_SYLVANAS_DEATH, LANG_UNIVERSAL, 0);
  542.         }
  543.  
  544.         void UpdateAI(uint32 diff)
  545.         {
  546.             if (!UpdateVictim())
  547.                 return;
  548.  
  549.             if (me->HasUnitState(UNIT_STATE_CASTING))
  550.                 return;
  551.  
  552.             // Multishot ogni 2 sec
  553.             if (MultiTimer <= diff)
  554.             {
  555.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
  556.                     DoCast(pTarget, SPELL_MULTISHOT);
  557.                 MultiTimer = 4000;
  558.             } else MultiTimer -= diff;
  559.  
  560.             // Ogni 10 sec casta Volley su un target random
  561.             if (VolleyTimer <= diff)
  562.             {
  563.                 DoCastAOE(SPELL_VOLLEY);
  564.                 VolleyTimer = 15000;
  565.             } else VolleyTimer -= diff;
  566.  
  567.             // Ogni 5 sec casta Snake Trap su un target random
  568.             if (SnakeTimer <= diff)
  569.             {
  570.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0))
  571.                     for (uint8 i = 1; i <= 3; i++)
  572.                     {
  573.                         me->SummonCreature(SUMMONED_SNAKE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
  574.                     }
  575.                 SnakeTimer = 5000;
  576.             } else SnakeTimer -= diff;
  577.  
  578.             // Poison ad area ogni 10 sec
  579.             if (PoisonTimer <= diff)
  580.             {
  581.                 DoCastAOE(SPELL_BOLT_VOLLEY);
  582.                 PoisonTimer = 12000;
  583.             } else PoisonTimer -= diff;
  584.  
  585.             // Ogni 20 sec casta Frost Trap sul tank
  586.             if (TrapTimer <= diff)
  587.             {
  588.                 me->Yell(SAY_SYLVANAS_ICE, LANG_UNIVERSAL, 0);
  589.                 DoCast(me->GetVictim(), SPELL_ICE_TRAP);
  590.                 TrapTimer = 20000;
  591.             } else TrapTimer -= diff;
  592.  
  593.             // Ogni 25 sec casta Rejuvenation
  594.             if (HealTimer <= diff)
  595.             {
  596.                 DoCast(me, SPELL_REJUVENATION);
  597.                 HealTimer = 25000;
  598.             } else HealTimer -= diff;
  599.  
  600.             DoMeleeAttackIfReady();
  601.         }
  602.     };
  603.  
  604. };
  605.  
  606.  
  607. /*#########
  608. # Trollzilla
  609. #########*/
  610.  
  611. class npc_trollzilla : public CreatureScript
  612. {
  613. public:
  614.     npc_trollzilla() : CreatureScript("npc_trollzilla") { }
  615.  
  616.     CreatureAI* GetAI(Creature* pCreature) const
  617.     {
  618.         return new npc_trollzillaAI (pCreature);
  619.     }
  620.  
  621.     struct npc_trollzillaAI : public ScriptedAI
  622.     {
  623.         npc_trollzillaAI(Creature *pCreature) : ScriptedAI(pCreature){}
  624.  
  625.         uint32 CleaveTimer;
  626.         uint32 StompTimer;
  627.         uint32 FireTimer;
  628.         bool Enraged;
  629.  
  630.         void Reset()
  631.         {
  632.             CleaveTimer = 5000;
  633.             StompTimer = 20000;
  634.             FireTimer = 30000;
  635.             Enraged = false;
  636.         }
  637.  
  638.         void EnterCombat(Unit* /*who*/)
  639.         {
  640.             me->Yell(SAY_TROLLZILLA_AGGRO, LANG_UNIVERSAL, 0);
  641.             me->AddAura(SPELL_FIRE_SHIELD, me);
  642.         }
  643.  
  644.         void KilledUnit(Unit* victim)
  645.         {
  646.             me->Yell(SAY_TROLLZILLA_SLAY, LANG_UNIVERSAL, 0);
  647.         }
  648.  
  649.         void JustDied(Unit* /*killer*/)
  650.         {
  651.             me->Yell(SAY_TROLLZILLA_DEATH, LANG_UNIVERSAL, 0);
  652.         }
  653.  
  654.         void UpdateAI(uint32 diff)
  655.         {
  656.             if (!UpdateVictim())
  657.                 return;
  658.  
  659.             // Ogni 5 sec fa Cleave
  660.             if (CleaveTimer <= diff)
  661.             {
  662.                 DoCast(me->GetVictim(), SPELL_CLEAVE);
  663.                 CleaveTimer = 5000;
  664.             } else CleaveTimer -= diff;
  665.  
  666.             // Ogni 20 sec fa un War Stomp che stunna ad area
  667.             if (StompTimer <= diff)
  668.             {
  669.                 DoCastAOE(SPELL_WAR_STOMP);
  670.                 StompTimer = 20000;
  671.             } else StompTimer -= diff;
  672.  
  673.             // Summon Fire Elemental ogni 30 sec
  674.             if (FireTimer <= diff)
  675.             {
  676.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0))
  677.                     me->SummonCreature(SUMMON_FIRE_ELEMENTAL, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
  678.                 FireTimer = 30000;
  679.             } else FireTimer -= diff;
  680.  
  681.             // Enrage a 25% di vita (aumenta 40% attack speed e 25% damage)
  682.             if (HealthBelowPct(25) && !Enraged)
  683.             {
  684.                 me->Yell(SAY_TROLLZILLA_FRENZY, LANG_UNIVERSAL, 0);
  685.                 DoCast(me, SPELL_FRENZY);
  686.                 Enraged = true;
  687.             }
  688.  
  689.             DoMeleeAttackIfReady();
  690.         }
  691.     };
  692.  
  693. };
  694.  
  695.  
  696. /*#########
  697. # Perotharn
  698. #########*/
  699.  
  700. class npc_perotharn : public CreatureScript
  701. {
  702. public:
  703.     npc_perotharn() : CreatureScript("npc_perotharn") { }
  704.  
  705.     CreatureAI* GetAI(Creature* pCreature) const
  706.     {
  707.         return new npc_perotharnAI (pCreature);
  708.     }
  709.  
  710.     struct npc_perotharnAI : public ScriptedAI
  711.     {
  712.         npc_perotharnAI(Creature *pCreature) : ScriptedAI(pCreature){}
  713.  
  714.         uint32 BurstTimer;
  715.         uint32 GriefTimer;
  716.         uint32 FlameTimer;
  717.         uint32 PiercingTimer;
  718.         uint32 HarvestTimer;
  719.  
  720.         void Reset()
  721.         {
  722.             BurstTimer = 30000;
  723.             GriefTimer = 20000;
  724.             FlameTimer = 15000;
  725.             PiercingTimer = 10000;
  726.             HarvestTimer = 45000;
  727.         }
  728.  
  729.         void EnterCombat(Unit* /*who*/)
  730.         {
  731.             me->Yell(SAY_PEROTHARN_AGGRO, LANG_UNIVERSAL, 0);
  732.         }
  733.  
  734.         void KilledUnit(Unit* victim)
  735.         {
  736.             me->Yell(SAY_PEROTHARN_SLAY, LANG_UNIVERSAL, 0);
  737.         }
  738.  
  739.         void JustDied(Unit* /*killer*/)
  740.         {
  741.             me->Yell(SAY_PEROTHARN_DEATH, LANG_UNIVERSAL, 0);
  742.         }
  743.  
  744.         void UpdateAI(uint32 diff)
  745.         {
  746.             if (!UpdateVictim())
  747.                 return;
  748.  
  749.             // Shadow Burst ad area e reset threat
  750.             if (BurstTimer <= diff)
  751.             {
  752.                 me->InterruptNonMeleeSpells(false);
  753.                 me->DeleteThreatList();
  754.                 DoCast(me->GetVictim(), SHADOW_BURST);
  755.                 BurstTimer = urand(25000,35000);
  756.             } else BurstTimer -= diff;
  757.  
  758.             // Storm of Grief ogni 20 sec colpisce ad area
  759.             if (GriefTimer <= diff)
  760.             {
  761.                 me->InterruptNonMeleeSpells(false);
  762.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0))
  763.                     DoCast(pTarget, STORM_OF_GRIEF);
  764.                 GriefTimer = 20000;
  765.             } else GriefTimer -= diff;
  766.  
  767.             // Ogni 10 sec casta Piercing Shadow sul target a maggior aggro dopo il tank
  768.             if (PiercingTimer <= diff)
  769.             {
  770.                 me->InterruptNonMeleeSpells(false);
  771.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,0))
  772.                     DoCast(pTarget, PIERCING_SHADOW);
  773.                 PiercingTimer = 10000;
  774.             } else PiercingTimer -= diff;
  775.  
  776.             // Ogni 15 sec casta Shadow Flame che fa danno a cono
  777.             if (FlameTimer <= diff)
  778.             {
  779.                 me->InterruptNonMeleeSpells(false);
  780.                 DoCastAOE(SHADOW_FLAME);
  781.                 FlameTimer = 15000;
  782.             } else FlameTimer -= diff;
  783.  
  784.             // Ogni 45 sec casta Harvest Soul su tutto il raid
  785.             if (HarvestTimer <= diff)
  786.             {
  787.                 me->InterruptNonMeleeSpells(false);
  788.                 me->Yell(SAY_PEROTHARN_SOUL, LANG_UNIVERSAL, 0);
  789.                 DoCastAOE(HARVEST_SOUL);
  790.                 HarvestTimer = 45000;
  791.             } else HarvestTimer -= diff;
  792.  
  793.             //DoSpellAttackIfReady(SHADOW_BOLT);
  794.         }
  795.     };
  796.  
  797. };
  798.  
  799.  
  800. /*#########
  801. # Uznam the Watcher
  802. #########*/
  803.  
  804. class npc_uznam_the_watcher : public CreatureScript
  805. {
  806. public:
  807.     npc_uznam_the_watcher() : CreatureScript("npc_uznam_the_watcher") { }
  808.  
  809.     CreatureAI* GetAI(Creature* pCreature) const
  810.     {
  811.         return new npc_uznam_the_watcherAI (pCreature);
  812.     }
  813.  
  814.     struct npc_uznam_the_watcherAI : public ScriptedAI
  815.     {
  816.         npc_uznam_the_watcherAI(Creature *pCreature) : ScriptedAI(pCreature){}
  817.  
  818.         uint32 EarthquakeTimer;
  819.         uint32 WhirlwindTimer;
  820.         uint32 ShockTimer;
  821.         uint32 AuralShockTimer;
  822.  
  823.         void Reset()
  824.         {
  825.             EarthquakeTimer = 8000;
  826.             WhirlwindTimer = 20000;
  827.             ShockTimer = 30000;
  828.             AuralShockTimer = 50000;
  829.         }
  830.  
  831.         void EnterCombat(Unit* /*who*/)
  832.         {
  833.             me->Yell(SAY_UZNAM_AGGRO, LANG_UNIVERSAL, 0);
  834.             DoCast(me, ENTROPIC_AURA);
  835.         }
  836.  
  837.         void KilledUnit(Unit* victim)
  838.         {
  839.             me->Yell(SAY_UZNAM_SLAY, LANG_UNIVERSAL, 0);
  840.         }
  841.  
  842.         void JustDied(Unit* /*killer*/)
  843.         {
  844.             me->Yell(SAY_UZNAM_DEATH, LANG_UNIVERSAL, 0);
  845.         }
  846.  
  847.         void UpdateAI(uint32 diff)
  848.         {
  849.             if (!UpdateVictim())
  850.                 return;
  851.  
  852.             // Earthquake Ogni 20 secondi.
  853.             if (EarthquakeTimer <= diff)
  854.             {
  855.                 DoCast(EARTHQUAKE);
  856.                 EarthquakeTimer = 20000;
  857.             } else EarthquakeTimer -= diff;
  858.  
  859.             // Whirlwind Ogni 30 sec
  860.             if (WhirlwindTimer <= diff)
  861.             {
  862.                 me->Yell(SAY_UZNAM_SPECIAL, LANG_UNIVERSAL, 0);
  863.                 me->TextEmote(EMOTE_WHIRL, 0, true);
  864.                 DoCast(me, WHIRLWIND);
  865.                 WhirlwindTimer = 30000;
  866.             } else WhirlwindTimer -= diff;
  867.  
  868.             // Shock of sorrow Ogni 40 sec.
  869.             if (ShockTimer <= diff)
  870.             {
  871.                 if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0))
  872.                     DoCast(pTarget, SHOCK_OF_SORROW);
  873.                 ShockTimer = 40000;
  874.             } else ShockTimer -= diff;
  875.            
  876.             // Aural Shock Ogni minuto
  877.             if (AuralShockTimer <= diff)
  878.             {
  879.                 DoCast(AURAL_SHOCK);
  880.                 AuralShockTimer = 60000;
  881.             } else AuralShockTimer -= diff;
  882.  
  883.             DoMeleeAttackIfReady();
  884.         }
  885.     };
  886.  
  887. };
  888.  
  889.  
  890. void AddSC_npcs_mini_boss()
  891. {
  892.     new npc_likantropo;
  893.     new npc_lava_boost;
  894.     new npc_quel_nagas;
  895.     new npc_might_of_sylvanas;
  896.     new npc_trollzilla;
  897.     new npc_perotharn;
  898.     new npc_uznam_the_watcher;
  899. }
Advertisement
Add Comment
Please, Sign In to add comment