Heroes 5 Wiki

Where are the creature spells and abilities stored?[]

Creature spells and abilities are stored in DATA.PAK\GameMechanics\Creature\Creatures\*Town*\*Creature*.xdb. For this example we will use the Titan file. Spells are stored in the <KnownSpells> tree while abilities can be found under <Abilities> tree.

Spells:

<Health>210</Health>
	<KnownSpells>
		<Item>
			<Spell>SPELL_ABILITY_CALL_LIGHTNING</Spell>
			<Mastery>MASTERY_ADVANCED</Mastery>
		</Item>
	</KnownSpells>
	<SpellPoints>0</SpellPoints>
	<SpellPoints1>0</SpellPoints1>
	<SpellPoints2>0</SpellPoints2>

Abilities:

	<BaseCreature>CREATURE_GIANT</BaseCreature>
	<Upgrades/>
	<Abilities>
		<Item>ABILITY_IMMUNITY_TO_MIND_CONTROL</Item>
		<Item>ABILITY_CALL_LIGHTNING</Item>
	</Abilities>
</Creature>

Adding spells[]

From the code snippet above, <KnownSpells> is an array of <Item> elements, each of which is a spell that the creature can use. To give a new spell to the creature add another item to the array keeping the same syntax. In the next example we will give the Titan the Chain lightning spell.

<Health>210</Health>
	<KnownSpells>
		<Item>
			<Spell>SPELL_ABILITY_CALL_LIGHTNING</Spell>
			<Mastery>MASTERY_ADVANCED</Mastery>
		</Item>
		<Item>
		   <Spell>SPELL_ABILITY_CALL_LIGHTNING</Spell>
		   <Mastery>MASTERY_ADVANCED</Mastery>
		 </Item>
	</KnownSpells>
	<SpellPoints>0</SpellPoints>
	<SpellPoints1>0</SpellPoints1>
	<SpellPoints2>0</SpellPoints2>

This is the code that gives Titans the Call Lightning ability. Notice that it's called SPELL_ABILITY_CALL_LIGHTNING, this is the internal name of the spell. There is an entry for the mastery level of the spell.

In the following example we will add Chain Lighting spell to Titan. From above entry, 2 items are required to add a spell to the creature:

  1. Internal ID of the spell - this can be taken from the internal spell table or by opening the spell file and taking it from there (GameMechanics\Spell\Combat_Spells\DestructiveMagic\Chain_Lightning_Hit.xdb).
  2. Mastery ID oft he spell - take this from the internal mastery table.

After getting both values, add them to the KnownSpells array


<KnownSpells>
     <Item>
          <Spell>SPELL_ABILITY_CALL_LIGHTNING</Spell>
          <Mastery>MASTERY_ADVANCED</Mastery>
     </Item>
     <Item>
          <Spell>SPELL_ABILITY_CALL_LIGHTNING</Spell>
          <Mastery>MASTERY_ADVANCED</Mastery>
     </Item>
     <Item>
          <Spell>SPELL_CHAIN_LIGHTNING</Spell>
          <Mastery>MASTERY_EXPERT</Mastery>
     </Item>
</KnownSpells>

This gives Titans the ability to cast Chain Lightning. All additions keep similar syntax. Change the *Spell ID* to the ID that's in the spell xdb file and the *Mastery* to the wanted mastery ( None, Basic, Advanced, Expert)

 <Item>
   <Spell>SPELL_*Spell ID*</Spell>
   <Mastery>MASTERY_*Mastery*</Mastery>
 </Item>

==
Adding abilities == Adding abilities is done in a similar way as spells, but IDs are in GameMechanics\Spell\Creature_Abilities\*Town*\*Ability* and the part to put in the creature xdb is:

 <Item>
   <Spell>SPELL_ABILITY_*Ability ID*</Spell>
   <Mastery>MASTERY_*Mastery*</Mastery>
 </Item>


In *Ability ID* put the ID from the xdb file and in *Mastery* put the mastery. Usually the mastery for abilities is Advanced.


5.1.1. How do I add an ability to a creature that doesn't have any?[]

If a creature doesn't have any abilities, than instead of this:

 <KnownSpells>
   <Item>
     <Spell>SPELL_*Ability/Spell*</Spell>
     <Mastery>MASTERY_*Mastery*</Mastery>
   </Item>
 </KnownSpells>


You'll have this: <KnownSpells/> So all you have to do is change this what you have to this:

 <KnownSpells>
   <Item>
     <Spell>SPELL_*Ability/Spell*</Spell>
     <Mastery>MASTERY_*Mastery*</Mastery>
   </Item>
 </KnownSpells>


Remember that you can add more spells/abilities.

NOTE: WHEN ADDING ABILITIES AND/OR SPELLS, REMEMBER THE <Item> IN THE BEGINNING AND </Item> IN THE END OR ELSE THE GAME WON'T WORK!!!


5.2. How do I add mana to creatures?[]

If you add spells, you also need to add mana so the spells can be cast. For the example, we'll ad 15 mana to our Titans. Open the xdb file and look for this:


 <SpellPoints>0</SpellPoints>
 <SpellPoints1>0</SpellPoints1>
 <SpellPoints2>0</SpellPoints2>


Change the 0 in <SpellPoints>0</SpellPoints> to 15. I have no idea what the other teo are for.


5.3. How do I add the "Caster" ability in the Abilities Description?[]

This is very simple. Go to Text\Game\Creatures\*Town*\*Creature*Abilities.txt and add the word Caster with a space behind it and a period after. Save and play.


\\


>> Next: 6. Animations