diff --git a/sql/base/mangos.sql b/sql/base/mangos.sql index 865c144d55..e6fa539ca0 100644 --- a/sql/base/mangos.sql +++ b/sql/base/mangos.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) DEFAULT NULL, `creature_ai_version` varchar(120) DEFAULT NULL, - `required_z2823_01_mangos_displayid_probability` bit(1) DEFAULT NULL + `required_z2824_01_mangos_model_unification` bit(1) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Used DB version notes'; -- @@ -1074,7 +1074,7 @@ CREATE TABLE `creature_model_info` ( `SpeedRun` FLOAT NOT NULL DEFAULT '1.14286' COMMENT 'Default running speed for any creature with model', `gender` tinyint(3) unsigned NOT NULL DEFAULT '2', `modelid_other_gender` mediumint(8) unsigned NOT NULL DEFAULT '0', - `modelid_other_team` mediumint(8) unsigned NOT NULL DEFAULT '0', + `modelid_alternative` mediumint(8) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`modelid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Model related info)'; @@ -1219,7 +1219,6 @@ CREATE TABLE `creature_template` ( `SubName` char(100) DEFAULT NULL, `MinLevel` tinyint(3) unsigned NOT NULL DEFAULT '1', `MaxLevel` tinyint(3) unsigned NOT NULL DEFAULT '1', - `HeroicEntry` mediumint(8) unsigned NOT NULL DEFAULT '0', `DisplayId1` mediumint(8) unsigned NOT NULL DEFAULT '0', `DisplayId2` mediumint(8) unsigned NOT NULL DEFAULT '0', `DisplayId3` mediumint(8) unsigned NOT NULL DEFAULT '0', diff --git a/sql/updates/mangos/z2823_01_mangos_displayid_probability.sql b/sql/updates/mangos/z2823_01_mangos_displayid_probability.sql index 19fd0eaacd..5756222322 100644 --- a/sql/updates/mangos/z2823_01_mangos_displayid_probability.sql +++ b/sql/updates/mangos/z2823_01_mangos_displayid_probability.sql @@ -12,9 +12,9 @@ ALTER TABLE `creature_template` ADD COLUMN `DisplayIdProbability4` SMALLINT UNSI 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_alternative > 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_alternative > 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_alternative > 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_alternative > 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; diff --git a/sql/updates/mangos/z2824_01_mangos_model_unification.sql b/sql/updates/mangos/z2824_01_mangos_model_unification.sql new file mode 100644 index 0000000000..59481c8be0 --- /dev/null +++ b/sql/updates/mangos/z2824_01_mangos_model_unification.sql @@ -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`; + + diff --git a/src/game/Entities/Creature.h b/src/game/Entities/Creature.h index adf0aa10c4..62192df30e 100644 --- a/src/game/Entities/Creature.h +++ b/src/game/Entities/Creature.h @@ -319,7 +319,7 @@ struct CreatureModelInfo float SpeedRun; uint8 gender; uint32 modelid_other_gender; // The oposite gender for this modelid (male/female) - uint32 modelid_other_team; // The oposite team. Generally for alliance totem + uint32 modelid_alternative; // The oposite team. Generally for alliance totem }; struct CreatureConditionalSpawn diff --git a/src/game/Globals/ObjectMgr.cpp b/src/game/Globals/ObjectMgr.cpp index ff7e670f2b..a408164ef8 100644 --- a/src/game/Globals/ObjectMgr.cpp +++ b/src/game/Globals/ObjectMgr.cpp @@ -1476,7 +1476,7 @@ void ObjectMgr::LoadEquipmentTemplates() uint32 ObjectMgr::GetCreatureModelOtherTeamModel(uint32 modelId) const { if (const CreatureModelInfo* modelInfo = GetCreatureModelInfo(modelId)) - return modelInfo->modelid_other_team; + return modelInfo->modelid_alternative; return 0; } @@ -1535,17 +1535,17 @@ void ObjectMgr::LoadCreatureModelInfo() } } - if (minfo->modelid_other_team) + if (minfo->modelid_alternative) { - if (minfo->modelid_other_team == minfo->modelid) + if (minfo->modelid_alternative == minfo->modelid) { - sLog.outErrorDb("Table `creature_model_info` has redundant modelid_other_team model (%u) defined for model id %u.", minfo->modelid_other_team, minfo->modelid); - const_cast(minfo)->modelid_other_team = 0; + sLog.outErrorDb("Table `creature_model_info` has redundant modelid_alternative model (%u) defined for model id %u.", minfo->modelid_alternative, minfo->modelid); + const_cast(minfo)->modelid_alternative = 0; } - else if (!sCreatureDisplayInfoStore.LookupEntry(minfo->modelid_other_team)) + else if (!sCreatureDisplayInfoStore.LookupEntry(minfo->modelid_alternative)) { - sLog.outErrorDb("Table `creature_model_info` has nonexistent modelid_other_team model (%u) defined for model id %u.", minfo->modelid_other_team, minfo->modelid); - const_cast(minfo)->modelid_other_team = 0; + sLog.outErrorDb("Table `creature_model_info` has nonexistent modelid_alternative model (%u) defined for model id %u.", minfo->modelid_alternative, minfo->modelid); + const_cast(minfo)->modelid_alternative = 0; } } } diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index 53fdb5d5e7..26f9881b16 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -3,5 +3,5 @@ #define REVISION_DB_REALMD "required_z2820_01_realmd_joindate_datetime" #define REVISION_DB_LOGS "required_z2778_01_logs_anticheat" #define REVISION_DB_CHARACTERS "required_z2819_01_characters_item_instance_text_id_fix" - #define REVISION_DB_MANGOS "required_z2823_01_mangos_displayid_probability" + #define REVISION_DB_MANGOS "required_z2824_01_mangos_model_unification" #endif // __REVISION_SQL_H__