# Spell Format ## Main format ```json { "spellName": { // Allowed values: "adventure", "combat", "ability" // adventure spells can only be cast by hero on adventure map // combat spells can be cast by hero or by creatures during combat // ability-type spells can not be rolled in town mage guild // learned by hero and can only be used by creatures "type": "adventure", // Mandatory. Spell target type // "NO_TARGET" - instant cast no aiming (e.g. Armageddon) // "CREATURE" - target is unit (e.g. Resurrection) // "OBSTACLE" - target is obstacle (e.g. Remove Obstacle) // "LOCATION" - target is location (e.g. Fire Wall) "targetType":"NO_TARGET", // Localizable name of this spell "name": "Localizable name", // List of spell schools this spell belongs to. Require for spells other than abilities "school": {"air":true, "earth":true, "fire":true, "water":true}, // Spell level, value in range 1-5, or 0 for abilities "level": 1, // Base power of the spell. To see how it affects spell, // see description of corresponding battle effect(s) "power": 10, // Default chance for this spell to appear in Mage Guilds // Used only if chance for a faction is not set in gainChance field "defaultGainChance": 0, // Chance for this spell to appear in Mage Guild of a specific faction // Symmetric property of "guildSpells" property in towns /// Identifier without modID specifier MUST exist in base game or in one of dependencies /// Identifier with explicit modID specifier will be silently skipped if corresponding mod is not loaded "gainChance": { "factionName" : 3, "modID:anotherFactionName" : 5 }, "animation":{}, // List of spells that will be countered by this spell // If unit is affected by any spells from this list, // then casting this spell will remove effect of countered spell "counters": { "spellID" : true, ... }, // List of flags that describe this spell // positive - this spell is positive to target (buff) and can target allies // negative - this spell is negative to target (debuff) and can target enemies // indifferent - spell is neither positive, nor negative // damage - spell does damage (direct or indirect). // If set, AI will avoid obstacles with such effect, and spellbook popup will also list damage of the spell // offensive - (Deprecated?) direct damage (implicitly sets damage and negative) // rising - (Deprecated?) rising spell (implicitly sets positive) // special - this spell can not be present in mage guild, or leared by hero, and can only be received explicitly, e.g. from bonus SPELL // nonMagical - this spell is not affected by Sorcery or magic resistance. School resistances (if any) apply. "flags" : { "positive": true, }, // If true, then creature capable of casting this spell can cast this spell on itself // If false, then creature can only cast this spell on other units "canCastOnSelf" : false, // If true, then creature capable of casting this spell can cast this spell only on itself "canCastOnlyOnSelf" : false, // If true the creature will not skip the turn after casting a spell "canCastWithoutSkip": false, // If true, spell won't be available on a map without water "onlyOnWaterMap" : true, //TODO: DEPRECATED | optional| no default | flags structure of bonus names,any one of these bonus grants immunity. Negatable by the Orb. "immunity": {"BONUS_NAME":true, ...}, //TODO: DEPRECATED | optional| no default | flags structure of bonus names //any one of these bonus grants immunity, cant be negated "absoluteImmunity": {"BONUS_NAME": true, ...}, //TODO: DEPRECATED | optional| no default | flags structure of bonus names, presence of all bonuses required to be affected by. Negatable by the Orb. "limit": {"BONUS_NAME": true, ...}, //TODO: DEPRECATED | optional| no default | flags structure of bonus names, presence of all bonuses required to be affected by. Cant be negated "absoluteLimit": {"BONUS_NAME": true, ...}, //TODO: optional | default no limit no immunity // "targetCondition" { //at least one required to be affected "anyOf" : { //generic format "mod:metaClassName.typeName":"absolute",//"normal", null or empty ignored - use for overrides }, //all required to be affected (like [absolute]limit) "allOf" : { //bonus type format "bonus.BONUS_TYPE":"absolute"//"normal" Short bonus type format "modId:bonus.bonusTypeName":"absolute"//"normal" Future bonus format for configurable bonuses }, //at least one grants immunity (like [absolute]immunity) "noneOf": { //some more examples "core:creature.imp":"absolute", //[to be in initial version] this creature explicitly absolutely immune "core:bonus.MIND_IMMUITY":"normal", // [to be in initial version] new format of existing mind spell immunity "core:artifact.armorOfWonder":"absolute", //[possible future extension] this artifact on target itself (!) explicitly grant absolute immune "core:luck":["absolute", 3], // [possible future extension] lack value of at least 3 grant absolute immunity from this horrible spell "core:custom":[