Extreme
Grandmaster Poster
Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20
SphereCommunity
|
RE: FORITEMS doesn´t work right?
I think the best way, without use foritems is something like this:
Code:
[DEFNAMES SHRINES_P]
SHRINES 5
SHRINE_1 100,100
SHRINE_2 200,200
SHRINE_3 300,300
SHRINE_4 400,400
SHRINE_5 500,500
[FUNCTION GOTONEARESTSHRINE]
LOCAL.SHRINEDIST 10000
FOR 1 <DEF.SHRINES>
IF <SRC.DISTANCE <DEF.SHRINE_<dLOCAL._FOR>> < LOCAL.SHRINEDIST>
LOCAL.SHRINEDIST <SRC.DISTANCE <DEF.SHRINE_<dLOCAL._FOR>>
LOCAL.SHRINE <dLOCAL._FOR>
ENDIF
ENDFOR
SRC.GO <DEF.SHRINE_<dLOCAL.SHRINE>>
SRC.FIX
RETURN 1
I didn't test it, but I think its okay.
STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
|
|
07-06-2012 07:25 AM |
|
|
Extreme
Grandmaster Poster
Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20
SphereCommunity
|
RE: FORITEMS doesn´t work right?
(07-06-2012 07:29 AM)Anarch Cassius Wrote: Extreme's wins.
Much faster script if you have a reasonable number of shrines to define. Faster even if you don't really, but the defs might get tedious
Hehe, or can just use VARs
(07-06-2012 06:46 AM)admin phoenix Wrote: For a resurrect script, I write a new script, so when you die you will be teleported to the next and nearest shrine.
this should work with foritems 6144
this doesn´t work as I wish because the players will not teleport to the nearest one.
I wrote a little script and checked it again. here is the script and the result... see the screenshot.
something is wrong there.
[FUNCTION test]
FORITEMS 6144
IF (<type> == t_gold)
local.x +=1
say <dlocal.x>
ENDIF
ENDFOR
@OFF, this shard, Athoris is yours?
If yes, can I try play there?
I don't know German language, but I just want to know the server.
If you can make me an account I would be happy.
PS: this server looks awesome, I NEVER seen something like it, congrats.
STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
(This post was last modified: 07-06-2012 08:07 AM by Extreme.)
|
|
07-06-2012 07:34 AM |
|
|
Skul
Master
Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9
|
RE: FORITEMS doesn´t work right?
just off how I think this should work:
Code:
[function teletonearestshrine]
foritems 9999
if (<type>==t_shrine)
local.s += 1
local.shrine<dlocal.s>.p.x=<p.x>
local.shrine<dlocal.s>.p.y=<p.y>
endif
endfor
for x 1 <dlocal.x>
if (strmatch(<local.p.x>,0)) && (strmatch(<local.p.y>,0))
local.p.x=<local.shrine<dlocal.x>.p.x>
local.p.y=<local.shrine<dlocal.x>.p.y>
endif
if (<local.shrine<dlocal.x>.p.x> < <local.p.x>) || (<local.shrine<dlocal.x>.p.y> < <local.p.y>)
local.p.x=<local.shrine<dlocal.x>.p.x>
local.p.y=<local.shrine<dlocal.x>.p.y>
endif
endfor
if (<local.p.x>) && (<local.p.y>)
go <local.p.x>,<local.p.y>,<serv.map(<local.p.x>,<local.p.y>,0,<map>).terrain.z>,<map>
endif
that's the function to seek for t_shrine across the whole map, teleports the player to the closest t_shrine, this next part is a @trigger to be placed on the player character
Code:
[event e_seek_shrine]
on=@death
teletonearestshrine
"I ask a question to the answer I already know."
Marchadium :: http://www.marchadium.ca/ :: Join us!
|
|
07-06-2012 04:40 PM |
|
|
admin phoenix
Master
Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3
|
RE: FORITEMS doesn´t work right?
Thanks for helping me guys
At first I will try Extreme code because it looks very nice but I will control the shrine via sql. Putting a new shrine in the world he coordinations will be writen in the sql.
@all
yes, it´s my shard and it is in german so it will be very hard for you to play ingame because all systems are in german too
at the moment we have an on open beta.
if you want an account you have to register because we control all accounts and chars via sql.
for example you have to create a character via homepage ...
In 3 weeks we will finish the open-beta and if we don´t get enough german player maybe I will think for an international shard
but then I also need international gamemasters and developers *g*
|
|
07-06-2012 09:14 PM |
|
|
Extreme
Grandmaster Poster
Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20
SphereCommunity
|
|
07-06-2012 10:24 PM |
|
|