Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SpellAddon options

The built-in SpellAddon supports SPELLADDON.INI. It uses the mod-folder file first, then the game-folder file. It reads one file, without merging them. Without either file, SpellAddon is off. The built-in version takes precedence over separate SpellAddon*.asi files.

Loader and INI compatibility details: addon start-up behavior.

The last column of each feature table gives eix’s difference from SpellAddon 20.6 (SpellAddonXa.asi), with what the original does in parentheses. same means the original’s behavior; fixed: marks a difference that only fixes a defect of the original.

Configuration

All feature switches default to 0 (off), including when an INI file exists. Parameter defaults below apply only when their feature uses them; they are not the sample values from older guides. Restart the game after edits. An INI file also enables the spell-construction diagnostic correction, independently of its feature switches.

Section and key names are case-insensitive. Spaces around names are ignored; disablepausekey works without the historical trailing space. Duplicate keys use the first value and produce a warning. Canonical keys take precedence over aliases: [gameplay] avrgarmors aliases avgarmors; [gameplay] showallquestsinmulti, spellsaimod and spellsarealwaysconstructable alias their [speed] counterparts.

The tables give active values. Other values make no change unless marked skipped. A skipped value is logged and left out, and every other feature still applies. Switches retain a signed byte: use the listed values within -128..127; larger values wrap and warn. 1+ below means 1..127. Byte parameters retain the low byte (0..255), and other values warn; 32-bit parameters retain 32 bits. Floating-point parameters accept decimal text with a sign and an exponent; use a decimal point. runconst, runconstex, pow and expforint read only their first 21 characters, take a leading -, ignore any other character that is not a digit, point or comma, and also accept a decimal comma (the original ignores the sign too). Other numeric text holds at most 31 bytes; font text holds at most 47 bytes. Parameters have no general range validation. Limits stated below describe their use, not an extra validator.

Features apply in a fixed order, independent of INI order. Where two features change the same code, the later one builds on the earlier, or the earlier is skipped with a warning when the later replaces all it does; the tables call out those interactions. A conflicting or unexpected game patch causes the affected feature to be skipped and logged. If writing the merged patches fails, no feature applies. See the addon options for the other built-in settings.

Combat - [gameplay]

KeyActive values and effecteix
archersdefence1+: bows and crossbows retain defence.same
unbreakablebodyparts1+: prevent limb breaking; also use bodypartbreakmodifier for the limb-damage floor.same
enablekillsinmulti1: remove player damage immunity so players can hurt other players.fixed: god mode still holds (the original drops it too)
rangedweaponbackstabs1: allow ranged backstabs.fixed: with newrangedweapontypes, its change to how orders are carried out stays (the original’s newrangedweapontypes replaces it)
backstabsforall1: allow units without a player to backstab.same
newattackdefence1, 2: physical damage after armour uses attack minus defence divided by divmod, plus submod and the speed term; 1 also includes the distance/weight term. 3, 4: use max((attack - defence) * divmod + 1, submod); backstabs ignore defence. 4 also disables misses.same
damageboost1: scale weapon damage by strength/dexterity above 25 and spell effects by intelligence above 25, dividing by str, dex, int. 2: multiply by those parameters instead. 3: bypass the normal effect scaling and its client display adjustment. 4: boost after weapon-effect scaling and at cast completion, using multiplication. 5: boost after scaling and mark casts so only their spell effects get the intelligence boost.same
changeweightrangebonuses1+: use weight and range in hit calculations; 2 also bypasses the conditional range test.same
strengthstats1: set strength’s health, damage and carrying-capacity coefficients with strhp, strdmg, strweight.same
allowheroesarmors1: retain heroes’ natural armour.same
newrangedweapontypes1: weapon types 11 and 15 count as ranged, alongside bows (5) and crossbows (6), throughout combat checks.same
randomlessaimedhits1-4: choose a vulnerable body part using the last hit. 5-9: estimate damage from the weapon’s damage range and target resistance. 2, 6, 7, 9 compare the target’s reach minus the attacker’s reach with rangeddistance; other modes use attack reach. Highest score wins; bodypart is the fallback. 10 is skipped.10 skipped (calls code the original never wrote); 5 and 8 keep the game’s minimum of distance and reach
increasinghitchance1: after more than tohitcheck misses, add misses * tohitmul - tohitsub to the hit threshold. The defender holds the counter; a hit resets it.fixed: with newattackdefence 1, 2 or 4, both apply (the original undoes part of newattackdefence)
runawaydistcontrol1: attack reach becomes weapon range * hitdistmul + hitdistadd.fixed: keeps fractional hitdistmul and hitdistadd (the original truncates them to integers)
nightpower2: multiply attack and defence by nightmeleeadd - P * nightmeleemul + vision * P * nightmeleemul / 100, where P is night level (0..1). 1 is skipped.1 skipped (every attack and defence value becomes garbage); fixed: with damageboost=3, the unit panel keeps that feature’s change (the original drops it)
duels1: suppress diplomacy reactions to damage when player 0’s und<victim id> variable rounds to nonzero.same
acidattack1, 2: unfinished acid-effect variants; neither changes the visible effect.same
armorspell1 is skipped.1 skipped (corrupts the stats refresh)

Progression and movement

