serakh00 Posted July 11, 2013 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 53 Reputation: 4 Joined: 02/08/12 Last Seen: December 10, 2018 Share Posted July 11, 2013 i want to spawn items in area within 4x4 cell from monster dead location using scriptcommand *makeitem Currently i manually add coordinate using getmapxy, but it only 2x2 cell consider how long i must write each coordinate (eg: x,y; x-1,y; x+1,y) is there any easier way to point each coordinate within 4x4 cell? Quote Link to comment Share on other sites More sharing options...
Capuche Posted July 11, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted July 11, 2013 prontera,150,180,5 script ujiono 56,{ getmapxy .@map$,.@x,.@y, 1;// XY npc sample for ( .@i = -4; .@i <= 4; .@i++ )// x for ( .@j = -4; .@j <= 4; .@j++ )// y if ( checkcell( .@map$, (.@x+.@i), (.@y+.@j), cell_chkpass ) ) {// can pass .@cell_x[.@size] = .@x+.@i; .@cell_y[.@size] = .@y+.@j; .@size++; } .@r = rand( .@size );// random index makeitem 501,1,.@map$,.@cell_x[.@r],.@cell_y[.@r]; } Quote Link to comment Share on other sites More sharing options...
serakh00 Posted July 13, 2013 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 53 Reputation: 4 Joined: 02/08/12 Last Seen: December 10, 2018 Author Share Posted July 13, 2013 prontera,150,180,5 script ujiono 56,{ getmapxy .@map$,.@x,.@y, 1;// XY npc sample for ( .@i = -4; .@i <= 4; .@i++ )// x for ( .@j = -4; .@j <= 4; .@j++ )// y if ( checkcell( .@map$, (.@x+.@i), (.@y+.@j), cell_chkpass ) ) {// can pass .@cell_x[.@size] = .@x+.@i; .@cell_y[.@size] = .@y+.@j; .@size++; } .@r = rand( .@size );// random index makeitem 501,1,.@map$,.@cell_x[.@r],.@cell_y[.@r]; } try it later thanks master.. Quote Link to comment Share on other sites More sharing options...
Question
serakh00
i want to spawn items in area within 4x4 cell from monster dead location using scriptcommand *makeitem
Currently i manually add coordinate using getmapxy, but it only 2x2 cell consider how long i must write each coordinate (eg: x,y; x-1,y; x+1,y)
is there any easier way to point each coordinate within 4x4 cell?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.