summaryrefslogtreecommitdiff
path: root/npc/functions/doors.txt
diff options
context:
space:
mode:
authorSaulc <lucashelaine14@gmail.com>2018-01-13 20:50:42 +0100
committerSaulc <lucashelaine14@gmail.com>2018-01-13 20:50:42 +0100
commit20df2abc1aca00d6aa5dc78347133890f36b32f3 (patch)
tree4ad4a8bb8b0605473a702e314799a4626347721a /npc/functions/doors.txt
downloadserverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.gz
serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.bz2
serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.xz
serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.zip
Initial commit
Diffstat (limited to 'npc/functions/doors.txt')
-rw-r--r--npc/functions/doors.txt59
1 files changed, 59 insertions, 0 deletions
diff --git a/npc/functions/doors.txt b/npc/functions/doors.txt
new file mode 100644
index 000000000..c1b6565ef
--- /dev/null
+++ b/npc/functions/doors.txt
@@ -0,0 +1,59 @@
+// Evol functions.
+// Author:
+// 4144
+// Description:
+// Doors utility functions
+// Variables:
+// none
+
+function script doorTouch {
+ if (getareausers() <= 1)
+ {
+ .dir = 2;
+ stopnpctimer;
+ initnpctimer;
+ }
+ close;
+}
+
+function script doorUnTouch {
+ if (getareausers(.map$) == 0)
+ {
+ .dir = 4;
+ initnpctimer;
+ startnpctimer;
+ }
+ close;
+}
+
+function script doorTimer {
+ stopnpctimer;
+ if (.dir == 2) .dir = 6;
+ if (.dir == 4) .dir = 8;
+ end;
+}
+
+function script doorInit {
+ .distance = 5;
+ .alwaysVisible = true;
+ .sex = G_OTHER;
+ end;
+}
+
+function script open_door {
+ .@door$ = getarg(0);
+ setnpcdir.@door$, 2;
+ sleep 300;
+ setnpcdir .@door$, 6;
+ sleep 300;
+ return 0;
+}
+
+function script close_door {
+ .@door$ = getarg(0);
+ setnpcdir .@door$, 4;
+ sleep 300;
+ setnpcdir .@door$, 8;
+ sleep 300;
+ return 0;
+}