From 8957483e7196d21db0fb6257fedbea01b59cf53b Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 29 Jul 2021 20:30:21 -0300 Subject: Fix minor issues --- npc/functions/default_npc_checks.txt | 10 ++++++---- npc/functions/ghost.txt | 4 ++-- npc/functions/inn.txt | 3 ++- npc/scripts.conf | 1 - 4 files changed, 10 insertions(+), 8 deletions(-) (limited to 'npc') 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; diff --git a/npc/scripts.conf b/npc/scripts.conf index ee4481cd..df258287 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -37,7 +37,6 @@ "npc/functions/process_equip.txt", "npc/functions/slot_machine.txt", "npc/functions/soul_menhir.txt", -"npc/functions/time.txt", "npc/functions/water_bottle.txt", "npc/functions/evil_obelisk.txt", "npc/functions/lockpicking.txt", -- cgit v1.2.3-60-g2f50