From c65e86223da7fbd961ff1f54f059ccb4e20b5290 Mon Sep 17 00:00:00 2001 From: Trust Date: Sun, 7 Jan 2024 02:51:28 -0500 Subject: [PATCH] [Rule] RequireMnemonicRetention for Spells 9-12 Rule Rule is default false to maintain current server setup. Enabling will require clients to have the required ranks of Mnemonic Retention in order to cast. This is a stopgap as on live, the buttons are not even available to use. This will mimic the functionality but denying the cast. --- common/ruletypes.h | 1 + zone/client_packet.cpp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/common/ruletypes.h b/common/ruletypes.h index cb73f3983..5873476bb 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -466,6 +466,7 @@ RULE_INT(Spells, DefensiveProcPenaltyLevelGap, 6, "Defensive Proc Penalty Level RULE_REAL(Spells, DefensiveProcPenaltyLevelGapModifier, 10.0f, "Defensive Proc Penalty Level Gap Modifier where procs start losing their proc rate at defined % after RuleI(Spells, DefensiveProcLevelGap) level difference") RULE_BOOL(Spells, DOTBonusDamageSplitOverDuration, true, "Disable to have Damage Over Time total bonus damage added to each tick instead of divided across duration") RULE_BOOL(Spells, HOTBonusHealingSplitOverDuration, true, "Disable to have Heal Over Time total bonus healing added to each tick instead of divided across duration") +RULE_BOOL(Spells, RequireMnemonicRetention, false, "Enabling will require spell slots 9-12 to have the appropriate Mnemonic Retention AA learned.") RULE_CATEGORY_END() RULE_CATEGORY(Combat) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index d06781867..79f0c8b28 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -4329,6 +4329,27 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) LogSpells("OP CastSpell: slot [{}] spell [{}] target [{}] inv [{}]", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); CastingSlot slot = static_cast(castspell->slot); + if (RuleB(Spells, RequireMnemonicRetention)) { + // casting from slot 9, 10, 11 or 12, we disable cause not classic. + if (castspell->slot == 8 && GetAA(aaMnemonicRetention) < 1) { + InterruptSpell(castspell->spell_id); + Message(Chat::Red, "You do not have the required AA to use this spell slot."); + return; + } else if(castspell->slot == 9 && GetAA(aaMnemonicRetention) < 2) { + InterruptSpell(castspell->spell_id); + Message(Chat::Red, "You do not have the required AA to use this spell slot."); + return; + } else if(castspell->slot == 10 && GetAA(aaMnemonicRetention) < 3) { + InterruptSpell(castspell->spell_id); + Message(Chat::Red, "You do not have the required AA to use this spell slot."); + return; + } else if(castspell->slot == 11 && GetAA(aaMnemonicRetention) < 4) { + InterruptSpell(castspell->spell_id); + Message(Chat::Red, "You do not have the required AA to use this spell slot."); + return; + } + } + /* Memorized Spell */ if (m_pp.mem_spells[castspell->slot] && m_pp.mem_spells[castspell->slot] == castspell->spell_id) { uint16 spell_to_cast = 0;