SectionKeyActive values and effecteix
skillsextendedskills1: replace the non-stealing skill cap with [skills] skills.fixed: uses [skills] skills as its cap (the original uses [stealing] stealing)
stealingextendedstealing1: replace the Sleight of Hand cap with [stealing] stealing.fixed: uses [stealing] stealing as its cap (the original uses [skills] skills)
rebalanceenginerewriteskillscounting1: next skill level costs pow ^ level * mul + add.fixed: pow without a decimal point reads as a whole number (the original divides by ten for each digit)
rebalanceenginerewriteherolevelcounting1: level is round(mullvla * log2(exp / divlvla + addlvla) + addlvlb) on server and client. 2 is skipped.2 skipped (returns a stale level)
rebalanceenginerewriterunabilitytime1: use runconst as the running stamina coefficient; also supply runconstex for newrunsystem=2.fixed: runconst and runconstex without a decimal point read as whole numbers (the original divides by ten for each digit)
rebalanceenginenewrunsystem1: drain a fixed amount instead of maximum stamina times the coefficient. 2: drain maximum stamina times the coefficient, plus runconstex. rewriterunabilitytime controls the coefficient; otherwise the game uses 1/150.fixed: runconstex without a decimal point reads as a whole number (the original divides by ten for each digit)
rebalanceengineuseonlymindamage1: use minimum weapon/unit damage instead of rolling within its range.same
rebalanceenginebackstabvisualbase1: show bsbase as the base backstab percentage; display only.same
rebalanceenginedifficultyreset1: apply difficulty scaling to all units, including heroes. 2: also add difficulty-table values instead of multiplying by them.same
rebalanceenginemeleesum_low1: non-hero server attack/defence add the first skill and dexterity minus 25. Skipped unless meleesum_1 or meleesum_2 is exactly 1; meleesum_1=1 satisfies this although that feature is itself skipped.1 skipped without meleesum_1 or meleesum_2 (the original’s game hangs at the first attack)
rebalanceenginemeleesum_11 is skipped.1 skipped (the original crashes at the first attack)
rebalanceenginemeleesum_21: client attack/defence add the first skill and dexterity minus 25, retaining the low byte: the client side of meleesum_low’s sum.same
animationsspeedrewriteactionsspeed1: set six animation factors from this section’s parameters; also adjust client animation timing.same
gameplaychangeexpforint1: use expforint as the experience multiplier per intelligence point.fixed: expforint without a decimal point reads as a whole number (the original divides by ten for each digit)
gameplayheroalwayscanrun1: remove the load-based restriction on running.same
gameplayautomaticruncontrol1: stop running at zero stamina.same
gameplayspeedboost1: multiply movement speed by ((action counter + speedadd) / 15) ^ speedbase.same
gameplayactionspatch1: actions become dexterity * actionsmul + actionsadd.same
gameplayactionsdexteritymovespeed1+: actions and dexterity contribute to movement speed through actmovemul and dexmovemul.same
gameplaycleveranimationsspeedup1: set casting animation speed from cast duration and send animation speed in unit network state; also adjust client animation timing. Peers need compatible settings.same
gameplaynhits1: use a fixed count of five hits for the special multi-hit animations.same
gameplaydiffchange1: ignore clicks on the difficulty spinner in game options.same
gameplaynewdifficultylevels1: add normal between easy and hard in the new-game choice, default to normal, and use a difficulty slider in options.fixed: the box grows for the new row and the explanation moves below it; a click on the hard box selects hard (the original’s overlaps and ignores the click)

Items, shops and camp - [gameplay]

KeyActive values and effecteix
unlockmoney1: keep money unencoded in memory.same
saveall1+: use the game’s persistent-zone save/load handling for every zone. Value 32 also participates in extendedmerc’s draw-range extension.same
extendedmerc1+: set the briefing mercenary limit to the low byte of maxcountofmerc. With value 16+, saveall=32 and maxcountofmerc>50, extend the client draw range from 100 to 4096.same
shopschanges1+: change trader templates’ price/count fields; the final template uses price/count factors 1.0, 0.2 and 0.1. shopsnewnormalchanges=1 supplies jigran for its shared factor.same
shopsnewnormalchanges1: set stock ranges for weapons, armour, wands, potions, prototypes and runes, plus four traders’ sell-price factors and jigran for shopschanges.same
copystatscut1: CopyStats skips portions of the stats copy, retaining the recipient’s racial traits rather than making a complete clone.same
liftchanges1: unfinished carry-weight check; no game-state change.same
liftdebuffs1: packed stats are scaled by 1.01 - q / (q + liftkey), q = load / maximum load, while load is nonzero.same
encumbrancemovespeed1: subtract r^3 * encumbrancemovemul from movement factor, r = load / (load + maximum load). With speedslowremaster=2, also apply its Speed/Slow contribution, defaultspeedmul, minimumspeedmul, and the overload factor.same
encumbranceattackspeed1: load slows attack animations using (animation factor - r^3) * encumbranceattackmul. 2: load reduces the stats’ attack rate using speed factor - r^3 * encumbranceattackmul. r is as above.fixed: 1 slows rewriteactionsspeed’s attack factor and 2 actionspatch‘s actions (the original uses the game’s values there, dropping those features’ changes)
improvedstealing1: separate theft from corpse loot. A living hero retains equipped armour/weapons; a previously robbed hero’s corpse yields those, without repeating gold or stolen items. An already robbed living unit yields nothing.same
dmgtypes1: list dmgtypescount damage types in camp panels.same
avgarmors1: show average rather than maximum armour, including Endurance’s bonus. Requires newperks>=1; otherwise skipped. The divisor follows dmgtypescount when dmgtypes is active.also accepts [gameplay] avrgarmors when absent (the original ignores it); 1 skipped without newperks (the original crashes entering the camp)
itemslightchanges1: replace eight item-highlight RGBA colours with light00 through light31.same
heroscanhideweapons1: press the selected weapon’s key again, or click its selected slot, to sheathe it.same
camp1+: SendStringEvent(0, "constr") enters camp. 2+: the camera-track key (Home by default) also enters when player 0’s Camp is nonzero, then sets Camp=2. With newoptions>=1, modes 2-12 omit Home; newoptions=1 adds the camp binding and ability button. Each of 3, 4 and 13+ adds only its own extra: 3 tracks/removes quest items; 4 limits quick quest-item slots by QuIs; 13+ restore zone music on return and retain Home.fixed: the Home key without player 0 does nothing (the original runs into the next action); value 3’s quest-item handling keeps the game’s own steps
newoptions1: add camp (action 60) and kick bindings (61, 62). Camp’s action requires camp>=2; actions 60/61 otherwise end safely, with no kick behavior added.fixed: actions 60 and 61 end the battle screen’s handling (the original jumps into garbage), unless camp defines 60
newperks1+: add Endurance (armour against all seven damage types) and Ghostliness (less visibility), and separate the magic-school skills. 2 also changes the school field used by spell descriptions.fixed: Ghostliness lowers loudness as well as visibility, and visibility stops at 0 (the original’s loudness change is overwritten, and visibility can go below 0)

