Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ScriptData
- SDName: Erados
- SD%Complete: 100 hopefully
- SDComment: Multi-phase boss
- SDCategory: Learning
- EndScriptData */
- #include "ScriptMgr.h"
- #include "ScriptedCreature.h"
- #include "ScriptedGossip.h"
- #include "Player.h"
- enum Yells //Defining yells
- {
- SAY_AGGRO = 0;
- SAY_EVADE = 6;
- SAY_RANDOM = 1;
- SAY_PHASE = 3;
- };
- enum Spells
- {
- SPELL_ONE = 72906, // frostbolt volley
- SPELL_ONE_ALT = 24099, // poison volley
- SPELL_TWO = 65791, // Arcane blast
- SPELL_THREE = 70464, // ice lance volley
- SPELL_BERSERK = 32965, // berserk
- SPELL_FULLHEAL = 9257, //lay on hands
- };
- class erados_creature : public CreatureScript
- {
- public:
- erados_creature()
- : CreatureScript("erados_creature")
- {
- }
- struct erados_creatureAI : public ScriptedAI
- {
- erados_creatureAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 m_uISayTimer;
- uint32 m_uiRebuffTimer;
- uint32 m_uiSpell1Timer;
- uint32 m_uiSpell2Timer;
- uint32 m_uiSpell3Timer;
- uint32 m_uiBerserkTimer;
- uint32 m_uiPhase;
- uint32 m_uiPhaseTimer;
- void Reset()
- {
- m_uiPhase = 1;
- m_uiPhaseTimer = 60000;
- m_uiSpell1Timer = 9000;
- m_uiSpell2Timer = 25000;
- m_uiSpell3Timer = 15000;
- m_uiBerserkTimer = 250000;
- }
- void EnterCombat(Unit* who)
- {
- Talk(SAY_AGGRO, who->GetGUID());
- }
- void AttackStart(Unit* who)
- {
- ScriptedAI::AttackStart(who);
- }
- void EnterEvadeMode()
- {
- Talk(SAY_EVADE);
- }
- void updateAI(const uint32 uiDiff)
- {
- if(!me->getVictim())
- {
- if(m_uiSayTimer <= uiDiff)
- {
- Talk(SAY_RANDOM);
- m_uiSayTimer = 45000;
- }
- else
- m_uiSayTimer -= uiDiff;
- }
- if(!UpdateVictim())
- return;
- //spell 1
- if(m_uiSpellTimer <= uiDiff)
- {
- if(rand()%50 > 10)
- DoCast(me->getVictim(), SPELL_ONE_ALT);
- else if(me->IsWithinDist(me->getVictim(), 25.0f))
- DoCast(me->getVictim(), SPELL_ONE);
- m_uiSpell1Timer = 10000;
- }
- else
- m_uiSpell1Timer -= uiDiff;
- //spell 2
- if (m_uiSpellTimer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_TWO);
- m_uiSpell2Timer = 12000;
- }
- else
- m_uiSpell2Timer -= uiDiff;
- //berserk timer
- if (m_uiPhase > 1)
- {
- if(m_uiSpell3Timer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_THREE);
- m_uiSpell3Timer = 19000;
- }
- else
- m_uiSpell3Timer -= uiDiff;
- if (m_uiBerserkTimer <= uiDiff)
- {
- Talk(SAY_BERSERK, me->getVictim() ? me->getVictim()->GetGUID() : 0);
- DoCast(me->getVictim(), SPELL_BERSERK);
- m_uiBerserkTimer = 12000;
- }
- else
- m_uiBerserkTimer -= uiDiff;
- }
- else if(m_uiPhase == 1)
- {
- if(m_uiPhaseTimer <= uiDiff)
- {
- ++m_uiPhase;
- Talk(SAY_PHASE);
- DoCast(me, SPELL_FULLHEAL)
- }
- else
- m_uiPhaseTimer -= uiDiff;
- }
- DoMeleeAttackIfReady();
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new erados_creatureAI(creature);
- }
- void AddSC_erados_creature()
- {
- new erados_creature();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement