Skip to content

Commit 1a5cd03

Browse files
author
schmoozerd
committed
Cleanup and Improvement Ikiss. Patch by DaC
The teleport-effect of blinking still needs MaNGOS support git-svn-id: https://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2@1926 5f9c896b-1e26-0410-94da-f77f675e2462
1 parent 296c878 commit 1a5cd03

2 files changed

Lines changed: 109 additions & 110 deletions

File tree

include/sc_creature.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,11 @@ void ScriptedAI::SetCombatMovement(bool bCombatMove)
487487
// It is assumed the information is found elswehere and can be handled by mangos. So far no luck finding such information/way to extract it.
488488
enum
489489
{
490-
NPC_BROODLORD = 12017,
491-
NPC_VOID_REAVER = 19516,
492-
NPC_JAN_ALAI = 23578,
493-
NPC_SARTHARION = 28860
490+
NPC_BROODLORD = 12017,
491+
NPC_VOID_REAVER = 19516,
492+
NPC_JAN_ALAI = 23578,
493+
NPC_SARTHARION = 28860,
494+
NPC_TALON_KING_IKISS = 18473,
494495
};
495496

496497
bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff)
@@ -528,6 +529,12 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff)
528529
if (fX > 3218.86f && fX < 3275.69f && fY < 572.40f && fY > 484.68f)
529530
return false;
530531
break;
532+
case NPC_TALON_KING_IKISS:
533+
float fX, fY, fZ;
534+
m_creature->GetRespawnCoord(fX, fY, fZ);
535+
if (m_creature->GetDistance2d(fX, fY) < 70.0f)
536+
return false;
537+
break;
531538
default:
532539
error_log("SD2: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", m_creature->GetEntry());
533540
return false;

scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp

Lines changed: 98 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -16,93 +16,88 @@
1616

1717
/* ScriptData
1818
SDName: Boss_Talon_King_Ikiss
19-
SD%Complete: 80
20-
SDComment: Heroic supported. Some details missing, but most are spell related.
19+
SD%Complete: 100
20+
SDComment:
2121
SDCategory: Auchindoun, Sethekk Halls
2222
EndScriptData */
2323

2424
#include "precompiled.h"
2525
#include "sethekk_halls.h"
2626

27-
#define SAY_INTRO -1556007
28-
#define SAY_AGGRO_1 -1556008
29-
#define SAY_AGGRO_2 -1556009
30-
#define SAY_AGGRO_3 -1556010
31-
#define SAY_SLAY_1 -1556011
32-
#define SAY_SLAY_2 -1556012
33-
#define SAY_DEATH -1556013
34-
#define EMOTE_ARCANE_EXP -1556015
35-
36-
#define SPELL_BLINK 38194
37-
#define SPELL_BLINK_TELEPORT 38203
38-
#define SPELL_MANA_SHIELD 38151
39-
#define SPELL_ARCANE_BUBBLE 9438
40-
#define H_SPELL_SLOW 35032
41-
42-
#define SPELL_POLYMORPH 38245
43-
#define H_SPELL_POLYMORPH 43309
44-
45-
#define SPELL_ARCANE_VOLLEY 35059
46-
#define H_SPELL_ARCANE_VOLLEY 40424
47-
48-
#define SPELL_ARCANE_EXPLOSION 38197
49-
#define H_SPELL_ARCANE_EXPLOSION 40425
27+
enum
28+
{
29+
SAY_INTRO = -1556007,
30+
SAY_AGGRO_1 = -1556008,
31+
SAY_AGGRO_2 = -1556009,
32+
SAY_AGGRO_3 = -1556010,
33+
SAY_SLAY_1 = -1556011,
34+
SAY_SLAY_2 = -1556012,
35+
SAY_DEATH = -1556013,
36+
EMOTE_ARCANE_EXP = -1556015,
37+
38+
SPELL_BLINK = 38194,
39+
SPELL_MANA_SHIELD = 38151,
40+
SPELL_ARCANE_BUBBLE = 9438,
41+
SPELL_SLOW_H = 35032,
42+
43+
SPELL_POLYMORPH = 38245,
44+
SPELL_POLYMORPH_H = 43309,
45+
46+
SPELL_ARCANE_VOLLEY = 35059,
47+
SPELL_ARCANE_VOLLEY_H = 40424,
48+
49+
SPELL_ARCANE_EXPLOSION = 38197,
50+
SPELL_ARCANE_EXPLOSION_H = 40425,
51+
};
5052

