TrinityCore
boss_chrono_lord_deja.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_Chrono_Lord_Deja
20%Complete: 65
21Comment: All abilities not 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
43 SPELL_ATTRACTION = 38540 //Not Implemented (Heroic mode)
44};
45
47{
52};
53
55{
57
58 void Reset() override { }
59
60 void JustEngagedWith(Unit* /*who*/) override
61 {
65 if (IsHeroic())
67
69 }
70
71 void MoveInLineOfSight(Unit* who) override
72
73 {
74 //Despawn Time Keeper
75 if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
76 {
77 if (me->IsWithinDistInMap(who, 20.0f))
78 {
80 Unit::DealDamage(me, who, who->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
81 }
82 }
83
85 }
86
87 void KilledUnit(Unit* /*victim*/) override
88 {
90 }
91
92 void JustDied(Unit* /*killer*/) override
93 {
95
97 }
98
99 void UpdateAI(uint32 diff) override
100 {
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 {
116 break;
117 case EVENT_TIME_LAPSE:
121 break;
126 break;
127 case EVENT_ATTRACTION: // Only in Heroic
130 break;
131 default:
132 break;
133 }
134
136 return;
137 }
138 }
139};
140
142{
144}
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
@ H_SPELL_ARCANE_BLAST
@ SPELL_ATTRACTION
@ SPELL_ARCANE_DISCHARGE
@ SPELL_TIME_LAPSE
@ H_SPELL_ARCANE_DISCHARGE
@ SPELL_ARCANE_BLAST
void AddSC_boss_chrono_lord_deja()
@ EVENT_ATTRACTION
@ EVENT_ARCANE_BLAST
@ EVENT_TIME_LAPSE
@ EVENT_ARCANE_DISCHARGE
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 DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
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 UpdateAI(uint32 diff) override
void MoveInLineOfSight(Unit *who) override
void JustDied(Unit *) override
boss_chrono_lord_deja(Creature *creature)
void KilledUnit(Unit *) override
void JustEngagedWith(Unit *) override
@ NPC_TIME_KEEPER
@ TYPE_CRONO_LORD_DEJA
@ TYPE_RIFT
#define RegisterBlackMorassCreatureAI(ai_name)