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#include "ScriptMgr.h"
19#include "InstanceScript.h"
20#include "ScriptedCreature.h"
21#include "the_black_morass.h"
22
32
40
47
48// 17881 - Aeonus
49struct boss_aeonus : public BossAI
50{
51 boss_aeonus(Creature* creature) : BossAI(creature, TYPE_AEONUS) { }
52
53 void Reset() override { }
54
55 void JustEngagedWith(Unit* /*who*/) override
56 {
60
62 }
63
64 void MoveInLineOfSight(Unit* who) override
65 {
66 //Despawn Time Keeper
67 if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
68 {
69 if (me->IsWithinDistInMap(who, 20.0f))
70 {
72 Unit::DealDamage(me, who, who->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
73 }
74 }
75
77 }
78
79 void JustDied(Unit* /*killer*/) override
80 {
82
84 instance->SetData(TYPE_MEDIVH, DONE); // FIXME: later should be removed
85 }
86
87 void KilledUnit(Unit* who) override
88 {
89 if (who->GetTypeId() == TYPEID_PLAYER)
91 }
92
93 void UpdateAI(uint32 diff) override
94 {
95 if (!UpdateVictim())
96 return;
97
98 events.Update(diff);
99
101 return;
102
103 while (uint32 eventId = events.ExecuteEvent())
104 {
105 switch (eventId)
106 {
107 case EVENT_SANDBREATH:
109 events.Repeat(15s, 25s);
110 break;
111 case EVENT_TIMESTOP:
113 events.Repeat(20s, 35s);
114 break;
115 case EVENT_FRENZY:
118 events.Repeat(20s, 35s);
119 break;
120 default:
121 break;
122 }
123
125 return;
126 }
127
129 }
130};
131
uint32_t uint32
Definition Define.h:133
@ DONE
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
@ SPELL_SCHOOL_MASK_NORMAL
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ DIRECT_DAMAGE
Definition Unit.h:353
AeonusSpells
@ SPELL_CLEAVE
@ SPELL_SAND_BREATH
@ SPELL_ENRAGE
@ SPELL_TIME_STOP
AeonusEvents
@ EVENT_SANDBREATH
@ EVENT_TIMESTOP
@ EVENT_FRENZY
void AddSC_boss_aeonus()
AeonusTexts
@ SAY_DEATH
@ SAY_BANISH
@ SAY_AGGRO
@ EMOTE_FRENZY
@ SAY_SLAY
@ SAY_ENTER
InstanceScript *const instance
EventMap events
virtual void MoveInLineOfSight(Unit *)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
TypeID GetTypeId() const
Definition Object.h:93
uint32 GetEntry() const
Definition Object.h:81
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Definition Unit.h:769
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:716
uint32 GetHealth() const
Definition Unit.h:913
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1192
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
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)