diff options
4 files changed, 17 insertions, 1 deletions
diff --git a/sql/updates/world/master/2023_07_03_01_world.sql b/sql/updates/world/master/2023_07_03_01_world.sql new file mode 100644 index 00000000000..00a5ab8b2ba --- /dev/null +++ b/sql/updates/world/master/2023_07_03_01_world.sql @@ -0,0 +1,13 @@ +DROP PROCEDURE IF EXISTS apply_if_not_exists_2023_07_03_01_world; + +DELIMITER ;; +CREATE PROCEDURE apply_if_not_exists_2023_07_03_01_world() BEGIN + IF NOT EXISTS (SELECT * FROM `information_schema`.`columns` WHERE `table_schema`=SCHEMA() AND `table_name`='conversation_line_template' AND `column_name`='ChatType') THEN + ALTER TABLE `conversation_line_template` ADD COLUMN `ChatType` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `Flags`; + END IF; +END;; + +DELIMITER ; +CALL apply_if_not_exists_2023_07_03_01_world; + +DROP PROCEDURE IF EXISTS apply_if_not_exists_2023_07_03_01_world; diff --git a/src/server/game/Entities/Conversation/Conversation.cpp b/src/server/game/Entities/Conversation/Conversation.cpp index e3edba75986..527bc6636dd 100644 --- a/src/server/game/Entities/Conversation/Conversation.cpp +++ b/src/server/game/Entities/Conversation/Conversation.cpp @@ -197,6 +197,7 @@ void Conversation::Create(ObjectGuid::LowType lowGuid, uint32 conversationEntry, lineField.UiCameraID = line->UiCameraID; lineField.ActorIndex = line->ActorIdx; lineField.Flags = line->Flags; + lineField.ChatType = line->ChatType; ConversationLineEntry const* convoLine = sConversationLineStore.LookupEntry(line->Id); // never null for conversationTemplate->Lines diff --git a/src/server/game/Globals/ConversationDataStore.cpp b/src/server/game/Globals/ConversationDataStore.cpp index 9f3b4949bbc..f133f97eddd 100644 --- a/src/server/game/Globals/ConversationDataStore.cpp +++ b/src/server/game/Globals/ConversationDataStore.cpp @@ -36,7 +36,7 @@ void ConversationDataStore::LoadConversationTemplates() std::unordered_map<uint32, std::vector<ConversationActorTemplate>> actorsByConversation; - if (QueryResult lineTemplates = WorldDatabase.Query("SELECT Id, UiCameraID, ActorIdx, Flags FROM conversation_line_template")) + if (QueryResult lineTemplates = WorldDatabase.Query("SELECT Id, UiCameraID, ActorIdx, Flags, ChatType FROM conversation_line_template")) { uint32 oldMSTime = getMSTime(); @@ -57,6 +57,7 @@ void ConversationDataStore::LoadConversationTemplates() conversationLine.UiCameraID = fields[1].GetUInt32(); conversationLine.ActorIdx = fields[2].GetUInt8(); conversationLine.Flags = fields[3].GetUInt8(); + conversationLine.ChatType = fields[4].GetUInt8(); } while (lineTemplates->NextRow()); diff --git a/src/server/game/Globals/ConversationDataStore.h b/src/server/game/Globals/ConversationDataStore.h index cd1f81a6969..ed8bec144f3 100644 --- a/src/server/game/Globals/ConversationDataStore.h +++ b/src/server/game/Globals/ConversationDataStore.h @@ -71,6 +71,7 @@ struct ConversationLineTemplate uint32 UiCameraID; // Link to UiCamera.db2 uint8 ActorIdx; // Index from conversation_actors uint8 Flags; + uint8 ChatType; }; struct ConversationTemplate |