*Update script for Loatheb.
--HG-- branch : trunk
This commit is contained in:
@@ -2,6 +2,8 @@ DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (-28169,28732,54097);
|
|||||||
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
|
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
|
||||||
( 28732,-28798, 1, 'Widow\'s Embrace - Frenzy'),
|
( 28732,-28798, 1, 'Widow\'s Embrace - Frenzy'),
|
||||||
( 54097,-54100, 1, 'Widow\'s Embrace - Frenzy (H)'),
|
( 54097,-54100, 1, 'Widow\'s Embrace - Frenzy (H)'),
|
||||||
|
(-29865, 55594, 0, 'Deathbloom'),
|
||||||
|
(-55053, 55601, 0, 'Deathbloom (H)'),
|
||||||
(-28169, 28206, 0, 'Mutating Injection - Mutagen Explosion'),
|
(-28169, 28206, 0, 'Mutating Injection - Mutagen Explosion'),
|
||||||
(-28169, 28240, 0, 'Mutating Injection - Poison Cloud');
|
(-28169, 28240, 0, 'Mutating Injection - Poison Cloud');
|
||||||
|
|
||||||
@@ -17,8 +19,8 @@ flags_extra = VALUES(flags_extra),
|
|||||||
scriptname = VALUES(scriptname);
|
scriptname = VALUES(scriptname);
|
||||||
|
|
||||||
INSERT INTO creature_template (entry, spell1, spell2, flags_extra, scriptname) VALUES
|
INSERT INTO creature_template (entry, spell1, spell2, flags_extra, scriptname) VALUES
|
||||||
(16474, 28547, 1000, 128, 'trigger_periodic'), # Blizzard (Sapphiron)
|
(16474, 28547, 0, 128, 'trigger_periodic'), # Blizzard (Sapphiron)
|
||||||
(30000, 55699, 1000, 128, 'trigger_periodic') # Blizzard (Sapphiron) (H)
|
(30000, 55699, 0, 128, 'trigger_periodic') # Blizzard (Sapphiron) (H)
|
||||||
ON DUPLICATE KEY UPDATE
|
ON DUPLICATE KEY UPDATE
|
||||||
spell1 = VALUES(spell1),
|
spell1 = VALUES(spell1),
|
||||||
spell2 = VALUES(spell2),
|
spell2 = VALUES(spell2),
|
||||||
@@ -51,6 +53,12 @@ INSERT INTO creature_template (entry, spell1, spell2, spell3, spell4, spell5, sp
|
|||||||
(29274, 54096, 0, 0, 0, 0, 0, 0, 54097), # Naxxramas Worshipper (H)
|
(29274, 54096, 0, 0, 0, 0, 0, 0, 54097), # Naxxramas Worshipper (H)
|
||||||
(16984, 15496, 0, 0, 0, 0, 0, 0, 0), # Plagued Warrior
|
(16984, 15496, 0, 0, 0, 0, 0, 0, 0), # Plagued Warrior
|
||||||
(29632, 15496, 0, 0, 0, 0, 0, 0, 0), # Plagued Warrior (H)
|
(29632, 15496, 0, 0, 0, 0, 0, 0, 0), # Plagued Warrior (H)
|
||||||
|
(16983, 32736, 30138, 0, 0, 0, 0, 0, 0), # Plagued Champion
|
||||||
|
(29632, 32736, 54889, 0, 0, 0, 0, 0, 0), # Plagued Champion (H)
|
||||||
|
(16981, 15496, 54890, 0, 0, 0, 0, 0, 0), # Plagued Guardian
|
||||||
|
(29632, 15496, 54891, 0, 0, 0, 0, 0, 0), # Plagued Guardian (H)
|
||||||
|
(16286, 0, 0, 0, 0, 0, 0, 0, 29232), # Spore
|
||||||
|
(30068, 0, 0, 0, 0, 0, 0, 0, 29232), # Spore (H)
|
||||||
(16290, 28156, 0, 0, 0, 0, 0, 0, 0), # Fallout Slime
|
(16290, 28156, 0, 0, 0, 0, 0, 0, 0), # Fallout Slime
|
||||||
(29388, 54367, 0, 0, 0, 0, 0, 0, 0), # Fallout Slime (H)
|
(29388, 54367, 0, 0, 0, 0, 0, 0, 0), # Fallout Slime (H)
|
||||||
(16360, 29307, 0, 0, 0, 0, 0, 0, 0), # Zombie Chow
|
(16360, 29307, 0, 0, 0, 0, 0, 0, 0), # Zombie Chow
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL trigger_periodicAI : public NullCreatureAI
|
|||||||
trigger_periodicAI(Creature* c) : NullCreatureAI(c)
|
trigger_periodicAI(Creature* c) : NullCreatureAI(c)
|
||||||
{
|
{
|
||||||
spell = me->m_spells[0] ? GetSpellStore()->LookupEntry(me->m_spells[0]) : NULL;
|
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;
|
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)
|
CreatureAI* GetAI_trigger_periodic(Creature *_Creature)
|
||||||
{
|
{
|
||||||
return new trigger_periodicAI (_Creature);
|
return new trigger_periodicAI (_Creature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CreatureAI* GetAI_trigger_death(Creature *_Creature)
|
||||||
|
{
|
||||||
|
return new trigger_deathAI (_Creature);
|
||||||
|
}
|
||||||
|
|
||||||
void AddSC_generic_creature()
|
void AddSC_generic_creature()
|
||||||
{
|
{
|
||||||
Script *newscript;
|
Script *newscript;
|
||||||
@@ -204,5 +219,10 @@ void AddSC_generic_creature()
|
|||||||
newscript->Name="trigger_periodic";
|
newscript->Name="trigger_periodic";
|
||||||
newscript->GetAI = &GetAI_trigger_periodic;
|
newscript->GetAI = &GetAI_trigger_periodic;
|
||||||
newscript->RegisterSelf();
|
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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* 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
|
* 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 "precompiled.h"
|
||||||
|
#include "def_naxxramas.h"
|
||||||
|
|
||||||
#define SPELL_CORRUPTED_MIND 29198
|
#define SPELL_NECROTIC_AURA 55593
|
||||||
#define SPELL_POISON_AURA 29865
|
#define SPELL_SUMMON_SPORE 29234
|
||||||
#define SPELL_INEVITABLE_DOOM 29204
|
#define SPELL_DEATHBLOOM HEROIC(29865,55053)
|
||||||
#define SPELL_REMOVE_CURSE 30281
|
#define SPELL_INEVITABLE_DOOM HEROIC(29204,55052)
|
||||||
|
|
||||||
#define ADD_1X 2957.040
|
enum Events
|
||||||
#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
|
|
||||||
{
|
{
|
||||||
boss_loathebAI(Creature *c) : ScriptedAI(c) {}
|
EVENT_AURA = 1,
|
||||||
|
EVENT_BLOOM,
|
||||||
|
EVENT_DOOM,
|
||||||
|
};
|
||||||
|
|
||||||
uint32 CorruptedMind_Timer;
|
struct TRINITY_DLL_DECL boss_loathebAI : public BossAI
|
||||||
uint32 PoisonAura_Timer;
|
{
|
||||||
uint32 InevitableDoom_Timer;
|
boss_loathebAI(Creature *c) : BossAI(c, BOSS_LOATHEB) {}
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnterCombat(Unit *who)
|
void EnterCombat(Unit *who)
|
||||||
{
|
{
|
||||||
}
|
_EnterCombat();
|
||||||
|
events.ScheduleEvent(EVENT_AURA, 0);
|
||||||
void JustDied(Unit* Killer)
|
events.ScheduleEvent(EVENT_BLOOM, 30000);
|
||||||
{
|
events.ScheduleEvent(EVENT_DOOM, 120000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
if (!UpdateVictim())
|
if(!UpdateVictim())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//CorruptedMind_Timer
|
events.Update(diff);
|
||||||
if (CorruptedMind_Timer < diff)
|
|
||||||
{
|
|
||||||
DoCast(m_creature->getVictim(),SPELL_CORRUPTED_MIND);
|
|
||||||
CorruptedMind_Timer = 62000;
|
|
||||||
}else CorruptedMind_Timer -= diff;
|
|
||||||
|
|
||||||
//PoisonAura_Timer
|
while(uint32 eventId = events.ExecuteEvent())
|
||||||
if (PoisonAura_Timer < diff)
|
|
||||||
{
|
{
|
||||||
DoCast(m_creature->getVictim(),SPELL_POISON_AURA);
|
switch(eventId)
|
||||||
PoisonAura_Timer = 60000;
|
|
||||||
}else PoisonAura_Timer -= diff;
|
|
||||||
|
|
||||||
//InevitableDoom_Timer
|
|
||||||
if (InevitableDoom_Timer < diff)
|
|
||||||
{
|
{
|
||||||
DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM);
|
case EVENT_AURA:
|
||||||
InevitableDoom_Timer = 120000;
|
DoCastAOE(SPELL_NECROTIC_AURA);
|
||||||
}else InevitableDoom_Timer -= diff;
|
events.ScheduleEvent(EVENT_AURA, 20000);
|
||||||
|
return;
|
||||||
//InevitableDoom5mins_Timer
|
case EVENT_BLOOM:
|
||||||
if (InevitableDoom5mins_Timer < diff)
|
DoCastAOE(SPELL_SUMMON_SPORE, true);
|
||||||
{
|
DoCastAOE(SPELL_DEATHBLOOM);
|
||||||
DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM);
|
events.ScheduleEvent(EVENT_BLOOM, 30000);
|
||||||
InevitableDoom5mins_Timer = 15000;
|
return;
|
||||||
}else InevitableDoom5mins_Timer -= diff;
|
case EVENT_DOOM:
|
||||||
|
DoCastAOE(SPELL_INEVITABLE_DOOM);
|
||||||
//RemoveCurse_Timer
|
events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000);
|
||||||
if (RemoveCurse_Timer < diff)
|
return;
|
||||||
{
|
}
|
||||||
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)
|
|
||||||
{
|
|
||||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
|
||||||
if (target)
|
|
||||||
SummonedSpores->AddThreat(target,1.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Summon_Timer = 28000;
|
|
||||||
} else Summon_Timer -= diff;
|
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CreatureAI* GetAI_boss_loatheb(Creature *_Creature)
|
CreatureAI* GetAI_boss_loatheb(Creature *_Creature)
|
||||||
{
|
{
|
||||||
return new boss_loathebAI (_Creature);
|
return new boss_loathebAI (_Creature);
|
||||||
@@ -143,5 +86,8 @@ void AddSC_boss_loatheb()
|
|||||||
newscript->Name="boss_loatheb";
|
newscript->Name="boss_loatheb";
|
||||||
newscript->GetAI = &GetAI_boss_loatheb;
|
newscript->GetAI = &GetAI_boss_loatheb;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
|
|
||||||
|
// Fungal Creep
|
||||||
|
GetAISpellInfo(29232)->condition = AICOND_DIE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -343,4 +343,8 @@ void AddSC_boss_sapphiron()
|
|||||||
newscript->Name="boss_sapphiron";
|
newscript->Name="boss_sapphiron";
|
||||||
newscript->GetAI = &GetAI_boss_sapphiron;
|
newscript->GetAI = &GetAI_boss_sapphiron;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
|
|
||||||
|
// Chill
|
||||||
|
GetAISpellInfo(28547)->cooldown = 1000;
|
||||||
|
GetAISpellInfo(55699)->cooldown = 1000;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ void CreatureAI::OnCharmed(bool apply)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AISpellInfoType * CreatureAI::AISpellInfo;
|
AISpellInfoType * CreatureAI::AISpellInfo;
|
||||||
|
TRINITY_DLL_SPEC AISpellInfoType * GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i]; }
|
||||||
|
|
||||||
void CreatureAI::DoZoneInCombat(Creature* creature)
|
void CreatureAI::DoZoneInCombat(Creature* creature)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ class EventMap : private std::map<uint32, uint32>
|
|||||||
public:
|
public:
|
||||||
explicit EventMap() : m_phase(0), m_time(0) {}
|
explicit EventMap() : m_phase(0), m_time(0) {}
|
||||||
|
|
||||||
|
uint32 GetTimer() const { return m_time; }
|
||||||
|
|
||||||
void Reset() { clear(); m_time = 0; m_phase = 0; }
|
void Reset() { clear(); m_time = 0; m_phase = 0; }
|
||||||
|
|
||||||
void Update(uint32 time) { m_time += time; }
|
void Update(uint32 time) { m_time += time; }
|
||||||
@@ -171,5 +173,7 @@ struct AISpellInfoType
|
|||||||
uint32 cooldown;
|
uint32 cooldown;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TRINITY_DLL_SPEC AISpellInfoType * GetAISpellInfo(uint32 i);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user