Ice Breath

So, I am trying to work on a mod that will allow me to make a new baddie that can use Ice breath

 

Current XML

 

</AbilityBonus>
<AbilityBonus InternalName="IceBreathAbility">
<AbilityBonusOption InternalName="IceBreath">
<DisplayName>Ice Breath</DisplayName>
<Description>Target units within a 1 tile radius are enveloped in Coldfire, taking the caster's Attack in Coldfire damage</Description>
<Icon>Ability_FireBreath_Icon.png</Icon>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>UnlockCombatAbility</Attribute>
<StrVal>ColdBreath</StrVal>
<Provides>Target units within a 1 tile radius are enveloped in Ice, taking the caster's Attack in Ice damage</Provides>
</GameModifier>
<CombatRating>300</CombatRating>

 

The problem is, it does not give me a skill it just....doesn't work? it just never gives me a skill to use in combat

6,515 views 7 replies
Reply #1 Top

Post the whole of your xml and a bit more info.


<StrVal>ColdBreath</StrVal>

Have you created a SpellDef called "ColdBreath" ?

 

 

 

 

Reply #3 Top

.....whats a spell def? and how do I make one, and ill eb honest, Thats my entire xml, I have the particles made though

Reply #4 Top

OK to do what you want is actually pretty easy, you just need to work out where to start and then how to find the right files to copy stuff from.

Let's say you want make the cold equivalent to the Fell Dragon's Fire Breath attack.  No problem... so the process would be roughly this:

First go look at the Fell Dragon, the monsters are all in CoreMonsterUnitTypes.xml.  Find the entry for <UnitType InternalName="FellDragon"> and you see that it has the ability <SelectedAbilityBonusOption>FireBreath</SelectedAbilityBonusOption>.  OK cool so lets make a copy of that ability.

So to do that you need to copy the FireBreath ability... abilities are all in CoreAbilities.xml, so open that file and search for FireBreath, you'll come across this entry:

<AbilityBonus InternalName="FireBreathAbility">
   <AbilityBonusOption InternalName="FireBreath">
      <DisplayName>Fire Breath</DisplayName>
      <Description>Target units within a 1 tile radius are enveloped in fire, taking the caster's Attack in fire damage</Description>
      <Icon>Ability_FireBreath_Icon.png</Icon>
      <GameModifier>
         <ModType>Unit</ModType>
         <Attribute>UnlockCombatAbility</Attribute>
         <StrVal>FireBreath</StrVal>
         <Provides>Target units within a 1 tile radius are enveloped in fire, taking the caster's Attack in fire damage</Provides>
      </GameModifier>
      <CombatRating>300</CombatRating>
      <IsCombatAbility>1</IsCombatAbility>
      <Type>Ability</Type>
      <AIData AIPersonality="AI_General">
         <AIPriority>5</AIPriority>
      </AIData>
   </AbilityBonusOption>
</AbilityBonus>

Create a new file in your mods directory and paste that ability into it, then change all the relevant info, i.e. give it a new InternalName, DisplayName, description etc.  I've bolded all the bits you probably want to change.  

This line here:

<StrVal>FireBreath</StrVal>

is the "spell" that is triggered by this ability.  Most non-passive abilities have something like this.  This "FireBreath" is actually a SpellDef which can be found in CoreSpells.xml.  You need to create a clone of this and convert it to a cold version.

Open up CoreSpells.xml, search for the SpellDef "FireBreath".  It looks like this:

<SpellDef InternalName="FireBreath">
   <DisplayName>Fire Breath</DisplayName>
   <Description>Target units in a 1 tile radius are enveloped in fire taking double the caster's attack strength in fire damage.</Description>
   <FormattedDescription>Target units in a 1 tile radius are enveloped in fire taking %d fire damage.</FormattedDescription>
   <IconFG>Ability_FireBreath_Icon.png</IconFG>
   <Cooldown>5</Cooldown>
   <SpellBookSortCategory>Unit</SpellBookSortCategory>
   <SpellBookSortSubCategory>UnitDamage</SpellBookSortSubCategory>
   <SpellType>Tactical</SpellType>
   <SpellClass>Offensive</SpellClass>
   <SpellSubClass>Damage</SpellSubClass>
   <SpellTargetType>EnemyUnit</SpellTargetType>
   <HideInHiergamenon>1</HideInHiergamenon>
   <IsCastable>0</IsCastable>
   <IsSpecialAbility>1</IsSpecialAbility>
   <Radius>1</Radius>
   <Range>3</Range>
   <GameModifier>
      <ModType>Unit</ModType>
      <Attribute>DefendableDamage</Attribute>
      <AttackStat>UnitStat_Attack_Fire</AttackStat>
      <IsForFormattedDescription>1</IsForFormattedDescription>
      <Calculate InternalName="Calc" ValueOwner="CastingUnit">
         <Expression><![CDATA[[UnitStat_CombinedAttack] * 2]]></Expression>
      </Calculate>
      <Calculate InternalName="Value">
          <Expression><![CDATA[[Calc]]]></Expression>
      </Calculate>
      <Calculate InternalName="ValueForFormattedDescription">
         <Expression><![CDATA[[Calc]]]></Expression>
      </Calculate>
   </GameModifier>
   <AIData AIPersonality="AI_General">
      <AIPriority>40</AIPriority>
   </AIData>
   <SpellCastSoundFX>Spell_FireBreath</SpellCastSoundFX>
   <SpellCastEffectName>Y_Firebreath_Particle</SpellCastEffectName>
   <SpellCastEffectScale>2.0</SpellCastEffectScale>
</SpellDef>

So again you want to copy this and paste it into your file in your mods directory.  Change all the bolded bits.  Make sure that the InternalName you give the SpellDef matches the name you use in the <StrVal> in the Ability.

Then you can give a monster your new Cold Breath ability by adding a <SelectedAbilityBonusOption>MyColdBreath</SelectedAbilityBonusOption> or whatever you called it to the UnitType definition.

Easy done!  Try that and let us know how you go.

 

 

Reply #6 Top

They don't *have* to be made, you could use any particle and icon you like, possibly just find something that is already existing that you could use.  

I highlighted the Ability_FireBreath_Icon.png above, but it is optional to change that.

It would make sense to make a new particle though.  I'd go into the Workshop and in the particle editor, open the existing Y_Firebreath_Particle, then modify it to give it a cold look.  It's not too hard to take an existing particle and change the colors.

Reply #7 Top

Ya, That was what I was proud of, it looks wicked awesome. Thanks abob!