5153
struct MANGOS_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
5254
{
5355
boss_talon_king_ikissAI(Creature* pCreature) : ScriptedAI(pCreature)
5456
{
5557
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
5658
m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
59+
m_bIntro = false;
5760
Reset();
5861
}
5962

6063
ScriptedInstance* m_pInstance;
6164
bool m_bIsRegularMode;
6265

63-
uint32 ArcaneVolley_Timer;
64-
uint32 Sheep_Timer;
65-
uint32 Blink_Timer;
66-
uint32 Slow_Timer;
66+
uint32 m_uiArcaneVolleyTimer;
67+
uint32 m_uiSheepTimer;
68+
uint32 m_uiBlinkTimer;
69+
uint32 m_uiSlowTimer;
6770

68-
bool ManaShield;
69-
bool Blink;
70-
bool Intro;
71+
bool m_bManaShield;
72+
bool m_bBlink;
73+
bool m_bIntro;
7174

7275
void Reset()
7376
{
74-
ArcaneVolley_Timer = 5000;
75-
Sheep_Timer = 8000;
76-
Blink_Timer = 35000;
77-
Slow_Timer = urand(15000, 30000);
78-
Blink = false;
79-
Intro = false;
80-
ManaShield = false;
77+
m_uiArcaneVolleyTimer = 5000;
78+
m_uiSheepTimer = 8000;
79+
m_uiBlinkTimer = 35000;
80+
m_uiSlowTimer = urand(15000, 30000);
81+
82+
m_bBlink = false;
83+
m_bManaShield = false;
8184
}
8285

83-
void MoveInLineOfSight(Unit *who)
86+
void MoveInLineOfSight(Unit* pWho)
8487
{
85-
if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessablePlaceFor(m_creature))
88+
if (!m_creature->getVictim() && pWho->isTargetableForAttack() && (m_creature->IsHostileTo(pWho)) && pWho->isInAccessablePlaceFor(m_creature))
8689
{
87-
if (!Intro && m_creature->IsWithinDistInMap(who, 100))
90+
if (!m_bIntro && m_creature->IsWithinDistInMap(pWho, 100.0f))
8891
{
89-
Intro = true;
92+
m_bIntro = true;
9093
DoScriptText(SAY_INTRO, m_creature);
9194
}
92-
93-
if (!m_creature->CanFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
94-
return;
95-
96-
float attackRadius = m_creature->GetAttackDistance(who);
97-
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
98-
{
99-
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
100-
AttackStart(who);
101-
}
10295
}
96+
97+
ScriptedAI::MoveInLineOfSight(pWho);
10398
}
10499

105-
void Aggro(Unit *who)
100+
void Aggro(Unit* pWho)
106101
{
107102
switch(urand(0, 2))
108103
{
@@ -115,7 +110,7 @@ struct MANGOS_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
115110
m_pInstance->SetData(TYPE_IKISS, IN_PROGRESS);
116111
}
117112

118-
void JustDied(Unit* Killer)
113+
void JustDied(Unit* pKiller)
119114
{
120115
DoScriptText(SAY_DEATH, m_creature);
121116

@@ -129,80 +124,76 @@ struct MANGOS_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
129124
m_pInstance->SetData(TYPE_IKISS, FAIL);
130125
}
131126

132-
void KilledUnit(Unit* victim)
127+
void KilledUnit(Unit* pVctim)
133128
{
134129
DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature);
135130
}
136131

137-
void UpdateAI(const uint32 diff)
132+
void UpdateAI(const uint32 uiDiff)
138133
{
139134
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
140135
return;
141136

142-
if (Blink)
137+
if (EnterEvadeIfOutOfCombatArea(uiDiff))
138+
return;
139+
140+
if (m_bBlink)
143141
{
144-
DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ARCANE_EXPLOSION : H_SPELL_ARCANE_EXPLOSION);
145-
m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true);
146-
Blink = false;
142+
DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION_H);
143+
DoCastSpellIfCan(m_creature, SPELL_ARCANE_BUBBLE, CAST_TRIGGERED);
144+
DoResetThreat();
145+
m_bBlink = false;
147146
}
148147

149-
if (ArcaneVolley_Timer < diff)
148+
if (m_uiArcaneVolleyTimer < uiDiff)
150149
{
151-
DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ARCANE_VOLLEY : H_SPELL_ARCANE_VOLLEY);
152-
ArcaneVolley_Timer = urand(7000, 12000);
153-
}else ArcaneVolley_Timer -= diff;
150+
if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY_H) == CAST_OK)
151+
m_uiArcaneVolleyTimer = urand(7000, 12000);
152+
}
153+
else
154+
m_uiArcaneVolleyTimer -= uiDiff;
154155

