diff options
Diffstat (limited to 'npc/items/teleporter.txt')
-rw-r--r-- | npc/items/teleporter.txt | 14 |
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; |