From ea3ee9e0dc8e2e7bf639d5c095ff7ce5255902d2 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 8 Jul 2018 14:36:57 -0300 Subject: @setq, the GM Quest Debugger --- npc/commands/debug-quest.txt | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'npc') diff --git a/npc/commands/debug-quest.txt b/npc/commands/debug-quest.txt index cb28a4f11..75801a3da 100644 --- a/npc/commands/debug-quest.txt +++ b/npc/commands/debug-quest.txt @@ -53,14 +53,36 @@ function script GlobalQuestDebug { end; OnCall: - if (!is_gm()) - { + if (!is_gm()) { end; } GlobalQuestDebug; closedialog; end; +OnSetq: + if (.@atcmd_numparameters < 2) { + dispbottom "setq called with invalid arguments (min. 2)"; + dispbottom "GM Command syntax: @setq "; + end; + } + .@q=atoi(.@atcmd_parameters$[0]); + switch (.@atcmd_numparameters < 2) { + case 4: + setq3 .@q, atoi(.@atcmd_parameters$[3]); + case 3: + setq2 .@q, atoi(.@atcmd_parameters$[2]); + case 2: + setq1 .@q, atoi(.@atcmd_parameters$[1]); + break; + default: + dispbottom "setq called with invalid arguments (max. 4)"; + dispbottom "GM Command syntax: @setq "; + break; + } + end; + OnInit: bindatcmd "qdebug", "@qdebug::OnCall", 99, 99, 1; + bindatcmd "setq", "@qdebug::OnSetq", 99, 99, 1; } -- cgit v1.2.3-60-g2f50