Skip to content

Commit d1fc15b

Browse files
committed
[2673] EventAI cleanup Part II - Kalimdor
1 parent 2c141bd commit d1fc15b

19 files changed

Lines changed: 135 additions & 1108 deletions

scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -404,32 +404,6 @@ struct MANGOS_DLL_DECL npc_doomfire_spiritAI : public ScriptedAI
404404
}
405405
};
406406

407-
struct mob_ancient_wispAI : public ScriptedAI
408-
{
409-
mob_ancient_wispAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
410-
411-
uint32 m_uiCheckTimer;
412-
413-
void Reset()
414-
{
415-
m_uiCheckTimer = 1000;
416-
}
417-
418-
void UpdateAI(const uint32 uiDiff)
419-
{
420-
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
421-
return;
422-
423-
if (m_uiCheckTimer < uiDiff)
424-
{
425-
DoCastSpellIfCan(m_creature->getVictim(), SPELL_ANCIENT_SPARK);
426-
m_uiCheckTimer = urand(2000, 3000);
427-
}
428-
else
429-
m_uiCheckTimer -= uiDiff;
430-
}
431-
};
432-
433407
CreatureAI* GetAI_boss_archimonde(Creature* pCreature)
434408
{
435409
return new boss_archimondeAI(pCreature);
@@ -440,11 +414,6 @@ CreatureAI* GetAI_npc_doomfire_spirit(Creature* pCreature)
440414
return new npc_doomfire_spiritAI(pCreature);
441415
}
442416

443-
CreatureAI* GetAI_mob_ancient_wisp(Creature* pCreature)
444-
{
445-
return new mob_ancient_wispAI(pCreature);
446-
}
447-
448417
void AddSC_boss_archimonde()
449418
{
450419
Script* pNewScript;
@@ -458,9 +427,4 @@ void AddSC_boss_archimonde()
458427
pNewScript->Name = "npc_doomfire_spirit";
459428
pNewScript->GetAI = &GetAI_npc_doomfire_spirit;
460429
pNewScript->RegisterSelf();
461-
462-
pNewScript = new Script;
463-
pNewScript->Name = "mob_ancient_wisp";
464-
pNewScript->GetAI = &GetAI_mob_ancient_wisp;
465-
pNewScript->RegisterSelf();
466430
}

scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp

Lines changed: 2 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -16,138 +16,13 @@
1616

1717
/* ScriptData
1818
SDName: Boss_Captain_Skarloc
19-
SD%Complete: 75
20-
SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + speech before enter combat.
19+
SD%Complete: 0
20+
SDComment: Placeholder
2121
SDCategory: Caverns of Time, Old Hillsbrad Foothills
2222
EndScriptData */
2323

