HERO (HE) Used to modify characteristics, troops, inventory, skills, location and just about everything
imaginable for a specified hero. Also used for setting blessings and curses.
RECEIVER
Note:
v998/v999/v1000 variables will store the location of the current hero visited.
Also, you can refer to it easily with an indirect reference (for example: !!HE998:...; )
!!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; | Current hero, 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OPTIONS | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A1/$1/$2 A2/$1/?$2/?$3 A3/$1/$2/$3 A4/$ A# |
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.) All artifacts start from 7 (Centaur's Axe) on. 1000 is a magic book 1001 on means a scroll with a spell of format SP and number is calculated as [artifact number]-1001. 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. - 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. 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 ?$3 - Returns the numbers of equipped artifacts of the type 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. $ - Number of artifact. (see Format A1). Note: 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] A# - Give/remove 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. Example: !!HE106:A-1; [Remove all scrolls in Lydorie's possession] |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
B0/z$ | Set/get the name of a hero. $ - number of z-variable with new name. 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, see Format HC) Divide $ to 2 and you will get a town type of a class. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 | Set/get monsters by hero slot #1 - hero's slot number (slots are numbered 0..6) $2 - monster type (Format C) $3 - number of monsters This command may be used to determine which creatures a hero has in his or her army slots, and also the number of those monsters in each slot. It can also be used to change the type or number of creatures in that slot. Use the 'd' modifier (as usual) for a relative change. e.g., !!HE-1:C0/0/d/d5; This would add 5 creatures of the same type to the current hero's first army slot (slot 0). Note: a value of -1 for type means none. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Change monsters by type | All monsters of type #1 will change into: $2 - type: Format C $3 - number. Example: !!HE-1:C1/0/1/d20; (add 20 units to every pikemen slot (d20) and change all pikemen (0) to halberdiers(1)) Note: If you use a value of -1 for $2 or 0 for $3, all creatures of that type will be removed from the hero. You can also get the number ($3). Getting the number ($3) lets you quickly check if a hero has any creatures of a given type without using a loop. However, if a hero has multiple stacks, it will only return the number of creatures of that type in the last creature slot that contains those creatures. For example, suppose a hero has: Slot 0: 14 Cyclops Slot 1: 18 Cyclops Kings Slot 2: 50 Pikemen Slot 3: 100 Halberdiers Slot 4: 9 Cyclops Slot 5: 49 Pikemen Slot 6: empty Then !!HE-1:C1/94/?y-1/?y-2; would return y-1=94, y-2=9 for the current hero. (94=Cyclops) But if you instead had !!HE-1:C1/96/?y-1/?y-2; it would return y-1=0, y-2=0. (96=Behemoth) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. #1 = type of monster 1 (-1 = no, see Format C) #2 = number of monsters 1 #3 = type of monster 2 (-1 = no, see Format C) #4 = number of monsters 2 #5 = type of monster 3 (-1 = no, see Format C) #6 = number of monsters 3 #7 = type of monster 4 (-1 = no, see Format C) #8 = number of monsters 4 #9 = type of monster 5 (-1 = no, see Format C) #10 = number of monsters 5 #11 = type of monster 6 (-1 = no, see Format C) #12 = number of monsters 6 #13 = type of monster 7 (-1 = no, see Format C) #14 = number of monsters 7 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(...) (SE support) |
Extended !!HE:C0, !!HE:C1 and !!HE:C2 syntax for setting or retaining Stack Experience. (Note: does not work with C#1/#2/..../#14). 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 stack of monsters $4 = experience value (default is 0) $5 = experience modifier (default is 0) Supported $5 modifier values:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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/?$2/1 | Additional Syntax The same as HE:E$1/?$2 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
F?$1/?$2/?$3/?$4/1 | Return the base value of hero's primary skills without artifact bonuses. $1 = Attack $2 = Defence $3 = Power $4 = Knowledge Comments: You can use only get or check syntax. You can also set it but it will do nothing. Example: !!HE-1:F?v100/?v101/?v102/?v103/1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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, see 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 !#HE0:H0/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/1:P; Set Army to all Heroes !?FU21000; !!VRv1:Sx16; !!HEv1:H0/99/3/3H1/-1/2/2H2/-1/0/0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I$ | Set/check/get spell points. $ - number of 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 will fall inside :-) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 | Give/remove spell in the spellbook #1 - number of a spell (see Format SP) $2 = 0 - remove spell = 1 - give spell Notes: To check if spell is learned/gained or just learned use the two ways described below: - 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. $ - player who controls the hero (see Format E1). 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. 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$/1 | Extended HE:O command syntax to use a neutral hero in a battle. Use a dummy second parameter in HE:O command (like HE-1: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/$4 | Move hero $1 - x $2 - y $3 - level $4 - style if $4 = 1 - move hero with sound and redraw (teleport) if $4 = 0 - hero jumps to new place immediately 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. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 Hero Male=0, Female=1. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
R3/$ | Set hero's availability in the hero pool for all players $ - enable (1) or disable (0) hero to hire for all R3/$1/$2
| Set hero's availability in the hero pool for each player | $1 - enable (1) or disable (0) hero to hire $2 - players to affect (see Format E1) 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 modifiers of visiting structures of temporal changing parameters of a hero. | $ - modifiers dword, bit mask. Comments: 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. Bits:
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
| Manage secondary skills showing | $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 Set/check/get if hero visited objects 'of one visit'. | V#1/$2 #1 - type of object (Format OV) $2 - 32-bit variable which is bit mask for 32 OV-objects of #1 type. V#1/#2/$3 #1 - type of object (Format OV) #2 - object number (0..31) $3 - Hero visited (1) or not (0) 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 | $ - movement points. 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. Note: In both SoD and WoG, AI heroes get additional movement points at higher difficulty level settings. At Expert they get 125 extra points and at Impossible, they get 75. While it seems like it should be the other way around (a bigger bonus for the AI at Impossible), it appears that it's set to give more at Expert for some unknown reason. W$/1
| Change Hero's movement points. Additional Syntax | The same as HE:W$ but without redrawing. For standard syntax some of them called redrawing always even if you check only. Change hero's specialty. | To make hero master of a secondary skill X0/$1/0/0/0/0/0 or X0/$1 $1=secondary skill number (see Format SS ) To make hero master of creatures X1/$1/0/0/0/0/0 or X1/$1 $1=creature type number (see Format C ) To make hero keeper of resources X2/$1/0/0/0/0/0 or X2/$1 $1=resource type (see Format R ) To make hero master of a spell X3/$1/0/0/0/0/0 or X3/$1 $1=spell number (see Format SP) To make hero grandmaster of creatures X4/$1/$2/$3/$4/0/0 or X4/$1/$2/$3/$4 $1=creature type number (see Format C ) $2=attack bonus $3=defence bonus $4=damage bonus To make hero master of speed X5/2/0/0/0/0/0 or X5/2 To make hero master of upgrades X6/$1/0/0/0/$2/$3 or X6/$1/$2/$3 $1=creature 1 to upgrade (see Format C ) $2=creature 2 to upgrade (see Format C ) $3=creature to upgrade to (see Format C ) To make hero master of dragons X7/$1/$2/0/0/0/0 or X7/$1/$2 $1=attack bonus $2=defense bonus To make hero master of WoG speciality X8/$1/0/0/0/0/0 or X8/$1 $2=subtype =1 for Walking Darkness =2 for Builder 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 |
Give, remove or adjust blessings and curses. | $1 - number of curse from 1 to 65 (Format BC) $2 - the power of curse (0 for affects 1,3,8,22..62; number of slot (Format AP, -1 for random) for Lock) $3 - the length in days of the curse $4 - what to do 1 = set 2 = add/sub 0 = del Comments: - Every hero can have only one curse of each type. So when you add/sub (sub is addition of negative value), that means that the power and the length will be changed to a sum of old and new values. If you del the curse, the power and length parameters do not matter. - If the slot to be locked has an artifact, it will be hidden and appear at the same place when curse has gone. |