TrinityCore
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/*
19Name: Boss_Temporus
20%Complete: 75
21Comment: More abilities need to be implemented
22Category: Caverns of Time, The Black Morass
23*/
24
25#include "ScriptMgr.h"
26#include "InstanceScript.h"
27#include "ScriptedCreature.h"
28#include "the_black_morass.h"
29
31{
37
38 SPELL_HASTE = 31458,
42 SPELL_REFLECT = 38592 //Not Implemented (Heroic mod)
43};
44
46{
51};
52
53struct boss_temporus : public BossAI
54{
55 boss_temporus(Creature* creature) : BossAI(creature, TYPE_TEMPORUS) { }
56
57 void Reset() override { }
58
59 void JustEngagedWith(Unit* /*who*/) override
60 {
64 if (IsHeroic())
66
68 }
69
70 void KilledUnit(Unit* /*victim*/) override
71 {
73 }
74
75 void JustDied(Unit* /*killer*/) override
76 {
78
80 }
81
82 void MoveInLineOfSight(Unit* who) override
83 {
84 //Despawn Time Keeper
85 if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
86 {
87 if (me->IsWithinDistInMap(who, 20.0f))
88 {
90
91 Unit::DealDamage(me, who, who->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
92 }
93 }
94
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_HASTE:
116 break;
120 break;
124 break;
125 case EVENT_SPELL_REFLECTION: // Only in Heroic
128 break;
129 default:
130 break;
131 }
132
134 return;
135 }
136 }
137};
138
140{
142}
uint32_t uint32
Definition: Define.h:142
@ SPECIAL
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
@ 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
@ H_SPELL_WING_BUFFET
@ SPELL_WING_BUFFET
@ SAY_BANISH
@ SAY_AGGRO
@ SPELL_HASTE
@ SPELL_REFLECT
@ SAY_SLAY
@ SAY_ENTER
@ SPELL_MORTAL_WOUND
void AddSC_boss_temporus()
@ EVENT_MORTAL_WOUND
@ EVENT_WING_BUFFET
@ EVENT_SPELL_REFLECTION
@ EVENT_HASTE
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 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
bool IsHeroic() const
void MoveInLineOfSight(Unit *who) override
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
boss_temporus(Creature *creature)
void JustEngagedWith(Unit *) override
void KilledUnit(Unit *) override
void Reset() override
@ NPC_TIME_KEEPER
@ TYPE_TEMPORUS
@ TYPE_RIFT
#define RegisterBlackMorassCreatureAI(ai_name)