Jump to content
  • 0

Npc appears and push player out


badneko

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   1
  • Joined:  06/09/14
  • Last Seen:  

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

  • 0

  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   597
  • Joined:  11/25/11
  • Last Seen:  

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;
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   1
  • Joined:  06/09/14
  • Last Seen:  

 

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: 

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   597
  • Joined:  11/25/11
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   1
  • Joined:  06/09/14
  • Last Seen:  

I already try this with walker npc and ontouch, nothing happend. I tried to use countarea. But nothing happend. :/

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   597
  • Joined:  11/25/11
  • Last Seen:  

Can you post your code fragment so we can figure it out?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   1
  • Joined:  06/09/14
  • Last Seen:  

 
 

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 by badneko
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...