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/EasternKingdoms | |
| parent | d8bcf5fcb655d9931f7c74883ca19c0428e2a8ae (diff) | |
Core/AI: Implemented conversation ai (#30538)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp | 25 | ||||
| -rw-r--r-- | src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp | 25 |
2 files changed, 26 insertions, 24 deletions
diff --git a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp index caa7fb2dd97..22a8b5dedf2 100644 --- a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp @@ -19,6 +19,7 @@ #include "AreaTriggerAI.h" #include "Containers.h" #include "Conversation.h" +#include "ConversationAI.h" #include "CreatureAIImpl.h" #include "CreatureGroups.h" #include "MotionMaster.h" @@ -469,12 +470,12 @@ struct at_human_heritage_lions_pride_inn_basement_enter : AreaTriggerAI }; // 20342 - Conversation -class conversation_an_unlikely_informant : public ConversationScript +class conversation_an_unlikely_informant : public ConversationAI { public: - conversation_an_unlikely_informant() : ConversationScript("conversation_an_unlikely_informant") { } + conversation_an_unlikely_informant(Conversation* conversation) : ConversationAI(conversation) { } - void OnConversationCreate(Conversation* conversation, Unit* creator) override + void OnCreate(Unit* creator) override { Creature* mathiasObject = GetClosestCreatureWithOptions(creator, 15.0f, { .CreatureId = NPC_MATHIAS_SHAW, .IgnorePhases = true }); Creature* vanessaObject = GetClosestCreatureWithOptions(creator, 15.0f, { .CreatureId = NPC_VANESSA_VANCLEEF, .IgnorePhases = true }); @@ -495,7 +496,7 @@ public: conversation->Start(); } - void OnConversationStart(Conversation* conversation) override + void OnStart() override { LocaleConstant privateOwnerLocale = conversation->GetPrivateObjectOwnerLocale(); @@ -511,7 +512,7 @@ public: _events.ScheduleEvent(EVENT_MATHIAS_CLONE_DESPAWN, conversation->GetLastLineEndTime(privateOwnerLocale)); } - void OnConversationUpdate(Conversation* conversation, uint32 diff) override + void OnUpdate(uint32 diff) override { _events.Update(diff); @@ -582,12 +583,12 @@ private: }; // 20387 - Conversation -class conversation_the_new_classington_estate : public ConversationScript +class conversation_the_new_classington_estate : public ConversationAI { public: - conversation_the_new_classington_estate() : ConversationScript("conversation_the_new_classington_estate") { } + conversation_the_new_classington_estate(Conversation* conversation) : ConversationAI(conversation) { } - void OnConversationCreate(Conversation* conversation, Unit* creator) override + void OnCreate(Unit* creator) override { Creature* mathiasObject = GetClosestCreatureWithOptions(creator, 15.0f, { .CreatureId = NPC_MATHIAS_SHAW, .IgnorePhases = true }); Creature* vanessaObject = GetClosestCreatureWithOptions(creator, 15.0f, { .CreatureId = NPC_VANESSA_VANCLEEF, .IgnorePhases = true }); @@ -608,7 +609,7 @@ public: conversation->Start(); } - void OnConversationStart(Conversation* conversation) override + void OnStart() override { LocaleConstant privateOwnerLocale = conversation->GetPrivateObjectOwnerLocale(); @@ -622,7 +623,7 @@ public: _events.ScheduleEvent(EVENT_MATHIAS_CLONE_DESPAWN, conversation->GetLastLineEndTime(privateOwnerLocale)); } - void OnConversationUpdate(Conversation* conversation, uint32 diff) override + void OnUpdate(uint32 diff) override { _events.Update(diff); @@ -720,8 +721,8 @@ void AddSC_elwynn_forest() RegisterSpellScript(spell_stealth_vanessa_human_heritage); // Conversation - new conversation_an_unlikely_informant(); - new conversation_the_new_classington_estate(); + RegisterConversationAI(conversation_an_unlikely_informant); + RegisterConversationAI(conversation_the_new_classington_estate); // AreaTrigger RegisterAreaTriggerAI(at_human_heritage_lions_pride_inn_basement_enter); diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp index e071fdf1f19..902fb016da4 100644 --- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp @@ -19,6 +19,7 @@ #include "AreaTriggerAI.h" #include "Containers.h" #include "Conversation.h" +#include "ConversationAI.h" #include "CreatureAIImpl.h" #include "MotionMaster.h" #include "ObjectAccessor.h" @@ -104,10 +105,10 @@ struct at_stormwind_keep_tides_of_war : AreaTriggerAI Position const VisionOfSailorsMemoryPosition = { -8384.131f, 324.383f, 148.443f, 1.559973f }; // 4857 - Conversation -class conversation_start_council_tides_of_war : public ConversationScript +class conversation_start_council_tides_of_war : public ConversationAI { public: - conversation_start_council_tides_of_war() : ConversationScript("conversation_start_council_tides_of_war") { } + conversation_start_council_tides_of_war(Conversation* conversation) : ConversationAI(conversation) { } enum Events { @@ -123,7 +124,7 @@ public: CONVO_LINE_JAINA_CREDIT = 19486, }; - void OnConversationCreate(Conversation* conversation, Unit* creator) override + void OnCreate(Unit* creator) override { Creature* jainaObject = GetClosestCreatureWithOptions(creator, 30.0f, { .CreatureId = NPC_JAINA_TIDES_OF_WAR, .IgnorePhases = true }); if (!jainaObject) @@ -137,7 +138,7 @@ public: conversation->Start(); } - void OnConversationStart(Conversation* conversation) override + void OnStart() override { LocaleConstant privateOwnerLocale = conversation->GetPrivateObjectOwnerLocale(); @@ -147,7 +148,7 @@ public: _events.ScheduleEvent(EVENT_KILL_CREDIT, conversation->GetLineEndTime(privateOwnerLocale, CONVO_LINE_JAINA_CREDIT)); } - void OnConversationUpdate(Conversation* conversation, uint32 diff) override + void OnUpdate(uint32 diff) override { _events.Update(diff); @@ -422,10 +423,10 @@ private: }; // 22025 - Conversation -class conversation_quest_ancient_curses_accept : public ConversationScript +class conversation_quest_ancient_curses_accept : public ConversationAI { public: - conversation_quest_ancient_curses_accept() : ConversationScript("conversation_quest_ancient_curses_accept") { } + conversation_quest_ancient_curses_accept(Conversation* conversation) : ConversationAI(conversation) { } enum AncientCursesConversationEvents { @@ -439,7 +440,7 @@ public: CONVO_LINE_LYSANDER_START_PATH = 60113, }; - void OnConversationCreate(Conversation* conversation, Unit* creator) override + void OnCreate(Unit* creator) override { Creature* arkonarinObject = GetClosestCreatureWithOptions(creator, 20.0f, { .CreatureId = NPC_ARKONARIN_STARSHADE, .IgnorePhases = true }); Creature* lysanderObject = GetClosestCreatureWithOptions(creator, 20.0f, { .CreatureId = NPC_LYSANDER_STARSHADE, .IgnorePhases = true }); @@ -461,7 +462,7 @@ public: conversation->Start(); } - void OnConversationStart(Conversation* conversation) override + void OnStart() override { LocaleConstant privateOwnerLocale = conversation->GetPrivateObjectOwnerLocale(); @@ -472,7 +473,7 @@ public: _events.ScheduleEvent(EVENT_LYSANDER_START_PATH, *lysanderPathStartTime); } - void OnConversationUpdate(Conversation* conversation, uint32 diff) override + void OnUpdate(uint32 diff) override { _events.Update(diff); @@ -563,8 +564,8 @@ void AddSC_stormwind_city() RegisterCreatureAI(npc_lysande_starshade_ancient_curses); // Conversation - new conversation_start_council_tides_of_war(); - new conversation_quest_ancient_curses_accept(); + RegisterConversationAI(conversation_start_council_tides_of_war); + RegisterConversationAI(conversation_quest_ancient_curses_accept); // PlayerScript new player_conv_after_movie_tides_of_war(); |
