diff options
author | gumi <mekolat@users.noreply.github.com> | 2016-08-15 10:56:59 -0400 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2016-09-01 12:09:02 -0400 |
commit | 96036014cdb83abf6033af4570bac7e5ef9b6689 (patch) | |
tree | d1674228668e6b536b5a802be67a277b2c7a89eb /npc/functions/quest-debug/functions.txt | |
parent | 2fa3eebd17a78b617f767df46988ddefefb9f71e (diff) | |
download | serverdata-96036014cdb83abf6033af4570bac7e5ef9b6689.tar.gz serverdata-96036014cdb83abf6033af4570bac7e5ef9b6689.tar.bz2 serverdata-96036014cdb83abf6033af4570bac7e5ef9b6689.tar.xz serverdata-96036014cdb83abf6033af4570bac7e5ef9b6689.zip |
add quest debug
Diffstat (limited to 'npc/functions/quest-debug/functions.txt')
-rw-r--r-- | npc/functions/quest-debug/functions.txt | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/npc/functions/quest-debug/functions.txt b/npc/functions/quest-debug/functions.txt new file mode 100644 index 00000000..c193f9f8 --- /dev/null +++ b/npc/functions/quest-debug/functions.txt @@ -0,0 +1,73 @@ +// generic quest debug functions + +function script GenericQuestDebug { + if (!debug) + { + select + menuimage("actions/back", l("Go back")), + menuimage("actions/exit", l("Close")); + + if (@menu == 1) + { + @menuret = 32766; + return 32766; + } + + closedialog; + end; + } + + mes l("Choose desired quest state:"); + + deletearray .@vals; + .@menustr$ = menuimage("actions/abort", l("Do nothing")) + ":"; + .@vals[0] = 32766; + .@cnt = 1; + + for (.@f = 1; .@f < getargcount(); .@f += 2) + { + if (getarg(.@f) != "") + { + .@qv = getarg(.@f + 1); + .@s$ = menuimage("actions/" + (.@qv ? "edit" : "reset"), "[" + .@qv + "] " + getarg(.@f)); + .@menustr$ += (.@qv >= 32700 ? getarg(.@f) : .@s$) + ":"; + .@vals[.@cnt] = .@qv; + ++.@cnt; + } + } + + if (getgroupid() >= 99) + { + .@menustr$ += menuimage("actions/nuke", l("Set state manually")) + ":"; + .@vals[.@cnt] = 32765; + ++.@cnt; + } + + .@menustr$ += menuimage("actions/exit", l("Close")); + .@vals[.@cnt] = 32767; + + @menu = 255; + @menuret = -1; + select(.@menustr$); + if (@menu == 255) + return -1; + + --@menu; + if (@menu < 0 || @menu >= getarraysize(.@vals)) + return -1; + + @menuret = .@vals[@menu]; + + switch (@menuret) + { + case 32765: input .@w; setq getarg(0,0), .@w; + case 32766: return 1; + case 32767: closedialog; end; + } + + if (@menuret < 32700) + { + setq getarg(0,0), @menuret; + } + return; +} |