summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r--npc/functions/util.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index e0c1b93d8..125f60044 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -921,6 +921,33 @@ function script gettimeparam {
}
+// Convert LOC (uppercase) to a TP variable
+// POL_LocToTP( {TOWNCODE} )
+function script POL_LocToTP {
+ .@tw$=strtoupper(getarg(0, LOCATION$));
+
+ if (.@tw$ == "TULIM")
+ return TP_TULIM;
+
+ if (.@tw$ == "HALIN")
+ return TP_HALIN;
+
+ if (.@tw$ == "HURNS")
+ return TP_HURNS;
+
+ if (.@tw$ == "LOF")
+ return TP_LOF;
+
+ if (.@tw$ == "NIVAL")
+ return TP_NIVAL;
+
+ if (.@tw$ == "FROSTIA")
+ return TP_FROSTIA;
+
+ return Exception("Invalid town requested / POL_LocToTP", RB_DEFAULT|RB_SPEECH, -1);
+}
+
+
// Upon entering a town
// EnterTown( LocName )
function script EnterTown {