diff --git a/sql/characters.sql b/sql/characters.sql index ced85bcb05..8c1ed40e98 100644 --- a/sql/characters.sql +++ b/sql/characters.sql @@ -434,7 +434,7 @@ DROP TABLE IF EXISTS `character_db_version`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_db_version` ( - `required_12447_02_characters_calendar_invites` bit(1) default NULL + `required_c12631_01_characters_corpse` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -444,7 +444,7 @@ CREATE TABLE `character_db_version` ( LOCK TABLES `character_db_version` WRITE; /*!40000 ALTER TABLE `character_db_version` DISABLE KEYS */; -INSERT INTO `character_db_version` (`required_12447_02_characters_calendar_invites`) VALUES +INSERT INTO `character_db_version` (`required_c12631_01_characters_corpse`) VALUES (NULL); /*!40000 ALTER TABLE `character_db_version` ENABLE KEYS */; UNLOCK TABLES; @@ -1220,7 +1220,7 @@ CREATE TABLE `corpse` ( `position_z` float NOT NULL DEFAULT '0', `orientation` float NOT NULL DEFAULT '0', `map` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', - `phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1', + `phaseMask` int(11) unsigned NOT NULL DEFAULT '1', `time` bigint(20) unsigned NOT NULL DEFAULT '0', `corpse_type` tinyint(3) unsigned NOT NULL DEFAULT '0', `instance` int(11) unsigned NOT NULL DEFAULT '0', diff --git a/sql/mangos.sql b/sql/mangos.sql index cd9f90a53e..525a1ae71a 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -645,7 +645,7 @@ CREATE TABLE `creature` ( `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Identifier', `map` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', `spawnMask` tinyint(3) unsigned NOT NULL DEFAULT '1', - `phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1', + `phaseMask` int(11) unsigned NOT NULL DEFAULT '1', `modelid` mediumint(8) unsigned NOT NULL DEFAULT '0', `equipment_id` mediumint(9) NOT NULL DEFAULT '0', `position_x` float NOT NULL DEFAULT '0', @@ -1425,7 +1425,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) DEFAULT NULL, `creature_ai_version` varchar(120) DEFAULT NULL, `cache_id` int(10) DEFAULT '0', - `required_c12602_01_mangos_npc_spellclick_spells` bit(1) default NULL + `required_c12631_02_mangos_gameobject` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1435,7 +1435,7 @@ CREATE TABLE `db_version` ( LOCK TABLES `db_version` WRITE; /*!40000 ALTER TABLE `db_version` DISABLE KEYS */; -INSERT INTO `db_version` (`version`, `creature_ai_version`, `cache_id`, `required_c12602_01_mangos_npc_spellclick_spells`) VALUES +INSERT INTO `db_version` (`version`, `creature_ai_version`, `cache_id`, `required_c12631_02_mangos_gameobject`) VALUES ('Mangos default database.','Creature EventAI not provided.',0,NULL); /*!40000 ALTER TABLE `db_version` ENABLE KEYS */; UNLOCK TABLES; @@ -1840,7 +1840,7 @@ CREATE TABLE `gameobject` ( `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Gameobject Identifier', `map` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', `spawnMask` tinyint(3) unsigned NOT NULL DEFAULT '1', - `phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1', + `phaseMask` int(11) unsigned NOT NULL DEFAULT '1', `position_x` float NOT NULL DEFAULT '0', `position_y` float NOT NULL DEFAULT '0', `position_z` float NOT NULL DEFAULT '0', diff --git a/sql/updates/c12631_01_characters_corpse.sql b/sql/updates/c12631_01_characters_corpse.sql new file mode 100644 index 0000000000..5daf6191aa --- /dev/null +++ b/sql/updates/c12631_01_characters_corpse.sql @@ -0,0 +1,3 @@ +ALTER TABLE character_db_version CHANGE COLUMN required_12447_02_characters_calendar_invites required_c12631_01_characters_corpse bit; + +ALTER TABLE corpse MODIFY COLUMN `phaseMask` int(11) unsigned NOT NULL DEFAULT '1'; \ No newline at end of file diff --git a/sql/updates/c12631_01_mangos_creature.sql b/sql/updates/c12631_01_mangos_creature.sql new file mode 100644 index 0000000000..305657ef88 --- /dev/null +++ b/sql/updates/c12631_01_mangos_creature.sql @@ -0,0 +1,3 @@ +ALTER TABLE db_version CHANGE COLUMN required_c12602_01_mangos_npc_spellclick_spells required_c12631_01_mangos_creature bit; + +ALTER TABLE creature MODIFY COLUMN `phaseMask` int(11) unsigned NOT NULL DEFAULT '1'; diff --git a/sql/updates/c12631_02_mangos_gameobject.sql b/sql/updates/c12631_02_mangos_gameobject.sql new file mode 100644 index 0000000000..eacb92662e --- /dev/null +++ b/sql/updates/c12631_02_mangos_gameobject.sql @@ -0,0 +1,3 @@ +ALTER TABLE db_version CHANGE COLUMN required_c12631_01_mangos_creature required_c12631_02_mangos_gameobject bit; + +ALTER TABLE gameobject MODIFY COLUMN `phaseMask` int(11) unsigned NOT NULL DEFAULT '1'; diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index cbfd3c62b4..0b74361e78 100644 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -119,7 +119,7 @@ void Corpse::SaveToDB() << uint64(m_time) << ", " << uint32(GetType()) << ", " << int(GetInstanceId()) << ", " - << uint16(GetPhaseMask()) << ")"; // prevent out of range error + << uint32(GetPhaseMask()) << ")"; // prevent out of range error CharacterDatabase.Execute(ss.str().c_str()); CharacterDatabase.CommitTransaction(); } diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index ba71b6db97..275f3359b1 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1139,7 +1139,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) << data.id << "," << data.mapid << "," << uint32(data.spawnMask) << "," // cast to prevent save as symbol - << uint16(data.phaseMask) << "," // prevent out of range error + << uint32(data.phaseMask) << "," // prevent out of range error << data.modelid_override << "," << data.equipmentId << "," << data.posX << "," diff --git a/src/game/Creature.h b/src/game/Creature.h index 5f0b7982ae..8791e417b2 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -193,7 +193,7 @@ struct CreatureData { uint32 id; // entry in creature_template uint16 mapid; - uint16 phaseMask; + uint32 phaseMask; uint32 modelid_override; // overrides any model defined in creature_template int32 equipmentId; float posX; diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index c73b3746b4..aeea946391 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -567,7 +567,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) << GetEntry() << ", " << mapid << ", " << uint32(spawnMask) << "," // cast to prevent save as symbol - << uint16(GetPhaseMask()) << "," // prevent out of range error + << uint32(GetPhaseMask()) << "," // prevent out of range error << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", " diff --git a/src/game/GameObject.h b/src/game/GameObject.h index 7711cd1152..d6518b8fc1 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -574,7 +574,7 @@ struct GameObjectData { uint32 id; // entry in gamobject_template uint16 mapid; - uint16 phaseMask; + uint32 phaseMask; float posX; float posY; float posZ; diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 0a2246d580..50802b223a 100755 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1262,7 +1262,7 @@ void ObjectMgr::LoadCreatures() data.is_dead = fields[14].GetBool(); data.movementType = fields[15].GetUInt8(); data.spawnMask = fields[16].GetUInt8(); - data.phaseMask = fields[17].GetUInt16(); + data.phaseMask = fields[17].GetUInt32(); int16 gameEvent = fields[18].GetInt16(); int16 GuidPoolId = fields[19].GetInt16(); int16 EntryPoolId = fields[20].GetInt16(); @@ -1492,7 +1492,7 @@ void ObjectMgr::LoadGameObjects() data.animprogress = fields[12].GetUInt32(); uint32 go_state = fields[13].GetUInt32(); data.spawnMask = fields[14].GetUInt8(); - data.phaseMask = fields[15].GetUInt16(); + data.phaseMask = fields[15].GetUInt32(); int16 gameEvent = fields[16].GetInt16(); int16 GuidPoolId = fields[17].GetInt16(); int16 EntryPoolId = fields[18].GetInt16(); diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 87e8cdc5ab..729f659584 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -596,25 +596,21 @@ void WorldSession::SendSetPhaseShift(uint32 phaseMask, uint16 mapId) data.WriteGuidMask<2, 3, 1, 6, 4, 5, 0, 7>(guid); data.WriteGuidBytes<7, 4>(guid); - // Seen only 0 bytes - data << uint32(0); + data << uint32(0); // number of WorldMapArea.dbc entries to control world map shift * 2 data.WriteGuidBytes<1>(guid); data << uint32(phaseMask ? phaseFlags : 8); data.WriteGuidBytes<2, 6>(guid); - // Seen only 0 bytes - data << uint32(0); + data << uint32(0); // number of inactive terrain swaps * 2 - // PhaseShift, uint16 (2 bytes) - data << uint32(phaseMask ? 2 : 0); + data << uint32(phaseMask ? 2 : 0); // WRONG: number of Phase.dbc ids * 2 if (phaseMask) data << uint16(phaseMask); data.WriteGuidBytes<3, 0>(guid); - // MapId , uint16 (2 bytes) - data << uint32(mapId ? 2 : 0); + data << uint32(mapId ? 2 : 0); // number of terrains swaps * 2 if (mapId) data << uint16(mapId); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 600e6d085c..b007376e06 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12630" + #define REVISION_NR "12631" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index 6612e4e251..7ef9c339a9 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -1,6 +1,6 @@ #ifndef __REVISION_SQL_H__ #define __REVISION_SQL_H__ - #define REVISION_DB_CHARACTERS "required_12447_02_characters_calendar_invites" - #define REVISION_DB_MANGOS "required_12602_01_mangos_npc_spellclick_spells" + #define REVISION_DB_CHARACTERS "required_c12631_01_characters_corpse" + #define REVISION_DB_MANGOS "required_c12631_02_mangos_gameobject" #define REVISION_DB_REALMD "required_c12484_02_realmd_account_access" #endif // __REVISION_SQL_H__