For camp=3, quest-item creation sets player 0’s q<item id>=2; taking the item sets it to 0, except while camp entry strips items. Set QuIs to the active quest-item count when using camp=4.

Spells - [gameplay] unless specified

KeyActive values and effecteix
possessioncharmlink1: allow casting Possession, Charm and Link.same
possessionpatch1: Possession retains the caster’s sight and registers both caster and target for script visibility.same
batterycharge1+: reject spells containing modifier codes ic or it when placing them in wands. Invalid rune-table references are skipped.fixed: a modifier past the rune table is skipped (the original crashes)
nonstopmanaregen1+: continue stamina/mana regeneration through the state that normally stops it.same
npcsmana1: charge NPCs mana on cast completion. 2: require enough mana before casting. 3: both. 4: make both exemptions depend on AI class 16 instead of player ownership.same
splashdamageonair1: area spells can hit flying units. 2: only Invoke Lightning gains this ability, including AI targeting.same
newspells1-3: extend spell dispatch, enable Ensorcell (42), Inspiration (43), script spells (44-48), and the Fireball-based spell 49. 1 also marks spell 49’s caster; 1/2 load the autorun mob. 3 adds lasting-effect cases and Ensorcell’s damage type. See script variables below. New spell records/scripts must come from the mod.fixed: the original’s crashes left out: Charm on a spawned wolf, the effect types that crash the effect loop, Charm and Healing with a broken stack; legendaryspellsystem and changefont keep their data
lastspellsdamagetype1: use astralbeam, destroyray, lightningbeam, firearrow as damage-type IDs.same
[speed] spellsaimod1: extend the AI offensive/friendly spell table to 54 types.also accepts [gameplay] spellsaimod when absent (the original ignores it)
[speed] spellsarealwaysconstructable1: bypass level checks when assembling spells or giving them to heroes.also accepts [gameplay] spellsarealwaysconstructable when absent (the original ignores it)
offensivespells1: mark Stench and Shrink as friendly in missile hostility checks.same
inspirationintelligence1: item Inspiration waits until mana is below maximum, as Healing waits for missing health; limit repeated item casts within the tick. 2/3 are skipped.2 and 3 skipped (Healing items crash)
teleportboost1: teleport duration becomes round(900 / (effect strength / 2 + 22)) + 2. 2: use delay 8 instead of 30. 3: use delay 1.same
shrinkenlargerebalance1, 2: Shrink and Enlarge no longer change unit size. 1 also changes the scale multiplier used by the size calculation.same
hidefireworks1: omit Fireworks’ drawing setup.same
wallsfrequency1: wall spells deal damage every frequencyvalue ticks.same
wallspercentage1: per-type wall fractions are percentagevalue * period / 150. 2: use each configured fraction directly.same
controlmagic1: Stun-like spells, Weaken and Slow meet target resistance; the latter two use weaknessmultiplier/slownessmultiplier. 2, 5, 7: add the 22 configured spell bonuses. 3: add bonuses only for spell switches with odd values. Duration/intelligence formulas from older guides do not run. 4/6 are skipped.4 and 6 skipped (corrupt durations)
effectredraws1: show all configured b<spell> bonuses as value+bonus in item descriptions, and their sum in the HUD, independently of the controlmagic switches.same
stenchremaster1: Stench increases visibility, loudness and two further perception stats by its strength times stenchmul.same
regenerationremaster1: add Regeneration strength times regenerationmul to natural regeneration.same
speedslowremaster1, 2: multiply Speed minus Slow by speedslowmul. 2 also affects movement when encumbrancemovespeed=1.same
strengthweakrebalance1: Strengthen minus Weaken, times strengthweakmul, scales strength.same
linkremaster1: every 32 ticks, transfer mana from the proportionally fuller linked unit towards equal fill ratios, limited by spell strength. 2/3 are skipped.2 and 3 skipped (the original crashes)
allowcastsonbriefings1: allow casting in briefing zones.same
fakesrcrune1: modifier code f starts a spell from its target point instead of its caster.same
filtersarealwaysusing1, 2: apply target filters to every spell.same
tornadochanges1+: use tordmg for tornado damage. 2+: also remove the unit exclusion, so it can hurt every unit.same
changesounds1: use fireboom as the Fireball volume factor.same
vampirism1 is skipped.1 skipped (the original runs unfinished code)
maxmanatrans1 is skipped. Do not use it for the advertised path-query interface.1 skipped (breaks every spell type but one)
fhrunetrans1 is skipped.1 skipped (the original crashes and stops every later feature)

AI and perception - [gameplay]

