From 7c437382149878180f502e37fb4b32b5593dd6d8 Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Thu, 10 Aug 2023 20:37:14 +0300 Subject: [PATCH] fix(Spells/Scripts): Gnomish Poultryizer (#15554) fix(Spells/Scripts): Gnomish Poultryizer not breaking on damage --- .../game/Spells/SpellInfoCorrections.cpp | 6 ++++++ src/server/scripts/Spells/spell_item.cpp | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 67c7473db..6934add0c 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4560,6 +4560,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].TriggerSpell = 62585; // Mulgore Hatchling (fear) }); + // Poultryized! + ApplySpellFix({ 30504 }, [](SpellInfo* spellInfo) + { + spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_TAKE_DAMAGE; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 8a5393942..a1cc175c8 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -2975,8 +2975,9 @@ class spell_item_nigh_invulnerability : public SpellScript enum Poultryzer { - SPELL_POULTRYIZER_SUCCESS = 30501, - SPELL_POULTRYIZER_BACKFIRE = 30504, + SPELL_POULTRYIZER_SUCCESS_1 = 30501, + SPELL_POULTRYIZER_SUCCESS_2 = 30504, // malfunction + SPELL_POULTRYIZER_BACKFIRE = 30506, // Not removed on damage }; class spell_item_poultryizer : public SpellScript @@ -2985,13 +2986,22 @@ class spell_item_poultryizer : public SpellScript bool Validate(SpellInfo const* /*spell*/) override { - return ValidateSpellInfo({ SPELL_POULTRYIZER_SUCCESS, SPELL_POULTRYIZER_BACKFIRE }); + return ValidateSpellInfo({ SPELL_POULTRYIZER_SUCCESS_1, SPELL_POULTRYIZER_SUCCESS_2, SPELL_POULTRYIZER_BACKFIRE }); } void HandleDummy(SpellEffIndex /* effIndex */) { if (GetCastItem() && GetHitUnit()) - GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE, true, GetCastItem()); + { + if (roll_chance_i(80)) + { + GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS_1 : SPELL_POULTRYIZER_SUCCESS_2, true, GetCastItem()); + } + else + { + GetCaster()->CastSpell(GetCaster(), SPELL_POULTRYIZER_BACKFIRE, true, GetCastItem()); + } + } } void Register() override