Json configuration for spells

  1. custom duration will be allowed only for scripted spells.
  2. Spell should have at least one school and custom schools are not planned at all yet
  3. need complete mod to try to fix “didn’t work at all until …”
  1. OK, I’ll say it for future. I just throught that set of durations isn’t complete:
PERMANENT 
## ONE_BATTLE //at the end of battle 
## ONE_DAY //at the end of day 
## ONE_WEEK //at the end of week (bonus lasts till the end of week, thats NOT 7 days 
## N_TURNS //used during battles, after battle bonus is always removed 
## N_DAYS 
## UNITL_BEING_ATTACKED //removed after attack and counterattacks are performed 
## UNTIL_ATTACK //removed after attack and counterattacks are performed 
## STACK_GETS_TURN //removed when stack gets its turn - used for defensive stance 
## COMMANDER_KILLED 
  1. It works without selecting any school. But there is a bug during spell book drawing of icons:-)
  2. Will create mod with this spell and send to you.

Thats why Ive said “should” :wink:

In attachment.

  1. In spell Champions Marsch propagator HERO is commented.
    So when spell is cast, green counter appears, but morale is not increased. And in creatue window there is no icon of active spell.
    In spell Bard Song propagator is not commented, so luck is applied.
  2. These hymns are not assigned to any magic school, so in magic book this is corruption - there are only 4 defs for spell level indicatings (for each school), so it goes outside of array schoolBorders] and takes cadre from another def (Schools.def) that should not be there.
    I think there must be check - is spell school is not set, that do not try to load graphics from schoolBorders.
    hymns-mod.zip (61.8 KB)

In theory it is of course possible, but a bit harder than trivial :). Spell school is not just required primary skill

struct SpellSchoolInfo
{
	ESpellSchool id; //backlink
	Bonus::BonusType damagePremyBonus;
	Bonus::BonusType immunityBonus;	
	std::string jsonName;
	SecondarySkill::ESecondarySkill skill;
	Bonus::BonusType knoledgeBonus;			
};

(non including interface logic).

Or then allow some time to add new Spell Schools Info with Secodary Skills.
To change AIR_SPELL_DMG_PREMY to SPELL_DMG_PREMY with “subtype”:"spellSchool.air"
and so on.
Magic Book problem

  1. Leave it be - 4 elemental magics will have their own pages, and all other schools will go to united combat spells pages.
  2. Move magic book to json, so user can make other schools pages.
    Or cause, it will require a lot of work, don’t expect it to 1.0 version.
    It will require to move secondary skills bonuses to json also.

This may be implemented in part 6 (current is 4; 5 will be about adventure spells) of spell refactoring.

Would You Implement Reinforcements Spell?
it allows to teleport creatures from Town to Hero which is not visiting it.

there is mod in ERA which replaces Disguise by Reinforcements, but we may add it as separate spell.

My plan after current refactoring of spells is implement scripting.

That’s really great news :smiley:.

Adventure map spells are working, this is really great.
But I have question.

