diff options
| author | Ovahlord <dreadkiller@gmx.de> | 2023-01-09 19:54:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-09 19:54:56 +0100 |
| commit | 6f835c233f7605d74926a2a3058634c9de478617 (patch) | |
| tree | 9c0078fc86425c8a1581bfef61d9a8d2eba19fdf /sql | |
| parent | 9d8fc9037163b2a0776ee44760025a17ce11f115 (diff) | |
Core/Creatures: Split creature_addon and creature_template_addon's byte columns into seperate ones (#28562)
* Instead of dumping raw byte values into these fields, we now only allow setting values which should be accessible to database devs. The remaining byte values should be handled by core internals and spells (pet talents and shapeshifting for example)
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/updates/world/3.3.5/2023_01_09_00_world.sql | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2023_01_09_00_world.sql b/sql/updates/world/3.3.5/2023_01_09_00_world.sql new file mode 100644 index 00000000000..c58503cbc0c --- /dev/null +++ b/sql/updates/world/3.3.5/2023_01_09_00_world.sql @@ -0,0 +1,34 @@ +ALTER TABLE `creature_template_addon` + ADD COLUMN `StandState` TINYINT UNSIGNED DEFAULT 0 NOT NULL AFTER `MountCreatureID`, + ADD COLUMN `AnimTier` TINYINT UNSIGNED DEFAULT 0 NOT NULL AFTER `StandState`, + ADD COLUMN `VisFlags` TINYINT UNSIGNED DEFAULT 0 NOT NULL AFTER `AnimTier`, + ADD COLUMN `SheathState` TINYINT UNSIGNED DEFAULT 1 NOT NULL AFTER `VisFlags`, + ADD COLUMN `PvPFlags` TINYINT UNSIGNED DEFAULT 0 NOT NULL AFTER `SheathState`; + +UPDATE `creature_template_addon` SET `StandState`=`bytes1` & 0xFF; +UPDATE `creature_template_addon` SET `AnimTier`=(`bytes1` >> 24) & 0xFF; +UPDATE `creature_template_addon` SET `VisFlags`=(`bytes1` >> 16) & 0xFF; +UPDATE `creature_template_addon` SET `SheathState`=`bytes2` & 0xFF; +UPDATE `creature_template_addon` SET `PvPFlags`=(`bytes2` >> 8) & 0xFF; + +ALTER TABLE `creature_addon` + ADD COLUMN `StandState` TINYINT UNSIGNED DEFAULT 0 NOT NULL AFTER `MountCreatureID`, + ADD COLUMN `AnimTier` TINYINT UNSIGNED DEFAULT 0 NOT NULL AFTER `StandState`, + ADD COLUMN `VisFlags` TINYINT UNSIGNED DEFAULT 0 NOT NULL AFTER `AnimTier`, + ADD COLUMN `SheathState` TINYINT UNSIGNED DEFAULT 1 NOT NULL AFTER `VisFlags`, + ADD COLUMN `PvPFlags` TINYINT UNSIGNED DEFAULT 0 NOT NULL AFTER `SheathState`; + +UPDATE `creature_addon` SET `StandState`=`bytes1` & 0xFF; +UPDATE `creature_addon` SET `AnimTier`=(`bytes1` >> 24) & 0xFF; +UPDATE `creature_addon` SET `VisFlags`=(`bytes1` >> 16) & 0xFF; +UPDATE `creature_addon` SET `SheathState`=`bytes2` & 0xFF; +UPDATE `creature_addon` SET `PvPFlags`=(`bytes2` >> 8) & 0xFF; + +-- Conversion done, drop old columns +ALTER TABLE `creature_template_addon` + DROP COLUMN `bytes1`, + DROP COLUMN `bytes2`; + +ALTER TABLE `creature_addon` + DROP COLUMN `bytes1`, + DROP COLUMN `bytes2`; |
