diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 80 | ||||
-rw-r--r-- | src/server/game/Globals/ObjectMgr.h | 38 | ||||
-rw-r--r-- | src/server/game/Texts/ChatTextBuilder.cpp | 4 |
3 files changed, 61 insertions, 61 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 80a56d17bf4..3ba31cda2cb 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6116,10 +6116,10 @@ void ObjectMgr::LoadGossipText() { if (BroadcastText const* bcText = sObjectMgr->GetBroadcastText(gOption.BroadcastTextID)) { - if (bcText->MaleText[DEFAULT_LOCALE] != gOption.Text_0) - TC_LOG_INFO("sql.sql", "Row %u in table `npc_text` has mismatch between text%u_0 and the corresponding MaleText in `broadcast_text` row %u", id, i, gOption.BroadcastTextID); - if (bcText->FemaleText[DEFAULT_LOCALE] != gOption.Text_1) - TC_LOG_INFO("sql.sql", "Row %u in table `npc_text` has mismatch between text%u_1 and the corresponding FemaleText in `broadcast_text` row %u", id, i, gOption.BroadcastTextID); + if (bcText->Text[DEFAULT_LOCALE] != gOption.Text_0) + TC_LOG_INFO("sql.sql", "Row %u in table `npc_text` has mismatch between text%u_0 and the corresponding Text in `broadcast_text` row %u", id, i, gOption.BroadcastTextID); + if (bcText->Text1[DEFAULT_LOCALE] != gOption.Text_1) + TC_LOG_INFO("sql.sql", "Row %u in table `npc_text` has mismatch between text%u_1 and the corresponding Text1 in `broadcast_text` row %u", id, i, gOption.BroadcastTextID); } else { @@ -9623,8 +9623,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, Text, Text1, EmoteID1, EmoteID2, EmoteID3, EmoteDelay1, EmoteDelay2, EmoteDelay3, SoundEntriesID, EmotesID, Flags FROM broadcast_text"); if (!result) { TC_LOG_INFO("server.loading", ">> Loaded 0 broadcast texts. DB table `broadcast_text` is empty."); @@ -9640,41 +9640,32 @@ void ObjectMgr::LoadBroadcastTexts() BroadcastText bct; bct.Id = fields[0].GetUInt32(); - bct.Language = 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.LanguageID = fields[1].GetUInt32(); + bct.Text[DEFAULT_LOCALE] = fields[2].GetString(); + bct.Text1[DEFAULT_LOCALE] = fields[3].GetString(); + 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)) { - TC_LOG_DEBUG("broadcasttext", "BroadcastText (Id: %u) in table `broadcast_text` has SoundId %u but sound does not exist.", bct.Id, bct.SoundId); - bct.SoundId = 0; + TC_LOG_DEBUG("broadcasttext", "BroadcastText (Id: %u) in table `broadcast_text` has SoundEntriesID %u but sound does not exist.", bct.Id, bct.SoundEntriesID); + bct.SoundEntriesID = 0; } } - if (!GetLanguageDescByID(bct.Language)) + if (!GetLanguageDescByID(bct.LanguageID)) { - TC_LOG_DEBUG("broadcasttext", "BroadcastText (Id: %u) in table `broadcast_text` using Language %u but Language does not exist.", bct.Id, bct.Language); - bct.Language = LANG_UNIVERSAL; - } - - if (bct.EmoteId0) - { - if (!sEmotesStore.LookupEntry(bct.EmoteId0)) - { - TC_LOG_DEBUG("broadcasttext", "BroadcastText (Id: %u) in table `broadcast_text` has EmoteId0 %u but emote does not exist.", bct.Id, bct.EmoteId0); - bct.EmoteId0 = 0; - } + TC_LOG_DEBUG("broadcasttext", "BroadcastText (Id: %u) in table `broadcast_text` using LanguageID %u but Language does not exist.", bct.Id, bct.LanguageID); + bct.LanguageID = LANG_UNIVERSAL; } if (bct.EmoteId1) @@ -9695,6 +9686,15 @@ void ObjectMgr::LoadBroadcastTexts() } } + if (bct.EmoteId3) + { + if (!sEmotesStore.LookupEntry(bct.EmoteId3)) + { + TC_LOG_DEBUG("broadcasttext", "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()); @@ -9706,8 +9706,8 @@ void ObjectMgr::LoadBroadcastTextLocales() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 - QueryResult result = WorldDatabase.Query("SELECT ID, locale, MaleText, FemaleText FROM broadcast_text_locale"); + // 0 1 2 3 + QueryResult result = WorldDatabase.Query("SELECT ID, locale, Text, Text1 FROM broadcast_text_locale"); if (!result) { TC_LOG_INFO("server.loading", ">> Loaded 0 broadcast text locales. DB table `broadcast_text_locale` is empty."); @@ -9720,8 +9720,8 @@ void ObjectMgr::LoadBroadcastTextLocales() uint32 id = fields[0].GetUInt32(); std::string localeName = fields[1].GetString(); - std::string MaleText = fields[2].GetString(); - std::string FemaleText = fields[3].GetString(); + std::string Text = fields[2].GetString(); + std::string Text1 = fields[3].GetString(); BroadcastTextContainer::iterator bct = _broadcastTextStore.find(id); if (bct == _broadcastTextStore.end()) @@ -9734,8 +9734,8 @@ void ObjectMgr::LoadBroadcastTextLocales() if (locale == LOCALE_enUS) continue; - AddLocaleString(MaleText, locale, bct->second.MaleText); - AddLocaleString(FemaleText, locale, bct->second.FemaleText); + AddLocaleString(Text, locale, bct->second.Text); + AddLocaleString(Text1, locale, bct->second.Text1); } while (result->NextRow()); TC_LOG_INFO("server.loading", ">> Loaded %u broadcast text locales in %u ms", uint32(_broadcastTextStore.size()), GetMSTimeDiffToNow(oldMSTime)); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 8611a828dac..01b8ec4ece9 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -474,41 +474,41 @@ struct AccessRequirement struct BroadcastText { - BroadcastText() : Id(0), Language(0), EmoteId0(0), EmoteId1(0), EmoteId2(0), - EmoteDelay0(0), EmoteDelay1(0), EmoteDelay2(0), SoundId(0), Unk1(0), Unk2(0) + BroadcastText() : Id(0), LanguageID(0), EmoteId1(0), EmoteId2(0), EmoteId3(0), + EmoteDelay1(0), EmoteDelay2(0), EmoteDelay3(0), SoundEntriesID(0), EmotesID(0), Flags(0) { - MaleText.resize(DEFAULT_LOCALE + 1); - FemaleText.resize(DEFAULT_LOCALE + 1); + Text.resize(DEFAULT_LOCALE + 1); + Text1.resize(DEFAULT_LOCALE + 1); } uint32 Id; - uint32 Language; - std::vector<std::string> MaleText; - std::vector<std::string> FemaleText; - uint32 EmoteId0; + uint32 LanguageID; + std::vector<std::string> Text; + std::vector<std::string> Text1; uint32 EmoteId1; uint32 EmoteId2; - uint32 EmoteDelay0; + uint32 EmoteId3; uint32 EmoteDelay1; uint32 EmoteDelay2; - uint32 SoundId; - uint32 Unk1; - uint32 Unk2; + uint32 EmoteDelay3; + uint32 SoundEntriesID; + uint32 EmotesID; + uint32 Flags; // uint32 VerifiedBuild; std::string const& GetText(LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false) const { - if ((gender == GENDER_FEMALE || gender == GENDER_NONE) && (forceGender || !FemaleText[DEFAULT_LOCALE].empty())) + if ((gender == GENDER_FEMALE || gender == GENDER_NONE) && (forceGender || !Text1[DEFAULT_LOCALE].empty())) { - if (FemaleText.size() > size_t(locale) && !FemaleText[locale].empty()) - return FemaleText[locale]; - return FemaleText[DEFAULT_LOCALE]; + if (Text1.size() > size_t(locale) && !Text1[locale].empty()) + return Text1[locale]; + return Text1[DEFAULT_LOCALE]; } // else if (gender == GENDER_MALE) { - if (MaleText.size() > size_t(locale) && !MaleText[locale].empty()) - return MaleText[locale]; - return MaleText[DEFAULT_LOCALE]; + if (Text.size() > size_t(locale) && !Text[locale].empty()) + return Text[locale]; + return Text[DEFAULT_LOCALE]; } } }; diff --git a/src/server/game/Texts/ChatTextBuilder.cpp b/src/server/game/Texts/ChatTextBuilder.cpp index ed9627a2109..46ada05d3d9 100644 --- a/src/server/game/Texts/ChatTextBuilder.cpp +++ b/src/server/game/Texts/ChatTextBuilder.cpp @@ -23,13 +23,13 @@ void Trinity::BroadcastTextBuilder::operator()(WorldPacket& data, LocaleConstant locale) const { BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId); - ChatHandler::BuildChatPacket(data, _msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _source, _target, bct ? bct->GetText(locale, _gender) : "", _achievementId, "", locale); + ChatHandler::BuildChatPacket(data, _msgType, bct ? Language(bct->LanguageID) : LANG_UNIVERSAL, _source, _target, bct ? bct->GetText(locale, _gender) : "", _achievementId, "", locale); } size_t Trinity::BroadcastTextBuilder::operator()(WorldPacket* data, LocaleConstant locale) const { BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId); - return ChatHandler::BuildChatPacket(*data, _msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _source, _target, bct ? bct->GetText(locale, _gender) : "", _achievementId, "", locale); + return ChatHandler::BuildChatPacket(*data, _msgType, bct ? Language(bct->LanguageID) : LANG_UNIVERSAL, _source, _target, bct ? bct->GetText(locale, _gender) : "", _achievementId, "", locale); } void Trinity::CustomChatTextBuilder::operator()(WorldPacket& data, LocaleConstant locale) const |