MONSTERS, WANDERING (MW)
RECEIVER

Used to enable/disable interaction with wandering monsters.

!!MW#:XXXX;

# is a number of Wandering Monster 

OPTIONS

A1/x/y/l; Get/check/set (jump) a Wandering Monsters to x/y/l position.
A2/x/y/l; Get/check/set a destination point for WM
Comments: 
For WM that searches for hero x means a number of hero to search.
A3/$1/$2/$3/$4/$5/$6/$7; Manage Wandering Monsters
   $1 - get/check/set a flag: to call !?MW0 or not when reaches a destination point/before attacking a searched Hero
   $2 - get/check/set a flag: to call !?MW1 or not when monster is killed (when a WM is killed it has no more a number and this number may be set for another monster when created)
   $3 - get/check/set a flag: go to a destination point
   $4 - get/check/set a flag: search for a specific hero
   $5 - get/check/set a flag: Stand still after reached point/hero or for a free monster. For now a monster, that reached a destination point or caught, attacked and killed a searched for Hero, becomes a free monster. If you set this flag, you will force it to stand still until get new command. For free WM this means the same - stand still.
   $6 - set/check/get a flag: search for a specific player (colour).
This flag used only for free WM. If it is set, the destination x coordinate should keep a colour of player. If it is not -1 (all colours), this free WM will search for heroes and towns of this current player only.
   $7 - set/check/get a flag: move over land and/or water.
 
If you set it to 0 (default), it will go over the land only. If you set it to 1, it will go over water only. If you set it to 2, it will go over land and water. 
A4/radius; Get/check/set a radius for searching (default is 20)
Cx/y/l/?var;   Check for a WM at a specified position.
   x/y/l - the location to check for a wandering monster
   var that receives the number of a WM (1...) or 0 if there is no WM at that position
E?$; Check for existence of this WM number # 
   1 = If there is a WM number # otherwise $=0
Mx/y/l/?var; Make an ordinary monster a WM.
   x/y/l - the location of existing ordinary monster
   var receive a number of WM (this monster become WM)
If var gets a value 0 (the same as for MW:P command), that means that WM was not created by any reason.
Comments:
You can also set up monster through MO receiver (by position) after generating a WM with !!MW:P
Px/y/l/type/?var; Set (generate a monster at position)
      type - monster type (Format C)
      var - receives a number of MW (to operate later)
Comments:
For this command # a number of MW is not needed (it is not known yet)

Comments:
WM has a radius 20 for searching (or as set with A4 command) . At the start of every turn, WM decide where to move/attack. But he will make a real move/attack at a turn of a player that is an owner of a hero/town to move to.

TRIGGERS FOR WANDERING MONSTERS

!?MW0; Trigger for Wandering Monsters
Called when monster reaches a destination point/hero
Comments: 
It will be called the next turn after a monster really reached a position or just before attacking a Hero. Called if only a corresponding flag is set. v997 stores a number of WM that is a caller.
!?MW1; Trigger for Wandering Monsters
Called when monster is killed
Comments: 
It will be called the next turn after the monster is really killed.
Called if only a corresponding flag is set. v997 stores a number of WM that is a caller.

Example:
ZVSE

!#TM1:S1/1/1/2;
!?TM1;

!!MW:P4/8/0/9/?v100; !!IF:M^v100:%V100^;
!!MWv100:A2/0/0/0A3/1/1/0/1/1/0;

!!MW:P1/8/0/10/?v110; !!IF:M^v110:%V110^;
!!MWv110:A2/10/10/0A3/1/1/1/0/1/0;

!?MW0;
!!IF:M^MW0:%V997^;

!?MW1;
!!IF:M^MW1:%V997^;