Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_tailonking_ikiss.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Boss_Talon_King_Ikiss
8SD%Complete: 80
9SDComment: Heroic supported. Some details missing, but most are spell related.
10SDCategory: Auchindoun, Sethekk Halls
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "sethekk_halls.h"
16
25
40
42{
43public:
44 boss_talon_king_ikiss() : CreatureScript("boss_talon_king_ikiss") { }
45
47 {
49
51 {
52 _Reset();
53 ArcaneVolley_Timer = 5000;
54 Sheep_Timer = 8000;
55 Blink_Timer = 35000;
56 Slow_Timer = 15000+rand()%15000;
57 Blink = false;
58 Intro = false;
59 ManaShield = false;
60 }
61
63 {
64 if (!me->GetVictim() && me->CanCreatureAttack(who))
65 {
66 if (!Intro && me->IsWithinDistInMap(who, 100))
67 {
68 Intro = true;
70 }
71
72 if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
73 return;
74
75 float attackRadius = me->GetAttackDistance(who);
76 if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
77 {
78 //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
79 AttackStart(who);
80 }
81 }
82 }
83
84 void EnterCombat(Unit* /*who*/) OVERRIDE
85 {
88 }
89
90 void JustDied(Unit* /*killer*/) OVERRIDE
91 {
92 _JustDied();
94 }
95
97 {
98 if (who->GetTypeId() == TypeID::TYPEID_PLAYER)
100 }
101
103 {
104 if (!UpdateVictim())
105 return;
106
107 if (Blink)
108 {
111 Blink = false;
112 }
113
114 if (ArcaneVolley_Timer <= diff)
115 {
117 ArcaneVolley_Timer = 7000+rand()%5000;
118 } else ArcaneVolley_Timer -= diff;
119
120 if (Sheep_Timer <= diff)
121 {
122 Unit* target;
123
124 //second top aggro target in normal, random target in heroic correct?
125 if (IsHeroic())
127 else
129
130 if (target)
131 DoCast(target, SPELL_POLYMORPH);
132 Sheep_Timer = 15000+rand()%2500;
133 } else Sheep_Timer -= diff;
134
135 //may not be correct time to cast
136 if (!ManaShield && HealthBelowPct(20))
137 {
139 ManaShield = true;
140 }
141
142 if (IsHeroic())
143 {
144 if (Slow_Timer <= diff)
145 {
147 Slow_Timer = 15000+rand()%25000;
148 } else Slow_Timer -= diff;
149 }
150
151 if (Blink_Timer <= diff)
152 {
154
155 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
156 {
157 if (me->IsNonMeleeSpellCasted(false))
158 me->InterruptNonMeleeSpells(false);
159
160 //Spell doesn't work, but we use for visual effect at least
161 DoCast(target, SPELL_BLINK);
162
163 float X = target->GetPositionX();
164 float Y = target->GetPositionY();
165 float Z = target->GetPositionZ();
166
167 DoTeleportTo(X, Y, Z);
168
170 Blink = true;
171 }
172 Blink_Timer = 35000+rand()%5000;
173 } else Blink_Timer -= diff;
174
175 if (!Blink)
177 }
178
179 private:
184
186 bool Blink;
187 bool Intro;
188 };
189
191 {
193 }
194};
195
#define CREATURE_Z_ATTACK_RANGE
Definition Creature.h:422
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TYPEID_PLAYER
Definition Object.h:55
@ SELECT_TARGET_TOPAGGRO
Definition UnitAI.h:24
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SLAY
@ SAY_INTRO
@ SPELL_ARCANE_EXPLOSION
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_ARCANE_VOLLEY
#define SPELL_BLINK
Definition boss_noth.cpp:28
@ SPELL_ARCANE_BUBBLE
@ SPELL_ARCANE_VOLLEY
@ H_SPELL_POLYMORPH
@ SPELL_MANA_SHIELD
@ H_SPELL_ARCANE_VOLLEY
@ SPELL_ARCANE_EXPLOSION
@ SPELL_BLINK_TELEPORT
void AddSC_boss_talon_king_ikiss()
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ SPELL_MANA_SHIELD
Definition karazhan.cpp:39
AI * GetSethekkHallsAI(Creature *creature)
@ DATA_TALON_KING_IKISS
bool IsHeroic() const
Creature * me
void DoTeleportTo(float x, float y, float z, uint32 time=0)
bool HealthBelowPct(uint32 pct) const
void AttackStart(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ H_SPELL_ARCANE_EXPLOSION