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#include "ScriptMgr.h"
19#include "Containers.h"
20#include "ScriptedCreature.h"
21#include "sethekk_halls.h"
22#include "SpellScript.h"
23
32
44
53
55{
57 {
58 Intro = false;
59 ManaShield = false;
60 }
61
62 void Reset() override
63 {
64 _Reset();
65 Intro = false;
66 ManaShield = false;
67 }
68
69 void MoveInLineOfSight(Unit* who) override
70 {
71 if (!Intro && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 100.0f))
72 {
73 Intro = true;
75 }
76
78 }
79
90
91 void ExecuteEvent(uint32 eventId) override
92 {
93 switch (eventId)
94 {
95 case EVENT_POLYMORPH:
96 // Second top aggro in normal, random target in heroic.
97 if (IsHeroic())
99 else
101 events.ScheduleEvent(EVENT_POLYMORPH, 15s, 17500ms);
102 break;
106 break;
107 case EVENT_SLOW:
110 break;
111 case EVENT_BLINK:
112 if (me->IsNonMeleeSpellCast(false))
118 break;
122 break;
123 default:
124 break;
125 }
126 }
127
128 void DamageTaken(Unit* /*who*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
129 {
130 if (!ManaShield && me->HealthBelowPctDamaged(20, damage))
131 {
133 ManaShield = true;
134 }
135 }
136
137 void JustDied(Unit* /*killer*/) override
138 {
139 _JustDied();
141 }
142
143 void KilledUnit(Unit* who) override
144 {
145 if (who->GetTypeId() == TYPEID_PLAYER)
146 Talk(SAY_SLAY);
147 }
148
149 private:
151 bool Intro;
152};
153
154// 38194 - Blink
156{
157 bool Validate(SpellInfo const* /*spellInfo*/) override
158 {
160 }
161
162 void FilterTargets(std::list<WorldObject*>& targets)
163 {
164 if (targets.empty())
165 return;
166
168 targets.clear();
169 targets.push_back(target);
170 }
171
177
183};
184
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
Spells
Definition PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_EFFECT_DUMMY
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
DamageEffectType
@ EMOTE_ARCANE_EXPLOSION
@ SPELL_ARCANE_BUBBLE
@ SPELL_ARCANE_VOLLEY
@ SPELL_MANA_SHIELD
@ SPELL_ARCANE_EXPLOSION
@ SPELL_BLINK_TELEPORT
void AddSC_boss_talon_king_ikiss()
@ EVENT_ARCANE_VOLLEY
@ EVENT_ARCANE_EXPLOSION
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 ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
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 DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3231
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition Unit.cpp:3201
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:501
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 JustEngagedWith(Unit *who) override
void KilledUnit(Unit *who) 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