diff --git a/data/sql/updates/pending_db_world/rev_1641686782891083700.sql b/data/sql/updates/pending_db_world/rev_1641686782891083700.sql new file mode 100644 index 000000000..a4f60b5c8 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1641686782891083700.sql @@ -0,0 +1,13 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1641686782891083700'); + +ALTER TABLE `broadcast_text` + CHANGE `Language` `LanguageID` MEDIUMINT, + CHANGE `EmoteID2` `EmoteID3` MEDIUMINT, + CHANGE `EmoteID1` `EmoteID2` MEDIUMINT, + CHANGE `EmoteID0` `EmoteID1` MEDIUMINT, + CHANGE `EmoteDelay2` `EmoteDelay3` MEDIUMINT, + CHANGE `EmoteDelay1` `EmoteDelay2` MEDIUMINT, + CHANGE `EmoteDelay0` `EmoteDelay1` MEDIUMINT, + CHANGE `SoundId` `SoundEntriesId` MEDIUMINT, + CHANGE `Unk1` `EmotesID` MEDIUMINT, + CHANGE `Unk2` `Flags` MEDIUMINT; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index cf4802fae..c486ecdad 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8981,8 +8981,8 @@ void ObjectMgr::LoadBroadcastTexts() _broadcastTextStore.clear(); // for reload case - // 0 1 2 3 4 5 6 7 8 9 10 11 12 - QueryResult result = WorldDatabase.Query("SELECT ID, Language, MaleText, FemaleText, EmoteID0, EmoteID1, EmoteID2, EmoteDelay0, EmoteDelay1, EmoteDelay2, SoundId, Unk1, Unk2 FROM broadcast_text"); + // 0 1 2 3 4 5 6 7 8 9 10 11 12 + QueryResult result = WorldDatabase.Query("SELECT ID, LanguageID, MaleText, FemaleText, EmoteID1, EmoteID2, EmoteID3, EmoteDelay1, EmoteDelay2, EmoteDelay3, SoundEntriesID, EmotesID, Flags FROM broadcast_text"); if (!result) { LOG_INFO("server.loading", ">> Loaded 0 broadcast texts. DB table `broadcast_text` is empty."); @@ -9002,22 +9002,22 @@ void ObjectMgr::LoadBroadcastTexts() bct.LanguageID = fields[1].GetUInt32(); bct.MaleText[DEFAULT_LOCALE] = fields[2].GetString(); bct.FemaleText[DEFAULT_LOCALE] = fields[3].GetString(); - bct.EmoteId0 = fields[4].GetUInt32(); - bct.EmoteId1 = fields[5].GetUInt32(); - bct.EmoteId2 = fields[6].GetUInt32(); - bct.EmoteDelay0 = fields[7].GetUInt32(); - bct.EmoteDelay1 = fields[8].GetUInt32(); - bct.EmoteDelay2 = fields[9].GetUInt32(); - bct.SoundId = fields[10].GetUInt32(); - bct.Unk1 = fields[11].GetUInt32(); - bct.Unk2 = fields[12].GetUInt32(); + bct.EmoteId1 = fields[4].GetUInt32(); + bct.EmoteId2 = fields[5].GetUInt32(); + bct.EmoteId3 = fields[6].GetUInt32(); + bct.EmoteDelay1 = fields[7].GetUInt32(); + bct.EmoteDelay2 = fields[8].GetUInt32(); + bct.EmoteDelay3 = fields[9].GetUInt32(); + bct.SoundEntriesId = fields[10].GetUInt32(); + bct.EmotesID = fields[11].GetUInt32(); + bct.Flags = fields[12].GetUInt32(); - if (bct.SoundId) + if (bct.SoundEntriesId) { - if (!sSoundEntriesStore.LookupEntry(bct.SoundId)) + if (!sSoundEntriesStore.LookupEntry(bct.SoundEntriesId)) { - LOG_DEBUG("misc", "BroadcastText (Id: %u) in table `broadcast_text` has SoundId %u but sound does not exist.", bct.Id, bct.SoundId); - bct.SoundId = 0; + LOG_DEBUG("misc", "BroadcastText (Id: %u) in table `broadcast_text` has SoundEntriesId %u but sound does not exist.", bct.Id, bct.SoundEntriesId); + bct.SoundEntriesId = 0; } } @@ -9027,15 +9027,6 @@ void ObjectMgr::LoadBroadcastTexts() bct.LanguageID = LANG_UNIVERSAL; } - if (bct.EmoteId0) - { - if (!sEmotesStore.LookupEntry(bct.EmoteId0)) - { - LOG_DEBUG("misc", "BroadcastText (Id: %u) in table `broadcast_text` has EmoteId0 %u but emote does not exist.", bct.Id, bct.EmoteId0); - bct.EmoteId0 = 0; - } - } - if (bct.EmoteId1) { if (!sEmotesStore.LookupEntry(bct.EmoteId1)) @@ -9054,6 +9045,15 @@ void ObjectMgr::LoadBroadcastTexts() } } + if (bct.EmoteId3) + { + if (!sEmotesStore.LookupEntry(bct.EmoteId3)) + { + LOG_DEBUG("misc", "BroadcastText (Id: %u) in table `broadcast_text` has EmoteId3 %u but emote does not exist.", bct.Id, bct.EmoteId3); + bct.EmoteId3 = 0; + } + } + _broadcastTextStore[bct.Id] = bct; } while (result->NextRow()); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 5339b64e1..681c8f143 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -442,15 +442,15 @@ struct BroadcastText uint32 LanguageID{0}; std::vector MaleText; std::vector FemaleText; - uint32 EmoteId0{0}; uint32 EmoteId1{0}; uint32 EmoteId2{0}; - uint32 EmoteDelay0{0}; + uint32 EmoteId3{0}; uint32 EmoteDelay1{0}; uint32 EmoteDelay2{0}; - uint32 SoundId{0}; - uint32 Unk1{0}; - uint32 Unk2{0}; + uint32 EmoteDelay3{0}; + uint32 SoundEntriesId{0}; + uint32 EmotesID{0}; + uint32 Flags{0}; // uint32 VerifiedBuild; [[nodiscard]] std::string const& GetText(LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false) const