summaryrefslogtreecommitdiff
path: root/npc/commands/debug-skill.txt
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2016-08-13 13:49:46 -0400
committergumi <mekolat@users.noreply.github.com>2016-09-01 12:09:00 -0400
commitf0173b4dcba4cc8ab82a57e44e3b5176a1ad2def (patch)
treeaf42a83ff77f799c0d36172f18dedf34319d59ca /npc/commands/debug-skill.txt
parent981a1e7326f879ffecf0532d36b0bad0a0bdcecf (diff)
downloadserverdata-f0173b4dcba4cc8ab82a57e44e3b5176a1ad2def.tar.gz
serverdata-f0173b4dcba4cc8ab82a57e44e3b5176a1ad2def.tar.bz2
serverdata-f0173b4dcba4cc8ab82a57e44e3b5176a1ad2def.tar.xz
serverdata-f0173b4dcba4cc8ab82a57e44e3b5176a1ad2def.zip
add skill debug
Diffstat (limited to 'npc/commands/debug-skill.txt')
-rw-r--r--npc/commands/debug-skill.txt85
1 files changed, 85 insertions, 0 deletions
diff --git a/npc/commands/debug-skill.txt b/npc/commands/debug-skill.txt
new file mode 100644
index 00000000..f782e753
--- /dev/null
+++ b/npc/commands/debug-skill.txt
@@ -0,0 +1,85 @@
+function script GlobalSkillDebug {
+
+ function modifySkill {
+
+ function setSkill {
+ clear;
+ mes l("Enter desired skill level:");
+ input .@y;
+ skill getarg(0,1), max(0, min(10, .@y)), 0;
+ return;
+ }
+
+ setnpcdialogtitle l("Skill Debug - Modify Skill");
+ .@k = getarg(0,1);
+ .@v = getskilllv(.@k);
+ menuint
+ menuimage("actions/abort", l("Abort")), 1,
+ rif(.@v > 0, menuimage("actions/remove", l("Remove this skill"))), 2,
+ rif(.@v < 10, menuimage("actions/raise", l("Raise this skill"))), 3,
+ rif(.@v > 0, menuimage("actions/lower", l("Lower this skill"))), 4,
+ menuimage("actions/edit", l("Set the level manually")), 5,
+ menuimage("actions/back", l("Return to skill debug menu")), 1,
+ menuimage("actions/exit", l("Close")), 6;
+
+ switch (@menuret)
+ {
+ case 2: skill .@k, 0, 0; break;
+ case 3: skill .@k, min(10, .@v + 1), 0; break;
+ case 4: skill .@k, max(0, .@v - 1), 0; break;
+ case 5: setSkill .@k; break;
+ case 6: closedialog; end;
+ }
+
+ return;
+ }
+
+ do
+ {
+ clear;
+ setnpcdialogtitle l("Skill Debug");
+ mes l("This menu allows you to change your skills.");
+ mes "";
+
+ mes "---";
+ // FIXME: maybe get skills from an array or `getskilllist;` <= would need a `getskillinfo()` buildin though
+ mes "NV_BASIC: " + getskilllv(NV_BASIC);
+ mes "---";
+
+ mes "";
+ mes l("Which skill do you wish to change?");
+ next;
+
+ menuint
+ "NV_BASIC", NV_BASIC,
+ rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))), 32766,
+ menuimage("actions/exit", l("Close")), 32767;
+
+ switch (@menuret)
+ {
+ case 32766: return;
+ case 32767: closedialog; end;
+ }
+
+ modifySkill @menuret;
+
+ } while (1);
+}
+
+
+
+- script @sdebug 32767,{
+ end;
+
+OnCall:
+ if (!debug && getgroupid() < 99)
+ {
+ end;
+ }
+ GlobalSkillDebug;
+ closedialog;
+ end;
+
+OnInit:
+ bindatcmd "sdebug", "@sdebug::OnCall", 0, 99, 0;
+}