TrinityCore
Loading...
Searching...
No Matches
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
45
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
uint32_t uint32
Definition Define.h:154
@ DONE
@ TYPEID_UNIT
Definition ObjectGuid.h:43
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
@ SPELL_SCHOOL_MASK_NORMAL
@ DIRECT_DAMAGE
@ UNIT_STATE_CASTING
Definition Unit.h:276
Enums
@ SAY_DEATH
@ SPELL_CLEAVE
@ SPELL_SAND_BREATH
@ SAY_BANISH
@ SPELL_ENRAGE
@ SPELL_TIME_STOP
@ SAY_AGGRO
@ EMOTE_FRENZY
@ H_SPELL_SAND_BREATH
@ SAY_SLAY
@ SAY_ENTER
void AddSC_boss_aeonus()
@ EVENT_SANDBREATH
@ EVENT_TIMESTOP
@ EVENT_FRENZY
TypeID GetTypeId() const
Definition BaseEntity.h:166
InstanceScript *const instance
EventMap events
virtual void MoveInLineOfSight(Unit *)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
uint32 GetEntry() const
Definition Object.h:89
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
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:820
uint64 GetHealth() const
Definition Unit.h:788
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:501
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
void Reset() override
void KilledUnit(Unit *who) override
void MoveInLineOfSight(Unit *who) override
void JustEngagedWith(Unit *) override
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
boss_aeonus(Creature *creature)
@ NPC_TIME_KEEPER
@ TYPE_MEDIVH
@ TYPE_AEONUS
@ TYPE_RIFT
#define RegisterBlackMorassCreatureAI(ai_name)