classy5 0 Posted October 26, 2015 Flywing that effects is to teleport you to any cell on your screen not map. Quote Share this post Link to post Share on other sites
0 mleo1 36 Posted October 26, 2015 getmapxyadd ~30 to x and ywarp Quote Share this post Link to post Share on other sites
0 classy5 0 Posted October 27, 2015 getmapxy add ~30 to x and y warp can you please write it in script? im kinda noob xD.. thanks Script: <asfaskfkjl> Quote Share this post Link to post Share on other sites
0 Tranquility 12 Posted October 27, 2015 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! Quote Share this post Link to post Share on other sites
0 mleo1 36 Posted October 27, 2015 I just guestimate 30, maybe -+ 12, you can still warp to unwalkable places, Quote Share this post Link to post Share on other sites
0 Tranquility 12 Posted October 27, 2015 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. Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted October 27, 2015 - 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;}@@Tranquilityvisible 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 Quote Share this post Link to post Share on other sites
0 Emistry 145 Posted October 27, 2015 @Master AnnieRuru http://nn.nachtwolke.com/dev/npclist/?q=45-999%2C10000-10090&qq=search 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
0 Tranquility 12 Posted October 27, 2015 - 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;}@@Tranquilityvisible 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 Quote Share this post Link to post Share on other sites
0 mleo1 36 Posted October 27, 2015 (edited) or editpc.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 October 27, 2015 by mleo1 Quote Share this post Link to post Share on other sites
Flywing that effects is to teleport you to any cell on your screen not map.
Share this post
Link to post
Share on other sites