TrinityCore
boss_aeonus.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19Name: Boss_Aeonus
20%Complete: 80
21Comment: Some spells not implemented
22Category: Caverns of Time, The Dark Portal
23*/
24
25#include "ScriptMgr.h"
26#include "InstanceScript.h"
27#include "ScriptedCreature.h"
28#include "the_black_morass.h"
29
31{
38
39 SPELL_CLEAVE = 40504,
41 SPELL_ENRAGE = 37605,
44};
45
47{
50 EVENT_FRENZY = 3
51};
52
53struct boss_aeonus : public BossAI
54{
55 boss_aeonus(Creature* creature) : BossAI(creature, TYPE_AEONUS) { }
56
57 void Reset() override { }
58
59 void JustEngagedWith(Unit* /*who*/) override
60 {
64
66 }
67
68 void MoveInLineOfSight(Unit* who) override
69
70 {
71 //Despawn Time Keeper
72 if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
73 {
74 if (me->IsWithinDistInMap(who, 20.0f))
75 {
77 Unit::DealDamage(me, who, who->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
78 }
79 }
80
82 }
83
84 void JustDied(Unit* /*killer*/) override
85 {
87
89 instance->SetData(TYPE_MEDIVH, DONE); // FIXME: later should be removed
90 }
91
92 void KilledUnit(Unit* who) override
93 {
94 if (who->GetTypeId() == TYPEID_PLAYER)
96 }
97
98 void UpdateAI(uint32 diff) override
99 {
100 //Return since we have no target
101 if (!UpdateVictim())
102 return;
103
104 events.Update(diff);
105
107 return;
108
109 while (uint32 eventId = events.ExecuteEvent())
110 {
111 switch (eventId)
112 {
113 case EVENT_SANDBREATH:
116 break;
117 case EVENT_TIMESTOP:
120 break;
121 case EVENT_FRENZY:
125 break;
126 default:
127 break;
128 }
129
131 return;
132 }
133 }
134};
135
137{
139}
uint32_t uint32
Definition: Define.h:142
@ DONE
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
@ SPELL_SCHOOL_MASK_NORMAL
@ DIRECT_DAMAGE
Definition: UnitDefines.h:132
@ UNIT_STATE_CASTING
Definition: Unit.h:270
Enums
Definition: boss_aeonus.cpp:31
@ SAY_DEATH
Definition: boss_aeonus.cpp:36
@ SPELL_CLEAVE
Definition: boss_aeonus.cpp:39
@ SPELL_SAND_BREATH
Definition: boss_aeonus.cpp:42
@ SAY_BANISH
Definition: boss_aeonus.cpp:34
@ SPELL_ENRAGE
Definition: boss_aeonus.cpp:41
@ SPELL_TIME_STOP
Definition: boss_aeonus.cpp:40
@ SAY_AGGRO
Definition: boss_aeonus.cpp:33
@ EMOTE_FRENZY
Definition: boss_aeonus.cpp:37
@ H_SPELL_SAND_BREATH
Definition: boss_aeonus.cpp:43
@ SAY_SLAY
Definition: boss_aeonus.cpp:35
@ SAY_ENTER
Definition: boss_aeonus.cpp:32
void AddSC_boss_aeonus()
@ EVENT_SANDBREATH
Definition: boss_aeonus.cpp:48
@ EVENT_TIMESTOP
Definition: boss_aeonus.cpp:49
@ EVENT_FRENZY
Definition: boss_aeonus.cpp:50
InstanceScript *const instance
EventMap events
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:122
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true)
Definition: Unit.cpp:769
uint64 GetHealth() const
Definition: Unit.h:776
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition: Object.cpp:1147
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
void Reset() override
Definition: boss_aeonus.cpp:57
void KilledUnit(Unit *who) override
Definition: boss_aeonus.cpp:92
void MoveInLineOfSight(Unit *who) override
Definition: boss_aeonus.cpp:68
void JustEngagedWith(Unit *) override
Definition: boss_aeonus.cpp:59
void JustDied(Unit *) override
Definition: boss_aeonus.cpp:84
void UpdateAI(uint32 diff) override
Definition: boss_aeonus.cpp:98
boss_aeonus(Creature *creature)
Definition: boss_aeonus.cpp:55
@ NPC_TIME_KEEPER
@ TYPE_MEDIVH
@ TYPE_AEONUS
@ TYPE_RIFT
#define RegisterBlackMorassCreatureAI(ai_name)