summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-03 11:20:27 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-03 11:20:27 -0300
commit8e60c58eddaaf08cdbe13eb075bbadfc422bb4e4 (patch)
tree73eb525b77e8a7ddf563e4c85c88bb6b278c9c1a
parent0c454e428d60bf972d49bed8fcb321761ed4c169 (diff)
downloadserverdata-8e60c58eddaaf08cdbe13eb075bbadfc422bb4e4.tar.gz
serverdata-8e60c58eddaaf08cdbe13eb075bbadfc422bb4e4.tar.bz2
serverdata-8e60c58eddaaf08cdbe13eb075bbadfc422bb4e4.tar.xz
serverdata-8e60c58eddaaf08cdbe13eb075bbadfc422bb4e4.zip
This is Saulc patch, but done properly ^.^
(Actually no, but I like high talking distances >.>)
-rw-r--r--npc/007-1/caelum.txt6
-rw-r--r--npc/functions/main.txt20
2 files changed, 25 insertions, 1 deletions
diff --git a/npc/007-1/caelum.txt b/npc/007-1/caelum.txt
index 4db6066bd..4adaeb80e 100644
--- a/npc/007-1/caelum.txt
+++ b/npc/007-1/caelum.txt
@@ -9,6 +9,10 @@
// id:193 MineQuests_Caelum
007-1,143,49,0 script Caelum NPC_PLAYER,{
+ // User is behind the wall, do nothing
+ if (isin("007-1", 142, 43, 3)
+ end;
+
.@Miner = getq(MineQuest_Caelum);
if (BaseLevel < 28) goto L_TooWeak;
if (.@Miner == 1) goto L_Check;
@@ -148,7 +152,7 @@ OnInit:
setunitdata(.@npcId, UDT_HAIRCOLOR, 3);
.sex = G_MALE;
- .distance = 3;
+ .distance = 4;
end;
}
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index 4a6f89d80..f491c24fe 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -279,6 +279,26 @@ function script getmap {
return .@mapName$;
}
+// isin( map, x1, y1, {[x2, y2][radius]} )
+function script isin {
+ if (getmapxy(.@mapName$, .@xpos, .@ypos, 0) != 0)
+ return false;
+ if (.@mapName$ != getarg(0))
+ return false;
+
+ if (getarg(4,-1) < 0) {
+ // Radius Based
+ if (.@xpos >= getarg(1)-getarg(3) && .@xpos <= getarg(1)+getarg(3) && .@ypos >= getarg(2)-getarg(3) && .@ypos <= getarg(2)+getarg(3))
+ return true;
+ } else {
+ // Coordinate based
+ if (.@xpos >= getarg(1) && .@xpos <= getarg(3) && .@ypos >= getarg(2) && .@ypos <= getarg(4))
+ return true;
+ }
+ return false;
+}
+
+// isinrad( map, x1, y1, radius)
function script isin {
if (getmapxy(.@mapName$, .@xpos, .@ypos, 0) != 0)
return false;