[LUA-FUNCTION] Check coordinate on a map.

03/08/2013 20:42 -TÜRK-#1
Hello community.

Here is original thread ( just prototype ):
[Only registered and activated users can see links. Click Here To Register...]

With this LUA function you can check your player coordinates.


Add this function to questlib.lua

Quote:
function check_range(x,y,range)
get_x = pc.get_local_x()
get_y = pc.get_local_y()
x1 = x-range
y1 = y-range
x2 = x+range
y3 = y+range
if (get_x > x1 and get_x < x2) and (get_y > y1 and get_y < y3) then
return true
else
return false
end
end
Then add this function to your quest_functions file.

check_range

Here is use example quest:

Quote:
-- By -TURK- --
quest check_coord begin
state start begin
when login with pc.get_map_index() == 41 begin
loop_timer("check_coords", 1) -- 1 second
end
when check_coords.timer begin
if check_range(377,576,10) == true then
chat("You're near to Ah-Yu!")
-- pc.warp(x,y)
end
end
end
end
/go c1

Go near to Ah-Yu and Voila!

Enjoy :rolleyes: ..
03/08/2013 21:00 .Colossus.#2
nice !
good to script new events ;)
03/08/2013 21:03 ebert.tonna#3
Das bringt mich auf Ideen , sauber sowas.
Vielen Dank.
03/08/2013 21:04 xRocknRoLL#4
great
03/08/2013 21:06 [SA]BlooD#5
Tskr :D
Danke :D
03/08/2013 21:20 lfcmaus#6
sehr gut sehr brauchbar danke danke
03/08/2013 21:21 MrGanja#7
Quote:
Originally Posted by -TÜRK- View Post
Hello community.

Here is original thread ( just prototype ):
[Only registered and activated users can see links. Click Here To Register...]

With this LUA function you can check your player coordinates.


Add this function to questlib.lua



Then add this function to your quest_functions file.

check_range

Here is use example quest:



/go c1

Go near to Ah-Yu and Voila!

Enjoy :rolleyes: ..

And what can you do with that?
Maybe a mission with how kill a monster in a range?
03/08/2013 21:28 -TÜRK-#8
Quote:
Originally Posted by MrGanja View Post
And what can you do with that?
Maybe a mission with how kill a monster in a range?
Huh ^^ Great Idea. Or event rules..
03/08/2013 21:30 MrGanja#9
Quote:
Originally Posted by -TÜRK- View Post
Huh ^^ Great Idea. Or event rules..
I think it's god for event PvP.
03/08/2013 21:32 Mijago#10
You can mark Ah-Yu as target for the same effect.. Same game with positions ( target.pos - command) and Players ( target.pc - command). <:

At last you can check whether you are near a npc / pc with pc.is_near_vid...
The command you show here isn't that tricky as someone think, but maybe someone would need it :)

You could use your Command for generating special Fields on a map with a bonus while you are standing in it bla..
03/08/2013 21:33 DarkNessWorld2#11
or a function who can only use it when you in rage as a boss example
03/08/2013 21:37 -TÜRK-#12
Quote:
Originally Posted by MrGanja View Post
I think it's god for event PvP.
> Ninja, bow race ;).
03/08/2013 21:38 MrGanja#13
Quote:
Originally Posted by Mijago View Post
You can mark Ah-Yu as target for the same effect.. Same game with positions ( target.pos - command) and Players ( target.pc - command). <:

At last you can check whether you are near a npc / pc with pc.is_near_vid...
The command you show here isn't that tricky as someone think, but maybe someone would need it :)

You could use your Command for generating special Fields on a map with a bonus while you are standing in it bla..
This is a circle now a target lol what the fuck you tall
03/08/2013 21:39 -TÜRK-#14
Quote:
Originally Posted by Mijago View Post
You can mark Ah-Yu as target for the same effect.. Same game with positions ( target.pos - command) and Players ( target.pc - command). <:

At last you can check whether you are near a npc / pc with pc.is_near_vid...
The command you show here isn't that tricky as someone think, but maybe someone would need it :)

You could use your Command for generating special Fields on a map with a bonus while you are standing in it bla..
+ one more good idea ^^
03/08/2013 21:39 Prince43™#15
DE: Ach du scheiße die Türken attackieren mit Bombenreleases EPvP :D Saubere Arbeit der junge haut einen nach dem anderen raus hammer!

TR: Yuch be türkler yine elitepvpersi hucumluyor bombareleaslerle :D Saglam is bu cocuk birden birini disariya vuruyor!



Kind Regards

Prince43™