diff --git a/data/sql/world/base/naxx40_spells.sql b/data/sql/world/base/naxx40_spells.sql index e2e7ca6..229998f 100644 --- a/data/sql/world/base/naxx40_spells.sql +++ b/data/sql/world/base/naxx40_spells.sql @@ -183,3 +183,67 @@ INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (29371, 'spel -- Wrath of the Plaguebringer, damage if failed to decurse DELETE FROM `spell_script_names` WHERE `spell_id` = 29213; INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (29213, 'spell_noth_curse_of_the_plaguebringer_aura_40'); + +-- Loatheb +-- Corrupted Mind +DELETE FROM `spell_script_names` WHERE `spell_id` = 29201; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (29201, 'spell_loatheb_corrupted_mind_40'); + +-- Corrupted Mind check - Druid +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'isAllowedToCastSpell' AND `spell_id` IN +(740, 774, 1058, 1430, 2090, 2091, 2782, 2893, 3627, 5185, 5186, 5187, 5188, 5189, 6778, 8903, 8910, 8918, 8936, 8938, 8939, 8940, 8941, 8946, +9750, 9758, 9839, 9840, 9841, 9856, 9857, 9858, 9862, 9863, 9888, 9889, 18562, 25297, 25299, 26978, 26979, 26980, 26981, 26982, 26983, 33763); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(740, 'isAllowedToCastSpell'), (774, 'isAllowedToCastSpell'), (1058, 'isAllowedToCastSpell'), (1430, 'isAllowedToCastSpell'), (2090, 'isAllowedToCastSpell'), (2091, 'isAllowedToCastSpell'), +(2782, 'isAllowedToCastSpell'), (2893, 'isAllowedToCastSpell'), (3627, 'isAllowedToCastSpell'), (5185, 'isAllowedToCastSpell'), (5186, 'isAllowedToCastSpell'), (5187, 'isAllowedToCastSpell'), +(5188, 'isAllowedToCastSpell'), (5189, 'isAllowedToCastSpell'), (6778, 'isAllowedToCastSpell'), (8903, 'isAllowedToCastSpell'), (8910, 'isAllowedToCastSpell'), (8918, 'isAllowedToCastSpell'), +(8936, 'isAllowedToCastSpell'), (8938, 'isAllowedToCastSpell'), (8939, 'isAllowedToCastSpell'), (8940, 'isAllowedToCastSpell'), (8941, 'isAllowedToCastSpell'), (8946, 'isAllowedToCastSpell'), +(9750, 'isAllowedToCastSpell'), (9758, 'isAllowedToCastSpell'), (9839, 'isAllowedToCastSpell'), (9840, 'isAllowedToCastSpell'), (9841, 'isAllowedToCastSpell'), (9856, 'isAllowedToCastSpell'), +(9857, 'isAllowedToCastSpell'), (9858, 'isAllowedToCastSpell'), (9862, 'isAllowedToCastSpell'), (9863, 'isAllowedToCastSpell'), (9888, 'isAllowedToCastSpell'), (9889, 'isAllowedToCastSpell'), +(18562, 'isAllowedToCastSpell'), (25297, 'isAllowedToCastSpell'), (25299, 'isAllowedToCastSpell'), (26978, 'isAllowedToCastSpell'), (26979, 'isAllowedToCastSpell'), +(26980, 'isAllowedToCastSpell'), (26981, 'isAllowedToCastSpell'), (26982, 'isAllowedToCastSpell'), (26983, 'isAllowedToCastSpell'), (33763, 'isAllowedToCastSpell'); + +-- Corrupted Mind check - Priest +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'isAllowedToCastSpell' AND `spell_id` IN +(17, 139, 527, 528, 552, 592, 596, 600, 988, 996, 2050, 2052, 2053, 2054, 2055, 2060, 2061, 3747, 6063, 6064, 6065, 6066, 6074, 6075, 6076, 6077, 6078, 9472, 9473, 9474, +10898, 10899, 10900, 10901, 10915, 10916, 10917, 10927, 10928, 10929, 10960, 10961, 10963, 10964, 10965, 15229, 15237, 15286, 15430, 15431, 19236, 19238, 19240, 19241, 19242, 19243, +25210, 25213, 25217, 25218, 25221, 25222, 25233, 25235, 25308, 25314, 25315, 25316, 25331, 25437, 27799, 27800, 27801, 32546, 33076, 34865, 34866); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(17, 'isAllowedToCastSpell'), (139, 'isAllowedToCastSpell'), (527, 'isAllowedToCastSpell'), (528, 'isAllowedToCastSpell'), (552, 'isAllowedToCastSpell'), (592, 'isAllowedToCastSpell'), +(596, 'isAllowedToCastSpell'), (600, 'isAllowedToCastSpell'), (988, 'isAllowedToCastSpell'), (996, 'isAllowedToCastSpell'), (2050, 'isAllowedToCastSpell'), (2052, 'isAllowedToCastSpell'), +(2053, 'isAllowedToCastSpell'), (2054, 'isAllowedToCastSpell'), (2055, 'isAllowedToCastSpell'), (2060, 'isAllowedToCastSpell'), (2061, 'isAllowedToCastSpell'), (3747, 'isAllowedToCastSpell'), +(6063, 'isAllowedToCastSpell'), (6064, 'isAllowedToCastSpell'), (6065, 'isAllowedToCastSpell'), (6066, 'isAllowedToCastSpell'), (6074, 'isAllowedToCastSpell'), (6075, 'isAllowedToCastSpell'), +(6076, 'isAllowedToCastSpell'), (6077, 'isAllowedToCastSpell'), (6078, 'isAllowedToCastSpell'), (9472, 'isAllowedToCastSpell'), (9473, 'isAllowedToCastSpell'), (9474, 'isAllowedToCastSpell'), +(10898, 'isAllowedToCastSpell'), (10899, 'isAllowedToCastSpell'), (10900, 'isAllowedToCastSpell'), (10901, 'isAllowedToCastSpell'), (10915, 'isAllowedToCastSpell'), (10916, 'isAllowedToCastSpell'), +(10917, 'isAllowedToCastSpell'), (10927, 'isAllowedToCastSpell'), (10928, 'isAllowedToCastSpell'), (10929, 'isAllowedToCastSpell'), (10960, 'isAllowedToCastSpell'), (10961, 'isAllowedToCastSpell'), +(10963, 'isAllowedToCastSpell'), (10964, 'isAllowedToCastSpell'), (10965, 'isAllowedToCastSpell'), (15229, 'isAllowedToCastSpell'), (15237, 'isAllowedToCastSpell'), (15286, 'isAllowedToCastSpell'), +(15430, 'isAllowedToCastSpell'), (15431, 'isAllowedToCastSpell'), (19236, 'isAllowedToCastSpell'), (19238, 'isAllowedToCastSpell'), (19240, 'isAllowedToCastSpell'), (19241, 'isAllowedToCastSpell'), +(19242, 'isAllowedToCastSpell'), (19243, 'isAllowedToCastSpell'), (25210, 'isAllowedToCastSpell'), (25213, 'isAllowedToCastSpell'), (25217, 'isAllowedToCastSpell'), (25218, 'isAllowedToCastSpell'), +(25221, 'isAllowedToCastSpell'), (25222, 'isAllowedToCastSpell'), (25233, 'isAllowedToCastSpell'), (25235, 'isAllowedToCastSpell'), (25308, 'isAllowedToCastSpell'), +(25314, 'isAllowedToCastSpell'), (25315, 'isAllowedToCastSpell'), (25316, 'isAllowedToCastSpell'), (25331, 'isAllowedToCastSpell'), (25437, 'isAllowedToCastSpell'), (27799, 'isAllowedToCastSpell'), +(27800, 'isAllowedToCastSpell'), (27801, 'isAllowedToCastSpell'), (32546, 'isAllowedToCastSpell'), (33076, 'isAllowedToCastSpell'), (34865, 'isAllowedToCastSpell'), (34866, 'isAllowedToCastSpell'); + +-- Corrupted Mind check - Paladin +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'isAllowedToCastSpell' AND `spell_id` IN +(633, 635, 639, 647, 1026, 1042, 1152, 2800, 3472, 4987, 10310, 10328, 10329, 19750, 19939, 19940, 19941, 19942, 19943, 20473, 20929, 20930, 25292, 27135, 27136, 27137, 27154, 27174, 33072); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(633, 'isAllowedToCastSpell'), (635, 'isAllowedToCastSpell'), (639, 'isAllowedToCastSpell'), (647, 'isAllowedToCastSpell'), (1026, 'isAllowedToCastSpell'), (1042, 'isAllowedToCastSpell'), +(1152, 'isAllowedToCastSpell'), (2800, 'isAllowedToCastSpell'), (3472, 'isAllowedToCastSpell'), (4987, 'isAllowedToCastSpell'), (10310, 'isAllowedToCastSpell'), (10328, 'isAllowedToCastSpell'), +(10329, 'isAllowedToCastSpell'), (19750, 'isAllowedToCastSpell'), (19939, 'isAllowedToCastSpell'), (19940, 'isAllowedToCastSpell'), (19941, 'isAllowedToCastSpell'), (19942, 'isAllowedToCastSpell'), +(19943, 'isAllowedToCastSpell'), (20473, 'isAllowedToCastSpell'), (20929, 'isAllowedToCastSpell'), (20930, 'isAllowedToCastSpell'), (25292, 'isAllowedToCastSpell'), (27135, 'isAllowedToCastSpell'), +(27136, 'isAllowedToCastSpell'), (27137, 'isAllowedToCastSpell'), (27154, 'isAllowedToCastSpell'), (27174, 'isAllowedToCastSpell'), (33072, 'isAllowedToCastSpell'); + +-- Corrupted Mind check - Shaman +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'isAllowedToCastSpell' AND `spell_id` IN +(331, 332, 526, 547, 913, 939, 959, 974, 1064, 8004, 8005, 8008, 8010, 10395, 10396, 10466, 10467, 10468, 10622, 10623, 25357, 25391, 25396, 25420, 25422, 25423, 32593, 32594, 51886); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(331, 'isAllowedToCastSpell'), (332, 'isAllowedToCastSpell'), (526, 'isAllowedToCastSpell'), (547, 'isAllowedToCastSpell'), +(913, 'isAllowedToCastSpell'), (939, 'isAllowedToCastSpell'), (959, 'isAllowedToCastSpell'), (974, 'isAllowedToCastSpell'), +(1064, 'isAllowedToCastSpell'), (8004, 'isAllowedToCastSpell'), (8005, 'isAllowedToCastSpell'), (8008, 'isAllowedToCastSpell'), (8010, 'isAllowedToCastSpell'), +(10395, 'isAllowedToCastSpell'), (10396, 'isAllowedToCastSpell'), (10466, 'isAllowedToCastSpell'), (10467, 'isAllowedToCastSpell'), (10468, 'isAllowedToCastSpell'), +(10622, 'isAllowedToCastSpell'), (10623, 'isAllowedToCastSpell'), (25357, 'isAllowedToCastSpell'), (25391, 'isAllowedToCastSpell'), (25396, 'isAllowedToCastSpell'), +(25420, 'isAllowedToCastSpell'), (25422, 'isAllowedToCastSpell'), (25423, 'isAllowedToCastSpell'), (32593, 'isAllowedToCastSpell'), (32594, 'isAllowedToCastSpell'), (51886, 'isAllowedToCastSpell'); diff --git a/src/naxx40Scripts/boss_loatheb_40.cpp b/src/naxx40Scripts/boss_loatheb_40.cpp index fb50884..f2787db 100644 --- a/src/naxx40Scripts/boss_loatheb_40.cpp +++ b/src/naxx40Scripts/boss_loatheb_40.cpp @@ -21,26 +21,20 @@ enum Spells { - // SPELL_CORRUPTED_MIND = 29201, // this triggers the following spells on targets (based on class): 29185, 29194, 29196, 29198 - SPELL_NECROTIC_AURA = 55593, - // SPELL_SUMMON_SPORE = 29234, // SPELL_DEATHBLOOM_10 = 29865, // does 200 dmg every second for 6 seconds with 1200 extra damage at the end. should do 196 dmg every 6 seconds. no extra damage at the end. - SPELL_POISON_SHOCK = 22595, // does 180-220 aoe poison damage. if Loatheb recasts this every 6 seconds it's a possible fix for poison aura. - // SPELL_DEATHBLOOM_25 = 55053, + SPELL_POISON_SHOCK = 22595, // does 180-220 aoe poison damage. if Loatheb recasts this every 6 seconds it's a fix for poison aura. + SPELL_CORRUPTED_MIND = 29201, // this triggers the following spells on targets (based on class): 29185, 29194, 29196, 29198 SPELL_INEVITABLE_DOOM = 29204, - //SPELL_INEVITABLE_DOOM_25 = 55052, - // SPELL_BERSERK = 26662, // he doesn't cast berserk in Naxx40 SPELL_REMOVE_CURSE = 30281 // He periodically removes all curses on himself + // SPELL_SUMMON_SPORE = 90006, // already defined in naxxramas_40.h + // SPELL_BERSERK = 26662, // he doesn't cast berserk in Naxx40 }; enum Events { - // EVENT_CORRUPTED_MIND = 1, // Loatheb should cast Corrupted Mind instead of Necrotic Aura - EVENT_NECROTIC_AURA = 1, - // EVENT_DEATHBLOOM = 2, + EVENT_CORRUPTED_MIND = 1, // Loatheb should cast Corrupted Mind instead of Necrotic Aura EVENT_POISON_SHOCK = 2, EVENT_INEVITABLE_DOOM = 3, - // EVENT_BERSERK = 4, EVENT_REMOVE_CURSE = 4, EVENT_SUMMON_SPORE = 5, EVENT_NECROTIC_AURA_FADING = 6, @@ -104,13 +98,10 @@ public: { BossAI::JustEngagedWith(who); me->SetInCombatWithZone(); - // events.ScheduleEvent(EVENT_CORRUPTED_MIND, 5s); - events.ScheduleEvent(EVENT_NECROTIC_AURA, 10s); - // events.ScheduleEvent(EVENT_DEATHBLOOM, 5s); + events.ScheduleEvent(EVENT_CORRUPTED_MIND, 5s); events.ScheduleEvent(EVENT_POISON_SHOCK, 5s); events.ScheduleEvent(EVENT_INEVITABLE_DOOM, 2min); events.ScheduleEvent(EVENT_SUMMON_SPORE, 15s); - // events.ScheduleEvent(EVENT_BERSERK, 12min); events.ScheduleEvent(EVENT_REMOVE_CURSE, 5s); } @@ -135,36 +126,18 @@ public: me->CastSpell(me, SPELL_SUMMON_SPORE, true); events.Repeat(13s); break; - /* case EVENT_CORRUPTED_MIND: { if (me->CastSpell(me, SPELL_CORRUPTED_MIND, true) == SPELL_CAST_OK) { - events.RepeatEvent(10000); + events.Repeat(10s); } else { - events.RepeatEvent(100); + events.Repeat(100ms); } break; } - */ - case EVENT_NECROTIC_AURA: - me->CastSpell(me, SPELL_NECROTIC_AURA, true); - Talk(SAY_NECROTIC_AURA_APPLIED); - events.ScheduleEvent(EVENT_NECROTIC_AURA_FADING, 14s); - events.ScheduleEvent(EVENT_NECROTIC_AURA_REMOVED, 17s); - events.Repeat(20s); - break; - /* - case EVENT_DEATHBLOOM: - { - int32 bp0 = 33; // TODO: Amplitude should be 6k, but is 1k. 200 dmg after 6 seconds - me->CastCustomSpell(me, SPELL_DEATHBLOOM_10, &bp0, 0, 0, false); - events.Repeat(30s); - break; - } - */ case EVENT_POISON_SHOCK: if (me->CastSpell(me, SPELL_POISON_SHOCK, true) == SPELL_CAST_OK) events.Repeat(6s); @@ -184,11 +157,6 @@ public: events.Repeat(100ms); break; } - /* - case EVENT_BERSERK: - me->CastSpell(me, SPELL_BERSERK, true); - break; - */ case EVENT_REMOVE_CURSE: me->CastSpell(me, SPELL_REMOVE_CURSE, true); events.Repeat(30s); diff --git a/src/naxx40Scripts/custom_spells_40.cpp b/src/naxx40Scripts/custom_spells_40.cpp index 08bea18..20d91d6 100644 --- a/src/naxx40Scripts/custom_spells_40.cpp +++ b/src/naxx40Scripts/custom_spells_40.cpp @@ -4,6 +4,7 @@ #include "SpellAuraEffects.h" #include "SpellScript.h" #include "naxxramas.h" +#include "Player.h" // 28785 - Locust Swarm // Locust Swarm: Reduce damage ~1500 to ~1000, increase radius 25yd to 30yd @@ -428,6 +429,89 @@ class spell_feugen_static_field_40 : public SpellScript } }; +class spell_loatheb_corrupted_mind_40 : public SpellScript +{ + PrepareSpellScript(spell_loatheb_corrupted_mind_40); + + void HandleEffect(SpellEffIndex effIndex) + { + if (Unit* caster = GetCaster()) + { + if (Unit* unitTarget = GetHitUnit()) + { + if (!unitTarget->IsPlayer()) + return; + + Player* playerTarget = unitTarget->ToPlayer(); + if (!playerTarget) + return; + + uint32 spell_id = 0; + + switch (playerTarget->getClass()) + { + case CLASS_PRIEST: + spell_id = 29185; + break; + case CLASS_DRUID: + spell_id = 29194; + break; + case CLASS_PALADIN: + spell_id = 29196; + break; + case CLASS_SHAMAN: + spell_id = 29198; + break; + default: + return; // ignore for non-healing classes + } + + caster->CastSpell(playerTarget, spell_id, TRIGGERED_FULL_MASK); + } + } + } + + void Register() override + { + OnEffectLaunchTarget += SpellEffectFn(spell_loatheb_corrupted_mind_40::HandleEffect, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +class isAllowedToCastSpell : public SpellScript +{ + PrepareSpellScript(isAllowedToCastSpell); + + SpellCastResult CheckCorruptedMind() + { + if (Unit* caster = GetCaster()) + { + Player* player = caster->ToPlayer(); + int mapId = player->GetMapId(); + if ((player->GetRaidDifficulty() != RAID_DIFFICULTY_10MAN_HEROIC) || (mapId != 533)) + { + return SPELL_CAST_OK; + } + + Unit::AuraEffectList const& auraClassScripts = caster->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); + + for (auto itr = auraClassScripts.begin(); itr != auraClassScripts.end(); ++itr) + { + if ((*itr)->GetSpellInfo()->Effects[0].MiscValue == 4327) + { + return SPELL_FAILED_FIZZLE; + } + } + } + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(isAllowedToCastSpell::CheckCorruptedMind); + } +}; + + void AddSC_custom_spells_40() { RegisterSpellScript(spell_anub_locust_swarm_aura_40); @@ -446,4 +530,6 @@ void AddSC_custom_spells_40() RegisterSpellScript(spell_unholy_staff_arcane_explosion_40); RegisterSpellScript(spell_disease_cloud_damage_40); RegisterSpellScript(spell_feugen_static_field_40); + RegisterSpellScript(spell_loatheb_corrupted_mind_40); + RegisterSpellScript(isAllowedToCastSpell); }