Difference between revisions of "Spell Format"

From VCMI Project Wiki
Jump to: navigation, search
Line 1: Line 1:
 
''Current draft. WiP.''
 
''Current draft. WiP.''
 
*{{todo}} config from sptraits
 
  
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
Line 16: Line 14:
 
//Mandatory, spell type  
 
//Mandatory, spell type  
 
"kind": "advmap",//"advmap", "combat", "ability"
 
"kind": "advmap",//"advmap", "combat", "ability"
 
//Mandatory, spell target type
 
"targetType":"NO_TARGET",//"CREATURE","CREATURE_EXPERT_MASSIVE","OBSTACLE"
 
  
 
//Mandatory
 
//Mandatory
Line 25: Line 20:
 
//Mandatory
 
//Mandatory
 
"abbname": "Localizable abbreviated name",
 
"abbname": "Localizable abbreviated name",
 
//Mandatory, localizable description, string array for levels
 
//Use {xxx} for formatting
 
"description": ["","","",""],
 
  
 
//Mandatory(?), Spell school
 
//Mandatory(?), Spell school
 
"school": ["air", "earth", "fire", "water"],
 
"school": ["air", "earth", "fire", "water"],
  
//nomber, mandatory; Spell level
+
//number, mandatory; Spell level
 
"level": 0,
 
"level": 0,
  
//Mandatory, cost for each school level
+
//Mandatory, base power
"cost": [1,2,3,4],
 
 
 
//Mandatory, power
 
 
"power": 10,
 
"power": 10,
  
//Mandatory, power for each school level
 
"levelPower": [10,20,30,50],
 
  
 
//Mandatory, chance in % to gain for faction
 
//Mandatory, chance in % to gain for faction
Line 53: Line 39:
 
},
 
},
  
"aiValue": [20,30,40,50],
 
  
 
//VCMI info
 
//VCMI info
  
//effect: -1 -> spell is negative for influenced creatures,
+
//Mandatory, string-encoded enum
//0 -> spell is indifferent for them
+
//Positiveness of spell for target
//1 -> spell is positive for them
+
"effect": "INDIFFERENT", //"NEGATIVE", "POSITIVE"
"effect": 0,
 
 
 
 
//  anim: main effect animation (AC format), -1 - none
 
//  anim: main effect animation (AC format), -1 - none
Line 66: Line 50:
 
"anim": -1,
 
"anim": -1,
 
 
//  ranges: spell range description in SRSL ([no magic] [basic] [advanced] [expert])
 
"ranges": [ "X", "X", "X", "X" ],
 
 
 
// counters: array of ids of countering spells
 
// counters: array of ids of countering spells
 
//TODO: use string ID
 
//TODO: use string ID
Line 86: Line 67:
 
"limit": ["BONUS_NAME", ...],
 
"limit": ["BONUS_NAME", ...],
  
 
+
//Optional, bonus format array
"effectsCommon": [{bonus format} ...], //for all spell levels
+
//common effects for all spell levels
"effects": [ //for particular level, merged with effectsCommon
+
"effects": [{bonus format} ...],
[{bonus format} ... ], //no skill
 
[{bonus format} ... ], //basic
 
[{bonus format} ... ], //adv
 
[{bonus format} ... ]  //expert
 
],
 
  
 
//graphics - OPTIONAL; object;
 
//graphics - OPTIONAL; object;
Line 101: Line 77:
 
//resourse path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)
 
//resourse path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)
 
"iconImmune":"ZVS/LIB1.RES/E_SPMET"
 
"iconImmune":"ZVS/LIB1.RES/E_SPMET"
}
+
},
 +
 
 +
//Mandatory 4 element array of objects
 +
//configuration for no skill, basic, adv, expert
 +
"levels":[
 +
{
 +
//Mandatory, localizable description
 +
//Use {xxx} for formatting
 +
"description": "",
 +
 
 +
 
 +
//Mandatory, number,
 +
//cost in mana points
 +
"cost": 1,
 +
 
 +
//Mandatory, number
 +
"power": 10,
 +
 
 +
//Mandatory, number
 +
"aiValue": 20,
 +
 
 +
//Mandatory, spell target type
 +
"targetType":"NO_TARGET",//"CREATURE","OBSTACLE"
 +
 +
//Mandatory
 +
//spell range description in SRSL
 +
"range": "X",
 +
 
 +
//Optional, bonus format array
 +
//timed effects
 +
"effects":
 +
[
 +
{bonus format}, ...
 +
]
 +
},
 +
{...},{...},{...}
 +
]
  
  

Revision as of 10:57, 4 March 2013

Current draft. WiP.

{
	"spells":
	{
		"spellName":
		{
			//numeric id of spell required only for original spells, prohibited for new spells
			"id": 0,

			//Original info
			
			//Mandatory, spell type 
			"kind": "advmap",//"advmap", "combat", "ability"

			//Mandatory
			"name": "Localizable name",

			//Mandatory
			"abbname": "Localizable abbreviated name",

			//Mandatory(?), Spell school 			
			"school": ["air", "earth", "fire", "water"],

			//number, mandatory; Spell level
			"level": 0,

			//Mandatory, base power
			"power": 10,


			//Mandatory, chance in % to gain for faction
			//NOTE: this field is merged with faction config
			"gainChance":
			{
				"default": 0, //by default for all factions
				"faction.first": 3 // specific faction
			},


			//VCMI info

			//Mandatory, string-encoded enum
			//Positiveness of spell for target
			"effect": "INDIFFERENT", //"NEGATIVE", "POSITIVE"
			
			//   anim: main effect animation (AC format), -1 - none
			//TODO: arbitary resourceID
			"anim": -1,
			
			//	 counters: array of ids of countering spells
			//TODO: use string ID
			"counters": [spellID, ...]

			//flags string array of:
			//		damage - spell does damage (direct or indirect)
			//		offensive - direct damage
			//		rising - rising spell
			//		summoning //todo:
			"flags" : ["flag1", "flag2"],

			//string array of bonus names, any one of these bonus grants immunity
			"immunity": ["BONUS_NAME", ...],

			//string array of bonus names, presence of all bonuses required to be affected by
			"limit": ["BONUS_NAME", ...],

			//Optional, bonus format array
			//common effects for all spell levels
			"effects": [{bonus format} ...],

			//graphics - OPTIONAL; object;
			"graphics":
			{
				//  iconImmune - OPTIONAL; string; 
				//resourse path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)
				"iconImmune":"ZVS/LIB1.RES/E_SPMET"
			},

			//Mandatory 4 element array of objects
			//configuration for no skill, basic, adv, expert
			"levels":[
			{
				//Mandatory, localizable description
				//Use {xxx} for formatting
				"description": "",


				//Mandatory, number, 
				//cost in mana points
				"cost": 1,

				//Mandatory, number
				"power": 10,

				//Mandatory, number
				"aiValue": 20,

				//Mandatory, spell target type
				"targetType":"NO_TARGET",//"CREATURE","OBSTACLE"
				
				//Mandatory
				//spell range description in SRSL
				"range": "X",

				//Optional, bonus format array
				//timed effects 
				"effects":
				[
				{bonus format}, ...
				]
			},
			{...},{...},{...}
			]


		}
	}
}


Modding related articles

Main articles
Modding changelog Modding guidelines Mod Handler


Formats
Mod file Format
Town Format Creature Format Hero Classes Format
Artifact Format Animation Format Hero Format
Bonus Format Object Format Spell Format


Work-in-progress formats
Building bonuses Map format
Bonus Type Format Random map template


Outdated pages
Mod system proposal