From a202c621d2f072b57d12feb25e2569573e6e1154 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 8 Jun 2018 02:07:01 -0300 Subject: Soren's Fountain prototype --- npc/functions/util.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'npc/functions/util.txt') diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 953b5f21f..1558fb4b7 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -120,3 +120,19 @@ function script nard_time { return INT_MAX; } +// Determines if player is still in range. +// eg. +// if (reachable(.x, .y, .distance)) { +function script reachable { + .@x=getarg(0); + .@y=getarg(1); + .@z=getarg(2); + getmapxy(.@mp$, .@xp, .@yp, 0); + + if (distance(.@x, .@y, .@xp, .@yp) <= .@z) + return 1; + else + return 0; +} + + -- cgit v1.2.3-70-g09d2