TrinityCore
Loading...
Searching...
No Matches
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#include "ScriptMgr.h"
19#include "InstanceScript.h"
20#include "ScriptedCreature.h"
21#include "the_black_morass.h"
22
31
33{
37 SPELL_ATTRACTION = 38540 //Not Implemented (Heroic mode)
38};
39
47
48// 17879 - Chrono Lord Deja
50{
52
53 void Reset() override { }
54
55 void JustEngagedWith(Unit* /*who*/) override
56 {
60 if (IsHeroic())
62
64 }
65
66 void MoveInLineOfSight(Unit* who) override
67 {
68 //Despawn Time Keeper
69 if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
70 {
71 if (me->IsWithinDistInMap(who, 20.0f))
72 {
74 Unit::DealDamage(me, who, who->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
75 }
76 }
77
79 }
80
81 void KilledUnit(Unit* /*victim*/) override
82 {
84 }
85
86 void JustDied(Unit* /*killer*/) override
87 {
89
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 {
109 events.Repeat(15s, 25s);
110 break;
111 case EVENT_TIME_LAPSE:
114 events.Repeat(15s, 25s);
115 break;
118 events.Repeat(20s, 30s);
119 break;
120 case EVENT_ATTRACTION:
122 events.Repeat(25s, 35s);
123 break;
124 default:
125 break;
126 }
127
129 return;
130 }
131
133 }
134};
135
uint32_t uint32
Definition Define.h:133
@ SPECIAL
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ SPELL_SCHOOL_MASK_NORMAL
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ DIRECT_DAMAGE
Definition Unit.h:353
@ SPELL_ARCANE_DISCHARGE
@ SPELL_ARCANE_BLAST
void AddSC_boss_chrono_lord_deja()
@ EVENT_ARCANE_BLAST
@ EVENT_ARCANE_DISCHARGE
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
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)