diff options
| author | ModoX <moardox@gmail.com> | 2021-10-12 00:16:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-12 00:16:20 +0200 |
| commit | 6d9ce8e8baa100ecc7650d0ae56037c131bab2e0 (patch) | |
| tree | 911d162cb936f3e7bc7c79dfe79b7f6002aee8a7 /src/server/game/Scripting | |
| parent | 9b036b8fe0c443acd882de9faf615abe89dad691 (diff) | |
Core/PacketIO: Implemented CMSG_CONVERSATION_LINE_STARTED (#27036)
* Added OnConversationLineStarted hook to ConversationScripts
* Added example for Defender of Azeroth conversation
Diffstat (limited to 'src/server/game/Scripting')
| -rw-r--r-- | src/server/game/Scripting/ScriptMgr.cpp | 9 | ||||
| -rw-r--r-- | src/server/game/Scripting/ScriptMgr.h | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index a74251922c3..fc7ac25b3da 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -2171,6 +2171,15 @@ void ScriptMgr::OnConversationCreate(Conversation* conversation, Unit* creator) tmpscript->OnConversationCreate(conversation, creator); } +void ScriptMgr::OnConversationLineStarted(Conversation* conversation, uint32 lineId, Player* sender) +{ + ASSERT(conversation); + ASSERT(sender); + + GET_SCRIPT(ConversationScript, conversation->GetScriptId(), tmpscript); + tmpscript->OnConversationLineStarted(conversation, lineId, sender); +} + // Scene void ScriptMgr::OnSceneStart(Player* player, uint32 sceneInstanceID, SceneTemplate const* sceneTemplate) { diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index bd3e383572c..9b4bd01e2b6 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -828,6 +828,9 @@ class TC_GAME_API ConversationScript : public ScriptObject // Called when Conversation is created but not added to Map yet. virtual void OnConversationCreate(Conversation* /*conversation*/, Unit* /*creator*/) { } + + // Called when player sends CMSG_CONVERSATION_LINE_STARTED with valid conversation guid + virtual void OnConversationLineStarted(Conversation* /*conversation*/, uint32 /*lineId*/, Player* /*sender*/) { } }; class TC_GAME_API SceneScript : public ScriptObject @@ -1132,6 +1135,7 @@ class TC_GAME_API ScriptMgr public: /* ConversationScript */ void OnConversationCreate(Conversation* conversation, Unit* creator); + void OnConversationLineStarted(Conversation* conversation, uint32 lineId, Player* sender); public: /* SceneScript */ |
