summaryrefslogtreecommitdiff
path: root/npc/items/teleporter.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-12-17 04:41:58 -0200
committerJesusaves <cpntb1@ymail.com>2018-12-17 04:41:58 -0200
commit8bd89174dec604cd1b39fff4cefc642821bf20a9 (patch)
tree116d81f3020c9023822d4e7763a9c06f72c3534b /npc/items/teleporter.txt
parentbca5dec4ed361c385bf550ef47c96cf7147587b1 (diff)
downloadserverdata-8bd89174dec604cd1b39fff4cefc642821bf20a9.tar.gz
serverdata-8bd89174dec604cd1b39fff4cefc642821bf20a9.tar.bz2
serverdata-8bd89174dec604cd1b39fff4cefc642821bf20a9.tar.xz
serverdata-8bd89174dec604cd1b39fff4cefc642821bf20a9.zip
Extra helper for LoF Teleporter. Code simplified.
Diffstat (limited to 'npc/items/teleporter.txt')
-rw-r--r--npc/items/teleporter.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/npc/items/teleporter.txt b/npc/items/teleporter.txt
index 30a7a7ead..2b95adc0f 100644
--- a/npc/items/teleporter.txt
+++ b/npc/items/teleporter.txt
@@ -16,6 +16,12 @@
return (.@is_hurt && !.@is_town);
}
+ // Calculate time remaining
+ // (time, .@x)
+ function loftel_time {
+ return gettimetick(2)+max((60*getarg(0))-(getarg(1)*60), 30);
+ }
+
L_Cooldown:
mesn;
mesc l("This teleporter is currently recharging.");
@@ -63,19 +69,19 @@ OnUse:
switch (@menu) {
case 2:
warp "017-1", 120, 89;
- TELEPORTER_TIME=gettimetick(2)+max((60*50)-(.@x*60), 30);
+ TELEPORTER_TIME=loftel_time(50, .@x);
break;
case 3:
warp "024-1", 155, 82;
- TELEPORTER_TIME=gettimetick(2)+max((60*360)-(.@x*60), 30);
+ TELEPORTER_TIME=loftel_time(360, .@x);
break;
case 4:
warp "009-1", 113, 91;
- TELEPORTER_TIME=gettimetick(2)+max((60*360)-(.@x*60), 30);
+ TELEPORTER_TIME=loftel_time(360, .@x);
break;
case 5:
warp "Save", 0, 0;
- TELEPORTER_TIME=gettimetick(2)+max((60*30)-(.@x*60), 30);
+ TELEPORTER_TIME=loftel_time(30, .@x);
break;
}
closedialog;