diff options
Diffstat (limited to 'src/server/scripts')
3 files changed, 26 insertions, 23 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 7cb4ed0d3d7..0b828c2c87e 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" @@ -94,10 +95,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 { @@ -113,7 +114,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) @@ -127,7 +128,7 @@ public: conversation->Start(); } - void OnConversationStart(Conversation* conversation) override + void OnStart() override { LocaleConstant privateOwnerLocale = conversation->GetPrivateObjectOwnerLocale(); @@ -137,7 +138,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); @@ -332,7 +333,7 @@ void AddSC_stormwind_city() RegisterCreatureAI(npc_anduin_wrynn_nation_of_kultiras); // Conversation - new conversation_start_council_tides_of_war(); + RegisterConversationAI(conversation_start_council_tides_of_war); // PlayerScript new player_conv_after_movie_tides_of_war(); 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); } |
