[Rule] RequireMnemonicRetention for Spells 9-12 Rule (#3876)

* [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.

* Change to default true

* Cleanup Logic - Thank you @KinglyKrab

* To aggressive on the cleanup

* True != true

* fix duplicated rule after rebase.
This commit is contained in:
Fryguy 2024-01-07 16:28:03 -05:00 committed by GitHub
parent cd85a8524a
commit 066b762e73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -473,6 +473,7 @@ RULE_BOOL(Spells, UseLegacyFizzleCode, false, "Enable will turn on the legacy fi
RULE_BOOL(Spells, LegacyManaburn, false, "Enable to have the legacy manaburn system from 2003 and earlier.")
RULE_BOOL(Spells, EvacClearAggroInSameZone, false, "Enable to clear aggro on clients when evacing in same zone.")
RULE_BOOL(Spells, CharmAggroOverLevel, false, "Enabling this rule will cause Charm casts over level to show resisted and cause aggro. Early EQ style.")
RULE_BOOL(Spells, RequireMnemonicRetention, true, "Enabling will require spell slots 9-12 to have the appropriate Mnemonic Retention AA learned.")
RULE_CATEGORY_END()
RULE_CATEGORY(Combat)

View File

@ -4329,6 +4329,14 @@ 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<CastingSlot>(castspell->slot);
if (RuleB(Spells, RequireMnemonicRetention)) {
if (EQ::ValueWithin(castspell->slot, 8, 11) && GetAA(aaMnemonicRetention) < (castspell->slot - 7)) {
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;