2424
#include "precompiled.h"
25-
#include "old_hillsbrad.h"
26-
27-
#define SAY_ENTER -1560000
28-
#define SAY_TAUNT1 -1560001
29-
#define SAY_TAUNT2 -1560002
30-
#define SAY_SLAY1 -1560003
31-
#define SAY_SLAY2 -1560004
32-
#define SAY_DEATH -1560005
33-
34-
#define SPELL_HOLY_LIGHT 29427
35-
#define SPELL_CLEANSE 29380
36-
#define SPELL_HAMMER_OF_JUSTICE 13005
37-
#define SPELL_HOLY_SHIELD 31904
38-
#define SPELL_DEVOTION_AURA 8258
39-
#define SPELL_CONSECRATION 38385
40-
41-
struct MANGOS_DLL_DECL boss_captain_skarlocAI : public ScriptedAI
42-
{
43-
boss_captain_skarlocAI(Creature* pCreature) : ScriptedAI(pCreature)
44-
{
45-
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
46-
Reset();
47-
}
48-
49-
ScriptedInstance* m_pInstance;
50-
51-
uint32 Holy_Light_Timer;
52-
uint32 Cleanse_Timer;
53-
uint32 HammerOfJustice_Timer;
54-
uint32 HolyShield_Timer;
55-
uint32 DevotionAura_Timer;
56-
uint32 Consecration_Timer;
57-
58-
void Reset()
59-
{
60-
Holy_Light_Timer = 30000;
61-
Cleanse_Timer = 10000;
62-
HammerOfJustice_Timer = 60000;
63-
HolyShield_Timer = 240000;
64-
DevotionAura_Timer = 3000;
65-
Consecration_Timer = 8000;
66-
}
67-
68-
void Aggro(Unit *who)
69-
{
70-
//This is not correct. Should taunt Thrall before engage in combat
71-
DoScriptText(SAY_TAUNT1, m_creature);
72-
DoScriptText(SAY_TAUNT2, m_creature);
73-
}
74-
75-
void KilledUnit(Unit *victim)
76-
{
77-
DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature);
78-
}
79-
80-
void JustDied(Unit *victim)
81-
{
82-
DoScriptText(SAY_DEATH, m_creature);
83-
84-
if (m_pInstance && m_pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
85-
m_pInstance->SetData(TYPE_THRALL_PART1, DONE);
86-
}
87-
88-
void UpdateAI(const uint32 diff)
89-
{
90-
//Return since we have no target
91-
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
92-
return;
93-
94-
//Holy_Light
95-
if (Holy_Light_Timer < diff)
96-
{
97-
DoCastSpellIfCan(m_creature, SPELL_HOLY_LIGHT);
98-
Holy_Light_Timer = urand(20000, 30000);
99-
}else Holy_Light_Timer -= diff;
100-
101-
//Cleanse
102-
if (Cleanse_Timer < diff)
103-
{
104-
DoCastSpellIfCan(m_creature, SPELL_CLEANSE);
105-
Cleanse_Timer = 10000;
106-
} else Cleanse_Timer -= diff;
107-
108-
//Hammer of Justice
109-
if (HammerOfJustice_Timer < diff)
110-
{
111-
DoCastSpellIfCan(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE);
112-
HammerOfJustice_Timer = urand(20000, 35000);
113-
}else HammerOfJustice_Timer -= diff;
114-
115-
//Holy Shield
116-
if (HolyShield_Timer < diff)
117-
{
118-
DoCastSpellIfCan(m_creature, SPELL_HOLY_SHIELD);
119-
HolyShield_Timer = 240000;
120-
}else HolyShield_Timer -= diff;
121-
122-
//Devotion_Aura
123-
if (DevotionAura_Timer < diff)
124-
{
125-
DoCastSpellIfCan(m_creature, SPELL_DEVOTION_AURA);
126-
DevotionAura_Timer = urand(45000, 55000);
127-
}else DevotionAura_Timer -= diff;
128-
129-
//Consecration
130-
if (Consecration_Timer < diff)
131-
{
132-
//DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONSECRATION);
133-
Consecration_Timer = urand(5000, 10000);
134-
}else Consecration_Timer -= diff;
135-
136-
DoMeleeAttackIfReady();
137-
}
138-
};
139-
140-
CreatureAI* GetAI_boss_captain_skarloc(Creature* pCreature)
141-
{
142-
return new boss_captain_skarlocAI(pCreature);
143-
}
14425

14526
void AddSC_boss_captain_skarloc()
14627
{
147-
Script* pNewScript;
148-
149-
pNewScript = new Script;
150-
pNewScript->Name = "boss_captain_skarloc";
151-
pNewScript->GetAI = &GetAI_boss_captain_skarloc;
152-
pNewScript->RegisterSelf();
15328
}

scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp

Lines changed: 2 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -16,124 +16,13 @@
1616

1717
/* ScriptData
1818
SDName: Boss_Epoch_Hunter
19-
SD%Complete: 60
20-
SDComment: Missing spawns pre-event, missing speech to be coordinated with rest of escort event.
19+
SD%Complete: 0
20+
SDComment: Placeholder
2121
SDCategory: Caverns of Time, Old Hillsbrad Foothills
2222
EndScriptData */
2323