KeyActive values and effecteix
rewritenpcvisionarc1+: set NPC sight-arc value to visionarc.skipped with a warning when removenpcsblock is 1 or 2, which removes the value it sets (the original writes it unused)
visionfix1: bypass two lost-sight exits; with aggrmod>5, bypass only the first shared exit.same
aggrmod1: record lost-sight state, without changing the loss calculation. 2: distance-dependent random loss using losehardcore. 4/5: distance-dependent loss based on clock ticks, losefactor1/2. 6/7: per-viewer aggression counter using losehardcore, losefactor1/2/3, difffactor, maxadd. follow affects all these modes; loseallyfast affects 6/7. 3 is skipped; 6/7 omit the faulty improve alarm hook and warn if requested.3 skipped (corrupts the AI’s state); 6 and 7 with improve nonzero leave out the alarm hook (it acts on the wrong unit), with a warning; 2, 4-7 handle a zero divisor
spellsprioritys1: replace seven AI target-rating constants with the priority parameters below.same
otherspellcastingai1: permit area spells even with allies nearby.same
npcsspellcastingtactics1: NPCs lacking mana switch to weapons and return to spells once mana recovers.same
removenpcsblock1, 2: remove NPC-specific stats, AI and naming branches. 1 also removes the NPC difficulty-scaling exception.same
everyoneishero1: broaden the shared hero-ID test to nonnegative IDs below two billion. 2: selected game systems treat all units as heroes. 3: as 2 but retain difficulty scaling for enemy heroes.same
allysseeseachothers1: sight treats all units as player-owned. 2/3: also use the player branch during visibility updates. 4: sight uses hero IDs from one billion to below two billion as the ownership test.fixed: 4: looting works with or without improvedstealing (the original crashes without it at the first scripted loot)
newplayersafetyconditions1: use safetymuldist in party-safety distance checks and maxvisibilitymul for the visibility factor.same
fearpatch1: use fearsafetydist for retreat distance and legsdamagedmul for the leg-damage cutoff.same
stupidenemies1: witnessing a murder no longer invokes the diplomacy attack reaction.same
hyperreactions1: react to seen units/corpses without the own-side-only restriction.same
hearingreactionspatch1: fix the unit/target used in reactions to sounds. 2: also offset and scatter the destination with runtosoundsmul and randsoundfactor.same
visioninweather1: use visionweathermul in bad weather.same
nightvisionincaves1+: dark zones always use night vision, without daytime growth.same
nightpowervisionpatch1: ramp night level between visionevening/visionnight and visionmorning/visionday, with slope visionmulpowbetween.same
newbigtables1: alter the rebuilt AI tables’ positions/bounds. Requires the corresponding rebuild switches; it supplies no extra entries. The caster lookup shifts beyond the written table, and the offensive bound grows beyond its 38 entries.same
allvisible1 is skipped.1 skipped (corrupts the options load)
sizerebalance1-3 are skipped.1-3 skipped (corrupts the unit)
unitsrunfromdangers1 is skipped.1 skipped (passes a point as a unit)
SectionKeyActive values and effecteix
aicastertablerebuildedaicastertable1: replace the 54 spell AI classes with keys 0 through 53 in this section.same
aioffendtablerebuildedaioffendtable1: replace the 38 offensive/friendly entries with keys 0 through 37 in this section. No effect while spellsaimod=1, whose own 54-entry table the game reads instead.same

Multiplayer and speed

SectionKeyActive values and effecteix
gameplayfullexpforall1: every recipient gets the full experience award; do not divide it among recipients.same
gameplaymanygameexe1: allow multiple game processes.same
gameplayenablecheatsinmulti1: allow the console’s restricted commands in multiplayer.same
gameplayextendedparams1: character creation uses attribute bounds 5..45 and required sum 20000. 2: use parammin, parammax, balance and bypass the sum check.fixed: keeps fractional parammin, parammax and balance (the original truncates them to integers)
gameplaylongnick1: remove the character-name edit field’s length checks.same
gameplaydisableexppenalty1+: add experience directly to totals, bypass pending experience in training/trade, and remove its loss on respawn.same
speedallowmpspeed1+: enable multiplayer speed keys and clock-button speed changes.same
speedrewritespeed1: clock-button normal/fast periods use normal and fast.same
speedrewritespeedkey1: keyboard normal/fast periods use normalkey and fastkey.same
speedrewriteotherspeed1: apply both following changes. 2: reset to normal1 on battle-screen close. 3: initial clock period uses normal2/fast2.same
speeddisablepause1: clock pause sets period pause instead of pausing.same
speeddisablepausekey1: pause key sets period pausekey instead of pausing.same
speedshowallquestsinmulti1: bypass the multiplayer restriction on selectable quest zones.also accepts [gameplay] showallquestsinmulti when absent (the original ignores it)
speedruntimervars1-3: publish a timer state, 0 during mission/zone/save loading and 1 when the game interface appears. 1/3 differ in battle-screen paths; 2 uses 3D-interface activation instead of briefing creation. Requires an external timer that reads this interface.same

Speed periods are milliseconds per update: smaller means faster. Speed and network-format changes must be compatible between multiplayer peers. bigmapspatch and cleveranimationsspeedup change network data handling.

Interface and world - [gameplay] unless specified

