aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-17 23:27:51 -0500
committermegamage <none@none>2009-05-17 23:27:51 -0500
commita922f36da5c1d3d9809649cac028393e6b06b5df (patch)
tree1a951f2cce9916c7d8d0abd7500d71e818262c85
parent1d859b6ee4251e26e02348286d549710435bd0f1 (diff)
*Update script for Loatheb.
--HG-- branch : trunk
-rw-r--r--sql/updates/3233_world_scripts_naxx.sql12
-rw-r--r--src/bindings/scripts/scripts/creature/mob_generic_creature.cpp22
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp138
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp4
-rw-r--r--src/game/CreatureAI.cpp1
-rw-r--r--src/game/CreatureAIImpl.h4
6 files changed, 82 insertions, 99 deletions
diff --git a/sql/updates/3233_world_scripts_naxx.sql b/sql/updates/3233_world_scripts_naxx.sql
index 6463de8f850..c809c5b280c 100644
--- a/sql/updates/3233_world_scripts_naxx.sql
+++ b/sql/updates/3233_world_scripts_naxx.sql
@@ -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
( 28732,-28798, 1, 'Widow\'s Embrace - Frenzy'),
( 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, 28240, 0, 'Mutating Injection - Poison Cloud');
@@ -17,8 +19,8 @@ flags_extra = VALUES(flags_extra),
scriptname = VALUES(scriptname);
INSERT INTO creature_template (entry, spell1, spell2, flags_extra, scriptname) VALUES
-(16474, 28547, 1000, 128, 'trigger_periodic'), # Blizzard (Sapphiron)
-(30000, 55699, 1000, 128, 'trigger_periodic') # Blizzard (Sapphiron) (H)
+(16474, 28547, 0, 128, 'trigger_periodic'), # Blizzard (Sapphiron)
+(30000, 55699, 0, 128, 'trigger_periodic') # Blizzard (Sapphiron) (H)
ON DUPLICATE KEY UPDATE
spell1 = VALUES(spell1),
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)
(16984, 15496, 0, 0, 0, 0, 0, 0, 0), # Plagued Warrior
(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
(29388, 54367, 0, 0, 0, 0, 0, 0, 0), # Fallout Slime (H)
(16360, 29307, 0, 0, 0, 0, 0, 0, 0), # Zombie Chow
diff --git a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
index cff456e3516..d26b724cdbf 100644
--- a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
@@ -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();*/
}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp
index 3d50e8f084b..8548862d1b5 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp
@@ -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 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 SPELL_NECROTIC_AURA 55593
+#define SPELL_SUMMON_SPORE 29234
+#define SPELL_DEATHBLOOM HEROIC(29865,55053)
+#define SPELL_INEVITABLE_DOOM HEROIC(29204,55052)
-#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) {}
-
- uint32 CorruptedMind_Timer;
- uint32 PoisonAura_Timer;
- uint32 InevitableDoom_Timer;
- uint32 InevitableDoom5mins_Timer;
- uint32 RemoveCurse_Timer;
- uint32 Summon_Timer;
+ EVENT_AURA = 1,
+ EVENT_BLOOM,
+ EVENT_DOOM,
+};
- 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;
-
- //PoisonAura_Timer
- if (PoisonAura_Timer < diff)
- {
- 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;
+ events.Update(diff);
- //RemoveCurse_Timer
- if (RemoveCurse_Timer < diff)
+ while(uint32 eventId = events.ExecuteEvent())
{
- 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;
}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
index dce3c974f47..9bfb98cab43 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
@@ -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;
}
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index 2fc4cf938cf..230c1d446fc 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -33,6 +33,7 @@ void CreatureAI::OnCharmed(bool apply)
}
AISpellInfoType * CreatureAI::AISpellInfo;
+TRINITY_DLL_SPEC AISpellInfoType * GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i]; }
void CreatureAI::DoZoneInCombat(Creature* creature)
{
diff --git a/src/game/CreatureAIImpl.h b/src/game/CreatureAIImpl.h
index 7edebb709fd..f404f0d954f 100644
--- a/src/game/CreatureAIImpl.h
+++ b/src/game/CreatureAIImpl.h
@@ -81,6 +81,8 @@ class EventMap : private std::map<uint32, uint32>
public:
explicit EventMap() : m_phase(0), m_time(0) {}
+ uint32 GetTimer() const { return m_time; }
+
void Reset() { clear(); m_time = 0; m_phase = 0; }
void Update(uint32 time) { m_time += time; }
@@ -171,5 +173,7 @@ struct AISpellInfoType
uint32 cooldown;
};
+TRINITY_DLL_SPEC AISpellInfoType * GetAISpellInfo(uint32 i);
+
#endif