TrinityCore
Loading...
Searching...
No Matches
boss_talon_king_ikiss.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 * Timers requires to be revisited
20 * Looks like SPELL_ARCANE_BUBBLE and SPELL_MANA_SHIELD were removed in Cata
21 */
22
23#include "ScriptMgr.h"
24#include "Containers.h"
25#include "ScriptedCreature.h"
26#include "SpellScript.h"
27#include "SpellInfo.h"
28#include "SpellMgr.h"
29#include "sethekk_halls.h"
30
39
41{
42 // Combat
45 SPELL_SLOW = 35032,
47
48 // Combat - Sequence
49 SPELL_BLINK = 38194,
52
53 // Scripts
55};
56
68
77
78// 18473 - Talon King Ikiss
80{
82
83 void Reset() override
84 {
85 _Reset();
88 }
89
91 void MoveInLineOfSight(Unit* who) override
92 {
93 if (!_introDone && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 100.0f))
94 {
95 _introDone = true;
97 }
98
100 }
101
102 void JustEngagedWith(Unit* who) override
103 {
105
107
110 if (IsHeroic())
112 }
113
114 void OnSpellCast(SpellInfo const* spellInfo) override
115 {
116 if (spellInfo->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_ARCANE_EXPLOSION, me))
118 }
119
120 void DamageTaken(Unit* /*who*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
121 {
122 if (_phase < PHASE_HEALTH_80 && me->HealthBelowPctDamaged(80, damage))
123 {
124 _phase++;
126 }
127
128 if (_phase < PHASE_HEALTH_50 && me->HealthBelowPctDamaged(50, damage))
129 {
130 _phase++;
132 }
133
134 if (_phase < PHASE_HEALTH_25 && me->HealthBelowPctDamaged(25, damage))
135 {
136 _phase++;
138 }
139
140 if (_phase < PHASE_HEALTH_15 && me->HealthBelowPctDamaged(15, damage))
141 {
142 _phase++;
144 }
145 }
146
147 void KilledUnit(Unit* /*who*/) override
148 {
149 Talk(SAY_SLAY);
150 }
151
152 void JustDied(Unit* /*killer*/) override
153 {
154 _JustDied();
156 }
157
158 void ExecuteEvent(uint32 eventId) override
159 {
160 switch (eventId)
161 {
162 case EVENT_POLYMORPH:
163 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 30.0f))
164 DoCast(target, SPELL_POLYMORPH);
165 events.Repeat(10s, 20s);
166 break;
169 events.Repeat(10s);
170 break;
171 case EVENT_SLOW:
173 events.Repeat(15s, 20s);
174 break;
177 break;
178
179 case EVENT_SEQUENCE_1:
184 break;
185 case EVENT_SEQUENCE_2:
189 break;
190 case EVENT_SEQUENCE_3:
192 break;
193 default:
194 break;
195 }
196 }
197
198private:
201};
202
203// 38194 - Blink
205{
207
208 bool Validate(SpellInfo const* /*spellInfo*/) override
209 {
211 }
212
213 void FilterTargets(std::list<WorldObject*>& targets)
214 {
215 if (targets.empty())
216 return;
217
219
220 _selectedTargetGuid = target->GetGUID();
221 }
222
223 void HandleDummy(SpellEffIndex /*effIndex*/)
224 {
225 if (GetHitUnit()->GetGUID() == _selectedTargetGuid)
227 }
228
234
235private:
237};
238
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ TARGET_UNIT_SRC_AREA_ENEMY
#define sSpellMgr
Definition SpellMgr.h:738
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
Definition Unit.h:366
void AddSC_boss_talon_king_ikiss()
@ SPELL_ARCANE_BUBBLE
@ SPELL_ARCANE_VOLLEY
@ SPELL_MANA_SHIELD
@ SPELL_ARCANE_EXPLOSION
@ SPELL_BLINK_TELEPORT
@ EMOTE_ARCANE_EXPLOSION
@ EVENT_ARCANE_VOLLEY
@ EVENT_MANA_SHIELD
void JustEngagedWith(Unit *who) override
EventMap events
virtual void MoveInLineOfSight(Unit *)
Creature *const me
Definition CreatureAI.h:82
void SetReactState(ReactStates st)
Definition Creature.h:128
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
TypeID GetTypeId() const
Definition Object.h:93
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
uint32 Id
Definition SpellInfo.h:289
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:783
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2833
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1193
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:108
@ DATA_TALON_KING_IKISS
#define RegisterSethekkHallsCreatureAI(ai_name)
bool IsHeroic() const
void ResetThreatList(Unit *who=nullptr)
void JustEngagedWith(Unit *who) override
void OnSpellCast(SpellInfo const *spellInfo) override
void ExecuteEvent(uint32 eventId) override
void MoveInLineOfSight(Unit *who) override
boss_talon_king_ikiss(Creature *creature)
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void JustDied(Unit *) override
void KilledUnit(Unit *) override