KeyActive values and effecteix
rewriteperssize1: use perssize for the hero preview scale.same
[fonts] changefont1+: use newfont1 through newfont4. 2 also loads the font file newfont5 from the INI folder for this process.fixed: with newspells on, value 1 keeps the second and third font names (the original’s newspells overwrites them)
infowindowschanges1: compact the unit-info layout.same
infowindowremake1: combine attack/defence with hearing on one line and add two panel rows.same
showtype1: show the movement-type line in unit information.same
showmanaforeveryone1: show mana bars for non-heroes too.same
meterscale1: use meter for the information ruler scale.same
allodsinfo1: display the adesc <allod> text from texts.res in a frame sized by framex/framey.same
exploredcolors1: set explored-zone colour with exred, exgreen, exblue.fixed: keeps fractional exred, exgreen and exblue (the original truncates them to integers)
lightsboost1: replace the light-strength constant with newlightsvalue.same
mainmenuweather1: set weather type 2 at strength 40. 2: skip menu weather. 0 leaves the game’s weather unchanged.same
drawvisiblepatch1: zone entry no longer resets the draw-visible setting.same
playingnewloadingscreens1: name loading movies after the zone. 2: also use gz1g in the special initial-zone movie selection. Requires matching movie assets.same
notrash1: share the speech resource path instead of requiring separate s and t folders; also change the client animation-mode timing test.same
musictimings1: wait minmusictime + random % (maxmusictime - minmusictime) between music tracks.fixed: with maxmusictime not above minmusictime, the pause is minmusictime (the original divides by zero at the first track change, or waits far too long)
newzonescpecificmusic1: zone gz12d2 uses music named gz12d2. 2: use the alternative music-name field in zones, briefings and camp and shorten music-mode setup. 3: as 2, but retain camp’s original field.same
disabledragon1: disable the quest-variable dragon response and the related flying-insect effect updates.same
noruinszoneanimation1: omit zone1’s built-in introduction script.same
dontmergegipathzones1: keep Gipat zones separate on the global map.same
newallodsacks1: add environment flags for zones named jigran, neloya, eyn, bebesh, kvatokh, nokks, umoir, yazes, yiul.same
newcounters1: narrow the regeneration counter to one byte.same
nogameoveronleadersdeath1: the leader’s death does not end the game; revival must be supplied by scripts.same
hiddenzonesexits1: subtract player 0’s Exits from exit count. 2+: replace exit count with Exits; absent/zero means no exits.same
segmentsonexitenter1: cap zone-transition segments at maxsegments, add addsegments, and use exitenteractivityradius for activity radius.same
bigmapspatch1: change network position scaling for larger maps; all peers need compatible encoding.same
ultrafixes1: skip network objects without the companion needed to send them.same
expirementalfxes1: change unit sorting. 2: mask loaded IDs to 16 bits and fix load-loop initialization. 3: combine 1/2. 4: mask IDs, change sorting, bypass the first load-section count check. 5: change sorting and zero load-loop initialization. 6: bypass three load-section checks. 7: bound load-loop iterations. 8: combine 1/7. 9: no change. 10: bound the loop, change unit sorting, add null guards in hostility/sight, and change drawing/removal paths.same
importantalerts1+: show the starter’s configured mod path in a modal box; without it, the fallback box has no useful path.same
versionalerts1: warn about unknown lowercase .asi files in the game folder. Known names: EI_Plugin.asi, mp3dec.asi, SpellAddonX.asi, SpellAddonXa.asi. Does not warn about the built-in SpellAddon.does not warn about the built-in SpellAddon itself

Script interfaces

These options change existing commands/functions, including their argument lists. Update the mod’s scripts together with its INI. Defaults are 0. Except where shown otherwise, the active value is 1 and the section is [gameplay]. Numbers used as integer indices, styles or IDs are rounded with the game’s floating-point rounding mode.

