Jump to content
  • 0
Sign in to follow this  
classy5

Possible? (fly wing)

Question

9 answers to this question

Recommended Posts

  • 0

 

getmapxy

add ~30 to x and y

warp

can you please write it in script? im kinda noob xD.. thanks

 

Script: <asfaskfkjl>

You could start here in case of lacking knowledge: https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt

Trial & error is a great master, though takes time.

 

You could declare a function, to store the getmapxy value(s), for example using ".@location" or the example used in the document that should be readily available ".@mapname$", ".@mapx" & ".@mapy".

Then you'll need to randomize between the range you're looking for, rand(30) and store that in a variable ".@value_x" & rand(30)  in a second variable ".@value_y".

Call the random values in your warp statement and use the mapname from getmapxy, add the random values to your mapx & mapy values to teleport them in that range (the on-screen range).

 

Mess around a little, show us what you got and then we can help you out further. I said this not to be mean, but to help you develop insight in scripting, good luck!

Share this post


Link to post
Share on other sites
  • 0

I just guestimate 30, maybe -+ 12, you can still warp to unwalkable places,

If you find such spots, modify the walkable areas in BROWEDIT, use WeeMapCache and you've solved that issue too.

Was just tagging along with the example, I think 17 is the visible range, or you can set it somewhere in config too I thought.

 

Anyhow, think along that path and it'll work.

Share this post


Link to post
Share on other sites
  • 0

-	script	ksdfkjsdhfksj	FAKE_NPC,{//	set .@range, getbattleflag("area_size");//	getmapxy .@map$, .@x, .@y, 0;//	while ( checkcell( strcharinfo(3), .@x = rand( .@x - .@range, .@x + .@range ), .@y = rand( .@y - .@range, .@y + .@range ), cell_chknopass ) );//	warp .@map$, .@x, .@y;//	end;OnInit:	setitemscript Wing_Of_Fly, "{ set .@range, getbattleflag("area_size"); getmapxy .@map$, .@x, .@y, 0; while ( checkcell( strcharinfo(3), .@x = rand( .@x - .@range, .@x + .@range ), .@y = rand( .@y - .@range, .@y + .@range ), cell_chknopass ) ); warp .@map$, .@x, .@y; }", 0;}
@@Tranquility

visible range is set in

// Visible area size (how many squares away from a player can they see)

area_size: 14

btw can anyone link me to the npc sprite ID with names ?

gonne pin at script support

because when I put 100 as sprite ID server pump msg says it is depricated soon

 

EDIT: change -1 into FAKE_NPC

Share this post


Link to post
Share on other sites
  • 0

 

-	script	ksdfkjsdhfksj	FAKE_NPC,{//	set .@range, getbattleflag("area_size");//	getmapxy .@map$, .@x, .@y, 0;//	while ( checkcell( strcharinfo(3), .@x = rand( .@x - .@range, .@x + .@range ), .@y = rand( .@y - .@range, .@y + .@range ), cell_chknopass ) );//	warp .@map$, .@x, .@y;//	end;OnInit:	setitemscript Wing_Of_Fly, "{ set .@range, getbattleflag("area_size"); getmapxy .@map$, .@x, .@y, 0; while ( checkcell( strcharinfo(3), .@x = rand( .@x - .@range, .@x + .@range ), .@y = rand( .@y - .@range, .@y + .@range ), cell_chknopass ) ); warp .@map$, .@x, .@y; }", 0;}
@@Tranquility

visible range is set in

// Visible area size (how many squares away from a player can they see)

area_size: 14

btw can anyone link me to the npc sprite ID with names ?

gonne pin at script support

because when I put 100 as sprite ID server pump msg says it is depricated soon

 

EDIT: change -1 into FAKE_NPC

Such amazing, but I wanted him/her to get into scripting ;p

Share this post


Link to post
Share on other sites
  • 0

or edit

pc.c for all tele haha
 

@@ -5155,8 +5155,10 @@ int pc_randomwarp(struct map_session_data *sd, clr_type type) { 		return 0;  	do {-		x=rnd()%(map->list[m].xs-2)+1;-		y=rnd()%(map->list[m].ys-2)+1;+		x=rnd()%30;+		y=rnd()%30;+		x=x>14 ? sd->bl.x+x-15 : sd->bl.x-x;+		y=y>14 ? sd->bl.y+y-15 : sd->bl.y-y; 	} while( map->getcell(m,x,y,CELL_CHKNOPASS) && (i++) < 1000 );  	if (i < 1000)
Edited by mleo1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.