Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_aeonus.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/*
7Name: Boss_Aeonus
8%Complete: 80
9Comment: Some spells not implemented
10Category: Caverns of Time, The Dark Portal
11*/
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "the_black_morass.h"
16
32
39
41{
42public:
43 boss_aeonus() : CreatureScript("boss_aeonus") { }
44
45 struct boss_aeonusAI : public BossAI
46 {
47 boss_aeonusAI(Creature* creature) : BossAI(creature, TYPE_AEONUS) { }
48
49 void Reset() OVERRIDE { }
50
51 void EnterCombat(Unit* /*who*/) OVERRIDE
52 {
53 events.ScheduleEvent(EVENT_SANDBREATH, std::rand() % 30000 + 15000);
54 events.ScheduleEvent(EVENT_TIMESTOP, std::rand() % 15000 + 10000);
55 events.ScheduleEvent(EVENT_FRENZY, std::rand() % 45000 + 30000);
56
58 }
59
61
62 {
63 //Despawn Time Keeper
64 if (who->GetTypeId() == TypeID::TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
65 {
66 if (me->IsWithinDistInMap(who, 20.0f))
67 {
69 me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
70 }
71 }
72
74 }
75
76 void JustDied(Unit* /*killer*/) OVERRIDE
77 {
79
80 if (instance)
81 {
82 instance->SetData(TYPE_RIFT, DONE);
83 instance->SetData(TYPE_MEDIVH, DONE); // FIXME: later should be removed
84 }
85 }
86
87 void KilledUnit(Unit* /*victim*/) OVERRIDE
88 {
90 }
91
93 {
94 //Return since we have no target
95 if (!UpdateVictim())
96 return;
97
98 events.Update(diff);
99
100 if (me->HasUnitState(UNIT_STATE_CASTING))
101 return;
102
103 while (uint32 eventId = events.ExecuteEvent())
104 {
105 switch (eventId)
106 {
107 case EVENT_SANDBREATH:
109 events.ScheduleEvent(EVENT_SANDBREATH, std::rand() % 25000 + 15000);
110 break;
111 case EVENT_TIMESTOP:
113 events.ScheduleEvent(EVENT_TIMESTOP, std::rand() % 35000 + 20000);
114 break;
115 case EVENT_FRENZY:
118 events.ScheduleEvent(EVENT_FRENZY, std::rand() % 35000 + 25000);
119 break;
120 default:
121 break;
122 }
123 }
125 }
126 };
127
129 {
130 return new boss_aeonusAI(creature);
131 }
132};
133
135{
136 new boss_aeonus();
137}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ DONE
@ TYPEID_UNIT
Definition Object.h:54
@ SPELL_SCHOOL_MASK_NORMAL
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ DIRECT_DAMAGE
Definition Unit.h:614
@ SPELL_CLEAVE
@ SPELL_ENRAGE
Enums
@ SAY_DEATH
@ SPELL_SAND_BREATH
@ SAY_BANISH
@ SPELL_ENRAGE
@ SPELL_TIME_STOP
@ SAY_AGGRO
@ EMOTE_FRENZY
@ H_SPELL_SAND_BREATH
@ SAY_SLAY
void AddSC_boss_aeonus()
@ EVENT_SANDBREATH
@ EVENT_TIMESTOP
@ EVENT_FRENZY
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_SAND_BREATH
InstanceScript *const instance
EventMap events
BossAI(Creature *creature, uint32 bossId)
virtual void MoveInLineOfSight(Unit *)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
void JustDied(Unit *) OVERRIDE
void EnterCombat(Unit *) OVERRIDE
boss_aeonusAI(Creature *creature)
void KilledUnit(Unit *) OVERRIDE
void MoveInLineOfSight(Unit *who) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ NPC_TIME_KEEPER
@ TYPE_MEDIVH
@ TYPE_AEONUS
@ TYPE_RIFT