mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
refactor(Core/ObjectMgr): Implement display probabilities. (#19068)
* Init. Cherry-picked from TC commits9d210476e5andc488fb219aCo-Authored-By: Traesh <9392905+traesh@users.noreply.github.com> Co-Authored-By: Shauren <shauren.trinity@gmail.com> * Add brute data. Needs validation against what existed before, i.e. Classic change prevention. * Add validation info for brute data. * Remove incomplete data queries. * Requested changes. * Whitespace. * Requested change. Table name. Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * Requested change. Table name. Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * Resolve the funny merge conflicts. I wonder why git blame doesn't work on a file with 20k lines in it that's odd huh champ. * Remove unused parameter. * Remove uses of unused parameter. * Use unused parameter. Hopefully? * I will cry. * Sobbing endlessly. * Remove comment. * Adjust table structure query. Remove length parameters and allow null for build value. Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * Adjust column datatype and add check constraint. --------- Co-authored-by: Traesh <9392905+traesh@users.noreply.github.com> Co-authored-by: Shauren <shauren.trinity@gmail.com> Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
24
data/sql/updates/pending_db_world/display-probabilities.sql
Normal file
24
data/sql/updates/pending_db_world/display-probabilities.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
DROP TABLE IF EXISTS `creature_template_model`;
|
||||
CREATE TABLE `creature_template_model`(
|
||||
`CreatureID` int unsigned NOT NULL,
|
||||
`Idx` smallint unsigned NOT NULL DEFAULT '0',
|
||||
`CreatureDisplayID` int unsigned NOT NULL,
|
||||
`DisplayScale` float NOT NULL DEFAULT '1',
|
||||
`Probability` float NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint unsigned,
|
||||
PRIMARY KEY (`CreatureID`,`Idx`),
|
||||
CONSTRAINT creature_template_model_chk_1 CHECK (`Idx` <= 3)
|
||||
) ENGINE=InnoDB CHARSET=utf8mb4;
|
||||
|
||||
INSERT IGNORE INTO `creature_template_model` (`CreatureID`,`Idx`,`CreatureDisplayID`,`DisplayScale`,`Probability`,`VerifiedBuild`) SELECT `entry`,0,`modelid1`,`scale`,1,`VerifiedBuild` FROM `creature_template` WHERE `modelid1`!=0;
|
||||
INSERT IGNORE INTO `creature_template_model` (`CreatureID`,`Idx`,`CreatureDisplayID`,`DisplayScale`,`Probability`,`VerifiedBuild`) SELECT `entry`,1,`modelid2`,`scale`,1,`VerifiedBuild` FROM `creature_template` WHERE `modelid2`!=0;
|
||||
INSERT IGNORE INTO `creature_template_model` (`CreatureID`,`Idx`,`CreatureDisplayID`,`DisplayScale`,`Probability`,`VerifiedBuild`) SELECT `entry`,2,`modelid3`,`scale`,1,`VerifiedBuild` FROM `creature_template` WHERE `modelid3`!=0;
|
||||
INSERT IGNORE INTO `creature_template_model` (`CreatureID`,`Idx`,`CreatureDisplayID`,`DisplayScale`,`Probability`,`VerifiedBuild`) SELECT `entry`,3,`modelid4`,`scale`,1,`VerifiedBuild` FROM `creature_template` WHERE `modelid4`!=0;
|
||||
|
||||
UPDATE `creature_template` SET `scale`=1;
|
||||
|
||||
ALTER TABLE `creature_template`
|
||||
DROP `modelid1`,
|
||||
DROP `modelid2`,
|
||||
DROP `modelid3`,
|
||||
DROP `modelid4`;
|
||||
Reference in New Issue
Block a user