For example, this spell (and all adventure spells rising some value) gives + to morale. I cast it 3 times, and it gives +6 morale on expert. I want to allow only 1 cast per turn for hero (or I cast it 20 times and will get +60 morale :mrgreen: till end of turn.
I tried to use “counters” but it doesn’t help. Is there is a way to prevent it from multiple casts?

{
	"armyPrayer":
	{
		"type": "adventure", 
		"name": "Army Prayer",
		"school":
		{
			"air": true,
			"earth": false,
			"fire": false,
			"water": false
		},
		"level": 3,
		"power": 10,
		
		"defaultGainChance": 3, 
		"gainChance":
		{
			"castle": 4
		},
 
		//counterstrike animation?
	"counters": {"spell.armyPrayer":true},

 
		"flags" : {"indifferent": true,"positive":true},
 
		//graphics - OPTIONAL; object;
		"graphics":
		{
			"iconBook": "!Map-spells/ArmyPrayer/back0.bmp",
			"iconScroll": "!Map-spells/ArmyPrayer/back1.bmp",
			"iconScenarioBonus": "!Map-spells/ArmyPrayer/back2.bmp",
			"iconEffect": "!Map-spells/ArmyPrayer/back3.bmp"
		},

		
		"targetType": "NO_TARGET",
 
		"levels":
		{
			"none":
			{
				"description": "Gives army +1 morale until end of turn.",
	 
				"cost": 8,
				"power": 10,
				"aiValue": 5,
				"range": "X",
	
				"targetModifier":{"smart":false},
	 
				"effects":
				{
					"attacks":
					{
						"type": "MORALE",
						"val": 1,
						"duration": "ONE_DAY",
//						"propagator":"HERO"
					},
//					"morale":
//					{
//					"type":"MORALE",
//					"val":1,
//					"duration":"ONE_DAY"
//					}
				}
			},
			"basic":
			{
				"description": "Gives army +1 morale until end of turn.",
	 
				"cost": 7,
				"power": 10,
				"aiValue": 5,
				"range": "X",
	
				"targetModifier":{"smart":false},
	 
				"effects":
				{
					"attacks":
					{
						"type": "MORALE",
						"val": 1,
						"duration": "ONE_DAY",
	//					"propagator":"HERO"
					},
//					"morale":
//					{
//					"type":"MORALE",
//					"val":1,
//					"duration":"ONE_DAY"
//					}
				}
			},
			"advanced":
			{
				"description": "Gives army +1 morale until end of turn.",
	 
				"cost": 6,
				"power": 10,
				"aiValue": 5,
				"range": "X",
	
				"targetModifier":{"smart":false},
	 
				"effects":
				{
					"attacks":
					{
						"type": "MORALE",
						"val": 1,
						"duration": "ONE_DAY",
		//				"propagator":"HERO"
					},
//					"morale":
//					{
//					"type":"MORALE",
//					"val":1,
//					"duration":"ONE_DAY"
//					}
				}
			},
			"expert":
			{
				"description": "Gives army +1 morale until end of turn.",
	 
				"cost": 8,
				"power": 10,
				"aiValue": 5,
				"range": "X",
	
				"targetModifier":{"smart":false},
	 
				"effects":
				{
					"attacks":
					{
						"type": "MORALE",
						"val": 2,
						"duration": "ONE_DAY",
		//				"propagator":"HERO"
					},
//					"morale":
//					{
//					"type":"MORALE",
//					"val":1,
//					"duration":"ONE_DAY"
//					}
				}
			}
		}
	}
 
}

I don’t think it’s possible yet as limit for Dimension Door is hardcoded.

How about adding “castLimit”:n (limit of cast per day) to spell levels configuration?
It will help dimension door too…

  1. maximum morale is +3
  2. this (configuration for adv spell) feature is not complete and anything may change.
  3. any suggestions for adventure spell configuration will be rejected until scripting will be implemented. Consider adventure spell configuration as internal engine feature an NOT intended for modding.

That’s one cool feature, so i’ll play with it :mrgreen:
Can AI use these custom spells for adventure map?
As for me, I can limit spell casting by my will :sunglasses:

VCAI isn’t capable of casting any adventure map spells. :frowning:

Of course you may do what you want with adv spells, but please don`t complain about missing features :wink: But patches are always welcome :slight_smile:

I hope I will finish my current hell of materials work in march, and will try to fix something.
I must remember GIT magic as well :sunglasses:

I plan to at least fix IMPROVED_NECROMANCY, so it will be configurable (user will write in “subtype” which creature to rise).

By the way, what is with summoning spells?

I looked into sources, it seems that something is changed for summoning spells.
Is it already can be configured through json?
What bonus type goes for summoning, if implemented?

I don`t have plans to implement summoning configuration right now. It will be part of second version of configuration format - kind of distant future (after json map format & scripting).