KeyInterface and effecteix
[speed] gsgetvarGSGetVar(player, name) returns difficulty for names beginning Diff, and update period when characters 4-7 (zero-based) are peed, such as SetSpeed.fixed: reads the variable’s name before freeing it
[speed] gssetvarGSSetVar(player, name, value) also sets update period for names with peed at characters 4-7. The named variable is still stored normally.same
[saves] savecontrol1, 2: player 0’s Save!=0 blocks escape-menu and keyboard saves. GSSetVar(0, "Save", 0) allows them.fixed: reads player 0’s “Save” without corrupting the stack
autorunmobfile1+: append loading of Maps/AutoRunSpellAddon123.mob to each zone’s start script. newspells=1/2 also enables this.skipped with a warning when newspells is 1 or 2 (the original writes the same change twice)
infiniteaddmobspawn1+: AddMob can load the same file repeatedly, except case-sensitive names beginning Auto, which still load once.same
standtransStand(unit) also revives it. A non-unit argument causes no revival.fixed: does nothing for an argument that is not a unit (the original crashes)
waslootedtrans1: WasLooted(unit) returns the full flag word. 2: WasLooted(unit, bit) returns the selected bit. Known bits: 15 moving, 19 knocked out, 20 looted, 24 stunned, 28 feebleminded.same
castscripttrans1: Cast(unit, x, y, spell) uses the numbered spell. 2: Cast(unit, x, y, spell, target) casts on target if present, otherwise at the point.fixed: 2 reads its target from the running command (the original: a stale value)
castspellunittransCastSpellUnit(spell, x, y, target, caster) adds a caster unit to the named-spell command.same
castspellpointtransCastSpellPoint(spell, x, y, x2, y2, caster) adds a caster unit to the named-spell command.same
giveunitspelltransGiveUnitSpell creates/adds a quick item instead of a spell, using the existing unit/name arguments.same
hptransHP(unit, index) reads a float by index from the unit’s vitals companion; valid indices 0..29. The useful fields are listed below.same
mptransMana(unit, index) reads a float from unit stats, indices 0..448; invalid objects/controllers/indices return 0. Also adds the index argument to HP, without changing its reader unless hptrans=1.same
legendaryspellsystemMaxHP(unit, index) reads a byte starting at the skill-byte area, indices 0..631; outside it returns 0. GiveQuestItem(unit, value) writes byte 10 of that area. Also changes MaxMana to seven numeric arguments, but supplies no working path-query implementation.fixed: MaxHP stays inside the unit (the original reads any address)
getplayertransGetPlayer(unit, index) reads a 32-bit integer at four times the index within the unit (0..310); returns 0 outside it.fixed: returns 0 outside the unit (the original reads any address)
setplayertransSetPlayer(unit, value, field) writes a rounded 32-bit integer at four times field within the unit (0..310). Fields 132..148 retain the game’s normal player-setting path; out-of-unit writes are ignored.fixed: stores nothing outside the unit (the original writes any address)
groupseetransGroupSee(group, mode) accepts an extra numeric mode argument; group traversal itself remains the game’s.same
unitseetransUnitSee(unit, mode) selects the visibility list: positive zero = visible living units; negative sign bit (including negative zero) = the second list; other values = the nearby-units list.same
getaiclasstransGetAIClass(unit) reads the server controller’s AI-class field.same
runtransRun(unit, style) sets the requested movement style instead of always selecting run.same
crawltransCrawl(unit, slot) requests a weapon slot instead of setting crawl style.same
killunittransKillUnit(type, strength) sets weather with two rounded numbers instead of killing a unit.same
fixworldtimetransFixWorldTime(time, speed) adds an explicit time-speed argument.same
movetoobjecttrans1: MoveToObject(unit, target) performs thieving while walking. 2: run instead. 3+: MoveToObject(unit, target, skill, unused, run, slot) supplies four numbers for the thieving order.same
playmusictrans1, 2: PlayMusic(player, "0") or "1" re-selects the local map’s music theme and sets the music system’s level to the digit. The first character selects this behavior. 1 uses the map’s theme, 2 its alternative name field. Other text, or no map/music system, uses normal handling.fixed: without a map or a music system, does what the game does (the original crashes)
notifydeaths1: a death sets player 0’s variable named by the victim ID to 1. 2: set 2 for a hero killer, otherwise 1.same
notifylootings1: increase the corpse-ID variable by 20 for a hero looter, 10 otherwise. 2: a hero looter’s ID goes into the corpse-ID variable. 3: the corpse ID goes into the hero looter’s ID variable. Variables belong to player 0.same
genocideincvars1, 3: player 0’s Hits counts hero hits on non-heroes. 2 is skipped; 1/3 are skipped with genocidedipvars set.2 skipped, and 1 or 3 with genocidedipvars=2 (reads garbage as objects); 1 or 3 skipped with a warning when genocidedipvars is 1, 3, 4 or 5, which replaces its change (the original writes it unused)
genocidedipvars1: Hits holds the last non-hero victim’s side when hit by a hero. 2: Kils holds that side on a hero kill. 3: both. 4: Hits records any ownerless victim’s side; Kils records ownerless victims killed by owned units. 5: both require an owned attacker and ownerless victim. Replaces genocideincvars.same
removefrozenvarZone 6 ignores its frozen/unique-zone restriction on entry.same
freemultiplayervarsSkip the built-in multiplayer variables in trader creation and journal refresh.same
setspellaggressiontransNo change for any value; the command itself remains inactive.same
[tech] scriptchecking1-7: append script errors to SAlog.txt. 2, 4-7 also log mob loads. 1/2 do not record errors in the script. 3/4/6/7 return nonzero from error handling. 5 permits eight script-load errors to pass. 8+ are skipped.8 and up skipped (calls code the original never wrote); 1 and 2 write the line where the original crashes at the first script error
[tech] drawunitsidsPrefix the unit-info name with its ID; truncate to 255 bytes. Safe with no selected unit.fixed: works without a unit (the original crashes); lines cut at 255 bytes

Loot and death notifications and genocide take IDs of at least one billion as heroes and lower IDs as non-heroes (the original’s death and genocide tests take IDs strictly above one billion).

With newspells=1..3, spell types 44-48 publish S0e (strength), S1d (duration), S2t (type), S3x/S4y (point) on the first server player; scripts can read them with GSGetVar. They give the caster hostile mask 29 and side round(strength * 32). Mode 1 also gives spell 49’s caster mask/side 29. These hooks expose script inputs; they do not supply a summoning script or mod assets.

Indexed stat readers

HP indices: 10 current HP, 11 maximum HP; 13 current mana, 14 maximum mana, 15 mana regeneration. Resistance uses base/current pairs: 16/17 piercing, 18/19 slashing, 20/21 crushing, 22/23 fire, 24/25 acid, 26/27 lightning, 28/29 general.

Mana reads the underlying float fields. Do not treat packed flags or skill bytes as ordinary numeric stats.

IndicesMana(unit, index) field
1, 2Total and spent experience.
3/4, 5/6, 7/8Natural/total strength, dexterity, intelligence.
9/10, 11/12Natural/total movement and action coefficients.
13-16Run, walk, crawl, lie speeds.
17Vision arc.
20/21Current/maximum load.
28-32Natural reach, attack, attack spread, defence, speed.
33/34/35Natural damage, damage spread, attack interval.
36-42Natural damage weights, in damage-type order 0..6.
44/45Base/current sight range.
56/57, 62/63Base/current visibility and loudness.
125/126/127/128Head HP/max HP/HP share/damage scale.
186/187/188/189Body HP/max HP/HP share/damage scale.
247/248/249/250, 308/309/310/311Left/right arm HP/max HP/HP share/damage scale.
369/370/371/372, 430/431/432/433Left/right leg HP/max HP/HP share/damage scale.
71 + 61*p + 18*l + tArmour absorption: part p = 0..5, layer l = 0..2, damage type t = 0..6.
447, 448Fixed maximum HP and pending experience.

Parameters

Each row gives the default and the feature that uses it. F = floating-point; I = 32-bit integer; B = byte. Unless stated otherwise, these are [gameplay] keys. Bounds and spell-ID lists below describe meaningful values; values outside them can select unrelated fields or unsupported game data.

Progression, speed and presentation

