[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
@@ -6747,6 +6747,29 @@ COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;
)"
},
ManifestEntry{
.version = 9302,
.description = "2025_02_09_illusion_block.sql",
.check = "SHOW COLUMNS FROM `character_data` LIKE 'illusion_block'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `character_data`
ADD COLUMN `illusion_block` TINYINT(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `deleted_at`;
UPDATE `command_settings`
SET `aliases` =
CASE
WHEN LENGTH(`aliases`) > 0 AND `aliases` NOT LIKE '%|ib%'
THEN CONCAT(`aliases`, '|ib')
WHEN LENGTH(`aliases`) = 0
THEN 'ib'
ELSE `aliases`
END
WHERE `command` = 'illusionblock'
AND `aliases` NOT LIKE '%ib%';
)",
}
// -- template; copy/paste this when you need to create a new entry
// ManifestEntry{