From a820439430944960d4407ae74660ecbb2e61f476 Mon Sep 17 00:00:00 2001 From: Emagi Date: Sat, 4 Jan 2025 16:10:38 -0500 Subject: [PATCH] add select command to support checking for accepted dialogs --- source/WorldServer/Commands/Commands.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/WorldServer/Commands/Commands.cpp b/source/WorldServer/Commands/Commands.cpp index 38f11ca..1fa25c8 100644 --- a/source/WorldServer/Commands/Commands.cpp +++ b/source/WorldServer/Commands/Commands.cpp @@ -11575,7 +11575,11 @@ void Commands::Command_Weather(Client* client, Seperator* sep) void Commands::Command_Select(Client* client, Seperator* sep) { if (sep && sep->arg[1]) { Spawn* spawn = client->GetPlayer()->GetTarget(); - if (spawn && strlen(sep->arg[1]) > 0) + int32 spawn_id = client->dialog_manager.getAcceptValue("select"); + if(spawn && spawn_id == spawn->GetID()) { + client->GetCurrentZone()->CallSpawnScript(spawn, SPAWN_SCRIPT_CASTED_ON, client->GetPlayer(), sep->argplus[0]); + } + else if (spawn && strlen(sep->arg[1]) > 0) client->GetCurrentZone()->CallSpawnScript(spawn, SPAWN_SCRIPT_CUSTOM, client->GetPlayer(), sep->arg[1]); } }