Skip to content

Commit

Permalink
apply z2823_01_mangos_displayid_probability.sql
Browse files Browse the repository at this point in the history
apply z2824_01_mangos_model_unification.sql
remove some unnecessary custom_fixes
closes: #318
  • Loading branch information
insunaa authored and Tobschinski committed May 10, 2024
1 parent bd3e359 commit cee3ad6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
20 changes: 20 additions & 0 deletions Updates/4620_z2823_01_mangos_displayid_probability.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ALTER TABLE db_version CHANGE COLUMN required_z2822_01_mangos_creature_cls_stats required_z2823_01_mangos_displayid_probability bit;

ALTER TABLE `creature_template` CHANGE `ModelId1` `DisplayId1` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `creature_template` CHANGE `ModelId2` `DisplayId2` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `creature_template` CHANGE `ModelId3` `DisplayId3` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `creature_template` CHANGE `ModelId4` `DisplayId4` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `creature_template` ADD COLUMN `DisplayIdProbability1` SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER `DisplayId4`;
ALTER TABLE `creature_template` ADD COLUMN `DisplayIdProbability2` SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER `DisplayIdProbability1`;
ALTER TABLE `creature_template` ADD COLUMN `DisplayIdProbability3` SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER `DisplayIdProbability2`;
ALTER TABLE `creature_template` ADD COLUMN `DisplayIdProbability4` SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER `DisplayIdProbability3`;

SET sql_safe_updates=0;
-- setting probabilities to exactly replicate previous behaviour
UPDATE creature_template SET DisplayIdProbability1=100 WHERE DisplayId1!=0;
UPDATE creature_template SET DisplayIdProbability1=50,DisplayIdProbability2=50 WHERE DisplayId1!=0 AND DisplayId2!=0 AND EXISTS(SELECT modelid FROM creature_model_info WHERE creature_template.DisplayId2=creature_model_info.modelid AND modelid_other_team > 0);
UPDATE creature_template SET DisplayIdProbability1=0,DisplayIdProbability2=100 WHERE DisplayId1!=0 AND DisplayId2!=0 AND NOT EXISTS(SELECT modelid FROM creature_model_info WHERE creature_template.DisplayId2=creature_model_info.modelid AND modelid_other_team > 0);
UPDATE creature_template SET DisplayIdProbability1=33,DisplayIdProbability2=33,DisplayIdProbability3=33 WHERE DisplayId1!=0 AND DisplayId2!=0 AND DisplayId3!=0 AND EXISTS(SELECT modelid FROM creature_model_info WHERE creature_template.DisplayId2=creature_model_info.modelid AND modelid_other_team > 0);
UPDATE creature_template SET DisplayIdProbability1=0,DisplayIdProbability2=0,DisplayIdProbability3=100 WHERE DisplayId1!=0 AND DisplayId2!=0 AND DisplayId3!=0 AND NOT EXISTS(SELECT modelid FROM creature_model_info WHERE creature_template.DisplayId2=creature_model_info.modelid AND modelid_other_team > 0);
UPDATE creature_template SET DisplayIdProbability1=25,DisplayIdProbability2=25,DisplayIdProbability3=25,DisplayIdProbability4=25 WHERE DisplayId1!=0 AND DisplayId2!=0 AND DisplayId3!=0 AND DisplayId4!=0;
SET sql_safe_updates=1;
5 changes: 5 additions & 0 deletions Updates/4621_z2824_01_mangos_model_unification.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE db_version CHANGE COLUMN required_z2823_01_mangos_displayid_probability required_z2824_01_mangos_model_unification bit;

ALTER TABLE `creature_model_info` RENAME COLUMN `modelid_other_team` TO `modelid_alternative`;


1 change: 1 addition & 0 deletions Updates/4622_fix_stuff.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE `creature_template` SET `DisplayId2` = '2176', `DisplayId3` = '1825', `DisplayId4` = '2955' WHERE (`Entry` = '5764');
9 changes: 2 additions & 7 deletions utilities/cmangos_custom.sql
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,8 @@ UPDATE item_template SET class=0, subclass=3 WHERE entry=5514;
-- -------------------------------

-- Fix a few model IDs found in sniffs from patch 1.13 but not present in patch 1.12 DBCs
UPDATE creature_template SET ModelId2=0 WHERE Entry IN (3651, 16979); -- [UNUSED] Kolkar Observer ; Midsummer Merchant
UPDATE creature_template SET ModelId3=13132, ModelId4=0 WHERE Entry=11446; -- Gordok Spirit

-- modelids with probability = 0
UPDATE creature_template SET `modelid2` = 0, `modelid3` = 0, `modelid4` = 0 WHERE `entry` IN (
5764 -- Guardian of B
);
UPDATE creature_template SET DisplayId2=0 WHERE Entry IN (3651, 16979); -- [UNUSED] Kolkar Observer ; Midsummer Merchant
UPDATE creature_template SET DisplayId3=13132, DisplayId4=0 WHERE Entry=11446; -- Gordok Spirit

-- -------------------------------
-- Quest custom changes
Expand Down

1 comment on commit cee3ad6

@AnonXS
Copy link
Member

@AnonXS AnonXS commented on cee3ad6 May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, having the Probability columns should resolve the hackfixes in this file so they can be removed.

Please sign in to comment.