Json object with data common for all levels can be put here. These configuration parameters will be default for all levels. All mandatory level fields become optional if they equal "base" configuration.
-`caster spell school` is assumed spell school level for the spell. For unit this is value of [SPELLCASTER](../bonus/Bonus_Types.md#spellcaster) bonus. For hero this is value of [MAGIC_SCHOOL_SKILL](../bonus/Bonus_Types.md#magic_school_skill) or [SPELL](../bonus/Bonus_Types.md#spell) bonus, whichever is greater
If unit has [SPECIFIC_SPELL_POWER](../bonus/Bonus_Types.md#specific_spell_power) bonus for corresponding spell, game will use value of the bonus instead
To restrict spell from casting it on "wrong" side in combat, you can use `smart` target modifier. If this flag is set, and spell has `positive` flag, it can only affect friendly units. Similarly, spells with `negative` flag and `smart` target modifier can only affect enemies. This affects both primary targets and any secondary targets in case of area of effect or massive spells.
This spell can only be used when attacking a town with existing, non-destroyed walls. Can be also cast by defender, unless spell uses "smart" targeting
Casting the spell on location with wall will deal 0-2 damage to the walls or towers, depending on spell configuration.
Casting the spell with "massive" target will randomly pick selected number of target using logic similar to H3
Target with [SPELL_DAMAGE_REDUCTION](../bonus/Bonus_Types.md#spell_damage_reduction) bonus with value greater than 100% for any of spell school of the spell are immune to this effect
Effect restores [spell effect power](#spell-power) health points of affected unit. Can only be cast on unit that is not a clone and have lost some health points in the battle.
If parameter `minFullUnits` is non-zero, spell can only be cast if it will at least heal enough health points to fully restore health of specified number of units. For example, a single Archangel can only use Resurrection on units with 100 health points or lower
Amount of summoned units is equal to [spell effect power](#spell-power). Summoned units will disappear after combat, unless `permanent` flag in effect config is set
If `summonByHealth` option is set, then number of summoned units will be equal to [spell effect power](#spell-power) / unit health. Hero need to be able to summon at least one full unit for spell to work
if `summonSameUnit` flag is set, and same creature was already summoned before, spell will instead heal unit in "overheal" mode, using same [spell effect power](#spell-power).
Implements Pit Lord's ability with the same name. Raises targeted dead unit as unit specified in spell parameters on casters side. New unit will be placed on the same position as corpse, and corpse will be removed from the battlefield
Raised amount of units is limited by (rounded down):
- Hero: Spellpower + value of [SPELL_DURATION](../bonus/Bonus_Types.md#spell_duration) + [SPELL_DURATION](../bonus/Bonus_Types.md#spell_duration) for specific spell
- Units: value of [CREATURE_ENCHANT_POWER](../bonus/Bonus_Types.md#creature_enchant_power), or 3 if no such bonus
Currently, VCMI does not allow completely new spell effects for adventure maps. However, it is possible to:
- modify the parameters of all H3 spells.
- create spells with similar effects to H3 spells
- create a spell that gives bonuses to the hero who cast the spell.
Unlike combat effects, adventure map spells can only have one special effect, such as the Dimension Door or Town Portal effect. The number of bonuses granted by an adventure map spell is unlimited.
The AI has a limited understanding of adventure map spells and may use the following spells:
- Spells that give WATER_WALKING or FLYING_MOVEMENT bonuses
- Spells with the Summon Boat effect, provided the spell can create new boats with a 100% success chance.
- Any spells with the Town Portal effect.
### Common format
All properties in this section can be used for all non-generic adventure map spell effects.
Parameters:
-`type` - the type of spell effect used for this spell, or `generic` if a custom mechanic is not used.
-`castsPerDay` - Optional. Defines how many times a hero can cast this spell per day; set to zero or omitted for unlimited use.
-`castsPerDayXL` - Optional. An alternative cast-per-day limit that is only active on maps that are at least XL+U in size. If this value is not set or is set to zero, the game will use the value of the `castsPerDay` variable.
-`bonuses` - A list of bonuses that will be given to the hero when this spell is cast successfully. When used with effects that can fail (e.g. Summon Boat), the bonuses will only apply to a successful cast.
Example:
```json
"adventureEffect" : {
"type" : "generic",
"castsPerDay" : 0,
"castsPerDayXL" : 0,
"bonuses" : {
"fly" : {
"type" : "FLYING_MOVEMENT",
"duration" : "ONE_DAY",
"val" : 40,
"valueType" : "INDEPENDENT_MIN"
}
}
}
```
### Dimension Door
The effect instantly teleports the hero to the selected location.
Parameters:
The effect instantly teleports the hero to the selected location.
-`movementPointsRequired` - The amount of movement points the hero must have to cast this spell.
-`movementPointsTaken` - The amount of movement points that will be taken if the spell is cast successfully. If the hero does not have enough movement points, they will be reduced to zero after casting.
-`waterLandFailureTakesPoints` - If set to true, mana and movement points will be spent on an attempt to teleport to an inaccessible location (e.g. teleporting to land while in a boat).
-`cursor` - Identifier of the cursor that will be shown when hovering over a valid destination tile. See `config/cursors.json` for more details.
-`cursorGuarded` - alternative cursor that appears if using the teleport spell on a target would result in combat. This is only used if the game rule 'dimensionDoorTriggersGuards' is active.
-`exposeFow` - If this is set to true, using this spell will reveal information behind fog of war, such as whether teleportation is possible or if the location is guarded.
-`ignoreFow` - If this is set to true, it is possible to use the spell to teleport into terra incognita.
-`rangeX` - maximum distance to teleport in the X dimension (left-right axis).
-`rangeY` - maximum distance to teleport in the Y dimension (top-bottom axis).
Example:
```json
"adventureEffect" : {
"type" : "dimensionDoor",
"movementPointsRequired" : 0,
"movementPointsTaken" : 300,
"waterLandFailureTakesPoints" : true,
"cursor" : "mapDimensionDoor",
"cursorGuarded" : "mapTurn1Attack",
"castsPerDay" : 2,
"rangeX" : 9,
"rangeY" : 8,
"ignoreFow" : true,
"exposeFow" : true
}
```
### Remove Object
The effect completely removes the targeted object from the map. The Scuttle Boat spell is an example of this effect.
Parameters:
-`objects` - a list of map objects that can be removed by this spell.
-`cursor` - identifier of the cursor that will be displayed when hovering over a valid target object. See `config/cursors.json` for more details.
-`ignoreFow` - If set to true, it is possible to use this spell to remove objects behind terra incognita.
-`rangeX` - maximum distance to remove objects in the X dimension (left-right axis).
-`rangeY` - maximum distance to remove objects in the Y dimension (top-bottom axis).
Example:
```json
"adventureEffect" : {
"type" : "removeObject",
"castsPerDay" : 0,
"cursor" : "mapScuttleBoat",
"rangeX" : 9,
"rangeY" : 8,
"ignoreFow" : false,
"objects" : {
"boat" : true
}
}
```
### Summon Boat
The effect moves or creates a boat next to the hero who cast the spell. The success chance is defined as [spell effect power](#spell-power).
Parameters:
-`useExistingBoat` - If this is set to true, the spell can move existing boats to the hero's location.
-`createdBoat` - Optional identifier of the boat type that can be created by this spell. If this is not set, the spell cannot create new boats.
Note that if the spell can both create new boats and use existing ones, it would prefer to move existing boats and only create new ones if there are no suitable ones to move.
Example:
```json
"adventureEffect" : {
"type" : "summonBoat",
"castsPerDay" : 0,
"useExistingBoat" : true,
"createdBoat" : "boatNecropolis"
}
```
### Town Portal
Effect moves hero to a location of owned or allied town.
Parameters:
-`movementPointsRequired` - amount of movement points that hero must have to cast this spell
-`movementPointsTaken` - amount of movement points that will be taken on sucessful cast of the spell. If hero does not have enough movement points, they will be reduced to zero after cast
-`allowTownSelection` - if set to true, player will be able to select town to teleport to among all friendly non-occupied towns.
-`skipOccupiedTowns` - if set to true, hero will teleport to nearest non-occupied town, ignoring any closer towns that are occupied by a visiting hero. No effect if `allowTownSelection` is set.
Example:
```json
"adventureEffect" : {
"type" : "townPortal",
"castsPerDay" : 2,
"allowTownSelection" : false,
"skipOccupiedTowns" : false,
"movementPointsRequired" : 300,
"movementPointsTaken" : 300
}
```
### View World
Effect shows World View menu with specified objects behind FoW revealed to the player
Parameters:
-`objects` - list of object types that will be revealed on World View. Note that only following objects have assotiated icon, any objects not from this list will not be visible: `resource`, `mine`, `abandonedMine`, `artifact`, `hero`, `town`.
-`showTerrain` - if set to true, terrain of the entire map (but not objects on it) will be revealed to the player.