SectionKey(s)Default(s)TypeUse
skillsskills0Bextendedskills: non-stealing skill cap.
stealingstealing0Bextendedstealing: stealing cap.
rebalanceenginepow, mul, add1.1, 4.5, 0.5Frewriteskillscounting: exponential base, multiplier, addition.
rebalanceenginemullvla, addlvla, divlvla, addlvlb4.5, 1.5, 245.5, 0.5Frewriteherolevelcounting: level formula.
rebalanceenginerunconst, runconstex0.006666666666, 0.5Frewriterunabilitytime/newrunsystem: drain coefficient and extra drain.
rebalanceenginebsbase300Ibackstabvisualbase: displayed percent.
speednormal, fast55, 27Irewritespeed: clock periods.
speednormalkey, fastkey55, 27Irewritespeedkey: keyboard periods; the game’s own are 55 and 27 (the original’s built-in normalkey is 5).
speednormal155Irewriteotherspeed 1/2: close/reset period.
speednormal2, fast255, 27Brewriteotherspeed 1/3: initial clock periods.
speedpause, pausekey0, 0Idisablepause/disablepausekey: replacement periods.
animationsspeedattackspeed, castspeed, hitspeed, deathspeed, specialspeed, idlespeedAll 1Frewriteactionsspeed: attack, cast, hit reaction, death, special, idle animation factors.
gameplayexpforint1.0245Fchangeexpforint: experience factor per intelligence point.
gameplayactionsmul, actionsadd0.2, 10.0Factionspatch: dexterity multiplier and action addition.
gameplayactmovemul, dexmovemul0.5, 0.01Factionsdexteritymovespeed: actions/dexterity contributions.
gameplayspeedbase, speedadd0.3, 5.0Fspeedboost: exponent and counter addition.
gameplayparammin, parammax, balance15.0, 35.0, 75.0Fextendedparams=2: attribute bounds and displayed balance; sum enforcement is bypassed.
gameplayperssize1.2Frewriteperssize: hero preview scale.
gameplayframex, framey75.0, 175.0Fallodsinfo: frame width/height; integer parts also size text rectangles.
gameplaymeter15.0Fmeterscale: ruler factor.
gameplaynewlightsvalue0.001Flightsboost: light strength.
gameplayexred, exgreen, exblueAll 0.5Fexploredcolors: RGB components; normally 0..1.
fontsnewfont1, newfont2, newfont3, newfont4All Times New RomanTextchangefont: four interface font families.
fontsnewfont5Times New RomanTextchangefont=2: font-file name relative to the INI folder, not a family name.

Combat, shops and load

Key(s)Default(s)TypeUse
divmod, submod100, 1Fnewattackdefence: divisor/base for modes 1/2; multiplier/floor for 3/4.
str, dex, int100.0012, 100.0013, 100.0014Fdamageboost: strength/dexterity/intelligence scaling; divisors in mode 1, multipliers in 2/4/5, unused in 3.
strhp, strdmg, strweight0.005, 0.003, 12.0Fstrengthstats: strength coefficients.
weight, range20.0, 10.0Fchangeweightrangebonuses: weapon-weight and distance constants.
bodypartbreakmodifier4Funbreakablebodyparts: replace the limb-damage floor constant (normally -5).
headmod, legmod, handmod3, 1, 1Frandomlessaimedhits: head/leg/arm score weights.
criticalmod2Frandomlessaimedhits: boost a head score reaching full head HP, and leg scores at ranged reach.
healthdowntoignore10.25Frandomlessaimedhits: ignore non-body parts when current HP times this value is below maximum HP.
rangeddistance5.65Frandomlessaimedhits: reach threshold for boosting leg scores.
bodypart1Irandomlessaimedhits: fallback part; 0 head, 1 body, 2/3 arms, 4/5 legs.
checkhero1Irandomlessaimedhits 5-9: nonzero makes player-owned attackers use bodypart instead of the chooser.
tohitcheck1Bincreasinghitchance: miss count must exceed this.
tohitsub, tohitmul0.0, 5.5Fincreasinghitchance: subtraction and counter multiplier.
hitdistmul, hitdistadd2.0, 5.0Frunawaydistcontrol: reach multiplier/addition.
nightmeleeadd, nightmeleemul1.0, 1.0Fnightpower=2: night-factor base and slope.
maxcountofmerc27Iextendedmerc: limit uses the low byte; full value controls the >50 draw-range condition (with extendedmerc 16+ and saveall=32).
minsweapons, maxsweapons1, 10Bshopsnewnormalchanges: weapon stock range.
minsarmors, maxsarmors1, 10Bshopsnewnormalchanges: armour stock range.
minswands, maxswands1, 10Bshopsnewnormalchanges: wand stock range.
minspotions, maxspotions20, 65Bshopsnewnormalchanges: potion stock range.
minsprototypes, maxsprototypes1, 10Bshopsnewnormalchanges: prototype stock range.
minsrunes, maxsrunes20, 56Bshopsnewnormalchanges: rune stock range. Use stock counts 0..127 because the game sign-extends these bytes.
ingos, gipatz, gipatb, suslanger, jigranAll 0.5Fshopsnewnormalchanges: sell-price factors for Ingos, Gipat healer, Babur, Suslanger and Jigran. shopschanges also reads jigran when shopsnewnormalchanges=1.
liftkey1.0Fliftdebuffs: load-ratio divisor term.
encumbrancemovemul, encumbranceattackmul1.0, 1.0Fencumbrancemovespeed, encumbranceattackspeed: load penalties for movement and attack.
speedslowmovemul, defaultspeedmul, minimumspeedmulAll 1.0Fencumbrancemovespeed with speedslowremaster=2: effect multiplier, overall multiplier, minimum factor.
dmgtypescount6Idmgtypes: displayed count; the game has seven damage types (0..6).
light00 through light31All 1Fitemslightchanges: eight RGBA groups in order; 00-03 first colour, 04-07 second, through 28-31 eighth. Normally 0..1.

AI, spells and zones

