diff options
-rw-r--r-- | sql/updates/world/3.3.5/2020_10_12_00_world.sql | 11 | ||||
-rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 34 |
2 files changed, 45 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2020_10_12_00_world.sql b/sql/updates/world/3.3.5/2020_10_12_00_world.sql new file mode 100644 index 00000000000..975a56ffc27 --- /dev/null +++ b/sql/updates/world/3.3.5/2020_10_12_00_world.sql @@ -0,0 +1,11 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_putricide_choking_gas_filter'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(71278,'spell_putricide_choking_gas_filter'), +(72460,'spell_putricide_choking_gas_filter'), +(72619,'spell_putricide_choking_gas_filter'), +(72620,'spell_putricide_choking_gas_filter'), +(71279,'spell_putricide_choking_gas_filter'), +(72459,'spell_putricide_choking_gas_filter'), +(72621,'spell_putricide_choking_gas_filter'), +(72622,'spell_putricide_choking_gas_filter'); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 3b3bbc33687..c8b960276fb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -1453,6 +1453,39 @@ class spell_abomination_mutated_transformation : public SpellScript } }; +// 71278, 72460, 72619, 72620 - Choking Gas +// 71279, 72459, 72621, 72622 - Choking Gas Explosion +class spell_putricide_choking_gas_filter : public SpellScript +{ + PrepareSpellScript(spell_putricide_choking_gas_filter); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_OOZE_VARIABLE, SPELL_GAS_VARIABLE }); + } + + void FilterTargets(std::list<WorldObject*>& targets) + { + targets.remove_if([](WorldObject* obj) + { + return obj->ToUnit() && obj->ToUnit()->GetVehicle(); + }); + } + + void HandleDispel(SpellEffIndex /*effIndex*/) + { + Unit* target = GetHitUnit(); + target->RemoveAurasDueToSpell(SPELL_OOZE_VARIABLE); + target->RemoveAurasDueToSpell(SPELL_GAS_VARIABLE); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_choking_gas_filter::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_putricide_choking_gas_filter::HandleDispel, EFFECT_1, SPELL_EFFECT_APPLY_AURA); + } +}; + void AddSC_boss_professor_putricide() { // Creatures @@ -1480,4 +1513,5 @@ void AddSC_boss_professor_putricide() RegisterSpellScript(spell_putricide_clear_aura_effect_value); RegisterSpellScript(spell_stinky_precious_decimate); RegisterSpellScript(spell_abomination_mutated_transformation); + RegisterSpellScript(spell_putricide_choking_gas_filter); } |