TrinityCore
Loading...
Searching...
No Matches
boss_temporus.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 "ScriptedCreature.h"
24#include "SpellInfo.h"
25#include "the_black_morass.h"
26
35
49
58
59// 17880 - Temporus
60// 21698 - Infinite Timereaver
61struct boss_temporus : public BossAI
62{
63 boss_temporus(Creature* creature) : BossAI(creature, DATA_TEMPORUS) { }
64
65 void JustAppeared() override
66 {
69 }
70
84
85 void OnSpellCast(SpellInfo const* spellInfo) override
86 {
87 if (spellInfo->Id == SPELL_BANISH_HELPER)
89 }
90
91 void KilledUnit(Unit* /*victim*/) override
92 {
94 }
95
96 void JustDied(Unit* /*killer*/) override
97 {
98 _JustDied();
100
102 }
103
104 void UpdateAI(uint32 diff) override
105 {
106 if (!UpdateVictim())
107 return;
108
109 events.Update(diff);
110
112 return;
113
114 while (uint32 eventId = events.ExecuteEvent())
115 {
116 switch (eventId)
117 {
118 case EVENT_HASTEN:
120 events.Repeat(15s, 20s);
121 break;
124 events.Repeat(6s, 8s);
125 break;
128 events.Repeat(20s, 30s);
129 break;
131 if (me->FindNearestCreature(NPC_TIME_KEEPER, 30.0f, true))
133 events.Repeat(1s);
134 break;
137 events.Repeat(25s, 35s);
138 break;
139 default:
140 break;
141 }
142
144 return;
145 }
146 }
147};
148
uint32_t uint32
Definition Define.h:154
@ UNIT_STATE_CASTING
Definition Unit.h:290
TemporusEvents
@ EVENT_HASTEN
@ EVENT_MORTAL_WOUND
@ EVENT_WING_BUFFET
@ EVENT_SPELL_REFLECTION
@ EVENT_BANISH_HELPER
void AddSC_boss_temporus()
TemporusSpells
@ SPELL_HASTEN
@ SPELL_WING_BUFFET
@ SPELL_BANISH_HELPER
@ SPELL_CLOSE_TIME_RIFT
@ SPELL_CHANNEL_TRIGGER
@ SPELL_MORTAL_WOUND
@ SPELL_SPELL_REFLECTION
TemporusTexts
@ SAY_DEATH
@ SAY_BANISH
@ SAY_AGGRO
@ SAY_SLAY
@ SAY_ENTER
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
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
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
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 OnSpellCast(SpellInfo const *spellInfo) override
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override
void JustAppeared() override
void JustDied(Unit *) override
boss_temporus(Creature *creature)
void KilledUnit(Unit *) override
@ NPC_TIME_KEEPER
@ DATA_TEMPORUS
#define RegisterBlackMorassCreatureAI(ai_name)