From 79c0beeb51ff38283696cb8e83060472ac48c420 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Tue, 30 Nov 2021 16:48:19 +0100 Subject: [PATCH] fix(Scripts/Spells): Omen of Clarity should proc off from more spells. (#9344) --- .../rev_1637867412352266700.sql | 3 +++ src/server/scripts/Spells/spell_druid.cpp | 26 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1637867412352266700.sql diff --git a/data/sql/updates/pending_db_world/rev_1637867412352266700.sql b/data/sql/updates/pending_db_world/rev_1637867412352266700.sql new file mode 100644 index 000000000..3816ea428 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1637867412352266700.sql @@ -0,0 +1,3 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1637867412352266700'); + +UPDATE `spell_proc_event` SET `procFlags`=0x00015414 WHERE `entry`=16864; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 5e16c81b8..2bb3abd40 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -190,16 +190,30 @@ class spell_dru_omen_of_clarity : public AuraScript bool CheckProc(ProcEventInfo& eventInfo) { - const SpellInfo* spellInfo = eventInfo.GetSpellInfo(); - if (!spellInfo) + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo || spellInfo->IsPassive()) + { return true; + } + + if (eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS) + { + return spellInfo->HasAttribute(SPELL_ATTR0_ON_NEXT_SWING) || spellInfo->HasAttribute(SPELL_ATTR0_ON_NEXT_SWING_NO_DAMAGE); + } + + // Non-damaged/Non-healing spells - only druid abilities + if (!spellInfo->HasAttribute(SpellCustomAttributes(SPELL_ATTR0_CU_DIRECT_DAMAGE | SPELL_ATTR0_CU_NO_INITIAL_THREAT))) + { + if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID) + { + // Exclude shapeshifting + return !spellInfo->HasAura(SPELL_AURA_MOD_SHAPESHIFT); + } - // xinef: no mana cost - if (spellInfo->ManaCost == 0 && spellInfo->ManaCostPercentage == 0) return false; + } - // xinef: SPELL_ATTR0_CU_NO_INITIAL_THREAT and SPELL_ATTR0_CU_DIRECT_DAMAGE contains spells capable of healing and damaging + some others, but this is taken care of above - return spellInfo->HasAttribute(SpellCustomAttributes(SPELL_ATTR0_CU_DIRECT_DAMAGE | SPELL_ATTR0_CU_NO_INITIAL_THREAT)); + return true; } void Register() override