155-
if (Sheep_Timer < diff)
156+
if (m_uiSheepTimer < uiDiff)
156157
{
157-
//second top aggro target in normal, random target in heroic correct?
158-
Unit *target = NULL;
159-
if (m_bIsRegularMode ? target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1) : target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
160-
DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_POLYMORPH : H_SPELL_POLYMORPH);
161-
Sheep_Timer = urand(15000, 17500);
162-
}else Sheep_Timer -= diff;
163-
164-
//may not be correct time to cast
165-
if (!ManaShield && m_creature->GetHealthPercent() < 20.0f)
158+
// second top aggro target in normal, random target in heroic
159+
if (Unit* pTarget = m_bIsRegularMode ? m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1) : m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
160+
DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_POLYMORPH : SPELL_POLYMORPH_H);
161+
m_uiSheepTimer = urand(15000, 17500);
162+
}
163+
else
164+
m_uiSheepTimer -= uiDiff;
165+
166+
if (!m_bManaShield && m_creature->GetHealthPercent() < 20.0f)
166167
{
167-
DoCastSpellIfCan(m_creature,SPELL_MANA_SHIELD);
168-
ManaShield = true;
168+
if (DoCastSpellIfCan(m_creature, SPELL_MANA_SHIELD) == CAST_OK)
169+
m_bManaShield = true;
169170
}
170171

171172
if (!m_bIsRegularMode)
172173
{
173-
if (Slow_Timer < diff)
174+
if (m_uiSlowTimer < uiDiff)
174175
{
175-
DoCastSpellIfCan(m_creature,H_SPELL_SLOW);
176-
Slow_Timer = urand(15000, 40000);
177-
}else Slow_Timer -= diff;
176+
if (DoCastSpellIfCan(m_creature, SPELL_SLOW_H) == CAST_OK)
177+
m_uiSlowTimer = urand(15000, 30000);
178+
}
179+
else
180+
m_uiSlowTimer -= uiDiff;
178181
}
179182

180-
if (Blink_Timer < diff)
183+
if (m_uiBlinkTimer < uiDiff)
181184
{
182185
DoScriptText(EMOTE_ARCANE_EXP, m_creature);
183186

184-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
187+
if (DoCastSpellIfCan(m_creature, SPELL_BLINK, CAST_INTERRUPT_PREVIOUS) == CAST_OK)
185188
{
186-
if (m_creature->IsNonMeleeSpellCasted(false))
187-
m_creature->InterruptNonMeleeSpells(false);
188-
189-
//Spell doesn't work, but we use for visual effect at least
190-
DoCastSpellIfCan(target,SPELL_BLINK);
191-
192-
float X = target->GetPositionX();
193-
float Y = target->GetPositionY();
194-
float Z = target->GetPositionZ();
195-
196-
m_creature->GetMap()->CreatureRelocation(m_creature,X,Y,Z,0.0f);
197-
m_creature->SendMonsterMove(X, Y, Z, SPLINETYPE_NORMAL, SPLINEFLAG_WALKMODE, 1);
198-
199-
DoCastSpellIfCan(target,SPELL_BLINK_TELEPORT);
200-
Blink = true;
189+
m_bBlink = true;
190+
m_uiBlinkTimer = urand(35000, 40000);
201191
}
202-
Blink_Timer = urand(35000, 40000);
203-
}else Blink_Timer -= diff;
192+
}
193+
else
194+
m_uiBlinkTimer -= uiDiff;
204195

205-
if (!Blink)
196+
if (!m_bBlink)
206197
DoMeleeAttackIfReady();
207198
}
208199
};
@@ -214,9 +205,10 @@ CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature)
214205

215206
void AddSC_boss_talon_king_ikiss()
216207
{
217-
Script *newscript;
218-
newscript = new Script;
219-
newscript->Name = "boss_talon_king_ikiss";
220-
newscript->GetAI = &GetAI_boss_talon_king_ikiss;
221-
newscript->RegisterSelf();
208+
Script* pNewscript;
209+
210+
pNewscript = new Script;
211+
pNewscript->Name = "boss_talon_king_ikiss";
212+
pNewscript->GetAI = &GetAI_boss_talon_king_ikiss;
213+
pNewscript->RegisterSelf();
222214
}

0 commit comments

Comments
 (0)