Skip to content

Commit a8d13bb

Browse files
committed
[s2588] EventAI cleanup Part I - Outland
Notes: Creature 22009 hasn't yet been removed because it may require additional research. Probably will be removed upon Lady Vashj script cleanup. (based on commit 8db426a)
1 parent f4ab4cb commit a8d13bb

18 files changed

Lines changed: 46 additions & 1080 deletions

scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -307,45 +307,6 @@ CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature)
307307
return new boss_exarch_maladaarAI(pCreature);
308308
}
309309

310-
enum
311-
{
312-
SPELL_AV_MORTAL_STRIKE = 16856,
313-
SPELL_AV_SUNDER_ARMOR = 16145
314-
};
315-
316-
struct MANGOS_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI
317-
{
318-
mob_avatar_of_martyredAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}
319-
320-
void Reset()
321-
{
322-
m_uiMortalStrikeTimer = 10000;
323-
}
324-
325-
uint32 m_uiMortalStrikeTimer;
326-
327-
void UpdateAI(const uint32 uiDiff)
328-
{
329-
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
330-
return;
331-
332-
if (m_uiMortalStrikeTimer < uiDiff)
333-
{
334-
DoCastSpellIfCan(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE);
335-
m_uiMortalStrikeTimer = urand(10000, 30000);
336-
}
337-
else
338-
m_uiMortalStrikeTimer -= uiDiff;
339-
340-
DoMeleeAttackIfReady();
341-
}
342-
};
343-
344-
CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature)
345-
{
346-
return new mob_avatar_of_martyredAI(pCreature);
347-
}
348-
349310
void AddSC_boss_exarch_maladaar()
350311
{
351312
Script* pNewScript;
@@ -355,11 +316,6 @@ void AddSC_boss_exarch_maladaar()
355316
pNewScript->GetAI = &GetAI_boss_exarch_maladaar;
356317
pNewScript->RegisterSelf();
357318

358-
pNewScript = new Script;
359-
pNewScript->Name = "mob_avatar_of_martyred";
360-
pNewScript->GetAI = &GetAI_mob_avatar_of_martyred;
361-
pNewScript->RegisterSelf();
362-
363319
pNewScript = new Script;
364320
pNewScript->Name = "mob_stolen_soul";
365321
pNewScript->GetAI = &GetAI_mob_stolen_soul;

scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -176,75 +176,6 @@ CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature)
176176
return new boss_nexusprince_shaffarAI(pCreature);
177177
}
178178

179-
enum
180-
{
181-
SPELL_ARCANE_BOLT = 15254,
182-
SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430
183-
};
184-
185-
struct MANGOS_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
186-
{
187-
mob_ethereal_beaconAI(Creature* pCreature) : ScriptedAI(pCreature)
188-
{
189-
m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
190-
Reset();
191-
}
192-
193-
bool m_bIsRegularMode;
194-
195-
uint32 m_uiApprenticeTimer;
196-
uint32 m_uiArcaneBoltTimer;
197-
198-
void Reset()
199-
{
200-
m_uiApprenticeTimer = m_bIsRegularMode ? 20000 : 10000;
201-
m_uiArcaneBoltTimer = 0;
202-
}
203-
204-
void JustSummoned(Creature* pSummoned)
205-
{
206-
if (m_creature->getVictim())
207-
pSummoned->AI()->AttackStart(m_creature->getVictim());
208-
}
209-
210-
void UpdateAI(const uint32 uiDiff)
211-
{
212-
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
213-
return;
214-
215-
if (m_uiArcaneBoltTimer < uiDiff)
216-
{
217-
DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_BOLT);
218-
m_uiArcaneBoltTimer = urand(3000, 8000);
219-
}
220-
else
221-
m_uiArcaneBoltTimer -= uiDiff;
222-
223-
if (m_uiApprenticeTimer)
224-
{
225-
if (m_uiApprenticeTimer <= uiDiff)
226-
{
227-
if (DoCastSpellIfCan(m_creature, SPELL_ETHEREAL_APPRENTICE) == CAST_OK)
228-
{
229-
// despawn in 2 sec because of the spell visual
230-
m_creature->ForcedDespawn(2000);
231-
m_uiApprenticeTimer = 0;
232-
}
233-
}
234-
else
235-
m_uiApprenticeTimer -= uiDiff;
236-
}
237-
238-
//should they do meele?
239-
DoMeleeAttackIfReady();
240-
}
241-
};
242-
243-
CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature)
244-
{
245-
return new mob_ethereal_beaconAI(pCreature);
246-
}
247-
248179
void AddSC_boss_nexusprince_shaffar()
249180
{
250181
Script* pNewScript;
@@ -253,9 +184,4 @@ void AddSC_boss_nexusprince_shaffar()
253184
pNewScript->Name = "boss_nexusprince_shaffar";
254185
pNewScript->GetAI = &GetAI_boss_nexusprince_shaffar;
255186
pNewScript->RegisterSelf();
256-
257-
pNewScript = new Script;
258-
pNewScript->Name = "mob_ethereal_beacon";
259-
pNewScript->GetAI = &GetAI_mob_ethereal_beacon;
260-
pNewScript->RegisterSelf();
261187
}

scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp

Lines changed: 1 addition & 225 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,6 @@ enum
5555
NPC_FROST_ELEMENTAL = 19204,
5656
NPC_ARCANE_ELEMENTAL = 19205,
5757
NPC_SHADOW_ELEMENTAL = 19206,
58-
59-
SPELL_FLAME_BUFFET = 33526,
60-
SPELL_FLAME_BUFFET_H = 38141,
61-
SPELL_ARCANE_BUFFET = 33527,
62-
SPELL_ARCANE_BUFFET_H = 38138,
63-
SPELL_FROST_BUFFET = 33528,
64-
SPELL_FROST_BUFFET_H = 38142,
65-
SPELL_SHADOW_BUFFET = 33529,
66-
SPELL_SHADOW_BUFFET_H = 38143,
6758
};
6859

6960
struct MANGOS_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI
@@ -229,201 +220,6 @@ CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature)
229220
return new boss_darkweaver_sythAI(pCreature);
230221
}
231222

232-
/* ELEMENTALS */
233-
234-
struct MANGOS_DLL_DECL mob_syth_fireAI : public ScriptedAI
235-
{
236-
mob_syth_fireAI(Creature* pCreature) : ScriptedAI(pCreature)
237-
{
238-
m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
239-
Reset();
240-
}
241-
242-
bool m_bIsRegularMode;
243-
uint32 flameshock_timer;
244-
uint32 flamebuffet_timer;
245-
246-
void Reset()
247-
{
248-
flameshock_timer = 2500;
249-
flamebuffet_timer = 5000;
250-
}
251-
252-
void UpdateAI(const uint32 diff)
253-
{
254-
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
255-
return;
256-
257-
if (flameshock_timer < diff)
258-
{
259-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
260-
DoCastSpellIfCan(target, SPELL_FLAME_SHOCK);
261-
262-
flameshock_timer = 5000;
263-
}else flameshock_timer -= diff;
264-
265-
if (flamebuffet_timer < diff)
266-
{
267-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
268-
DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_FLAME_BUFFET : SPELL_FLAME_BUFFET_H);
269-
270-
flamebuffet_timer = 5000;
271-
272-
}else flamebuffet_timer -= diff;
273-
274-
DoMeleeAttackIfReady();
275-
}
276-
};
277-
278-
CreatureAI* GetAI_mob_syth_fire(Creature* pCreature)
279-
{
280-
return new mob_syth_fireAI(pCreature);
281-
}
282-
283-
struct MANGOS_DLL_DECL mob_syth_arcaneAI : public ScriptedAI
284-
{
285-
mob_syth_arcaneAI(Creature* pCreature) : ScriptedAI(pCreature)
286-
{
287-
m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
288-
Reset();
289-
}
290-
291-
bool m_bIsRegularMode;
292-
uint32 arcaneshock_timer;
293-
uint32 arcanebuffet_timer;
294-
295-
void Reset()
296-
{
297-
arcaneshock_timer = 2500;
298-
arcanebuffet_timer = 5000;
299-
}
300-
301-
void UpdateAI(const uint32 diff)
302-
{
303-
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
304-
return;
305-
306-
if (arcaneshock_timer < diff)
307-
{
308-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
309-
DoCastSpellIfCan(target, SPELL_ARCANE_SHOCK);
310-
311-
arcaneshock_timer = 5000;
312-
}else arcaneshock_timer -= diff;
313-
314-
if (arcanebuffet_timer < diff)
315-
{
316-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
317-
DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_ARCANE_BUFFET : SPELL_ARCANE_BUFFET_H);
318-
319-
arcanebuffet_timer = 5000;
320-
}else arcanebuffet_timer -= diff;
321-
322-
DoMeleeAttackIfReady();
323-
}
324-
};
325-
326-
CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature)
327-
{
328-
return new mob_syth_arcaneAI(pCreature);
329-
}
330-
331-
struct MANGOS_DLL_DECL mob_syth_frostAI : public ScriptedAI
332-
{
333-
mob_syth_frostAI(Creature* pCreature) : ScriptedAI(pCreature)
334-
{
335-
m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
336-
Reset();
337-
}
338-
339-
bool m_bIsRegularMode;
340-
uint32 frostshock_timer;
341-
uint32 frostbuffet_timer;
342-
343-
void Reset()
344-
{
345-
frostshock_timer = 2500;
346-
frostbuffet_timer = 5000;
347-
}
348-
349-
void UpdateAI(const uint32 diff)
350-
{
351-
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
352-
return;
353-
354-
if (frostshock_timer < diff)
355-
{
356-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
357-
DoCastSpellIfCan(target, SPELL_FROST_SHOCK);
358-
359-
frostshock_timer = 5000;
360-
}else frostshock_timer -= diff;
361-
362-
if (frostbuffet_timer < diff)
363-
{
364-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
365-
DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_FROST_BUFFET : SPELL_FROST_BUFFET_H);
366-
367-
frostbuffet_timer = 5000;
368-
}else frostbuffet_timer -= diff;
369-
370-
DoMeleeAttackIfReady();
371-
}
372-
};
373-
374-
CreatureAI* GetAI_mob_syth_frost(Creature* pCreature)
375-
{
376-
return new mob_syth_frostAI(pCreature);
377-
}
378-
379-
struct MANGOS_DLL_DECL mob_syth_shadowAI : public ScriptedAI
380-
{
381-
mob_syth_shadowAI(Creature* pCreature) : ScriptedAI(pCreature)
382-
{
383-
m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
384-
Reset();
385-
}
386-
387-
bool m_bIsRegularMode;
388-
uint32 shadowshock_timer;
389-
uint32 shadowbuffet_timer;
390-
391-
void Reset()
392-
{
393-
shadowshock_timer = 2500;
394-
shadowbuffet_timer = 5000;
395-
}
396-
397-
void UpdateAI(const uint32 diff)
398-
{
399-
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
400-
return;
401-
402-
if (shadowshock_timer < diff)
403-
{
404-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
405-
DoCastSpellIfCan(target, SPELL_SHADOW_SHOCK);
406-
407-
shadowshock_timer = 5000;
408-
}else shadowshock_timer -= diff;
409-
410-
if (shadowbuffet_timer < diff)
411-
{
412-
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
413-
DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_SHADOW_BUFFET : SPELL_SHADOW_BUFFET_H);
414-
415-
shadowbuffet_timer = 5000;
416-
}else shadowbuffet_timer -= diff;
417-
418-
DoMeleeAttackIfReady();
419-
}
420-
};
421-
422-
CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature)
423-
{
424-
return new mob_syth_shadowAI(pCreature);
425-
}
426-
427223
void AddSC_boss_darkweaver_syth()
428224
{
429225
Script* pNewScript;
@@ -432,24 +228,4 @@ void AddSC_boss_darkweaver_syth()
432228
pNewScript->Name = "boss_darkweaver_syth";
433229
pNewScript->GetAI = &GetAI_boss_darkweaver_syth;
434230
pNewScript->RegisterSelf();
435-
436-
pNewScript = new Script;
437-
pNewScript->Name = "mob_syth_fire";
438-
pNewScript->GetAI = &GetAI_mob_syth_fire;
439-
pNewScript->RegisterSelf();
440-
441-
pNewScript = new Script;
442-
pNewScript->Name = "mob_syth_arcane";
443-
pNewScript->GetAI = &GetAI_mob_syth_arcane;
444-
pNewScript->RegisterSelf();
445-
446-
pNewScript = new Script;
447-
pNewScript->Name = "mob_syth_frost";
448-
pNewScript->GetAI = &GetAI_mob_syth_frost;
449-
pNewScript->RegisterSelf();
450-
451-
pNewScript = new Script;
452-
pNewScript->Name = "mob_syth_shadow";
453-
pNewScript->GetAI = &GetAI_mob_syth_shadow;
454-
pNewScript->RegisterSelf();
455-
}
231+
}

0 commit comments

Comments
 (0)