summaryrefslogtreecommitdiff
path: root/npc/commands
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-13 18:05:36 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-13 18:05:36 -0300
commitb69bafdb60b507ef57fd32ce4ed12efeb78062b6 (patch)
treed3072c24e20671297951dff56fe8c398407416d2 /npc/commands
parent9ac9fc3c64ad43693d992c338f3b5c19e3b0c637 (diff)
downloadserverdata-b69bafdb60b507ef57fd32ce4ed12efeb78062b6.tar.gz
serverdata-b69bafdb60b507ef57fd32ce4ed12efeb78062b6.tar.bz2
serverdata-b69bafdb60b507ef57fd32ce4ed12efeb78062b6.tar.xz
serverdata-b69bafdb60b507ef57fd32ce4ed12efeb78062b6.zip
I actually forgot part of my debug toolkit
Diffstat (limited to 'npc/commands')
-rw-r--r--npc/commands/debug.txt75
1 files changed, 74 insertions, 1 deletions
diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt
index 0529d2fe..3747156f 100644
--- a/npc/commands/debug.txt
+++ b/npc/commands/debug.txt
@@ -528,9 +528,76 @@ L_ResetAll:
goto L_Begin;
L_close:
- close2;
+ closeclientdialog;
return;
+OnSetVar:
+ if (getarraysize(.@atcmd_parameters$) != 3)
+ Exception("Usage: @set-var VARIABLE INDEX VALUE", RB_DISPBOTTOM|RB_ISFATAL);
+
+ .@cmd$=array_shift(.@atcmd_parameters$);
+ .@idx=atoi(array_shift(.@atcmd_parameters$));
+ if (charat(.@atcmd_parameters$[0],
+ getstrlen(.@atcmd_parameters$[0])-1) == "$")
+ .@str=true;
+
+ if (.@str)
+ .@val$=array_shift(.@atcmd_parameters$);
+ else
+ .@val=array_shift(.@atcmd_parameters$);
+
+ if (.@str)
+ setd(sprintf("%s[%d]", .@cmd$, .@idx), .@val$);
+ else
+ setd(sprintf("%s[%d]", .@cmd$, .@idx), .@val);
+
+ .@msg$=sprintf("%s[%d] is now: %s", .@cmd$, .@idx,
+ getd(sprintf("%s[%d]", .@cmd$, .@idx)));
+
+ if (!is_trusted())
+ atcommand("@request System Information: "+.@msg$);
+ else
+ dispbottom(.@msg$);
+ end;
+
+// If the char is not a staff member, it'll be sent to GM Log instead
+OnGetVar:
+ if (getarraysize(.@atcmd_parameters$) != 2)
+ Exception("Usage: @get-var VARIABLE INDEX", RB_DISPBOTTOM|RB_ISFATAL);
+
+ .@cmd$=array_shift(.@atcmd_parameters$);
+ .@idx=atoi(array_shift(.@atcmd_parameters$));
+
+ .@mg$=sprintf("%s[%d] == %s", .@cmd$, .@idx,
+ getd(sprintf("%s[%d]", .@cmd$, .@idx)));
+
+ if (!is_trusted())
+ atcommand("@request System Information: "+.@mg$);
+ else
+ dispbottom(.@mg$);
+ end;
+
+OnSClear:
+ sc_end SC_ALL;
+ sc_end SC_DAILYSENDMAILCNT;
+ dispbottom l("Status Condition Cleared");
+ end;
+
+OnAllperms:
+ if (@allperms) end;
+ charcommand("@addperm all_skill");
+ charcommand("@addperm all_equipment");
+ charcommand("@addperm skill_unconditional");
+ charcommand("@addperm join_chat");
+ charcommand("@addperm hide_session");
+ charcommand("@addperm any_warp");
+ charcommand("@addperm view_hpmeter");
+ charcommand("@addperm view_equipment");
+ charcommand("@addperm receive_requests");
+ charcommand("@addperm can_trade_bound");
+ charcommand("@addperm bypass_nostorage");
+ @allperms=true;
+ end;
}
- script Debug Spell NPC32767,{
@@ -543,6 +610,12 @@ OnDeprecated:
end;
OnInit:
registercmd "@debug", "Debug Spell::OnDebug";
+ bindatcmd "getvar", "Debug::OnGetVar", 99, 99, 1;
+ bindatcmd "get-var", "Debug::OnGetVar", 99, 99, 1;
+ bindatcmd "setvar", "Debug::OnSetVar", 99, 99, 1;
+ bindatcmd "set-var", "Debug::OnSetVar", 99, 99, 1;
+ bindatcmd "sclear", "Debug::OnSClear", 99, 99, 1;
+ bindatcmd "allperms", "Debug::OnAllPerms", 99, 100, 1;
end;
}