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,
- };
- 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_uiEnrageTimer;
- void Reset()
- {
- m_uiPhase = 0;
- m_uiFrostPunchTimer = 12000;
- m_uiRoarTimer = 20000;
- m_uiEnrageTimer = 180000;
- me->RestoreFaction();
- }
- void EnterCombat(Unit* unit, Player* player)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- {
- DoCast(target, SPELL_ROAR);
- DoCast(target, SHAKE_CAMERA);
- // DoCast(target, SPELL_PUNCH); // NOT DEFINED SPELL_PUNCH
- DoCast(target, SPELL_FREEZE);
- /*
- // Not needed if $N works
- char message[250];
- snprintf(message, 250, "Yetiname glares at %s, roars, and casts Frost Punch!", player->GetName());
- */
- me->MonsterTextEmote("Yetiname glares at $N, roars, and casts Frost Punch!", player->GetGUID());
- }
- }
- void EnterEvadeMode()
- {
- }
- void UpdateAI(const uint32 uiDiff)
- {
- if (!UpdateVictim())
- return;
- if (m_uiFrostPunchTimer <= uiDiff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0))
- {
- /*
- // Not needed if $N works
- char message[250];
- snprintf(message, 250, "Yetiname casts Frost Punch on %s!", target->GetName());
- */
- me->MonsterTextEmote("Yetiname casts Frost Punch on $N!", target->GetGUID());
- // DoCast(target, SPELL_PUNCH); // SPELL_PUNCH undefined
- DoCast(target, SPELL_FREEZE);
- }
- // m_uiSpell3Timer = 12000; // undefined m_uiSpell3Timer
- m_uiFrostPunchTimer = 12000; // meant this?
- }
- else
- m_uiFrostPunchTimer -= uiDiff;
- if (m_uiRoarTimer <= uiDiff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0))
- {
- /*
- // Not needed if $N works
- char message[250];
- snprintf(message, 250, "Yetiname roars at %s!", target->GetName());
- */
- me->MonsterTextEmote("Yetiname roars at $N!", target->GetGUID());
- DoCast(target, SPELL_ROAR);
- DoCast(target, SHAKE_CAMERA);
- }
- m_uiRoarTimer = 20000;
- }
- else
- m_uiRoarTimer -= uiDiff;
- /*
- // Undefined m_uiBeserkTimer
- if (m_uiBeserkTimer <= uiDiff)
- {
- DoCast(me, SPELL_ENRAGE);
- }
- else
- m_uiBeserkTimer -= uiDiff;
- */
- DoMeleeAttackIfReady();
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new example_creatureAI(creature);
- }
- };
- void AddSC_Yeti_Boss()
- {
- new Yeti_Boss();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement