Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- enum Spells
- {
- SPELL_FLAMEBREATH = 119420,
- SPELL_INFERNOCHARGE = 119405,
- };
- enum Events
- {
- EVENT_FLAMEBREATH = 1,
- EVENT_INFERNOCHARGE = 2,
- };
- class example : public CreatureScript
- {
- public:
- example() : CreatureScript("example") { }
- struct exampleAI : public BossAI
- {
- exampleAI(Creature* creature) : BossAI(creature, 0)
- {
- }
- void Reset() OVERRIDE
- {
- _Reset();
- }
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- me->MonsterYell("Vei muri!", LAND_UNIVERSAL, NULL);
- events.ScheduleEvent(EVENT_FLAMEBREATH, 6000);
- events.ScheduleEvent(EVENT_INFERNOCHARGE, 12000);
- }
- void KilledUnit(Unit * /*victim*/) OVERRIDE
- {
- me->MonsterYell("You killed the You You!", LAND_UNIVERSAL, NULL);
- }
- void JustDied(Unit * /*victim*/) OVERRIDE
- {
- }
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (!UpdateVictim())
- return;
- events.Update(diff);
- if (me->HasUnitState(UNIT_STATE_CASTING))
- return;
- while (uint32 eventId = events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_FLAMEBREATH:
- if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_FLAMEBREATH);
- events.ScheduleEvent(EVENT_FLAMEBREATH, 6000);
- break;
- case EVENT_INFERNOCHARGE:
- me->MonsterYell("MUIE RAGELESS", LAND_UNIVERSAL, NULL);
- if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 2))
- DoCast(target, SPELL_INFERNOCHARGE);
- events.ScheduleEvent(EVENT_INFERNOCHARGE, 12000);
- break;
- default:
- break;
- }
- }
- DoMeleeAttackIfReady();
- }
- };
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new exampleAI(creature);
- }
- };
- void AddSC_example()
- {
- new example();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement