EXPERIENCE ADDING (EA)
RECEIVER

Receiver for adding stack experience support to ERM.

!!EA$:XXXX; Receiver for adding stack experience support to ERM. $ is a type of monster.
!#EA$:XXXX;

OPTIONS

A$1/$2; Set an AI modifier.
    $1 - difficulty level index (0...4)
    $2 - modifier
   This modifier is a multiplier that is used for AI hero's experience to get the resulting experience distributed to his/her stacks.
   It is 1 (easy), 2, 3, 4, 5 (Impossible) by default.
B#1/$2/$3
...$15;
Set/get an experience line.
  #1 - bonus line index (0...19) (you cannot "get" it)
  $2 - Flags. For now:
     0 - ability is disabled
     1 - ability is enabled
  $3 - ability (ASCII code of a char, see Format SE1)
  $4 - modifier (this is a numeric representation of a char or a number for "#..." parameter, standards are here))
  $5 - a value for a Rank 0 (no experience)
   ...
  $15 - a value for a Rank 10 (max experience)
C$; Set/get an experience Cap.
This is the maximum percent of experience that a unit can gain from a single battle.
H$1; Set a human experience modifier
$1 - modifier
   This modifier is a multiplier that is used for human control heroes to determine the experience gained by each army stack after a victorious battle. The default value is 100 (100% of the experience the hero gains from the battle).
Comments:
   Settings are stored in a saved game.
   For A, S and T and H commands the type of monster in EA$ may be any, say, 0 because it is not used.
F$1/$2; Get a number of the bonus line that has a specific ability or find the number of the next free line.
$1 - ability number (ASCII code of a char, see Format SE1)
$2 - line index (-1,0,1..13)
Comments:
You may only get or check the second parameter but not set it. So the call like this is a standard:
!!EA...:F65/?v100;
   This will return the index of a line that keeps 'A' (65) bonus ability for a creature (attack bonus).
   If the line is not found, it will return a line that is empty.
   If you set $1 to 0, you will find the first free bonus line.
   If $2 returns -1, there is no more room in the ability list for this creature.
F$1/$2/$3; Extended syntax for EA:F command:
!!EA:F$1/$2/$3;

   $1 is an ability type (ASCII code of a char, see Format SE1)
   $2 is a modifier (-1 = does not matter, takes the first found)
   $3 is a var to store the search result.
M$; Set/get experience multiplier
The value of $ is 1000 times more than used. So for 0.75 you will get 750. If you want to set it to 1, you should use M1000;
L$; Set/get an experience scale and limit.
  This sets the stack experience needed for a creature to reach rank 10, and from this number the experience needed for each rank up to 10 is also derived and automatically calculated by the game (as a percentage of this total).
Example:
********
!!EA141:L30000;
[Set rank 10 experience for Mummies to 30000 points]
********
S$1/$2; Set an AI modifier.
  $1 - difficulty level index (0...4)
  $2 - modifier
 This modifier is additional experience that is used for AI hero's experience to get the resulting experience distributed to his/her stacks.
 It is 50 (easy), 100, 200, 300, 400 (Impossible) by default.
T$1/$2; Set an AI modifier.
    $1 - difficulty level index (0...4)
    $2 - modifier
This modifier is a multiplier that is used for AI hero's experience to get the resulting experience distributed to AI town garrison stacks. If the EA:A modifier is set to 0, the town garrison experience will be 0 regardless of the value set here. It is 10 (easy), 25, 50, 75, 100 (Impossible) by default.
U$; Set/get experience upgrade multiplier.
The value of $ is 1000 times more than used (see M command).

    Support for stack experience on the battle field.
   You can set experience points, experience lines and experience parameters for any creature on the battle field.
   Use any !!EA command for this. To refer to a stack on a battle field you need to mention a stack index in negative range:
!!EA-1:... stack 0
!!EA-2:... stack 1
..
!!EA-42:...
stack 41
As before you can use a positive value to apply the command to a type of creature. You may set experience parameters for any stack on the battlefield, right in BA0 (BA50) trigger sections or later during a battle.


E$1/$2/$3/$4; Set experience for a battlefield stack.
E$1/$2/$3/$4;
   $1 - experience points
   $2 - modifier (as for HE:C modifier - parameter 6)
   $3 - creature type
   $4 - creature number
   You may use d modifier for $3 and $4 to not change the default creature type (will be set automatically to a correct creature type).
   Example:
!!EA-2:E1000/2/d/d;
Set (2) experience points (1000) for creatures that are located in a stack number 1 on the battle field.
Comment:
You may use this command ONLY for a stack on a battlefield.
So it should be !!EA-1:... !!EA-42:...
D?$; Check if experience bonus lines were copied to a stack on the battlefield.
  # is a stack index (reversed) -1...-42
  $ a variable to get a "copied" value.
Comments:
   If $ returns 0, the settings are taken from a default creature type bonuses and were not copied to a temporary BF settings for this stack. Actually it may happen if you summon a stack.
   If $ returns number 1...7, the stack bonus lines was copied and that was a stack 0...6 in an attacking army.
   If $ returns number 8...14, the stack bonus lines was copied and that was a stack 0...6 in an defending army.
   If $ returns -1, this is a stack that was not in an attacking or defending army but bonus lines for it were copied already.
   So if you summon a stack and use this command, it returns 0 (bonus line was not copied). If then you use any command of EA:MULPCBO to not check but set anything for this particular stack and then check EA:D again, it will return -1.
   The typical sequence is:
   - check whether the bonus lines is copied with EA:D
   - if no, use EA:O to copy them.
   - now make any particular change with EA:MULPCB
O$; EA#:O$; Copy all bonus lines and parameters.
# is a target creature type or stack.
$ is a source creature.
Comments:
   This command copies all bonus lines and experience parameters of one creature (on the battlefield or a type of creature) to a creature/stack.
Example:
  !!EA-2:O0;
   This command will set all bonus lines stack 1 on a battlefield (-2) to have the bonus lines of Pikemen.
   Also all experience parameters (Upgrade multiplier and so on) are also copied.
   This command is useful if you summon a stack and you want it to have specific lines of another monster or for dynamic changing of any stack experience parameters.
   This command does not set experience points itself.
O$/#2; Extended syntax for EA:O command: EA#1:O$/#2;
Extended EA:O command. You may use it with the first syntax and also:
EA#1:O$/#2;
         #1 - destination stack
         - source stack
         #2 - copying modifier

#2:
0 (default) - just copy source to destination
1 - if destination on Battlefield (BF):
        - copy to destination plus all the same type of friendly stacks
    if destination is a standard creature index:
        - nothing will be done
2 - if destination on BF:
        - copy to destination plus all the same type of enemy stacks
    if destination is a standard creature index:
        - nothing will be done
3 - if destination on BF:
        - copy to destination plus all the same type of attacker's stacks
    if destination is a standard creature index:
        - copy to all the same type of attacker's stacks
4 - if destination on BF:
        - copy to destination plus all the same type of defender's stacks
    if destination is a standard creature index:
        - copy to all the same type of defender's stacks
5 - if destination on BF:
        - copy to destination plus all the same type stacks
    if destination is a standard creature index:
        - copy to all the same type of stacks
R$1/$2; Artifact support for battlefield stacks.
EA...:R$1/$2; - set/check/get artifact and option
   $1 = artifact index
   $2 = artifact option
Comments:
   For now only one artifact index ($1) is supported - 156 (banner).
   For now only options 0...8 ($2) are supported.