HERO (HE)
RECEIVER

Used to modify characteristics, troops, inventory, skills, location and just about everything imaginable for a specified hero. Also used for setting blessings and curses.
When any hero steps !?HM trigger occurs

Note: v998/v999/v1000 variables will store the location of the current hero visited.

For a more detailed and explained version of HE receiver, read the HE receiver easily explained (ERM for dummies, by Qurqirish Dragon)

!!HE#:XXXX; The hero number of # (see Format H - each hero has a unique number in the game).
!!HE#1/#2/#3:XXXX; The hero at x,y,l coordinates
  
#1 = x
   #2 = y
   #3 = level (0-Surface, 1-Underground)
!!HE-1:XXXX; The hero who activated the trigger. Using this format simplifies things greatly as you do not need to keep changing the coordinates for every !!HE command if you move the trigger event or object. 

Note:
When you load a saved game, the top Hero in the Hero scroll list appears to be active, but the MGO trigger (Spell Book) will not have a valid Hero number for HE-1 at this point! Use OW:A to check whether there is an active Hero, to avoid error messages.

COMMANDS
A1/$1/$2;
A2/
$1/$2/$3
;
A3/
$1/$2/$3
;
These commands let you equip, check, calculate, or delete one or more artifacts from a hero.
(When you equip/take off an artifact, !?AE trigger occurs.)

For now you cannot add combo artifacts this way -- there is only one way to add them, to the hero's backpack: !!HE-1:A129;

