[Commands] [Hotfix] Fix Illusion Block (#4666)

* [Commands] [Hotfix] Fix Illusion Block

This wasn't properly being set or saved if bots were not enabled, moved to extended character profile for players.

* Move out of EPP

* ValueWithin

* I learned a new word today - idempotent

I'm dumb. Will forget it tomorrow.

* Move saving to ZoneDatabase, inline SetIllusionBlock
This commit is contained in:
nytmyr
2025-02-12 00:18:34 -06:00
committed by GitHub
parent ac4ffefa09
commit d9d2d5d47c
10 changed files with 54 additions and 11 deletions
+5 -1
View File
@@ -7,6 +7,10 @@ void command_illusion_block(Client* c, const Seperator* sep)
BotCommandHelpParams p;
p.description = { "Toggles whether or not you will block the illusion effects of spells cast by players or bots." };
p.notes = {
"- This will still allow other portions of a spell to land on you.",
"- Spells cast by NPCs will ignore this setting and land as normal."
};
p.example_format = { fmt::format("{} [value]", sep->arg[0]) };
p.examples_one =
{
@@ -35,7 +39,7 @@ void command_illusion_block(Client* c, const Seperator* sep)
if (sep->IsNumber(1)) {
int set_status = atoi(sep->arg[1]);
if (set_status == 0 || set_status == 1) {
if (EQ::ValueWithin(set_status, 0, 1)) {
c->SetIllusionBlock(set_status);
c->Message(Chat::Green, "Your Illusion Block has been %s.", (set_status ? "enabled" : "disabled"));
}