*Update script for Loatheb.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-17 23:27:51 -05:00
parent 1d859b6ee4
commit a922f36da5
6 changed files with 82 additions and 99 deletions
@@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL trigger_periodicAI : public NullCreatureAI
trigger_periodicAI(Creature* c) : NullCreatureAI(c)
{
spell = me->m_spells[0] ? GetSpellStore()->LookupEntry(me->m_spells[0]) : NULL;
interval = me->m_spells[1] ? me->m_spells[1] : 1000;
interval = spell ? GetAISpellInfo(me->m_spells[0])->cooldown : 100000; //me->m_spells[1] ? me->m_spells[1] : 1000;
timer = interval;
}
@@ -187,11 +187,26 @@ struct TRINITY_DLL_DECL trigger_periodicAI : public NullCreatureAI
}
};
struct TRINITY_DLL_DECL trigger_deathAI : public NullCreatureAI
{
trigger_deathAI(Creature* c) : NullCreatureAI(c) {}
void JustDied(Unit *killer)
{
if(me->m_spells[0])
me->CastSpell(killer, me->m_spells[0], true);
}
};
CreatureAI* GetAI_trigger_periodic(Creature *_Creature)
{
return new trigger_periodicAI (_Creature);
}
CreatureAI* GetAI_trigger_death(Creature *_Creature)
{
return new trigger_deathAI (_Creature);
}
void AddSC_generic_creature()
{
Script *newscript;
@@ -204,5 +219,10 @@ void AddSC_generic_creature()
newscript->Name="trigger_periodic";
newscript->GetAI = &GetAI_trigger_periodic;
newscript->RegisterSelf();
/*newscript = new Script;
newscript->Name="trigger_death";
newscript->GetAI = &GetAI_trigger_death;
newscript->RegisterSelf();*/
}
@@ -1,4 +1,6 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
/*
* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -14,123 +16,64 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Loatheb
SD%Complete: 100
SDComment:
SDCategory: Naxxramas
EndScriptData */
#include "precompiled.h"
#include "def_naxxramas.h"
#define SPELL_CORRUPTED_MIND 29198
#define SPELL_POISON_AURA 29865
#define SPELL_INEVITABLE_DOOM 29204
#define SPELL_REMOVE_CURSE 30281
#define SPELL_NECROTIC_AURA 55593
#define SPELL_SUMMON_SPORE 29234
#define SPELL_DEATHBLOOM HEROIC(29865,55053)
#define SPELL_INEVITABLE_DOOM HEROIC(29204,55052)
#define ADD_1X 2957.040
#define ADD_1Y -3997.590
#define ADD_1Z 274.280
#define ADD_2X 2909.130
#define ADD_2Y -4042.970
#define ADD_2Z 274.280
#define ADD_3X 2861.102
#define ADD_3Y -3997.901
#define ADD_3Z 274.280
struct TRINITY_DLL_DECL boss_loathebAI : public ScriptedAI
enum Events
{
boss_loathebAI(Creature *c) : ScriptedAI(c) {}
EVENT_AURA = 1,
EVENT_BLOOM,
EVENT_DOOM,
};
uint32 CorruptedMind_Timer;
uint32 PoisonAura_Timer;
uint32 InevitableDoom_Timer;
uint32 InevitableDoom5mins_Timer;
uint32 RemoveCurse_Timer;
uint32 Summon_Timer;
void Reset()
{
CorruptedMind_Timer = 4000;
PoisonAura_Timer = 2500;
InevitableDoom_Timer = 120000;
InevitableDoom5mins_Timer = 300000;
RemoveCurse_Timer = 30000;
Summon_Timer = 8000;
}
struct TRINITY_DLL_DECL boss_loathebAI : public BossAI
{
boss_loathebAI(Creature *c) : BossAI(c, BOSS_LOATHEB) {}
void EnterCombat(Unit *who)
{
}
void JustDied(Unit* Killer)
{
_EnterCombat();
events.ScheduleEvent(EVENT_AURA, 0);
events.ScheduleEvent(EVENT_BLOOM, 30000);
events.ScheduleEvent(EVENT_DOOM, 120000);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
if(!UpdateVictim())
return;
//CorruptedMind_Timer
if (CorruptedMind_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CORRUPTED_MIND);
CorruptedMind_Timer = 62000;
}else CorruptedMind_Timer -= diff;
events.Update(diff);
//PoisonAura_Timer
if (PoisonAura_Timer < diff)
while(uint32 eventId = events.ExecuteEvent())
{
DoCast(m_creature->getVictim(),SPELL_POISON_AURA);
PoisonAura_Timer = 60000;
}else PoisonAura_Timer -= diff;
//InevitableDoom_Timer
if (InevitableDoom_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM);
InevitableDoom_Timer = 120000;
}else InevitableDoom_Timer -= diff;
//InevitableDoom5mins_Timer
if (InevitableDoom5mins_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM);
InevitableDoom5mins_Timer = 15000;
}else InevitableDoom5mins_Timer -= diff;
//RemoveCurse_Timer
if (RemoveCurse_Timer < diff)
{
DoCast(m_creature,SPELL_REMOVE_CURSE);
RemoveCurse_Timer = 30000;
}else RemoveCurse_Timer -= diff;
//Summon_Timer
if (Summon_Timer < diff)
{
Unit* target = NULL;
Unit* SummonedSpores = NULL;
SummonedSpores = m_creature->SummonCreature(16286,ADD_1X,ADD_1Y,ADD_1Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
SummonedSpores = m_creature->SummonCreature(16286,ADD_2X,ADD_2Y,ADD_2Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
SummonedSpores = m_creature->SummonCreature(16286,ADD_3X,ADD_3Y,ADD_3Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
if (SummonedSpores)
switch(eventId)
{
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target)
SummonedSpores->AddThreat(target,1.0f);
case EVENT_AURA:
DoCastAOE(SPELL_NECROTIC_AURA);
events.ScheduleEvent(EVENT_AURA, 20000);
return;
case EVENT_BLOOM:
DoCastAOE(SPELL_SUMMON_SPORE, true);
DoCastAOE(SPELL_DEATHBLOOM);
events.ScheduleEvent(EVENT_BLOOM, 30000);
return;
case EVENT_DOOM:
DoCastAOE(SPELL_INEVITABLE_DOOM);
events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000);
return;
}
Summon_Timer = 28000;
} else Summon_Timer -= diff;
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_loatheb(Creature *_Creature)
{
return new boss_loathebAI (_Creature);
@@ -143,5 +86,8 @@ void AddSC_boss_loatheb()
newscript->Name="boss_loatheb";
newscript->GetAI = &GetAI_boss_loatheb;
newscript->RegisterSelf();
// Fungal Creep
GetAISpellInfo(29232)->condition = AICOND_DIE;
}
@@ -343,4 +343,8 @@ void AddSC_boss_sapphiron()
newscript->Name="boss_sapphiron";
newscript->GetAI = &GetAI_boss_sapphiron;
newscript->RegisterSelf();
// Chill
GetAISpellInfo(28547)->cooldown = 1000;
GetAISpellInfo(55699)->cooldown = 1000;
}