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

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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

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