From 955f23b7ff0c74a546c5e13e3d46c14b85ea07ac Mon Sep 17 00:00:00 2001 From: Aelto Date: Tue, 18 Feb 2025 12:52:24 +0100 Subject: [PATCH 1/2] add `transmo model` subcommand --- GWToolboxdll/Modules/ChatCommands.cpp | 38 ++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/GWToolboxdll/Modules/ChatCommands.cpp b/GWToolboxdll/Modules/ChatCommands.cpp index 3477bc56f..b3551e21f 100644 --- a/GWToolboxdll/Modules/ChatCommands.cpp +++ b/GWToolboxdll/Modules/ChatCommands.cpp @@ -2719,6 +2719,42 @@ void CHAT_CMD_FUNC(ChatCommands::CmdTransmo) if (wcsncmp(argv[1], L"reset", 5) == 0) { transmo.npc_id = std::numeric_limits::max(); } + else if (wcsncmp(argv[1], L"model", 5) == 0) { + bool invalid_data = argc < 6; + int npc_id = transmo.npc_id; + if (!invalid_data && argc > 2 && !TextUtils::ParseInt(argv[3], &npc_id)) { + Log::Error("Transmo model: invalid NPC ID '%ls', expected an integer. Example: 4581", argv[3]); + invalid_data = true; + } + int model_file_id = transmo.npc_model_file_id; + if (!invalid_data && argc > 3 && !TextUtils::ParseInt(argv[3], &model_file_id)) { + Log::Error("Transmo model: invalid NPC ModelFileID '%ls', expected an integer. Example: 204020", argv[3]); + invalid_data = true; + } + int model_file_data = transmo.npc_model_file_data; + if (!invalid_data && argc > 4 && !TextUtils::ParseInt(argv[4], &model_file_data)) { + Log::Error("Transmo model: invalid NPC ModelFile'%ls', expected an integer. Example: 245127", argv[4]); + invalid_data = true; + } + int flags = transmo.flags; + if (!invalid_data && argc > 5 && !TextUtils::ParseInt(argv[5], &flags)) { + Log::Error("Transmo model: invalid NPC Flags '%ls', expected an integer. Example: 540", argv[5]); + invalid_data = true; + } + + if (invalid_data) { + Log::Info("HELP for /transmo model"); + Log::Info("Usage: /transmo model NPC_ID MODEL_FILE_ID MODEL_FILE FLAGS"); + Log::Info("Example, transfo as Gehraz: /transmo model 4581 204020 245127 540"); + Log::Info("The numbers required by the command can be obtained from the GWToolbox 'Info' window, in the 'Advanced' section under the 'Target' menu. Note: the numbers must be converted from hexadecimal to decimal."); + return; + } + + transmo.npc_id = npc_id; + transmo.npc_model_file_id = model_file_id; + transmo.npc_model_file_data = model_file_data; + transmo.flags = flags; + } else if (TextUtils::ParseInt(argv[1], &iscale)) { if (!ParseScale(iscale, transmo)) { return; @@ -2728,7 +2764,7 @@ void CHAT_CMD_FUNC(ChatCommands::CmdTransmo) Log::Error("unknown transmo '%ls'", argv[1]); return; } - if (argc > 2 && TextUtils::ParseInt(argv[2], &iscale)) { + else if (argc > 2 && TextUtils::ParseInt(argv[2], &iscale)) { if (!ParseScale(iscale, transmo)) { return; } From 17bc1b2323224102579b1900fb4fdaf998fd70bd Mon Sep 17 00:00:00 2001 From: Aelto Date: Tue, 18 Feb 2025 13:01:40 +0100 Subject: [PATCH 2/2] add `transmo model` subcommand doc to website --- docs/commands.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/commands.md b/docs/commands.md index 4f3ed340e..e173cf186 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -58,6 +58,7 @@ GWToolbox++ supports a variety of chat commands that enhance your gameplay exper - `/transmo`: Change your character model to that of the target NPC (only visible to you). - `/transmo [size (6-255)]`: Set the size of your model. - `/transmo [size (6-255)]`: Change your appearance into a specific NPC. + - `/transmo model `: Change your appearance into a specific NPC model. - `/transmo reset`: Reset your appearance. - `/transmotarget [size (6-255)]`: Change your target's appearance into an NPC (only visible to you). - `/transmotarget reset`: Reset your target's appearance.