Timokha 0 Posted April 6, 2021 Hi all, I'd like to write the script, that will kill all monster (except for 2-3 IDs) with 2-3 cells area around NPC. Do anyone have idea how it should look like? I prepared loop event, but dont know how can I write auto-killing monster within this area.. Quote map_name,200,214,5 script test 4_M_JOB_KNIGHT1,{ end; OnInit: startnpctimer; .@interval = 1; while (1) { sleep .@interval * 1000; getmapxy .@map$,.@x,.@y, 1;// XY npc sample for ( .@i = -4; .@i <= 4; .@i++ )// x for ( .@j = -4; .@j <= 4; .@j++ )// y ???? ???? } initnpctimer; end; } Thank you. Quote Share this post Link to post Share on other sites
0 Racaae 10 Posted April 7, 2021 You can use OnTouchNPC. map_name,200,214,5 script test 4_M_JOB_KNIGHT1,3,3,{ end; //Will trigger when a monster gets close OnTouchNPC: //gets the monster ID .@mob_id = getunitdata(mobattached(), UDT_CLASS); //checking if it's not a Poring, Zombie or Orc Warrior if (.@mob_id != 1002 && .@mob_id != 1015 && .@mob_id != 1023) { //kill the monster since it's not one of those killmonstergid mobattached(); } end; } Quote Share this post Link to post Share on other sites
0 Timokha 0 Posted April 7, 2021 7 hours ago, Racaae said: You can use OnTouchNPC. map_name,200,214,5 script test 4_M_JOB_KNIGHT1,3,3,{ end; //Will trigger when a monster gets close OnTouchNPC: //gets the monster ID .@mob_id = getunitdata(mobattached(), UDT_CLASS); //checking if it's not a Poring, Zombie or Orc Warrior if (.@mob_id != 1002 && .@mob_id != 1015 && .@mob_id != 1023) { //kill the monster since it's not one of those killmonstergid mobattached(); } end; } Thank you Racaae, highly appreciate your help! Quote Share this post Link to post Share on other sites
Hi all,
I'd like to write the script, that will kill all monster (except for 2-3 IDs) with 2-3 cells area around NPC.
Do anyone have idea how it should look like?
I prepared loop event, but dont know how can I write auto-killing monster within this area..
Thank you.
Share this post
Link to post
Share on other sites