[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
2 changed files with 9 additions and 0 deletions
+8
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;