All artifacts start from 7 (Centaur's Axe) on.
1000 is a magic book
1001 on means a scroll with a spell 0 on (1001=0, 1002=1,...)

A1/$1/$2 - Equip an artifact
   $1 - number of artifact. (see Format A1).
   $2 - position on the body where to place (see Format AP).
Notes:
 - If the slot is busy, the ERM Flag1 will be set to 0 otherwise to 1.
 - If you use HE:A1 to equip an artifact that gives spells, such as a Tome, Spell Scroll or Spellbinder's Hat, the spell won't be added. It will only be added if the player unequips and reequips the artifact.

Note:
this is solved using the new A4 parameter, which is availlable in WoG game versions 3.58 and later

 - If you use the HE:A1 command to equip an artifact, it will equip into a locked slot and the slot won't register as busy.
Note: this is solved using the new A4 parameter, which is availlable in WoG game versions 3.58 and later

The HE#:A1 command is extended so it now supports backpack slots.

A2/$1/$2/$3 - Calculate numbers of an artifact (get or check)
   $1 - Number of artifact. (see Format A1).
   $2 - Returns number of artifacts of the type hero has (get or check syntax)
   $3 - Returns the numbers of equipped artifacts of the type (get or check syntax)

A3/$1/$2/$3 - Remove several copies of artifact
   $1 - Number of artifact. (see Format A1).
   $2 - Numbers of copy to delete
   $3 - Flag to delete first equipped (1) or in backpack (0)
_
Notes:
 - If you remove an artifact that has added a spell to a hero's book with ERM (HE:A- or HE:A3), the spell remains in the hero's book permanently.
 - If you remove an artifact with HE:A- it will correctly remove the added bonuses but if you remove it with HE:A3 it won't remove the bonuses.
 - If you remove a combo artifact with HE:A- it will correctly remove the locked slots and added bonuses too, but if you remove it with HE:A3 it won't remove either!

A4/#; Equip an artifact You can now automaticaly add spells from artifacts. Also, the locked slots problem solved

  Uses an internal function for this so artifact will be equipped if
possible and not equipped (put to backpack) otherwise.
  Example:
!?LE4/2/0;
!!HE-1:A4/129;  [equip Angelic Alliance]
!!HE-1:A4/15;   [try to equip a shield but put to backpack]
!!HE-1:A4/1016; [equip Magic Arrow scroll]
!!HE-1:A4/1000; [equip Magic Book]
A5/$1/$2/?$3/?$4; Control artifact locks
    $1 - slot lock index (see below)
    $2 - number of locks in slot
    ?$3 - (optional) returns the number of free artifact slots for the lock slot ($2 shouldn't exceed ?3)
    ?$4 - (optional) returns the total number of artifact slots for the lock slot

Here's the list of slot lock indexes (it's not the same as format AP):
0   head
1   shoulders
2   neck
3   right hand
4   left hand
5   torso
6   rings
7   feet
8   misc. slots
9   ballista (war machine 1)  
10  ammo cart (war machine 2)  
11  first aid tent (war machine 3)  
12  catapult  
13  spell book  
A#; Give/remove/check an artifact. 
# is the artifact's number (see Format A1). 
    If # > 0 the artifact will be added to the hero's backpack. 
    If # < 0 removes the artifact from all slots.
Comments:
An artifact given with this command will not be automatically equipped and will be placed in the hero's backpack.

HE:A-1 command will delete all scrolls from the hero. 
Example:
!!HE106:A-1;
[Remove all scrolls in Lydorie's possession]
B0/$;

Set/get the name of a hero.
Now if you customize a name but do not set a biography, it will display a hero's default biography, rather than setting it to the same string as the customized name. So if you want to name Orin "Orin II", it will still display Orin's default biography.

B1/$; Set/get the bios of a hero.
Comments:
If it has a default name or bio, you will get a void string not default text.

Example:
!!IFv10:S3;
!!IVz15:S^This is a new bios.^;

!!HE-1:B1/?v10; get the old bios of current hero to z[v10] -> z3 string var
!!HE-1:B1/z15; set the new bios to z15 string var
B2/$;   Set/get the class of a hero.
   $ is a class (0...17) (Format HC)
Divide $ to 2 and you will get a town/class type
B3/?$;   Read a hero's default biography.
Get a hero's default biography text to a string variable.
This will always return the same text whether you changed the hero's biography text or not. You may use only get syntax, like this:
!!HE0:B3/?z25;
This will store Orin's default biography in the z25 variable.
C0/#1/$2/$3; Change monsters: format 1.
 #1 = hero's slot number (slots are numbered 0..6)
 $2 = new monster type (
Format C
 $3 = number of monsters


You may not use any variable indexed -1 or -2 in parameter $3. Other negative indexes (f.e. y-3) are fine.
 
C1/#1/$2/$3; Change monsters: format 2.
All monsters of type #1 will change into:
 $2 (type: Format C)
 $3 (number).


Example:
!!HE-1:
C1/0/1/d; (all pikemen change to halberdiers)
C2/#1/#2/#3; Add a new stack of monsters to a hero.
 #1 = type of monsters (Format C
 #2 = number of monsters
 #3 = 1 - ask human to find room in the army if all slots are filled.
     = 0 - use AI to add it (if it feels the addition is more valuable than an existing stack)
C#1/#2/..../#14; Change monsters : Give to player a choice of monsters set.
Use C command with 14 parameters:
   #1 = type of monster 1 (-1 = no)
(Format C
   #2 = number of monsters 1
   #3 = type of monster 2 (-1 = no)
(Format C
   #4 = number of monsters 2
   #5 = type of monster 3 (-1 = no)
(Format C
   #6 = number of monsters 3
   #7 = type of monster 4 (-1 = no)
(Format C
   #8 = number of monsters 4
   #9 = type of monster 5 (-1 = no)
(Format C
   #10 = number of monsters 5
   #11 = type of monster 6 (-1 = no)
(Format C
   #12 = number of monsters 6
   #13 = type of monster 7 (-1 = no)
(Format C
   #14 = number of monsters 7
Now supports check syntax that lets you find out which troops were left. No idea what this exactly means right now, to be tested
Example:
This will be a dialog like when you leave creatures.
!!HE-1:C5/6/7/8/9/10/11/12/13/14/15/16/17/18;
!!HE-1:C1/2/-1/0/-1/0/-1/0/-1/0/-1/0/-1/0;
C...
(experience support)
Extended !!HE:C0, !!HE:C1 and !!HE:C2 syntax for setting or retaining Stack Experience.
(Note: does not work with HE:C).

Now these commands may have 5 or 6 parameters: !!HE...:C#/#1/$2/$3/$4/$5;
  # = 0 - change monsters (by slot)
  # = 1 - change monsters (by type)
  # = 2 - add monsters
  $4 = experience value (default is 0)
  $5 = experience modifier (default is 0)

Supported $5 modifier values:

Mode 0 - Use this mode to add additional creatures that have experience.
  New creatures have their own experience $4, but old creatures (if you "add" monsters) keep their own experience. The result of experience per creature is calculated as:
Exp=(ExpOld*NumOld+ExpNew*NumNew)/(NumOld+NumNew)

a) Say you have a stack of 10 Monks with Exp 1000 (here and later per creature) and want to add 5 Monks with experience 3000.
The result will be: (1000*10+3000*5)/15=1666
Ex: HE...:C0/0/d/d100/5000/0;
Add to the stack 100 creatures with exp 5000.

b) If you add a creature of a different type, only the experience of the new creatures is taken. So if you have 10 Griffins Exp 1000 and want to add 5 Monks with experience 3000.
The result will be: 3000.
This is used to avoid problems when you move stacks from one slot to another and the experience is mixed. Say you placed a stack of Griffins in the stack 1 and then changed it to Monks accidentally forgot to change experience (so it IS a stack of Monks but the system thinks that it IS a stack of Griffins). So now adding more Monks, the system will think that you changed the type of creatures and takes only experience of new creatures.
Exception: if the stack has not gained experience yet the experience will be averaged as if you weren't changing the type (same as mode 1).

Note:
do not use the 'd' modifier for $4 with mode 0.

Mode 1 - The same as Mode 0 except that there is no check of creature type. So it always works according a) formula (above) whatever type of ex and new creature type you have.
  Examples.
a) you want to set creatures in slot to Pikemen and they should have the experience (per creature) of previous creatures in the stack (whatever they were) plus new 7 creatures has 50 exp. points.
!!HE...:C0/1/0/d7/50/1;

Note:

do not use the 'd' modifier for $4 with mode 1.

Mode 2 - Use this mode to set experience for the whole stack.
  The stack will always be set to $4 experience.
Example:
HE...:C0/0/d/d/5000/2;
The stack will have experience 5000

Note:
if you use the 'd' modifier with Mode 2 for $4, it will add the experience instead. This is identical to the operation of mode 3.

Mode 3 - Use this mode to add additional experience to a stack.
  Ex: HE...:C0/0/d/d/5000/3;
The stack will have +5000 experience.

New creatures take the experience of the old creatures plus $4. Experience is not distributed. So if you have a stack of 10 Monks with Exp 1000, want to add 5 Monks and add 3000 experience with Mode 3, the result is: 1000+3000=4000.
Ex: HE...:C0/0/d/d5/3000/3;
The stack will have +5 creatures and +3000 experience.

You can also use this mode to add creatures to a stack without reducing the stack's experience, or change the type of creatures in the stack while keeping the experience unchanged.

You may use this modifier for temporary creature type changing as well, because the new stack will still have the same experience and if you change it then back, the stack will keep the experience.
!!HE...:C0/1/0/d/0/3;
!!HE...:C0/1/99/d/0/3;
!!HE...:C0/1/0/d/0/3;

Note:
if you use the 'd' modifier for $4 with mode 3 it will work the following way:
StackExp=OldExp+OldExp+AdditionalExperience.
So if a stack had 200 experience, and you add 100 experience, it will have 200+200+100=500.
Then if you add another 100 experience it will have 500+500+100=1100.

Mode 4 - Use this mode to add experience Levels (Ranks) to a stack.
  New creatures take the experience of the old creatures plus experience equal to $4 levels.
Experience is not distributed. So if you have a stack of 10 Monks with Exp 1000, and want to add 5 Monks and add 3 experience levels, the result is:
1000+3levels=????
It uses the next calculation:
- we have E exp
- get a current stack exp. level L0
- get an exp. value E0 for level L0
- get a reminder dE as E-E0
- we have a level bonus L
- get a resulting level L1 as L0+L
- get an exp. value E1 for level L1
- get a final exp. E as E1+dE
Ex: HE...:C0/0/d/d/5/4;
The stack will have +5 experience levels.

Note:
do not use the 'd' modifier for $4 with mode 4.

Mode 5 - Use this mode if you upgrade creatures.
  The same as Mode 3 but the experience of new creatures is taken as though you made an upgrade of old creatures. The new experience will be the old experience multiplied by the Upgrade Multiplier plus an experience bonus.
Ex: HE...:C0/0/d/d/500/5;
The stack will have experience as if upgraded +500 experience.

Note:
do not use the 'd' modifier for $4 with mode 5.

Mode 10 - Use this mode to add additional creatures with levels (ranks) of experience.
  This is the same as Mode 0 but $4 means additional levels (ranks) of new creature type experience.
Ex: HE...:C0/0/d/d100/5/10;
Add to the stack 100 creatures with exp of Rank 5.
Note:
do not use the 'd' modifier for $4 with mode 10.

Mode 11 - The same as Mode 10 but regardless of creature types.
  This is the same as Mode 1 but you add creatures with experience equal to $4 levels (ranks).

Ex: HE...:C0/0/3/d100/5/11;
Add to the stack 100 creatures with exp of Rank 5, but also changing their type to Marksmen.

Mode 12 - Use this mode to set the experience level (rank) for the whole stack.
  This is he same as 2 but $4 means experience levels (ranks).
Ex: HE...:C0/0/d/d/5/12;

The stack will have 5 levels (ranks) of experience.

Mode 13 - Use this mode to set the equivalent percentage of experience for a new type of creature.
  This is the same as Mode 3 but it is assumed that you change the type of creatures and a new creature experience is taken as the same percentage that the old creatures have.
So if you have a stack of Monks with exp. X and change it to a stack of Angels, the new experience will be:
X*MaxA/MaxM+dE
where MaxA is a max experience of an Angel and MaxM is a max experience of a Monk, dE is the added experience.
Ex: HE...:C0/0/../d/1000/13;
The new stack gets the corresponding experience that the old stack had plus 1000 exp.
NewExp=OldExp*NewCreatureTypeR10Exp/
OldCreatureTypeR10Exp+ExtraExp.

Mode 14 - The same as Mode 13 but an addition is experience levels (ranks).
  Ex: HE...:C0/0/../d/3/14;
The new stack gets the corresponding experience that the old stack had plus 3 levels (ranks) of exp.
D; Call upgrade dialog for hero's army (no parameters)
E$;

Set/check/get experience# to the hero (Format HL)

E$1/$2; Set/check/get hero's experience (additional syntax)
   $1 - Experience points
   $2 - Hero's level
(Format HL)
E$1/?$/1;   Additional Syntax
The same as HE:E$/?$ but without redrawing
For standard syntax some of them called redrawing always even if you check only.
F$1/$2/$3/$4; Set/check/get primary skills.
   $1 = Attack
   $2 = Defence
   $3 = Power
   $4 = Knowledge (Format PK)
G$; Set initial hero's movement points
$ - initial hero's movement points.
Comment:
If you set both HE:W and HE:G options to the same value (any), you may dig for the Grail.
F$1/$2/$3/$4/1; Additional syntax for primary skill checking.
Adding /1 at the end of the command returns the base value of a hero's primary skill without including artifact bonuses.
   $1 = Attack
   $2 = Defence
   $3 = Power
   $4 = Knowledge (Format PK)
Comments:
You can use only get or check syntax. You can also set it but it will do nothing.
e.g., !!HE-1:F?v100/?v101/?v102/?v103/1;
H$1/$2/$3/$4; Set army type for newly hired heroes.
   $1 = Slot number (0,1,2)
   $2 = Monster type (-1 means no monster)
(Format C
   $3 = Minimum value of monsters number
   $4 = Maximum value of monsters number (may be equal to min number for fixed number)

Comments:
This will be applied to a hero that CANNOT be hired right now. So if Orin and Jeddite are currently available in a tavern, their army WILL NOT be changed until next week. But if you change the army of Crag Hack and he will be available to be hired after you hire Orin or Jeddite, he WILL have the army that you set.

Then, when you hire a hero that appears in a Tavern in the beginning of the week, he will have 2 or 3 slots of army (it's not possible to set 2 or 3 exactly). So you can set 1st and 2nd slots to desired monsters and 3rd slot to -1 monster type. This will result in the hero always having 2 slots of monsters. Then if you hire a Hero, he or she will have only one slot of monsters and number 1.

Example:
Set Army of Orin to Gnoll at the game start
!#HE0H0/99/3/3H1/-1/2/2H2/-1/0/0;

This may be used later during a game.
!?LE3/7/0; Trigger for cycle
!!DO21000/0/155/1P; Set Army to all Heroes
!?FU21000;
!!VRv1Sx16;
!!HEv1H0/99/3/3H1/-1/2/2H2/-1/0/0;

I$; Set/check/get spell points. 
Be sure to use d for relative change if you wish to add or subtract rather than set. 
Example: 
!!HE-1:Id-1;
This will reduce the hero's current spell points by 1.
I$/1;   Additional Syntax
The same as HE:I$ but without redrawing
For standard syntax some of them called redrawing always even if you check only.
K; Instantly kills the hero (put this to a well - all fall inside :-)
K$/1;   Additional Syntax
The same as HE:I$ but without redrawing
For standard syntax some of them called redrawing always even if you check only.
L#^file.pcx^; Sets a hero's portrait to an external image file.
   # = 1 - Set small picture to file.pcx
   # = 2 - Set large picture to file.pcx
   # = 3 - Reset both pictures to default (no ^...^ allowed)
Comments:
file.pcx will be searched for in heroes DATA directory. But you can use subdirectory. Example ^c\name.pcx^ - in "c" subdirectory of the DATA dir. Or ^..\maps\1.1^ - in MAPS dir of Heroes.
Important! The full length of file name (with subdirectory path) cannot be more than 12 characters.
The screen will be redrawn automatically if you change the hero's portrait.
L0/$; Set hero's portrait to portrait number $. (Cf.CMD file).
L4/$; Sets both the small and large portrait to the game portrait equal to $.
L5/$1/$2; Set a hero portraits.
   $1 - String variable for large pic (0-do not change)
   $2 - String variable for small pic (0-do not change)
M#1/$2; Set/check/get spell: only for spellbook
spell #1 (see Format SP)  
at level $2 (0 = remove spell, 1 = give spell)


Note: To check if spell is learned/gained or just learned use the two ways described bellow:
- You can check for a spell that the hero has learned *or* that he/she knows due to a scroll or spell-giving artifact by using HE:M#/?$; In *either* case, the variable will have a value of 1 if the hero has the spell.
 - You can check for a spell that the hero has learned but NOT one he/she only knows from a scroll or spell-giving artifact by using HE:M=#/1; with flag 1 set to 1 the hero has learned the spell. If the hero has the spell from a scroll or spell-giving artifact, flag 1 will still be set to 0
N$; Check or get the hero's number.
Comments:
Don't try to set the hero's number to something else. It won't work or will cause instability.
Example: !!HE-1:N?v100;
O$; Set/check/get the hero's owner (see Format E1).
   $ - player number that controls hero. If a hero isn't on the map and thus has no owner, the number returned will be -1.
Comments:
This command should work properly to let you change the owner of a player, unlike in previous versions where the changeover didn't work completely.
Note: If you try to give a hero to an owner that has 8 active heroes already, the command will be just canceled. Check a hero's owner to be sure that he/she was transferred successfully.
O... Extended HE:O command syntax to use a "neutral" hero in a battle.

Use a dummy second parameter in HE:O command (like HE...:O5/1; ) to use this way. If you use a two parameters syntax, it will directly change the hero's owner. You can use this to set an unowned hero to defend a neutral monster stack, but make sure that the owner is changed back to -1 after the battle is over. Note: if you change an unowned hero in this way to temporarily give it an owner (number 0..7), it can be read with HE:O, but BA:O will still return -1.
P$1/$2/$3; Set/check/get the hero to X = $1, Y = $2, level = $3. (Move)
Comments:
In addition to its normal use of moving a hero on the map, this command can also be used to bring a hero from the hero pool (not currently "in play" into the game. After you bring the hero onto the map with this command, you should then set the hero's owner with the HE:O command.
P$1/$2/$3/S;

Move an opponent hero (not one of your colour) with sound and redraw operation:
   if $<>0 - move hero with sound and redraw (teleport)
   if $=0 - old style (hero jump to the new place immediately)
Old style of command (without $) suppose $=0

R0/$; Set/check/get hero's moral (until next battle)
R1/$; Set/check/get hero's luck (until next battle)
R2/$; Set/check/get sex of a Hero
Male=0, Female=1.
R3/$; Set hero's availability in the hero pool for all players
 
   $ - (set/check/get) enabled (1) or disabled (0) hero to hire to all
R3/$1/$2; Set hero's availability in the hero pool for each player
   $1 - (set/check/get) enabled (1) or disabled (0) hero to hire
   $2 - (set/check/get) players that may hire (one bit - one colour)
Comments: 
$2 makes sense (will be set) only if you enable a hero.
If you disable a hero that is owned by any player, the hero will be killed.
R4/$; Set/check/get a hero's Tactic control
    -1 = Enable
     0 = Disable
R5/$; Maximum morale
    1 = maximum morale set
     0 = maximum morale not set
R6/$; Maximum luck
    1 = maximum luck set
     0 = maximum luck not set
R7/$; Set/get/check "visited object" flag
    $ - modifiers word

In most cases, setting or clearing these bits won't change Luck, Morale, movement or spell points--they only set (or clear) the record of whether the hero has already visited a given type of structure in a given period, e.g., this week, for next battle, etc. However, it will set or clear any text associated with these structure if you click on the hero's Luck or Morale in the hero screen (e.g., "Temple Visited +1"), but you'll still have to set the hero's temporary Luck or Morale with the HE:R0 and HE:R1 commands.

Slava writes; I think it is correct for THIS current day. If you set a "affect a few days" like a Stable, I think the effect will be applied automatically on every next day until the effect ends up.
  Bits:
  00000001 = 1 MAGIC WELL
  00000002 = 2 stable
  00000004 = 4 BOUY
  00000008 = 8 swan pond
  00000010 = 16 IDOL OF FORTUNE (DAY 1-6)
  00000020 = 32 fountain of fortune  (-1 LUCK)
  00000040 = 64 WATERING HOLE
  00000080 = 128 oasis
  00000100 = 256 TEMPLE (DAY 1-6)
  00000200 = 512 SHIPWRECK
  00000400 = 1024 CRYPT
  00000800 = 2048 DERELICT SHIP
  00001000 = 4096 PYRAMID
  00002000 = 8192 faerie ring
  00004000 = 16384 FOUNTAIN OF YOUTH
  00008000 = 32768 MERMAID
  00010000 = 65536 RALLY FLAG
  00020000 = 131072 ? (NO IDEA)
  00040000 = 262144 in a boat (ONLY SET THIS IF HERO IS ON WATER OR IT CRASHES)
  00080000 = 524288 ? (NO IDEA)
  00100000 = 1048576 SIRENS
  00200000 = 2097152 Warrior's Tomb
  00400000 = 4194304 Maximum Luck (the same as HE:R6)
  00800000 = 8388608 Maximum Moral (the same as HE:R5)
  01000000 = 16772216 WOGSHADOWFAX (THIS RESETS MOVE TO ONE MILLION EACH TURN)
  02000000 = 33554432 IDOL OF FORTUNE (DAY 7)
  04000000 = 67108864 TEMPLE (DAY 7)
  08000000 = 134217728 +1 LUCK FOUNTAIN OF FORTUNE
  10000000 = 268435456 +2 LUCK FOUNTAIN OF FORTUNE
  20000000 = 536870912 +3 LUCK FOUNTAIN OF FORTUNE
  (38000000 = 939524096 mask for a type of fountain of fortune, total of the three values above)
  
R#1/$/#2; R command with redraw control  (for all HE:R commands)
   #1 - R command number
    $  - value
   #2 - redraw flag (1=redraw, 0=no redraw)
Comments:
The adventure screen will no longer be redrawn automatically after an HE:R command. If you wish it to redraw, use this syntax with a redraw flag of 1.
S$; Check or set the number of known skills that are displayed
$ - number of skills to show (0..8).

Comments:
If you want to display only one skill, first swap it's display position to slot
number 1 and then limit the display to only 1 skill with this command.
S#1/$2; Set/check/get secondary skill 
   #1 - Skill number (see Format SS)
   $2 - Skill level (0=none, 1=basic, 2 =advanced, 3 =expert).
Comments:
You can even set all(!) secondary skills (28 altogether) but only the first eight will show on the hero screen.
S$1/$2/1; Set/check/get secondary skill. Extended syntax.
$1 - is a number in display sequence (0 = not shown, 1..8 = slot index)
$2 - is a skill index (0...27)
Comments:
You may use three types of syntax:
!!HE#:S?#1/#2/1; ask what display slot takes #2 skill to #1 var
!!HE#:S#1/?#2/1; ask what skill occupies display slot #1 to #2 var
!!HE#:S#1/#2/1; set display slot #1 to #2 skill
In the last case if another skill takes this slot, it will be set to
"no slot". You can use the command twice to swap two skill positions.

When setting skills with this command, you must use the following rules:
- you may move any two displayed skills to exchange their position;
- you must NOT set a skill to display if it's below Basic level (no skill);
- you must set skills to display in order (no empty spaces);

Therefore you cannot use the command to hide a skill that's already
displayed. You also can't use it to set a skill to display if the hero
doesn't know the skill. Attempting either will usually display a different
"phantom" skill (perhaps Basic Wisdom) that will crash if clicked on.
T$1/$2/$3/$4/$5; Provoke a battle but only with one type of monsters.
   $1 = x position of the battle
   $2 = y position of the battle
   $3 = level of the battle
   $4 = type of monsters to fight (Format C)
   $5 = number of monsters to fight
Comments:
x,y and level are used only for choosing the type of the ground and corresponding bonuses.
U$1/$2/$3; Set/check/get hero's patrol position and radius. 
   Patrol position will be set to X($1), Y($2) (the level is fixed). 
   The radius will be set to $3 ("set free" if $3 = -1).
V#1/$2;
V#1/#2/$3
;

V#1/$2 - set/check/get if hero visited (1) or not (0) $2 all objects of type #1 ($2 is used as a bit mask)

V#1/#2/$3
    #1 = Object type
    #2 = Object number (0..31)
    $3 = Hero visited (1) or not (0)

Types of objects (#1):
(Number in parenthesis is object type number)
0 - Learning Stone (100)
1 - Marletto Tower (23)
2 - Garden of Revelation (32)
3 - Mercenary Camp (51)
4 - Star Axis (61)
5 - Tree of Knowledge (102)
6 - Library of Enlightenment (41)
7 - Arena (4)
8 - School of Magic (47)
9 - School of War (107)

Examples:
V0/0/0 - set the Learning stone number 0 to be "not visited" by the hero.
V6/2/0 - set the Library of Enlightenment number 2 to be "not visited" by the hero.
V5/2 - set all Trees of Knowledge except second to be "not visited" (second one is visited).

W$;

Change Hero's movement points
   $ - points to change (W0,Wd-10,W?i,W>=100...)
This number is not the number of steps that the hero can take in a turn but is a much higher number (usually between 1500 and 2000 depending on fastest troop speed) that the game sets internally. This was probably done so that they wouldn't have to deal with fractions when calculating terrain bonuses and penalties (plus path finding, logistics, Boots of Speed, etc.) . On grass terrain with mixed creatures, 1 step equals about 100 movement points.

W$/1;   Additional Syntax
The same as HE:W$ but without redrawing
For standard syntax some of them called redrawing always even if you check only.
X#(...); Change hero's specialty. (see Table 1 below).
# from 0 to 6. The number of other parameters depends on a type of specialization #.
X... Extended HE:X command to control specialty settings:

!!HE#:X$1/$2/$3/$4/$5/$6/$7;
- get/set/check all speciality settings.
$1...$7 - parameters.

Speciality types (defined by $1)

  $1=0 Secondary skills
    $2=secondary skill number (see Format SS )
   ($3...$7 ignored, preferably 0)

  $1=1 Creatures
    $2=creature type number (see Format C )
   ($3...$7 ignored, preferably 0)

  $1=2 Resources
    $2=resource type (see Format R )
   ($3...$7 ignored, preferably 0)

  $1=3 Spells
    $2=spell number (see Format SP)
   ($3...$7 ignored, preferably 0)

  $1=4 Creatures extra
    $2=creature type number (see Format C )
    $3=attack bonus
    $4=defence bonus
    $5=damage bonus
  ($6...$7 ignored, preferably 0)

  $1=5 Speed +2 to all units
   ($2...$7 ignored, preferably 0)

  $1=6 Upgrades
    $2=creature 1 to upgrade(see Format C )
    $6=creature 2 to upgrade(see Format C )
    $7=creature to upgrade to(see Format C )
   ($3...$5 ignored, preferably 0)

  $1=7 Dragons
    $2=attack bonus
    $3=defense bonus
   ($4...$7 ignored, preferably 0)

  $1=8 Extra WoG speciality
    $2=subtype
   ($3...$7 ignored, preferably 0)

Comment:
You may use 'd' modifier to ignore unchanged settings: HE:...:X8/2/d/d/d/d/d;
The original syntax (number of parameters < 7) should work as before.

Example.
To check the current settings use:
!!HE#:X?y5/?y6/?y7/?y8/?y9/?y10/?y11;
Note:
If you set it X7/???/$1/$2/$3 (so it will be compatible with X4 syntax), so
??? - no matter (it is a placeholder for a creature type)
$1 is an attack bonus
$2 is a defence bonus
$3 is a damage (low and high) bonus.
Y$1/$2/$3/$4; See Bless and Curse Section

 


Syntax X options for HE receiver:
0/$; To give to a hero a secondary skill $ (see. Format SS)
1/$; To make the hero by the master of creatures $(and possibly $+1) (see. Format C).
2/$; To generate the resources $ each day. (see. Format R).
3/$; To give to the hero a spell $ (see. Format SP).
4/$1/$2/$3/$4; Another way to make the hero by the master of creatures $1(and possibly $1+1) (see Format C). $2 - bonus of monster's attack, $3 - bonus of monster's defence, $4 - bonus of monster's damage.
5/2; Set hero's additional specialty to Sir Mullich's one (All troops' speed +2)
6/$1/$2/$3; Upgrade of creatures type $1 and $2 ($1+1 and $2+1 possible as well) to creatures type $3. Upgrade's price is counted as difference between the prices of the creatures (if its more than zero:-)
7/$1/$2; Dragon Master.
   $1 = attack bonus.
   $2 = defence bonus.
8/#;    # = 1 - Walking Darkness. Shroud is replaced for all other players as hero moves.
   # = 2 - Town Builder. Hero may choose which type to rebuild a destroyed town as from any of the 9 available town types.

Comments:
For "couple" creatures (basic and upgraded), if the first is changed, the second will also be changed.

In the line, options should not be separated by other symbols and may be repeated with the last cancelling all the previous. The same receiver can occur several times. There might be comments between trigger's and receivers' descriptions.