Jump to content
  • 0
xienne15

prohibit monsters in a map to go to a certain area of the same map

Question

5 answers to this question

Recommended Posts

  • 0

You can try to warp monsters outside by making use of the OnTouchNPC event label and unitwarp script command:

 

doc/script_commands.txt (unit* commands, especially unitwarp):

*unitkill <GID>;*unitwarp <GID>,<Mapname>,<x>,<y>;*unitattack <GID>,<Target ID>;*unitstop <GID>;*unittalk <GID>,<Text>;*unitemote <GID>,<Emote>;Okay, these commands should be fairly self explaining.For the emotions, you can look in db/const.txt for prefixes with e_PS: unitwarp supports a <GID> of zero, which causes the executor of the script to be affected. This can be used with OnTouchNPC to warp monsters:OnTouchNPC:	unitwarp 0,"this",-1,-1;

Share this post


Link to post
Share on other sites
  • 0

You can try to warp monsters outside by making use of the OnTouchNPC event label and unitwarp script command:

 

doc/script_commands.txt (unit* commands, especially unitwarp):

*unitkill <GID>;*unitwarp <GID>,<Mapname>,<x>,<y>;*unitattack <GID>,<Target ID>;*unitstop <GID>;*unittalk <GID>,<Text>;*unitemote <GID>,<Emote>;Okay, these commands should be fairly self explaining.For the emotions, you can look in db/const.txt for prefixes with e_PS: unitwarp supports a <GID> of zero, which causes the executor of the script to be affected. This can be used with OnTouchNPC to warp monsters:OnTouchNPC:	unitwarp 0,"this",-1,-1;

 

 

Since im a beginner to this, how can i implement this? for example im using prontera map and the monster is poring. Can you do a sample?

Share this post


Link to post
Share on other sites
  • 0

Since im a beginner to this, how can i implement this? for example im using prontera map and the monster is poring. Can you do a sample?

 

Here's an example:

// Since this script should only be triggered by touch, we can set the Sprite ID to -1 (invisible)// The extra "5,5," signifies a 5-by-5 cell area around the NPC that will trigger the 'OnTouch' labelprontera,151,172,0    script    no_mob_walk    -1,5,5,{        //end;    // Uncomment this line if you use a visible sprite    OnTouch:    // Triggers when the defined area is walked into        unitwarp 0, "this", -1, -1;    // Warps invoking player/monster to random cell on the same map        end;}
Edited by Via

Share this post


Link to post
Share on other sites
  • 0

 

 

Since im a beginner to this, how can i implement this? for example im using prontera map and the monster is poring. Can you do a sample?

 

Here's an example:

// Since this script should only be triggered by touch, we can set the Sprite ID to -1 (invisible)// The extra "5,5," signifies a 5-by-5 cell area around the NPC that will trigger the 'OnTouch' labelprontera,151,172,0    script    no_mob_walk    -1,5,5,{        //end;    // Uncomment this line if you use a visible sprite    OnTouch:    // Triggers when the defined area is walked into        unitwarp 0, "this", -1, -1;    // Warps invoking player/monster to random cell on the same map        end;}
 it warps players too? how can i make it only monsters?

 

 

Share this post


Link to post
Share on other sites
  • 0

it warps players too? how can i make it only monsters?

 

My mistake; I used OnTouch instead of OnTouchNPC; here's an updated version:

// Since this script should only be triggered by touch, we can set the Sprite ID to -1 (invisible)// The extra "5,5," signifies a 5-by-5 cell area around the NPC that will trigger the 'OnTouch' labelprontera,151,172,0    script    no_mob_walk    -1,5,5,{        //end;    // Uncomment this line if you use a visible sprite    OnTouchNPC:    // Triggers when the defined area is walked into        unitwarp 0, "this", -1, -1;    // Warps invoking monster to random cell on the same map        end;}

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.