summaryrefslogtreecommitdiff
path: root/npc/functions/bodytype.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/bodytype.txt')
-rw-r--r--npc/functions/bodytype.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/npc/functions/bodytype.txt b/npc/functions/bodytype.txt
new file mode 100644
index 00000000..5d37775a
--- /dev/null
+++ b/npc/functions/bodytype.txt
@@ -0,0 +1,19 @@
+function script stringToBodytype {
+ switch (ord(strtolower(charat(getarg(0, "n"), 0)))) {
+ case 50: // 2
+ case 102: // f
+ return BODYTYPE_2;
+ case 51: // 3
+ case 109: // m
+ return BODYTYPE_3;
+ default:
+ return BODYTYPE_1;
+ }
+}
+
+function script bodytypeToString {
+ .@bodytype = getarg(0, BodyType);
+
+ return .@bodytype == BODYTYPE_2 ? l("type %i", 2) :
+ .@bodytype == BODYTYPE_3 ? l("type %i", 3) : l("type %i", 1);
+}