summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/default_npc_checks.txt10
-rw-r--r--npc/functions/ghost.txt4
-rw-r--r--npc/functions/inn.txt3
3 files changed, 10 insertions, 7 deletions
diff --git a/npc/functions/default_npc_checks.txt b/npc/functions/default_npc_checks.txt
index ee12bc49..c8dbec47 100644
--- a/npc/functions/default_npc_checks.txt
+++ b/npc/functions/default_npc_checks.txt
@@ -1,14 +1,13 @@
function script PCtoNPCRange {
@npc_check = 0;
- if(!@npc_distance) set @npc_distance, 4; // <== default distance
- if(@npc_distance < 0) set @npc_distance, ATTACKRANGE;
+ if(!@npc_distance) set @npc_distance, getarg(0, 4); // <== default distance
+ if(@npc_distance < 0) set @npc_distance, readparam2(UDT_ATKRANGE);
.@x=getvariableofnpc(.x, strnpcinfo(0));
.@y=getvariableofnpc(.y, strnpcinfo(0));
if (isin(getmap(), .@x, .@y, @npc_distance))
goto L_Return;
@npc_check = 1;
- if(@distance_handler) goto L_Return;
@dnpc_name$ = strnpcinfo(1);
if(@dnpc_name$ != "") goto L_Named;
message strcharinfo(0), "Server : ##BYou need to move closer to interact with this npc.";
@@ -20,8 +19,11 @@ L_Named:
L_Return:
@dnpc_name$ = "";
- @distance_handler = 0;
@npc_distance = 0;
+ if (@npc_check) {
+ @npc_check = 0;
+ end;
+ }
return;
}
diff --git a/npc/functions/ghost.txt b/npc/functions/ghost.txt
index 1325525b..3e1a9724 100644
--- a/npc/functions/ghost.txt
+++ b/npc/functions/ghost.txt
@@ -13,8 +13,8 @@ function script SpawnGhost {
return;
L_Spawn:
- .@x = POS_X;
- .@y = POS_Y;
+ .@x = getx();
+ .@y = gety();
if (!(iscollision(getmapname(), .@x, .@y - 1))) set .@y, .@y - 1; // up
else if (!(iscollision(getmapname(), .@x, .@y + 1))) set .@y, .@y + 1; // down
diff --git a/npc/functions/inn.txt b/npc/functions/inn.txt
index 50f1afd6..82204f4b 100644
--- a/npc/functions/inn.txt
+++ b/npc/functions/inn.txt
@@ -1,6 +1,7 @@
function script Inn {
- if(@npcname$ == "") set @npcname$, strnpcinfo(1);
+ if (@Cost < 1) @Cost = getarg(0, 1000);
+ if (@npcname$ == "") set @npcname$, strnpcinfo(1);
mes "[" + @npcname$ + "]";
mes "\"Would you like to rest? It's only " + @Cost + " gp.\"";
next;