I'm trying to do a npc that pushes away the player, whatever the direction the player comes from. I know it can work if i put the specific coordinates but i want to replicate it so i need something that will work in any map. I tried this for start.
This is supposed to push west if the player approach the npc from the left and push south if the player approach from below.
But only the West push works and the South push is pushing West.
Question
Erebos
I'm trying to do a npc that pushes away the player, whatever the direction the player comes from. I know it can work if i put the specific coordinates but i want to replicate it so i need something that will work in any map. I tried this for start.
prontera,50,50,0 script push 99,3,3,{ OnTouch: getmapxy(@mapname$, @mapx, @mapy, BL_PC); getmapxy(@mapnamee$, @x, @y, BL_NPC); if (@mapx = @x - 3 & @mapy = @y | @mapy = @y + 1 | @mapy = @y +2 | @mapy = @y - 1 | @mapy = @y -2 ) { pushpc DIR_WEST, 2; end; } if (@mapx = @x - 2 & @mapy = @y - 3 | @mapx = @x - 1 & @mapy = @y - 3 | @mapx = @x & @mapy = @y - 3 | @mapx = @x + 1 & @mapy = @y - 3 | @mapx = @x + 2 & @mapy = @y - 3) { pushpc DIR_SOUTH, 2; end; } }
This is supposed to push west if the player approach the npc from the left and push south if the player approach from below.
But only the West push works and the South push is pushing West.
Please correct me what im doing wrong, thanks.
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.