From d8712455c7c36820b38a91fb282e4753961fe68b Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 3 Jan 2022 19:15:24 +0100 Subject: [PATCH] =?UTF-8?q?fix(Core/Spells):=20Multi-Shot=20should=20not?= =?UTF-8?q?=20be=20affected=20by=20Glyph=20of=20Aimed=E2=80=A6=20(#9897)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Core/Spells): Multi-Shot should not be affected by Glyph of Aimed Shot. Fixes #9707 * Update. --- src/server/game/Entities/Player/Player.cpp | 16 +++++++++++++++- src/server/game/Spells/SpellInfo.h | 2 +- src/server/game/Spells/SpellMgr.cpp | 15 +++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 51842d626..6abc0a68a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -10274,7 +10274,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite // category spells if (cat && catrec > 0) { - _AddSpellCooldown(spellInfo->Id, cat, itemId, useSpellCooldown? recTime : catrecTime, true, true); + _AddSpellCooldown(spellInfo->Id, cat, itemId, useSpellCooldown ? recTime : catrecTime, true, true); if (needsCooldownPacket) { WorldPacket data; @@ -10282,6 +10282,8 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite SendDirectMessage(&data); } + PacketCooldowns forcedCategoryCooldowns; + SpellCategoryStore::const_iterator i_scstore = sSpellsByCategoryStore.find(cat); if (i_scstore != sSpellsByCategoryStore.end()) { @@ -10306,8 +10308,20 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite } _AddSpellCooldown(i_scset->second, cat, itemId, catrecTime, !spellInfo->IsCooldownStartedOnEvent() && catrec && rec && catrec != rec); + + if (spellInfo->HasAttribute(SPELL_ATTR0_CU_FORCE_SEND_CATEGORY_COOLDOWNS)) + { + forcedCategoryCooldowns[i_scset->second] = catrecTime; + } } } + + if (!forcedCategoryCooldowns.empty()) + { + WorldPacket data; + BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, forcedCategoryCooldowns); + SendDirectMessage(&data); + } } else { diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 388c70bcc..a82e8ef92 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -201,7 +201,7 @@ enum SpellCustomAttributes SPELL_ATTR0_CU_POSITIVE_EFF0 = 0x02000000, SPELL_ATTR0_CU_POSITIVE_EFF1 = 0x04000000, SPELL_ATTR0_CU_POSITIVE_EFF2 = 0x08000000, - // unused = 0x10000000, + SPELL_ATTR0_CU_FORCE_SEND_CATEGORY_COOLDOWNS = 0x10000000, SPELL_ATTR0_CU_FORCE_AURA_SAVING = 0x20000800, SPELL_ATTR0_CU_ENCOUNTER_REWARD = 0x40000000, // pussywizard diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 547fccf82..475e19fe0 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3058,7 +3058,14 @@ void SpellMgr::LoadSpellCustomAttr() case SPELLFAMILY_HUNTER: // Aspects if (spellInfo->GetCategory() == 47) + { spellInfo->AttributesCu |= SPELL_ATTR0_CU_NO_INITIAL_THREAT; + } + // Aimed Shot + if (spellInfo->SpellFamilyFlags[0] & 0x00020000) + { + spellInfo->AttributesCu |= SPELL_ATTR0_CU_FORCE_SEND_CATEGORY_COOLDOWNS; + } break; default: break; @@ -7581,6 +7588,14 @@ void SpellMgr::LoadDbcDataCorrections() if (spellInfo->SpellIconID == 2721 && spellInfo->SpellFamilyFlags[0] & 0x2) spellInfo->SpellFamilyFlags[0] |= 0x40; break; + case SPELLFAMILY_HUNTER: + // Aimed Shot not affected by category cooldown modifiers + if (spellInfo->SpellFamilyFlags[0] & 0x00020000) + { + spellInfo->AttributesEx6 |= SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS; + spellInfo->RecoveryTime = 10 * IN_MILLISECONDS; + } + break; } // Recklessness/Shield Wall/Retaliation