TrinityCore
Loading...
Searching...
No Matches
boss_the_curator_rtk.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 "AreaTrigger.h"
19#include "AreaTriggerAI.h"
20#include "InstanceScript.h"
21#include "ScriptedCreature.h"
22#include "ScriptMgr.h"
23#include "SpellAuras.h"
24#include "SpellAuraEffects.h"
25#include "SpellScript.h"
26#include "return_to_karazhan.h"
27
43
50
59
64
65// 114247 - The Curator
67{
69
70 void RemoveAreaTriggers() const
71 {
73 powerDischarge->Remove();
74 }
75
85
94
95 void KilledUnit(Unit* victim) override
96 {
97 if (!victim->IsPlayer())
98 return;
99
100 Talk(SAY_SLAY);
101 }
102
115
116 void OnChannelFinished(SpellInfo const* spell) override
117 {
118 if (spell->Id != SPELL_EVOCATION)
119 return;
120
125 }
126
127 void UpdateAI(uint32 diff) override
128 {
129 if (!UpdateVictim())
130 return;
131
132 events.Update(diff);
133
135 return;
136
137 while (uint32 eventId = events.ExecuteEvent())
138 {
139 switch (eventId)
140 {
142 {
145 events.Repeat(9700ms);
146 break;
147 }
149 {
151 events.Repeat(12s);
152 break;
153 }
154 case EVENT_CHECK_MANA:
155 {
156 if (me->GetPower(POWER_MANA) <= 0)
157 {
164 }
165 events.Repeat(500ms);
166 break;
167 }
168 default:
169 break;
170 }
171
173 return;
174 }
175 }
176};
177
178// 234416 - Summon Volatile Energy
199
200// 227278 - Power Discharge
221
222// 227269 - Arc Lightning
243
244// 228735 - Static Charge
265
266// 227256 - Overload
268{
269 bool Validate(SpellInfo const* /*spellInfo*/) override
270 {
272 }
273
274 void HandleHitTarget(SpellEffIndex /*effIndex*/) const
275 {
276 Creature* creatureCaster = GetCaster()->ToCreature();
277 if (!creatureCaster)
278 return;
279
282 .TriggeringSpell = GetSpell()
283 });
284 creatureCaster->SetReactState(REACT_AGGRESSIVE);
285 }
286
291};
292
293// 227289 Power Discharge
295{
297
298 void OnUnitEnter(Unit* unit) override
299 {
300 if (!unit->IsPlayer())
301 return;
302
303 Unit* caster = at->GetCaster();
304 if (!caster)
305 return;
306
308 }
309
310 void OnUnitExit(Unit* unit, AreaTriggerExitReason /*reason*/) override
311 {
313 }
314};
315
AreaTriggerExitReason
Definition AreaTrigger.h:69
uint32_t uint32
Definition Define.h:154
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
#define RegisterAreaTriggerAI(ai_name)
Definition ScriptMgr.h:1428
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ POWER_MANA
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
#define SpellEffectFn(F, I, N)
EvadeReason
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_STATE_CASTING
Definition Unit.h:276
void AddSC_boss_the_curator_rtk()
@ EVENT_CHECK_MANA
@ EVENT_VOLATILE_ENERGY
@ EVENT_POWER_DISCHARGE
@ SAY_VOLATILE_ENERGY
@ SUMMON_GROUP_MEDIVH_SCENE
@ SPELL_POWER_DISCHARGE_SELECTOR
@ SPELL_ARC_LIGHTNING_DAMAGE
@ SPELL_POWER_DISCHARGE_DAMAGE
@ SPELL_OVERLOAD_DAMAGE
@ SPELL_EVOCATION
@ SPELL_SUMMON_VOLATILE_ENERGY_SELECTOR
@ SPELL_POWER_DISCHARGE
@ SPELL_SUMMON_VOLATILE_ENERGY
@ SPELL_STATIC_CHARGE
@ SPELL_POWER_DISCHARGE_AREATRIGGER
@ SPELL_COSMETIC_MANA_DRAIN
AreaTrigger *const at
AreaTriggerAI(AreaTrigger *a, uint32 scriptId={}) noexcept
ObjectGuid const & GetCasterGuid() const
Unit * GetCaster() const
bool IsPlayer() const
Definition BaseEntity.h:173
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
SummonList summons
EventMap events
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetReactState(ReactStates st)
Definition Creature.h:174
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void CancelEvent(uint32 eventId)
Definition EventMap.cpp:135
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
Creature * ToCreature()
Definition Object.h:121
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
Spell * GetSpell() const
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
Definition Unit.h:635
int32 GetPower(Powers power) const
Definition Unit.cpp:10028
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
std::vector< AreaTrigger * > GetAreaTriggers(uint32 spellId) const
Definition Unit.cpp:5475
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:1507
bool Validate(SpellInfo const *) override
void HandleHitTarget(SpellEffIndex) const
#define RegisterReturnToKarazhanCreatureAI(ai_name)
@ DATA_THE_CURATOR_RTK
TriggerCastFlags TriggerFlags
void OnUnitExit(Unit *unit, AreaTriggerExitReason) override
boss_the_curator_rtk(Creature *creature)
void KilledUnit(Unit *victim) override
void UpdateAI(uint32 diff) override
void EnterEvadeMode(EvadeReason) override
void JustEngagedWith(Unit *who) override
void OnChannelFinished(SpellInfo const *spell) override
void JustDied(Unit *) override