diff options
author | ModoX <moardox@gmail.com> | 2024-12-28 23:25:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-28 23:25:10 +0100 |
commit | 309ba22a15e5e0b4321b99f7157ccb18e0adc8dd (patch) | |
tree | f40e4b0b27df733b348144b3813b932f8aeb3268 /src/server/scripts/World | |
parent | d8bcf5fcb655d9931f7c74883ca19c0428e2a8ae (diff) |
Core/AI: Implemented conversation ai (#30538)
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r-- | src/server/scripts/World/conversation_scripts.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/server/scripts/World/conversation_scripts.cpp b/src/server/scripts/World/conversation_scripts.cpp index 507da020e79..f1a442c40b7 100644 --- a/src/server/scripts/World/conversation_scripts.cpp +++ b/src/server/scripts/World/conversation_scripts.cpp @@ -17,9 +17,10 @@ #include "ScriptMgr.h" #include "Conversation.h" +#include "ConversationAI.h" #include "Player.h" -class conversation_allied_race_dk_defender_of_azeroth : public ConversationScript +class conversation_allied_race_dk_defender_of_azeroth : public ConversationAI { public: enum DefenderOfAzerothIds : uint32 @@ -30,15 +31,15 @@ public: CONVERSATION_LINE_PLAYER = 32926 }; - conversation_allied_race_dk_defender_of_azeroth() : ConversationScript("conversation_allied_race_dk_defender_of_azeroth") { } + conversation_allied_race_dk_defender_of_azeroth(Conversation* conversation) : ConversationAI(conversation) { } - void OnConversationCreate(Conversation* /*conversation*/, Unit* creator) override + void OnCreate(Unit* creator) override { if (Player* player = creator->ToPlayer()) player->KilledMonsterCredit(NPC_TALK_TO_YOUR_COMMANDER_CREDIT); } - void OnConversationLineStarted(Conversation* /*conversation*/, uint32 lineId, Player* sender) override + void OnLineStarted(uint32 lineId, Player* sender) override { if (lineId != CONVERSATION_LINE_PLAYER) return; @@ -49,5 +50,5 @@ public: void AddSC_conversation_scripts() { - new conversation_allied_race_dk_defender_of_azeroth(); + RegisterConversationAI(conversation_allied_race_dk_defender_of_azeroth); } |