2424
#include "precompiled.h"
25-
#include "old_hillsbrad.h"
26-
27-
#define SAY_ENTER1 -1560013
28-
#define SAY_ENTER2 -1560014
29-
#define SAY_ENTER3 -1560015
30-
#define SAY_AGGRO1 -1560016
31-
#define SAY_AGGRO2 -1560017
32-
#define SAY_SLAY1 -1560018
33-
#define SAY_SLAY2 -1560019
34-
#define SAY_BREATH1 -1560020
35-
#define SAY_BREATH2 -1560021
36-
#define SAY_DEATH -1560022
37-
38-
#define SPELL_SAND_BREATH 31914
39-
#define SPELL_IMPENDING_DEATH 31916
40-
#define SPELL_MAGIC_DISRUPTION_AURA 33834
41-
#define SPELL_WING_BUFFET 31475
42-
43-
struct MANGOS_DLL_DECL boss_epoch_hunterAI : public ScriptedAI
44-
{
45-
boss_epoch_hunterAI(Creature* pCreature) : ScriptedAI(pCreature)
46-
{
47-
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
48-
Reset();
49-
}
50-
51-
ScriptedInstance* m_pInstance;
52-
53-
uint32 SandBreath_Timer;
54-
uint32 ImpendingDeath_Timer;
55-
uint32 WingBuffet_Timer;
56-
uint32 Mda_Timer;
57-
58-
void Reset()
59-
{
60-
SandBreath_Timer = urand(8000, 16000);
61-
ImpendingDeath_Timer = urand(25000, 30000);
62-
WingBuffet_Timer = 35000;
63-
Mda_Timer = 40000;
64-
}
65-
66-
void Aggro(Unit *who)
67-
{
68-
DoScriptText(urand(0, 1) ? SAY_AGGRO1 : SAY_AGGRO2, m_creature);
69-
}
70-
71-
void KilledUnit(Unit *victim)
72-
{
73-
DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature);
74-
}
75-
76-
void JustDied(Unit *victim)
77-
{
78-
DoScriptText(SAY_DEATH, m_creature);
79-
80-
if (m_pInstance && m_pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
81-
m_pInstance->SetData(TYPE_THRALL_PART4, DONE);
82-
}
83-
84-
void UpdateAI(const uint32 diff)
85-
{
86-
//Return since we have no target
87-
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
88-
return;
89-
90-
//Sand Breath
91-
if (SandBreath_Timer < diff)
92-
{
93-
if (m_creature->IsNonMeleeSpellCasted(false))
94-
m_creature->InterruptNonMeleeSpells(false);
95-
96-
DoCastSpellIfCan(m_creature->getVictim(),SPELL_SAND_BREATH);
97-
98-
DoScriptText(urand(0, 1) ? SAY_BREATH1 : SAY_BREATH2, m_creature);
99-
100-
SandBreath_Timer = urand(10000, 20000);
101-
}else SandBreath_Timer -= diff;
102-
103-
if (ImpendingDeath_Timer < diff)
104-
{
105-
DoCastSpellIfCan(m_creature->getVictim(),SPELL_IMPENDING_DEATH);
106-
ImpendingDeath_Timer = urand(25000, 30000);
107-
}else ImpendingDeath_Timer -= diff;
108-
109-
if (WingBuffet_Timer < diff)
110-
{
111-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
112-
DoCastSpellIfCan(target,SPELL_WING_BUFFET);
113-
WingBuffet_Timer = urand(25000, 35000);
114-
}else WingBuffet_Timer -= diff;
115-
116-
if (Mda_Timer < diff)
117-
{
118-
DoCastSpellIfCan(m_creature,SPELL_MAGIC_DISRUPTION_AURA);
119-
Mda_Timer = 15000;
120-
}else Mda_Timer -= diff;
121-
122-
DoMeleeAttackIfReady();
123-
}
124-
};
125-
126-
CreatureAI* GetAI_boss_epoch_hunter(Creature* pCreature)
127-
{
128-
return new boss_epoch_hunterAI(pCreature);
129-
}
13025

13126
void AddSC_boss_epoch_hunter()
13227
{
133-
Script* pNewScript;
134-
135-
pNewScript = new Script;
136-
pNewScript->Name = "boss_epoch_hunter";
137-
pNewScript->GetAI = &GetAI_boss_epoch_hunter;
138-
pNewScript->RegisterSelf();
13928
}

0 commit comments

Comments
 (0)