summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/000-2-1/alige.txt2
-rw-r--r--npc/001-2-22/alige.txt2
-rw-r--r--npc/functions/input.txt36
-rw-r--r--npc/scripts.conf1
4 files changed, 39 insertions, 2 deletions
diff --git a/npc/000-2-1/alige.txt b/npc/000-2-1/alige.txt
index 39d88b3c..34fc7912 100644
--- a/npc/000-2-1/alige.txt
+++ b/npc/000-2-1/alige.txt
@@ -167,7 +167,7 @@ L_Accepted:
L_GiveFood:
mes "";
- menu
+ menu2
rif(countitemcolor(501, 1), l(getitemname("Acorn"))), 0,
rif(countitemcolor(502, 1), l(getitemname("Bread"))), 502,
rif(countitemcolor(503, 1), l(getitemname("Fungus"))), 503,
diff --git a/npc/001-2-22/alige.txt b/npc/001-2-22/alige.txt
index 24db2387..a003f252 100644
--- a/npc/001-2-22/alige.txt
+++ b/npc/001-2-22/alige.txt
@@ -171,7 +171,7 @@ L_Accepted:
L_GiveFood:
mes "";
- menu
+ menu2
rif(countitemcolor(501, 1), l(getitemname("Acorn"))), 0,
rif(countitemcolor(502, 1), l(getitemname("Bread"))), 502,
rif(countitemcolor(503, 1), l(getitemname("Fungus"))), 503,
diff --git a/npc/functions/input.txt b/npc/functions/input.txt
new file mode 100644
index 00000000..c380940c
--- /dev/null
+++ b/npc/functions/input.txt
@@ -0,0 +1,36 @@
+// Evol functions.
+// Authors:
+// 4144
+// Description:
+// Input utility functions
+// Variables:
+// none
+
+function script menu2 {
+ deletearray .@vals;
+ .@menustr$ = "";
+ .@cnt = 0;
+
+ for (.@f = 0; .@f < getargcount(); .@f = .@f + 2)
+ {
+ if (getarg(.@f) != "")
+ {
+ .@menustr$ = .@menustr$ + getarg(.@f) + ":";
+ .@vals[.@cnt] = getarg(.@f + 1);
+ .@cnt ++;
+ }
+ }
+
+ @menu = 255;
+ @menuret = -1;
+ select(.@menustr$);
+ if (@menu == 255)
+ return -1;
+
+ @menu --;
+ if (@menu < 0 || @menu >= getarraysize(.@vals))
+ return -1;
+
+ @menuret = .@vals[@menu];
+ return @menuret;
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index eeb92856..c5b3a457 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -10,6 +10,7 @@ npc: npc/functions/clientversion.txt
npc: npc/functions/doors.txt
npc: npc/functions/hammocks.txt
npc: npc/functions/harbours.txt
+npc: npc/functions/input.txt
npc: npc/functions/inventoryplace.txt
npc: npc/functions/goodbye.txt
npc: npc/functions/sailordialogue.txt