badneko Posted November 15, 2015 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 37 Reputation: 1 Joined: 06/09/14 Last Seen: February 10, 2019 Share Posted November 15, 2015 Im doing a npc event how appears in prontera where people sit and talk. My problem is: if someone sit in the exact square of this npc. I need the npc appears and push a litle the players. I tryed with magnum break skill, i tried with npc walking with ontouch warp off. I really dont know what to do now XD. Quote Link to comment Share on other sites More sharing options...
0 Haziel Posted November 15, 2015 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 609 Joined: 11/25/11 Last Seen: March 7 Share Posted November 15, 2015 On doc/script_commands.txt: *pushpc <direction>,<cells>; This command will push the currently attached player to given direction by given amount of square cells. Direction is the same as used when declaring NPCs, and can be specified by using one of the DIR_* constants (db/const.txt). The knock-back is not restricted by items or map flags, only obstacles are taken into account. If there is not enough space to perform the push (e.g. due to a wall), the character is pushed only up to the obstacle. // pushes the character 5 cells in 3 o'clock direction from its // current position. pushpc DIR_EAST, 5; Quote Link to comment Share on other sites More sharing options...
0 badneko Posted November 15, 2015 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 37 Reputation: 1 Joined: 06/09/14 Last Seen: February 10, 2019 Author Share Posted November 15, 2015 On doc/script_commands.txt: *pushpc <direction>,<cells>; This command will push the currently attached player to given direction by given amount of square cells. Direction is the same as used when declaring NPCs, and can be specified by using one of the DIR_* constants (db/const.txt). The knock-back is not restricted by items or map flags, only obstacles are taken into account. If there is not enough space to perform the push (e.g. due to a wall), the character is pushed only up to the obstacle. // pushes the character 5 cells in 3 o'clock direction from its // current position. pushpc DIR_EAST, 5; But how the npc use this? I try alot with touch: but not works when the player is already on the area. The player need to exit first, then enter again to use ontouch: Quote Link to comment Share on other sites More sharing options...
0 Haziel Posted November 15, 2015 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 609 Joined: 11/25/11 Last Seen: March 7 Share Posted November 15, 2015 On doc/script_commands.txt: *getareausers("<map name>",<x1>,<y1>,<x2>,<y2>) This function will return the count of connected characters which are located within the specified area - an x1/y1-x2/y2 square on the specified map. This is useful for maps that are split into many buildings, such as all the "*_in" maps, due to all the shops and houses. You can use that function to check if there's players, then, configure various points of spawn for your NPC, so, the players can be out of the OnTouch area, then, the NPC can walk and knock the players. Quote Link to comment Share on other sites More sharing options...
0 badneko Posted November 15, 2015 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 37 Reputation: 1 Joined: 06/09/14 Last Seen: February 10, 2019 Author Share Posted November 15, 2015 I already try this with walker npc and ontouch, nothing happend. I tried to use countarea. But nothing happend. :/ Quote Link to comment Share on other sites More sharing options...
0 Haziel Posted November 15, 2015 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 609 Joined: 11/25/11 Last Seen: March 7 Share Posted November 15, 2015 Can you post your code fragment so we can figure it out? Quote Link to comment Share on other sites More sharing options...
0 badneko Posted November 15, 2015 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 37 Reputation: 1 Joined: 06/09/14 Last Seen: February 10, 2019 Author Share Posted November 15, 2015 (edited) Ontouch is super weird, sometimes works. I figure out i need more range for ontouch, i used 3x3. With 5,5 never fails. But just works 1 time. prontera,156,89,4 script fencima 80,5,5,{ end; OnTouch: pushpc rand(0,8), 5; end; } Edited November 15, 2015 by badneko Quote Link to comment Share on other sites More sharing options...
Question
badneko
Im doing a npc event how appears in prontera where people sit and talk.
My problem is: if someone sit in the exact square of this npc.
I need the npc appears and push a litle the players.
I tryed with magnum break skill, i tried with npc walking with ontouch warp off.
I really dont know what to do now XD.
Link to comment
Share on other sites
6 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.