Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- enum Spells
- {
- SPELL_ROAR = 42398,
- SHAKE_CAMERA = 46853,
- SPELL_FREEZE = 58534,
- SPELL_ENRAGE = 23537,
- SPELL_KNOCKBACK = 46360,
- SPELL_KNOCKUP = 29190,
- };
- class Yeti_Boss : public CreatureScript
- {
- public:
- Yeti_Boss()
- : CreatureScript("Yeti_Boss") {}
- struct example_creatureAI : public ScriptedAI
- {
- example_creatureAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 m_uiPhase;
- uint32 m_uiFrostPunchTimer;
- uint32 m_uiRoarTimer;
- uint32 m_uiIceQuakeTimer;
- uint32 m_uiEnrageTimer;
- void Reset()
- {
- m_uiPhase = 0;
- m_uiFrostPunchTimer = 13000;
- m_uiRoarTimer = 18000;
- m_uiIceQuakeTimer = 25000;
- m_uiEnrageTimer = 180000;
- me->RestoreFaction();
- }
- void EnterCombat(Unit* unit)
- {
- {
- DoCast(me->getVictim(), SPELL_ROAR);
- DoCast(me->getVictim(), SHAKE_CAMERA);
- DoCast(me->getVictim(), SPELL_KNOCKBACK);
- DoCast(me->getVictim(), SPELL_FREEZE);
- me->MonsterTextEmote("The Yeti Matriarch glares at $N, roars, and casts Frost Punch!", me->getVictim());
- }
- }
- void EnterEvadeMode()
- {
- }
- void UpdateAI(const uint32 uiDiff)
- {
- if (!UpdateVictim())
- return;
- if (m_uiFrostPunchTimer <= uiDiff)
- {
- std::list<Unit*> targets;
- SelectTargetList(targets, 1, SELECT_TARGET_RANDOM, me->GetMeleeReach()*1, true);
- for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
- if (!me->IsWithinMeleeRange(*i))
- {
- DoCast(*i, SPELL_KNOCKBACK);
- DoCast(*i, SPELL_FREEZE);
- me->MonsterTextEmote("The Yeti Matriarch casts Frost Punch on $N!", *i);
- break;
- }
- m_uiFrostPunchTimer = 12000;
- }
- else
- m_uiFrostPunchTimer -= uiDiff;
- if (m_uiRoarTimer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_ROAR);
- DoCast(me->getVictim(), SHAKE_CAMERA);
- me->MonsterTextEmote("The Yeti Matriarch angrily roars!", NULL);
- break;
- }
- m_uiRoarTimer = 20000;
- }
- else
- m_uiRoarTimer -= uiDiff;
- if (m_uiIceQuakeTimer <= uiDiff)
- {
- std::list<Unit*> targets;
- SelectTargetList(targets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true);
- for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
- if (!me->IsWithinMeleeRange(*i))
- {
- DoCast(me->getVictim(), SPELL_KNOCKUP);
- DoCast(me->getVictim(), CAMERA_SHAKE);
- DoCast(*i, SPELL_FREEZE);
- me->MonsterTextEmote("The Yeti Matriarch stomps angrily, causing an Ice Quake!", NULL);
- break;
- }
- m_uiIceQuakeTimer = 15000;
- }
- else
- m_uiIceQuakeTimer -= uiDiff;
- if (m_uiEnrageTimer <= uiDiff)
- {
- DoCast(me, SPELL_ENRAGE);
- }
- else
- m_uiEnrageTimer -= uiDiff;
- DoMeleeAttackIfReady();
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new Yeti_BossAI(creature);
- }
- };
- void AddSC_Yeti_Boss()
- {
- new Yeti_Boss();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement