From a9cb0b4cf5273d5d84669dd916deb3e9a1e64b7a Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 9 Apr 2021 22:45:54 -0300 Subject: Fix area timers --- npc/008-1/dock.txt | 2 +- npc/functions/main.txt | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/npc/008-1/dock.txt b/npc/008-1/dock.txt index 651dd402..a9f2c94b 100755 --- a/npc/008-1/dock.txt +++ b/npc/008-1/dock.txt @@ -70,7 +70,7 @@ OnBoard: OnCommandArrive: disablenpc "Hurnscald South Dock"; enablenpc "Hurnscald South Koga"; - areatimer 0, "008-1", 137, 75, 141, 76, get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnAreaWarp"; // warp players on dock + areatimer "008-1", 137, 75, 141, 76, get(.warp_delay, "#FerryConfig"), strnpcinfo(0)+"::OnAreaWarp"; // warp players on dock end; OnAreaWarp: diff --git a/npc/functions/main.txt b/npc/functions/main.txt index c6b90043..bbd119e0 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -609,9 +609,20 @@ function script maptimer { // areatimer("", , , , , , "::") function script areatimer { - .@c = getunits(BL_PC, .@players, false, getarg(0), getarg(1), getarg(2), getarg(3), getarg(4)); + // Legacy + if (getargcount() > 7) + .@ox=1; + // Variables + .@m$=getarg(.@ox); .@ox+=1; + .@x1=getarg(.@ox); .@ox+=1; + .@y1=getarg(.@ox); .@ox+=1; + .@x2=getarg(.@ox); .@ox+=1; + .@y2=getarg(.@ox); .@ox+=1; + .@tk=getarg(.@ox); .@ox+=1; + .@e$=getarg(.@ox); .@ox+=1; + .@c = getunits(BL_PC, .@players, false, .@m$, .@x1, .@y1, .@x2, .@y2); for (.@i = 0; .@i < .@c; .@i++) { - addtimer(getarg(5), getarg(6), .@players[.@i]); + addtimer(.@tk, .@e$, .@players[.@i]); } return .@i; } -- cgit v1.2.3-60-g2f50