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 "sethekk_halls.h"
29
38
40{
41 // Combat
44 SPELL_SLOW = 35032,
46
47 // Combat - Sequence
48 SPELL_BLINK = 38194,
51
52 // Scripts
54};
55
67
76
77// 18473 - Talon King Ikiss
79{
81
82 void Reset() override
83 {
84 _Reset();
87 }
88
90 void MoveInLineOfSight(Unit* who) override
91 {
92 if (!_introDone && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 100.0f))
93 {
94 _introDone = true;
96 }
97
99 }
100
101 void JustEngagedWith(Unit* who) override
102 {
104
106
109 if (IsHeroic())
111 }
112
113 void OnSpellCast(SpellInfo const* spellInfo) override
114 {
115 if (spellInfo->Id == SPELL_ARCANE_EXPLOSION)
117 }
118
119 void DamageTaken(Unit* /*who*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
120 {
121 if (_phase < PHASE_HEALTH_80 && me->HealthBelowPctDamaged(80, damage))
122 {
123 _phase++;
125 }
126
127 if (_phase < PHASE_HEALTH_50 && me->HealthBelowPctDamaged(50, damage))
128 {
129 _phase++;
131 }
132
133 if (_phase < PHASE_HEALTH_25 && me->HealthBelowPctDamaged(25, damage))
134 {
135 _phase++;
137 }
138
139 if (_phase < PHASE_HEALTH_15 && me->HealthBelowPctDamaged(15, damage))
140 {
141 _phase++;
143 }
144 }
145
146 void KilledUnit(Unit* /*who*/) override
147 {
148 Talk(SAY_SLAY);
149 }
150
151 void JustDied(Unit* /*killer*/) override
152 {
153 _JustDied();
155 }
156
157 void ExecuteEvent(uint32 eventId) override
158 {
159 switch (eventId)
160 {
161 case EVENT_POLYMORPH:
162 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 30.0f))
163 DoCast(target, SPELL_POLYMORPH);
164 events.Repeat(10s, 20s);
165 break;
168 events.Repeat(10s);
169 break;
170 case EVENT_SLOW:
172 events.Repeat(15s, 20s);
173 break;
176 break;
177
178 case EVENT_SEQUENCE_1:
183 break;
184 case EVENT_SEQUENCE_2:
188 break;
189 case EVENT_SEQUENCE_3:
191 break;
192 default:
193 break;
194 }
195 }
196
197private:
200};
201
202// 38194 - Blink
204{
205 bool Validate(SpellInfo const* /*spellInfo*/) override
206 {
208 }
209
210 void FilterTargets(std::list<WorldObject*>& targets)
211 {
212 if (targets.empty())
213 return;
214
216
217 _selectedTargetGuid = target->GetGUID();
218 }
219
220 void HandleDummy(SpellEffIndex /*effIndex*/)
221 {
222 if (GetHitUnit()->GetGUID() == _selectedTargetGuid)
224 }
225
231
232private:
234};
235
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ TARGET_UNIT_SRC_AREA_ENEMY
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
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
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
TypeID GetTypeId() const
Definition BaseEntity.h:166
void JustEngagedWith(Unit *who) override
EventMap events
virtual void MoveInLineOfSight(Unit *)
Creature *const me
Definition CreatureAI.h:63
void SetReactState(ReactStates st)
Definition Creature.h:180
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:499
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
@ 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