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/*
19 * Combat timers requires to be revisited
20 */
21
22#include "ScriptMgr.h"
23#include "InstanceScript.h"
24#include "MotionMaster.h"
25#include "ScriptedCreature.h"
26#include "SpellInfo.h"
27#include "the_black_morass.h"
28
38
40{
41 // Initial
44
45 // Combat
46 SPELL_CLEAVE = 40504,
49 SPELL_ENRAGE = 37605,
51
52 // Misc
55};
56
65
67{
68 POINT_MEDIVH = 0
69};
70
71// 17881 - Aeonus
72struct boss_aeonus : public BossAI
73{
74 boss_aeonus(Creature* creature) : BossAI(creature, DATA_AEONUS) { }
75
76 void JustAppeared() override
77 {
79
81
83
85 {
86 float x, y, z;
87 medivh->GetContactPoint(me, x, y, z, 20.0f);
89 }
90 }
91
104
105 void OnSpellCast(SpellInfo const* spellInfo) override
106 {
107 switch (spellInfo->Id)
108 {
111 break;
112 case SPELL_ENRAGE:
114 break;
115 default:
116 break;
117 }
118 }
119
120 void MovementInform(uint32 type, uint32 id) override
121 {
122 if (type == POINT_MOTION_TYPE && id == POINT_MEDIVH)
124 }
125
126 void JustReachedHome() override
127 {
129
131 {
132 float x, y, z;
133 medivh->GetContactPoint(me, x, y, z, 20.0f);
135 }
136 }
137
138 void KilledUnit(Unit* /*who*/) override
139 {
140 Talk(SAY_SLAY);
141 }
142
143 void JustDied(Unit* /*killer*/) override
144 {
145 _JustDied();
147
149 }
150
151 void UpdateAI(uint32 diff) override
152 {
153 if (!UpdateVictim())
154 return;
155
156 events.Update(diff);
157
159 return;
160
161 while (uint32 eventId = events.ExecuteEvent())
162 {
163 switch (eventId)
164 {
165 case EVENT_CLEAVE:
167 events.Repeat(15s, 20s);
168 break;
169 case EVENT_TIME_STOP:
171 events.Repeat(10s, 30s);
172 break;
175 events.Repeat(10s, 30s);
176 break;
177 case EVENT_ENRAGE:
179 events.Repeat(30s, 35s);
180 break;
182 if (me->FindNearestCreature(NPC_TIME_KEEPER, 30.0f, true))
184 events.Repeat(1s);
185 break;
186 default:
187 break;
188 }
189
191 return;
192 }
193 }
194};
195
uint32_t uint32
Definition Define.h:154
@ POINT_MOTION_TYPE
@ REACT_DEFENSIVE
@ UNIT_STATE_CASTING
Definition Unit.h:290
AeonusSpells
@ SPELL_CORRUPT_MEDIVH
@ SPELL_CLEAVE
@ SPELL_SAND_BREATH
@ SPELL_ENRAGE
@ SPELL_BANISH_HELPER
@ SPELL_TIME_STOP
@ SPELL_CLOSE_TIME_RIFT
@ SPELL_THRASH
@ SPELL_DOUBLE_ATTACK
AeonusEvents
@ EVENT_ENRAGE
@ EVENT_TIME_STOP
@ EVENT_BANISH_HELPER
@ EVENT_SAND_BREATH
@ EVENT_CLEAVE
void AddSC_boss_aeonus()
AeonusTexts
@ SAY_DEATH
@ SAY_BANISH
@ SAY_AGGRO
@ EMOTE_ENRAGE
@ SAY_SLAY
@ SAY_ENTER
AeonusMisc
@ POINT_MEDIVH
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void JustReachedHome() override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetReactState(ReactStates st)
Definition Creature.h:180
void Update(uint32 time)
Definition EventMap.h:77
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
EventId ExecuteEvent()
Definition EventMap.cpp:77
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
Creature * GetCreature(uint32 type)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
uint32 const Id
Definition SpellInfo.h:328
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Definition Unit.h:647
MotionMaster * GetMotionMaster()
Definition Unit.h:1750
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:1522
bool IsHeroic() const
void KilledUnit(Unit *) override
void JustAppeared() override
void JustReachedHome() override
void JustDied(Unit *) override
void OnSpellCast(SpellInfo const *spellInfo) override
void MovementInform(uint32 type, uint32 id) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
boss_aeonus(Creature *creature)
@ NPC_TIME_KEEPER
@ DATA_MEDIVH
@ DATA_AEONUS
#define RegisterBlackMorassCreatureAI(ai_name)