Key(s)Default(s)TypeUse
visionarc-2Frewritenpcvisionarc: NPC sight-arc value.
visiondependence1.05Faggrmod 2/4/5/6/7: NPC vision-distance factor.
aggrrangemulmodifier4Faggrmod=1 stores it but does not use it.
losehardcore100000Iaggrmod=2: random modulus. 6/7: counter limit uses only 16 bits (default becomes 34464).
losefactor1, losefactor215, 5Iaggrmod 4/5: time divisor multiplier and right-shift count. 6/7: distance multiplier and level-divisor addition.
losefactor3, difffactor, maxadd5, 2, 2Iaggrmod 6/7: distance addition, difficulty addition, quotient threshold. These and losefactor1/2 use signed low bytes in 6/7.
follow0INonzero lets units continue towards a lost enemy’s position in active aggrmod modes.
improve0INonzero requests the faulty alarm hook in aggrmod 6/7; eix omits it and warns.
loseallyfast0INonzero in aggrmod 6/7 bypasses the counter for units not classed as enemies.
sametarget, magicattack, damagemult, magicdamagemult, savedamagemult, rangecost, kickpriceAll 10.0Fspellsprioritys: same-target bias, magic bias, weapon/spell/healing priorities, casting-distance cost, quick-kill target factor.
safetymuldist, maxvisibilitymul2.0, 3.0Fnewplayersafetyconditions: safety distance and visibility factors.
fearsafetydist, legsdamagedmul10.0, 0.6Ffearpatch: retreat distance and damaged-leg threshold.
runtosoundsmul, randsoundfactor1.0, 1.0Fhearingreactionspatch=2: extrapolation from sound position and random scatter factor.
visionweathermul0.9Fvisioninweather: bad-weather vision factor.
visionevening, visionnight, visionmorning, visionday18.0, 22.0, 4.0, 8.0Fnightpowervisionpatch: hours for dusk/full night/dawn/full day.
visionmulpowbetween0.250Fnightpowervisionpatch: night-level ramp slope per hour.
astralbeam, destroyray, firearrow, lightningbeam5, 3, 3, 5Blastspellsdamagetype: 0 piercing, 1 slashing, 2 crushing, 3 fire, 4 acid, 5 lightning, 6 general.
slownessmultiplier, weaknessmultiplier12, 0.5Fcontrolmagic=1: resistance scaling for Slow and Weaken.
durcoeff, effcoeff, lvldurcoeffAll 0.03FRead but no active duration/effect formula consumes them; lvldurcoeff is stored by some controlmagic modes.
mul3, pow31.0, 1.0FRead but unused by the built-in features.
frequencyvalue0Bwallsfrequency: ticks per damage event; set a meaningful positive period.
firepercentagevalue, lightningpercentagevalue, acidpercentagevalueAll 0.1Fwallspercentage: fire, lightning and acid wall fractions.
stenchmul, regenerationmul, speedslowmul, strengthweakmulAll 0.1FRespective Stench, Regeneration, Speed/Slow and Strengthen/Weaken remasters.
tordmg5.0Ftornadochanges: damage per tornado hit.
fireboom5.0Fchangesounds: Fireball volume factor.
minmusictime, maxmusictime120000, 180000Imusictimings: minimum and exclusive upper delay in milliseconds.
maxsegments, addsegments1000, 0Isegmentsonexitenter: segment cap and addition.
exitenteractivityradius70.0Fsegmentsonexitenter: transition activity radius.

Per-spell bonuses - [gameplay]

Each switch defaults to 0 (B); each bonus defaults to 0.0 (F). controlmagic=3 applies the bonus only when the switch is odd. Modes 2/5/7 apply all bonuses. effectredraws=1 displays all bonuses regardless of these switches.

SpellSwitchBonus
Protection from Fireprot_firebprot_fire
Protection from Lightningprot_electrobprot_electro
Protection from Acidprot_acidbprot_acid
Eagle Sighteagle_sightbeagle_sight
Night Visioninfravisionbinfravision
Detect Lifedetect_lifebdetect_life
Invisibilityinvisibilitybinvisibility
Silencesilencebsilence
Lichdomlichdomblichdom
Stenchstenchbstench
Stunstunbstun
Antimagicantimagicbantimagic
Strengthenstrengthbstrength
Weakenweakbweak
Regenerationregenerationbregeneration
Feeblemindfeeblemindbfeeblemind
Speedspeedbspeed
Slowslowbslow
Enlargeenlargebenlarge
Shrinkshrinkbshrink
Necronecrobnecro
Destroydestroybdestroy

Spell AI table entries

SectionKeysDefaultAccepted meaning
aicastertable0 through 53All 8B; 0 missile, 1 area attack, 2 lasting area attack, 3 out-of-combat buff, 4 combat buff, 5 unused, 6 healing, 7 debuff, 8 unused. Used with rebuildedaicastertable=1; with newbigtables=1, key n no longer classifies spell type n.
aioffendtable0 through 37All 8B; 0 harmful, 1 friendly. Set meaningful entries before enabling rebuildedaioffendtable=1; the default 8 is not a normal classification.

Read-only placeholders - [gameplay]

These switches default to 0 and have no feature of their own. Changing them has no effect in the built-in version.

Key(s)Status
enemysmanaRead only; use npcsmana for the implemented mana rules.
newspells_fireraze, newspells_inspircharm, newspells_spellsmachine, newspells_invislichdRead only; newspells controls the implemented spell extensions.
hideobjecttrans, stableaggrmod, helloworld, castspellpatchRead only; no command/AI change.
newallodsinmulti, autocastsRead only; no allod-selection or automatic-casting feature.
walktrans, lietrans, resttrans, getleadertrans, inflictdamagetrans, isunitblockedtrans, setplayeraggressiontransRead only; the named script interfaces retain their existing behavior.