aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaelima <kaelima@live.se>2012-01-09 10:07:46 +0100
committerkaelima <kaelima@live.se>2012-01-09 10:07:46 +0100
commitf850baeb30e2532d2fb52fbd49368f313b73fe04 (patch)
tree0e3cdbc50ff9d66db4252d154e36a8aa336dfe25
parentf53a1f253e0dfb3de2d85117e36d36d9daea87a6 (diff)
Script/Naxxramas: Fixed "A Spore Loser", texts and timers for Loatheb encounter.
Creds to Warpten, thanks.
-rw-r--r--sql/updates/world/2012_01_09_00_world_achievement_criteria_data.sql5
-rw-r--r--sql/updates/world/2012_01_09_00_world_creature_text.sql5
-rw-r--r--sql/updates/world/2012_01_09_00_world_spell_script_names.sql3
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp204
4 files changed, 168 insertions, 49 deletions
diff --git a/sql/updates/world/2012_01_09_00_world_achievement_criteria_data.sql b/sql/updates/world/2012_01_09_00_world_achievement_criteria_data.sql
new file mode 100644
index 00000000000..6c2bcc86d03
--- /dev/null
+++ b/sql/updates/world/2012_01_09_00_world_achievement_criteria_data.sql
@@ -0,0 +1,5 @@
+DELETE FROM `disables` WHERE `sourceType`=4 AND `entry` IN (7612,7613);
+DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (7612,7613);
+INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES
+(7612,11,0,0, 'achievement_spore_loser'),
+(7613,11,0,0, 'achievement_spore_loser');
diff --git a/sql/updates/world/2012_01_09_00_world_creature_text.sql b/sql/updates/world/2012_01_09_00_world_creature_text.sql
new file mode 100644
index 00000000000..2a70be00b12
--- /dev/null
+++ b/sql/updates/world/2012_01_09_00_world_creature_text.sql
@@ -0,0 +1,5 @@
+DELETE FROM `creature_text` WHERE `entry`=16011;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(16011,0,0, 'An aura of necrotic energy blocks all healing!',41,0,100,0,0,0, 'Loatheb'),
+(16011,1,0, 'The aura fades away, allowing for healing once more!',41,0,100,0,0,0, 'Loatheb'),
+(16011,2,0, 'The aura''s power begins to wane!',41,0,100,0,0,0, 'Loatheb');
diff --git a/sql/updates/world/2012_01_09_00_world_spell_script_names.sql b/sql/updates/world/2012_01_09_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..7279fc54413
--- /dev/null
+++ b/sql/updates/world/2012_01_09_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=59481;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(59481, 'spell_loatheb_necrotic_aura_warning');
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
index 4c2348d30c9..502c841540a 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
@@ -20,79 +20,185 @@
enum Spells
{
- SPELL_NECROTIC_AURA = 55593,
- SPELL_SUMMON_SPORE = 29234,
- SPELL_DEATHBLOOM = 29865,
- H_SPELL_DEATHBLOOM = 55053,
- SPELL_INEVITABLE_DOOM = 29204,
- H_SPELL_INEVITABLE_DOOM = 55052
+ SPELL_NECROTIC_AURA = 55593,
+ SPELL_WARN_NECROTIC_AURA = 59481,
+ SPELL_SUMMON_SPORE = 29234,
+ SPELL_DEATHBLOOM = 29865,
+ H_SPELL_DEATHBLOOM = 55053,
+ SPELL_INEVITABLE_DOOM = 29204,
+ H_SPELL_INEVITABLE_DOOM = 55052
+};
+
+enum Texts
+{
+ SAY_NECROTIC_AURA_APPLIED = 0,
+ SAY_NECROTIC_AURA_REMOVED = 1,
+ SAY_NECROTIC_AURA_FADING = 2,
};
enum Events
{
- EVENT_NONE,
- EVENT_AURA,
- EVENT_BLOOM,
- EVENT_DOOM,
+ EVENT_NECROTIC_AURA = 1,
+ EVENT_DEATHBLOOM = 2,
+ EVENT_INEVITABLE_DOOM = 3,
+ EVENT_SPORE = 4,
+ EVENT_NECROTIC_AURA_FADING = 5,
+};
+
+enum Achievement
+{
+ DATA_ACHIEVEMENT_SPORE_LOSER = 21822183,
};
class boss_loatheb : public CreatureScript
{
-public:
- boss_loatheb() : CreatureScript("boss_loatheb") { }
+ public:
+ boss_loatheb() : CreatureScript("boss_loatheb") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_loathebAI (creature);
- }
+ struct boss_loathebAI : public BossAI
+ {
+ boss_loathebAI(Creature* creature) : BossAI(creature, BOSS_LOATHEB)
+ {
+ }
- struct boss_loathebAI : public BossAI
- {
- boss_loathebAI(Creature* c) : BossAI(c, BOSS_LOATHEB) {}
+ void Reset()
+ {
+ _Reset();
+ _doomCounter = 0;
+ _sporeLoserData = true;
+ }
- void EnterCombat(Unit* /*who*/)
- {
- _EnterCombat();
- events.ScheduleEvent(EVENT_AURA, 10000);
- events.ScheduleEvent(EVENT_BLOOM, 5000);
- events.ScheduleEvent(EVENT_DOOM, 120000);
- }
+ void EnterCombat(Unit* /*who*/)
+ {
+ _EnterCombat();
+ events.ScheduleEvent(EVENT_NECROTIC_AURA, 17000);
+ events.ScheduleEvent(EVENT_DEATHBLOOM, 5000);
+ events.ScheduleEvent(EVENT_SPORE, IsHeroic() ? 18000 : 36000);
+ events.ScheduleEvent(EVENT_INEVITABLE_DOOM, 120000);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void SummonedCreatureDies(Creature* /*summon*/, Unit* /*killer*/)
+ {
+ _sporeLoserData = false;
+ }
- events.Update(diff);
+ uint32 GetData(int32 id)
+ {
+ if (id != DATA_ACHIEVEMENT_SPORE_LOSER)
+ return 0;
- while (uint32 eventId = events.ExecuteEvent())
+ return uint32(_sporeLoserData);
+ }
+
+ void UpdateAI(uint32 const diff)
{
- switch (eventId)
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- case EVENT_AURA:
- DoCastAOE(SPELL_NECROTIC_AURA);
- events.ScheduleEvent(EVENT_AURA, 20000);
- break;
- case EVENT_BLOOM:
- // TODO : Add missing text
- DoCastAOE(SPELL_SUMMON_SPORE, true);
- DoCastAOE(RAID_MODE(SPELL_DEATHBLOOM, H_SPELL_DEATHBLOOM));
- events.ScheduleEvent(EVENT_BLOOM, 30000);
- break;
- case EVENT_DOOM:
- DoCastAOE(RAID_MODE(SPELL_INEVITABLE_DOOM, H_SPELL_INEVITABLE_DOOM));
- events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000);
- break;
+ switch (eventId)
+ {
+ case EVENT_NECROTIC_AURA:
+ DoCastAOE(SPELL_NECROTIC_AURA);
+ DoCast(me, SPELL_WARN_NECROTIC_AURA);
+ events.ScheduleEvent(EVENT_NECROTIC_AURA, 20000);
+ events.ScheduleEvent(EVENT_NECROTIC_AURA_FADING, 14000);
+ break;
+ case EVENT_DEATHBLOOM:
+ DoCastAOE(RAID_MODE(SPELL_DEATHBLOOM, H_SPELL_DEATHBLOOM));
+ events.ScheduleEvent(EVENT_DEATHBLOOM, 30000);
+ break;
+ case EVENT_INEVITABLE_DOOM:
+ _doomCounter++;
+ DoCastAOE(RAID_MODE(SPELL_INEVITABLE_DOOM, H_SPELL_INEVITABLE_DOOM));
+ events.ScheduleEvent(EVENT_INEVITABLE_DOOM, std::max(120000 - _doomCounter * 15000, 15000)); // needs to be confirmed
+ break;
+ case EVENT_SPORE:
+ DoCast(me, SPELL_SUMMON_SPORE, false);
+ events.ScheduleEvent(EVENT_SPORE, IsHeroic() ? 18000 : 36000);
+ break;
+ case EVENT_NECROTIC_AURA_FADING:
+ Talk(SAY_NECROTIC_AURA_FADING);
+ break;
+ default:
+ break;
+ }
}
+
+ DoMeleeAttackIfReady();
}
- DoMeleeAttackIfReady();
+ private:
+ bool _sporeLoserData;
+ uint8 _doomCounter;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new boss_loathebAI(creature);
+ }
+};
+
+class achievement_spore_loser : public AchievementCriteriaScript
+{
+ public:
+ achievement_spore_loser() : AchievementCriteriaScript("achievement_spore_loser") { }
+
+ bool OnCheck(Player* /*source*/, Unit* target)
+ {
+ return target && target->GetAI()->GetData(DATA_ACHIEVEMENT_SPORE_LOSER);
}
- };
+};
+
+typedef boss_loatheb::boss_loathebAI LoathebAI;
+
+class spell_loatheb_necrotic_aura_warning : public SpellScriptLoader
+{
+ public:
+ spell_loatheb_necrotic_aura_warning() : SpellScriptLoader("spell_loatheb_necrotic_aura_warning") { }
+
+ class spell_loatheb_necrotic_aura_warning_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_loatheb_necrotic_aura_warning_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellStore.LookupEntry(SPELL_WARN_NECROTIC_AURA))
+ return false;
+ return true;
+ }
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetTarget()->IsAIEnabled)
+ CAST_AI(LoathebAI, GetTarget()->GetAI())->Talk(SAY_NECROTIC_AURA_APPLIED);
+ }
+
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetTarget()->IsAIEnabled)
+ CAST_AI(LoathebAI, GetTarget()->GetAI())->Talk(SAY_NECROTIC_AURA_REMOVED);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_loatheb_necrotic_aura_warning_AuraScript();
+ }
};
void AddSC_boss_loatheb()
{
new boss_loatheb();
+ new achievement_spore_loser();
+ new spell_loatheb_necrotic_aura_warning();
}