summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-08-24 18:00:15 -0300
committerJesusaves <cpntb1@ymail.com>2019-08-24 18:00:15 -0300
commit22d32caa83810d18c64c9b2c6f09acec0f015c97 (patch)
tree93caa716c63bdf05e503ebb0d351394ce46d3553 /npc/functions/util.txt
parent99d4e0237cb69e87c94ce5f5a97fb2454106d006 (diff)
downloadserverdata-22d32caa83810d18c64c9b2c6f09acec0f015c97.tar.gz
serverdata-22d32caa83810d18c64c9b2c6f09acec0f015c97.tar.bz2
serverdata-22d32caa83810d18c64c9b2c6f09acec0f015c97.tar.xz
serverdata-22d32caa83810d18c64c9b2c6f09acec0f015c97.zip
Political System sketch. Siege defeat will now lower town reputation.
All towns start with 50% town reputation (meaning 50% of income). Best income is Tulimshar, Worst income is Halinarzo. Volatile! Experimental sketch only. No pratical effects thus far.
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r--npc/functions/util.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 886dec447..c32a831e1 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -825,3 +825,19 @@ function script EnterTown {
return;
}
+// Convert map name to location id
+// MapToLoc( MapName )
+function script MapToLoc {
+ // Fill variable
+ .@v$=getarg(0);
+
+ // Validade variable, see npc/000-1/exit.txt first
+ setarray .@mapx$, "005-1", "003-1", "009-1", "012-1", "017-1", "018-5", "020-1", "024-1";
+ setarray .@locs$, "Candor", "Tulim", "Halin", "Hurns", "LoF", "Lilit", "Nival", "Frostia";
+ .@lx=array_find(.@locs$, .@v$);
+ if (.@lx < 0)
+ return Exception("Invalid map passed to MapToLoc: "+.@v$, RB_DEBUGMES);
+
+ return .@locs$[.@lx];
+}
+