2024-07-16 20:29:20 +02:00
# Spell Format
2024-06-04 22:21:39 +02:00
## Main format
2023-08-12 11:39:44 +02:00
``` javascript
{
"spellName":
2023-09-23 18:21:12 +02:00
{
// Mandatory. Spell type
// Allowed values: "adventure", "combat", "ability"
"type": "adventure",
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
// 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
2023-08-12 11:39:44 +02:00
"name": "Localizable name",
2023-09-23 18:21:12 +02:00
// Mandatory. List of spell schools this spell belongs to
2023-08-12 11:39:44 +02:00
"school": {"air":true, "earth":true, "fire":true, "water":true},
2023-09-23 18:21:12 +02:00
// Mandatory. Spell level, value in range 1-5, or 0 for abilities
2023-08-12 11:39:44 +02:00
"level": 1,
2023-09-23 18:21:12 +02:00
// Mandatory. Base power of the spell
2023-08-12 11:39:44 +02:00
"power": 10,
2023-09-23 18:21:12 +02:00
// Mandatory. Default chance for this spell to appear in Mage Guilds
// Used only if chance for a faction is not set in gainChance field
2023-08-12 11:39:44 +02:00
"defaultGainChance": 0,
2023-09-23 18:21:12 +02:00
// Chance for this spell to appear in Mage Guild of a specific faction
// Symmetric property of "guildSpells" property in towns
2023-08-12 11:39:44 +02:00
"gainChance":
{
2023-09-23 18:21:12 +02:00
"factionName" : 3
2023-08-12 11:39:44 +02:00
},
2023-09-23 18:21:12 +02:00
2023-08-12 11:39:44 +02:00
"animation":{< Animation format > },
2023-09-23 18:21:12 +02:00
// List of spells that will be countered by this spell
"counters": {
"spellID" : true,
...
},
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
//Mandatory. List of flags that describe this spell
// positive - this spell is positive to target (buff)
// negative - this spell is negative to target (debuff)
// indifferent - spell is neither positive, nor negative
// damage - spell does damage (direct or indirect)
// offensive - direct damage (implicitly sets damage and negative)
// rising - rising spell (implicitly sets positive)
// special - this spell is normally unavailable and can only be received explicitly, e.g. from bonus SPELL
// nonMagical - this spell is not affected by Sorcery or magic resistance. School resistances apply.
"flags" : {
"positive": true,
},
2024-01-16 15:01:42 +02:00
// 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,
2024-09-14 14:49:52 +02:00
// If true the creature will not skip the turn after casting a spell
"canCastWithoutSkip": false,
2024-01-16 15:01:42 +02:00
2023-09-23 18:21:12 +02:00
// If true, spell won't be available on a map without water
"onlyOnWaterMap" : true,
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
//TODO: DEPRECATED | optional| no default | flags structure of bonus names,any one of these bonus grants immunity. Negatable by the Orb.
2023-08-12 11:39:44 +02:00
"immunity": {"BONUS_NAME":true, ...},
2023-09-23 18:21:12 +02:00
//TODO: DEPRECATED | optional| no default | flags structure of bonus names
2023-08-12 11:39:44 +02:00
//any one of these bonus grants immunity, cant be negated
"absoluteImmunity": {"BONUS_NAME": true, ...},
2023-09-23 18:21:12 +02:00
//TODO: DEPRECATED | optional| no default | flags structure of bonus names, presence of all bonuses required to be affected by. Negatable by the Orb.
2023-08-12 11:39:44 +02:00
"limit": {"BONUS_NAME": true, ...},
2023-09-23 18:21:12 +02:00
//TODO: DEPRECATED | optional| no default | flags structure of bonus names, presence of all bonuses required to be affected by. Cant be negated
2023-08-12 11:39:44 +02:00
"absoluteLimit": {"BONUS_NAME": true, ...},
2023-09-23 18:21:12 +02:00
//TODO: optional | default no limit no immunity
2023-08-12 11:39:44 +02:00
//
"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":[< script > ] / / [ p o s s i b l e f u t u r e e x t e n s i o n ] s c r i p t l i n e s f o r a r b i t r a r y c o n d i t i o n
}
}
"graphics":
{
2023-09-23 18:21:12 +02:00
// resource path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)
2023-08-12 11:39:44 +02:00
"iconImmune":"ZVS/LIB1.RES/E_SPMET",
2023-09-23 18:21:12 +02:00
// resource path of icon for scenario bonus
2023-08-12 11:39:44 +02:00
"iconScenarioBonus": "MYSPELL_B",
2023-09-23 18:21:12 +02:00
// resource path of icon for spell effects during battle
2023-08-12 11:39:44 +02:00
"iconEffect": "MYSPELL_E",
2023-09-23 18:21:12 +02:00
// resource path of icon for spellbook
2023-08-12 11:39:44 +02:00
"iconBook": "MYSPELL_E",
2023-09-23 18:21:12 +02:00
// resource path of icon for spell scrolls
2023-08-12 11:39:44 +02:00
"iconScroll": "MYSPELL_E"
},
"sounds":
{
2023-09-23 18:21:12 +02:00
//Resourse path of cast sound
2023-08-12 11:39:44 +02:00
"cast":"LIGHTBLT"
},
2023-09-23 18:21:12 +02:00
// Mandatory structure
// configuration for no skill, basic, adv, expert
2023-08-12 11:39:44 +02:00
"levels":{
"base": {Spell level base format},
"none": {Spell level format},
"basic":{Spell level format},
"advanced":{Spell level format},
"expert":{Spell level format}
}
}
}
```
2024-06-04 22:21:39 +02:00
## Animation format
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
``` javascript
2023-08-12 11:39:44 +02:00
{
"projectile": [
{"minimumAngle": 0 ,"defName":"C20SPX4"},
{"minimumAngle": 0.60 ,"defName":"C20SPX3"},
{"minimumAngle": 0.90 ,"defName":"C20SPX2"},
{"minimumAngle": 1.20 ,"defName":"C20SPX1"},
{"minimumAngle": 1.50 ,"defName":"C20SPX0"}
],
2023-09-23 18:21:12 +02:00
"cast" : []
2023-08-12 11:39:44 +02:00
"hit":["C20SPX"],
"affect":[{"defName":"C03SPA0", "verticalPosition":"bottom"}, "C11SPA1"]
}
```
2024-06-04 22:21:39 +02:00
## Spell level base format
2023-08-12 11:39:44 +02:00
2023-08-25 12:02:01 +02:00
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.
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Example
2023-08-12 11:39:44 +02:00
2023-08-25 12:02:01 +02:00
This will make spell affect single target on all levels except expert, where it is massive spell.
2023-08-12 11:39:44 +02:00
``` javascript
"base":{
2023-09-23 18:21:12 +02:00
"range": 0
2023-08-12 11:39:44 +02:00
},
"expert":{
2023-09-23 18:21:12 +02:00
"range": "X"
2023-08-12 11:39:44 +02:00
}
```
2024-06-04 22:21:39 +02:00
## Spell level format
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
``` javascript
{
2023-09-23 18:21:12 +02:00
//Mandatory, localizable description. Use {xxx} for formatting
2023-08-12 11:39:44 +02:00
"description": "",
2023-09-23 18:21:12 +02:00
//Mandatory, cost in mana points
2023-08-12 11:39:44 +02:00
"cost": 1,
//Mandatory, number
"power": 10,
//Mandatory, number
"aiValue": 20,
//Mandatory, flags structure //TODO
// modifiers make sense for creature target
"targetModifier":
{
"smart": false, //true: friendly/hostile based on positiveness; false: all targets
"clearTarget": false,
"clearAffected": false,
2023-09-23 18:21:12 +02:00
},
2023-08-12 11:39:44 +02:00
//Mandatory
//spell range description in SRSL
// range "X" + smart modifier = enchanter casting, expert massive spells
// range "X" + no smart modifier = armageddon, death ripple, destroy undead
"range": "X",
//DEPRECATED, Optional, arbitrary name - bonus format map
//timed effects, overriding by name
"effects":
{
"firstEffect": {[bonus format]},
"secondEffect": {[bonus format]}
//...
},
//DEPRECATED, cumulative effects that stack while active
"cumulativeEffects":
{
"firstCumulativeEffect": {[bonus format]}
//...
},
"battleEffects":
{
"mod:firstEffect": {[effect format]},
"mod:secondEffect": {[effect format]}
//...
}
}
```
2024-06-04 22:21:39 +02:00
## Configurable battle effects
2023-08-12 11:39:44 +02:00
2023-08-25 12:02:01 +02:00
**If spell have at least one special effect it become configurable spell and spell configuration processed different way**
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Configurable spell
2023-08-12 11:39:44 +02:00
2023-08-25 12:02:01 +02:00
Configurable spells ignore *offensive* flag, *effects* and *cumulativeEffects* . For backward compatibility *offensive* flag define Damage effect, *effects* and *cumulativeEffects* define Timed effect.
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Special effect common format
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
``` javascript
"mod:effectId":{
"type":"mod:effectType", //identifier of effect type
"indirect": false, // effect will be deferred (f.e. land mine damage)
"optional": false // you can cast spell even if this effect in not applicable
//for unit target effects
"ignoreImmunity" : false,
"chainFactor" : 0.5,
"chainLength" : 4
//other fields depending on type
}
```
2024-06-04 22:21:39 +02:00
### Catapult
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
``` javascript
"mod:effectId":{
"type": "core:catapult"
"targetsToAttack": 1, //How many targets will be attacked by this
"chanceToHitKeep" : 5, //If it is a targeted spell, chances to hit keep
"chanceToHitGate" : 25, //If it is a targeted spell, chances to hit gate
"chanceToHitTower" : 10, //If it is a targeted spell, chances to hit tower
"chanceToHitWall" : 50, //If it is a targeted spell, chances to hit wall
"chanceToNormalHit" : 60, //Chance to have 1 damage to wall, used for both targeted and massive
"chanceToCrit" : 30 //Chance to have 2 damage to wall, used for both targeted and massive
}
```
2024-06-04 22:21:39 +02:00
### Clone
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
Configurable version of Clone spell.
``` javascript
"mod:effectId":{
"type": "core:clone"
"maxTier" : 3//unit tier
}
```
2024-06-04 22:21:39 +02:00
### Damage effect
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-25 12:02:01 +02:00
If effect is automatic, spell behave like offensive spell (uses power, levelPower etc)
2023-08-12 11:39:44 +02:00
``` javascript
"mod:effectId":{
"type": "core:damage",
"killByCount": false, //if true works like Death Stare
"killByPercentage" : false, //if true works like DESTRUCTION ability
//TODO: options override
}
```
2024-06-04 22:21:39 +02:00
### Dispel
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Heal
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Obstacle
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Remove obstacle
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Sacrifice
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Summon
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Teleport
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Timed
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-12 11:39:44 +02:00
If effect is automatic, spell behave like \[de\]buff spell (effect and
cumulativeEffects ignored)
``` javascript
"mod:effectId":{
"type": "core:timed",
"cumulative": false
"bonus":
{
"firstBonus":{[bonus format]}
//...
}
}
```
2024-06-04 22:21:39 +02:00
## Additional documentation
2023-08-12 11:39:44 +02:00
2024-06-04 22:21:39 +02:00
### Targets, ranges, modifiers
2023-08-12 11:39:44 +02:00
2023-09-23 18:21:12 +02:00
TODO
2023-08-25 12:02:01 +02:00
- CREATURE target (only battle spells)
- range 0: smart assumed single creature target
- range "X" + smart modifier = enchanter casting, expert massive spells
- range "X" + no smart modifier = armageddon, death ripple, destroy undead
- any other range (including chain effect)
- smart modifier: smth like cloud of confusion in H4 (if I remember correctly :) )
- no smart modifier: like inferno, fireball etc. but target only creature
- NO_TARGET
- no target selection,(abilities, most adventure spells)
- LOCATION
- any tile on map/battlefield (inferno, fireball etc.), DD also here but with special handling
- clearTarget - destination hex must be clear (unused so far)
- clearAfffected - all affected hexes must be clear (forceField, fireWall)
- OBSTACLE target
- range 0: any single obstacle
- range X: all obstacles