aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Shadowlands
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2024-12-28 23:25:10 +0100
committerGitHub <noreply@github.com>2024-12-28 23:25:10 +0100
commit309ba22a15e5e0b4321b99f7157ccb18e0adc8dd (patch)
treef40e4b0b27df733b348144b3813b932f8aeb3268 /src/server/scripts/Shadowlands
parentd8bcf5fcb655d9931f7c74883ca19c0428e2a8ae (diff)
Core/AI: Implemented conversation ai (#30538)
Diffstat (limited to 'src/server/scripts/Shadowlands')
-rw-r--r--src/server/scripts/Shadowlands/SanctumOfDomination/boss_sylvanas_windrunner.cpp11
-rw-r--r--src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp38
2 files changed, 25 insertions, 24 deletions
diff --git a/src/server/scripts/Shadowlands/SanctumOfDomination/boss_sylvanas_windrunner.cpp b/src/server/scripts/Shadowlands/SanctumOfDomination/boss_sylvanas_windrunner.cpp
index 4ed74a7b144..c54d4a7d8fa 100644
--- a/src/server/scripts/Shadowlands/SanctumOfDomination/boss_sylvanas_windrunner.cpp
+++ b/src/server/scripts/Shadowlands/SanctumOfDomination/boss_sylvanas_windrunner.cpp
@@ -18,6 +18,7 @@
#include "AreaTrigger.h"
#include "AreaTriggerAI.h"
#include "Conversation.h"
+#include "ConversationAI.h"
#include "CreatureAI.h"
#include "CreatureAIImpl.h"
#include "InstanceScript.h"
@@ -262,12 +263,12 @@ struct at_sylvanas_windrunner_introduction : AreaTriggerAI
};
// 17368 - Sylvanas Windrunner's Introduction (Conversation)
-class conversation_sylvanas_windrunner_introduction : public ConversationScript
+class conversation_sylvanas_windrunner_introduction : public ConversationAI
{
public:
- conversation_sylvanas_windrunner_introduction() : ConversationScript("conversation_sylvanas_windrunner_introduction") { }
+ conversation_sylvanas_windrunner_introduction(Conversation* conversation) : ConversationAI(conversation) { }
- void OnConversationCreate(Conversation* conversation, Unit* creator) override
+ void OnCreate(Unit* creator) override
{
InstanceScript* instance = creator->GetInstanceScript();
if (!instance)
@@ -283,7 +284,7 @@ public:
_events.ScheduleEvent(EVENT_INTRODUCTION, 5s + 500ms);
}
- void OnConversationUpdate(Conversation* conversation, uint32 diff) override
+ void OnUpdate(uint32 diff) override
{
_events.Update(diff);
@@ -485,5 +486,5 @@ void AddSC_boss_sylvanas_windrunner()
RegisterAreaTriggerAI(at_sylvanas_windrunner_z_check);
RegisterAreaTriggerAI(at_sylvanas_windrunner_introduction);
- new conversation_sylvanas_windrunner_introduction();
+ RegisterConversationAI(conversation_sylvanas_windrunner_introduction);
}
diff --git a/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp
index 62f6ca3f78b..aba4b171ef4 100644
--- a/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp
+++ b/src/server/scripts/Shadowlands/SepulcherOfTheFirstOnes/boss_anduin_wrynn.cpp
@@ -776,14 +776,14 @@ struct boss_anduin_wrynn : public BossAI
if (!jaina)
return;
- Conversation* convo = Conversation::CreateConversation(CONVERSATION_INTRO, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false);
- if (!convo)
+ Conversation* conversation = Conversation::CreateConversation(CONVERSATION_INTRO, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false);
+ if (!conversation)
return;
- convo->AddActor(NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, 1, uther->GetGUID());
- convo->AddActor(NPC_SYLVANAS_WINDRUNNER_ANDUIN, 2, sylvanas->GetGUID());
- convo->AddActor(NPC_LADY_JAINA_PROUDMOORE_ANDUIN, 3, jaina->GetGUID());
- convo->Start();
+ conversation->AddActor(NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, 1, uther->GetGUID());
+ conversation->AddActor(NPC_SYLVANAS_WINDRUNNER_ANDUIN, 2, sylvanas->GetGUID());
+ conversation->AddActor(NPC_LADY_JAINA_PROUDMOORE_ANDUIN, 3, jaina->GetGUID());
+ conversation->Start();
});
scheduler.Schedule(35s, [this](TaskContext /*task*/)
@@ -827,15 +827,15 @@ struct boss_anduin_wrynn : public BossAI
firim->GetMotionMaster()->MovePath(PATH_OUTRODUCTION_FIRIM, false);
- Conversation* convo = Conversation::CreateConversation(CONVERSATION_ANDUIN_OUTRODUCTION, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false);
- if (!convo)
+ Conversation* conversation = Conversation::CreateConversation(CONVERSATION_ANDUIN_OUTRODUCTION, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false);
+ if (!conversation)
break;
- convo->AddActor(NPC_LADY_JAINA_PROUDMOORE_ANDUIN, 1, jaina->GetGUID());
- convo->AddActor(NPC_SYLVANAS_WINDRUNNER_ANDUIN, 2, sylvanas->GetGUID());
- convo->AddActor(NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, 3, uther->GetGUID());
- convo->AddActor(NPC_FIRIM_ANDUIN, 4, firim->GetGUID());
- convo->Start();
+ conversation->AddActor(NPC_LADY_JAINA_PROUDMOORE_ANDUIN, 1, jaina->GetGUID());
+ conversation->AddActor(NPC_SYLVANAS_WINDRUNNER_ANDUIN, 2, sylvanas->GetGUID());
+ conversation->AddActor(NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, 3, uther->GetGUID());
+ conversation->AddActor(NPC_FIRIM_ANDUIN, 4, firim->GetGUID());
+ conversation->Start();
break;
}
case ACTION_ARTHAS_INTERMISSION_UTHER:
@@ -843,10 +843,10 @@ struct boss_anduin_wrynn : public BossAI
instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_INTERMISSION, 1);
if (Creature* uther = instance->GetCreature(DATA_UTHER_THE_LIGHTBRINGER_ANDUIN))
{
- if (Conversation* convo = Conversation::CreateConversation(CONVERSATION_ARTHAS_UTHER, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false))
+ if (Conversation* conversation = Conversation::CreateConversation(CONVERSATION_ARTHAS_UTHER, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false))
{
- convo->AddActor(NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, 1, uther->GetGUID());
- convo->Start();
+ conversation->AddActor(NPC_UTHER_THE_LIGHTBRINGER_ANDUIN, 1, uther->GetGUID());
+ conversation->Start();
}
}
break;
@@ -856,10 +856,10 @@ struct boss_anduin_wrynn : public BossAI
instance->DoUpdateWorldState(WORLD_STATE_ANDUIN_INTERMISSION, 2);
if (Creature* sylvanas = instance->GetCreature(DATA_SYLVANAS_WINDRUNNER_ANDUIN))
{
- if (Conversation* convo = Conversation::CreateConversation(CONVERSATION_ARTHAS_SYLVANAS, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false))
+ if (Conversation* conversation = Conversation::CreateConversation(CONVERSATION_ARTHAS_SYLVANAS, me, me->GetPosition(), ObjectGuid::Empty, nullptr, false))
{
- convo->AddActor(NPC_SYLVANAS_WINDRUNNER_ANDUIN, 1, sylvanas->GetGUID());
- convo->Start();
+ conversation->AddActor(NPC_SYLVANAS_WINDRUNNER_ANDUIN, 1, sylvanas->GetGUID());
+ conversation->Start();
}
}
break;