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

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):

Code:
*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;
 
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):

Code:
*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?
 
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:

Code:
// 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;}
 
Last edited by a moderator:
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:

Code:
// 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?
 
it warps players too? how can i make it only monsters?
My mistake; I used OnTouch instead of OnTouchNPC; here's an updated version:

Code:
// 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;}
 
Back
Top