Summoning spell help


I was wondering if I am on the right track here with my spell, my ideal will be to tie this to Ceresa but I want to know if the basic code is sound. Basically Im trying to get it so Ceresa can summon a death demon when she reaches level 12. I may want to tie in research prereqs later but for now I want to get it working first.(This will not be a tactical spell) I used the summon shadow warg spell as the template and then snips bits and pieces to hopefully tweak it in the right direction.

<SpellDef InternalName="Summondeathdemon">
        <DisplayName>Demonic Binding</DisplayName>
        <Description>Summons a level 9 Death Demon.</Description>
        <Image>T_DemonicAlly_Painting.png</Image>
        <IconFG>T_DemonicAlly_Icon.png</IconFG>
        <IconColor>167,249,131</IconColor>
        <AutoUnlock>1</AutoUnlock>
        <CanStack>0</CanStack>
        <SpellBookSortCategory>Summon</SpellBookSortCategory>
        <SpellBookSortSubCategory>Summon</SpellBookSortSubCategory>
        <SpellType>Strategic</SpellType>
        <SpellClass>Defensive</SpellClass>
        <SpellSubClass>Summon</SpellSubClass>
        <SpellTargetType>Self</SpellTargetType>
        <Range>0</Range>
        <Prereq>
            <Type>AbilityBonusOption</Type>
            <Attribute>Summoner</Attribute>
            <Type>UnitStat_Level</Type>
            <Attribute>12</Attribute>
        </Prereq>
        <SpellResourceCost>
            <Resource>Mana</Resource>
            <Amount>400</Amount>
        </SpellResourceCost>
        <SpellResourceCost>
            <Resource>Mana</Resource>
            <PerTurn>40</PerTurn>
            <Amount>1</Amount>
        </SpellResourceCost>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>SummonUnit</Attribute>
            <StrVal>Death Demon</StrVal>
            <UnitClass>deathdemon</UnitClass>
            <Duration>-1</Duration>
            <Value>1</Value>
        </GameModifier>
        <AIData AIPersonality="AI_General">
            <AIPriority>10</AIPriority>
        </AIData>
        <HitSoundFX>Spell_SummonDemonicAlly_01</HitSoundFX>
        <SpellDefEffect>
            <EffectName>Y_SummonDeathDemon_Particle</EffectName>
            <LocalPosition>0,20,0</LocalPosition>
            <EffectScale>1</EffectScale>
            <EffectDelay>0</EffectDelay>
            <SnapToTerrain>1</SnapToTerrain>
        </SpellDefEffect>
    </SpellDef>

10,768 views 14 replies
Reply #1 Top

First you need the right prereq for the level:   

   <Prereq>
      <Type>UnitStat_Level</Type>
      <Attribute>7</Attribute>
    </Prereq>

 

then you need a way to tie it to Ceresa specifically. I would recommend you give her a special trait, then prereq that trait in the spell.

Reply #2 Top


Sweet, so how would I go about creating a new trait? And further more how would I make it so rituals and sorcery have to be researched as a prereq as well?

Thanksa for the help and I am glad Im really close, now to think of a trait name and Icon...

Would the traits be under the coreplayer abilities file?

Here is an example of what I found, its not modded in any way

 

 

<PlayerAbilityType InternalName="A_SummonAttackBoost">
    <DisplayName>Summon's Attack Boost</DisplayName>
    <Description>Percentage boost to attack for summoned units.</Description>
    <Icon>Icon_Level.png</Icon>
    <UsedAsMultiplier>1</UsedAsMultiplier>
  </PlayerAbilityType>

So hypothetically I could change this to "Binding" and then give it to Ceresa whilwe making it a prereq for the spell?

Reply #3 Top

No, they're in CoreAbilities.xml. Here's an example, note how AbilityBonusOption is inside an AbilityBonus. You want to make one of these yourself, but with new internalnames, and then copy your new internalname for the AbilityBonusOption into Ceresa's XML as a SelectedBonusOption.

    <AbilityBonus InternalName="Regeneration1Ability">
        <AbilityBonusOption InternalName="Regeneration1">
            <DisplayName>Regeneration I</DisplayName>
            <Description>Unit heals 4 points per round</Description>
            <Icon>Ability_RegenerationI_Icon.png</Icon>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_HealthRegen</StrVal>
                <Value>4</Value>
                <Provides>Unit heals 4 points per round</Provides>
            </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_TacticalHealthRegen</StrVal>
                <Value>4</Value>
            </GameModifier>
            <CombatRating>40</CombatRating>
            <HideWhenUpgraded>1</HideWhenUpgraded>
            <IsCombatAbility>1</IsCombatAbility>
            <Type>Defensive</Type>
            <AIData AIPersonality="AI_General">
                <AIPriority>5</AIPriority>
            </AIData>
        </AbilityBonusOption>
    </AbilityBonus>

 

Then you prereq the same internalname like other spells have for other AbilityBonustraits.

I think you can just put in a prereq for a research, check the blueprint for that in CoreWeapons.xml. Tech files are found in /Only-SP/

Reply #4 Top


Im still on the process of getting this set but I am wondering what I would be able to remove, since I don't need this to do anything other than be a prereq and tie it to ceresa only.

<AbilityBonus InternalName="demonbind">
        <AbilityBonusType>Champion_Talent</AbilityBonusType>
        <AbilityBonusOption InternalName="DemonBinding">
            <DisplayName>Demonic Binding</DisplayName>
            <Description>Allows Ceresa to bind a Death Demon to her cause.</Description>
            <Icon>Ability_Binding_Icon.png</Icon>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_ExpBonus</StrVal>
                <Value>10</Value>
                <Provides>+10% Experience</Provides>
            </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_MagicPower</StrVal>
                <Value>2</Value>
                <PerLevel>1</PerLevel>
                <Provides>+2 Spell Mastery per Level</Provides>
            </GameModifier>
            <Cost>1</Cost>
            <HideWhenUpgraded>0</HideWhenUpgraded>
            <Type>Spell</Type>
            <AIData AIPersonality="AI_General">
                <AIPriority>5</AIPriority>
            </AIData>
        </AbilityBonusOption>
    </AbilityBonus>

Reply #5 Top

You can probably remove all the game modfiers.  Maybe add a gamemodifier like this

<GameModifier>
    <Provides>Ceresa with the ability to bind a death demon</Provides>
</GameModifier>

This should provide the tool tip when somebody hovers over the ablity, or highlights the ability. (I forget which)

Reply #6 Top

Ok here is what I got:

The spell:

<SpellDef InternalName="Summondeathdemon">
        <DisplayName>Demonic Binding</DisplayName>
        <Description>Summons a level 9 Death Demon.</Description>
        <Image>T_DemonicAlly_Painting.png</Image>
        <IconFG>T_DemonicAlly_Icon.png</IconFG>
        <IconColor>167,249,131</IconColor>
        <AutoUnlock>1</AutoUnlock>
        <CanStack>0</CanStack>
        <SpellBookSortCategory>Summon</SpellBookSortCategory>
        <SpellBookSortSubCategory>Summon</SpellBookSortSubCategory>
        <SpellType>Strategic</SpellType>
        <SpellClass>Defensive</SpellClass>
        <SpellSubClass>Summon</SpellSubClass>
        <SpellTargetType>Self</SpellTargetType>
        <Range>0</Range>
        <Prereq>
            <Type>AbilityBonusOption"demonbind"</Type>
            <Attribute>Summoner</Attribute>
       <Type>UnitStat_Level</Type>
       <Attribute>12</Attribute>
        </Prereq>
        <Prereq>
        <SpellResourceCost>
            <Resource>Mana</Resource>
            <Amount>400</Amount>
        </SpellResourceCost>
        <SpellResourceCost>
            <Resource>Mana</Resource>
            <PerTurn>40</PerTurn>
            <Amount>1</Amount>
        </SpellResourceCost>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>SummonUnit</Attribute>
            <StrVal>Death Demon</StrVal>
            <UnitClass>deathdemon</UnitClass>
            <Duration>-1</Duration>
            <Value>1</Value>
        </GameModifier>
        <AIData AIPersonality="AI_General">
            <AIPriority>10</AIPriority>
        </AIData>
        <HitSoundFX>Spell_SummonDemonicAlly_01</HitSoundFX>
        <SpellDefEffect>
            <EffectName>Y_SummonDeathDemon_Particle</EffectName>
            <LocalPosition>0,20,0</LocalPosition>
            <EffectScale>1</EffectScale>
            <EffectDelay>0</EffectDelay>
            <SnapToTerrain>1</SnapToTerrain>
        </SpellDefEffect>
    </SpellDef>

Ceresa:

    <UnitType InternalName="Sovereign_Ceresa">
        <DisplayName>Oracle Ceresa</DisplayName>
        <UnitDisplayName>Oracle Ceresa</UnitDisplayName>
        <Class>Sovereign</Class>
        <Allegiance>Empire</Allegiance>
        <CreatureType>Champion</CreatureType>
        <RaceType>Race_Type_Wraiths</RaceType>
        <Unique>1</Unique>
        <CanBeDesigned>0</CanBeDesigned>
        <FactionToLead>EmpireOfResoln</FactionToLead>
        <Gender>Female</Gender>
        <HasWages>0</HasWages>
        <IsSovereign>1</IsSovereign>
        <HasEssence>1</HasEssence>
        <GameModifier>
            <ModType>Resource</ModType>
            <Attribute>Unrest</Attribute>
            <Value>-10</Value>
            <Provides>-10% Unrest in the city this unit is in</Provides>
        </GameModifier>
        <GameModifier>
            <ModType>Player</ModType>
            <Attribute>AbilityBonus</Attribute>
            <StrVal>A_FactionPrestige</StrVal>
            <Value>0.5</Value>
            <PerLevel>1</PerLevel>
            <Provides>+0.5 Faction Prestige per Level</Provides>
        </GameModifier>
        <LevelMilestone InternalName="L1">
            <Level>1</Level>
            <UnitStat_Accuracy>75</UnitStat_Accuracy>
            <UnitStat_CombatSpeed>22</UnitStat_CombatSpeed>
            <UnitStat_ChanceToCrit>1</UnitStat_ChanceToCrit>
            <UnitStat_HitPoints>15</UnitStat_HitPoints>
        </LevelMilestone>
        <SelectedAbilityBonusOption>Blood_Wraith</SelectedAbilityBonusOption>
        <SelectedAbilityBonusOption>Summoner</SelectedAbilityBonusOption>
        <AbilityBonus InternalName="demonbind">
        <AbilityBonusType>Champion_Talent</AbilityBonusType>
        <AbilityBonusOption InternalName="Binding">
            <DisplayName>Demonic Binding</DisplayName>
            <Description>Allows Ceresa to bind a Death Demon</Description>
            <Icon>T_DemonicAlly_Icon.png</Icon>
            <Cost>0</Cost>
            <HideWhenUpgraded>0</HideWhenUpgraded>
            <Type>Spell</Type>
            <AIData AIPersonality="AI_General">
                <AIPriority>5</AIPriority>
            </AIData>
        </AbilityBonusOption>
    </AbilityBonus>
        <SelectedAbilityBonusOption>Death1</SelectedAbilityBonusOption>
        <SelectedAbilityBonusOption>Death2</SelectedAbilityBonusOption>
        <SelectedAbilityBonusOption>Water1</SelectedAbilityBonusOption>
        <SelectedAbilityBonusOption>Attunement</SelectedAbilityBonusOption>
        <SelectedAbilityBonusOption>Scarred</SelectedAbilityBonusOption>
        <AutoCreateEquipment>Staff_Souls</AutoCreateEquipment>
        <Equipment>K_Female_Head_04</Equipment>
        <Equipment>K_Female_Slim_Hair</Equipment>
        <Equipment>CeresaCloak</Equipment>
        <Equipment>Wraith_Female_Robe</Equipment>

There is an issue with Ceresa's coding as I think I used a name already taken since my ability overwrote the ability that was previously there si back to take one.

Reply #7 Top

Okay... I recommend that you seperate the ability bonus from the unit type (for ease of reading and changing things in the future).

like this (This is not necessary for the game though)

<UnitType InternalName="Sovereign_Ceresa">
     BLAH
</UnitType>

<AblityBonus>
     BLAH
</AbilityBonus>

You are correct that there is something already called binding and you should rename your <AbilityBonusOption InternalName="BindingDemonSpawn">

or something. Then you also need to add to ceresa sovereign the line

<SelectedAbilityBonusOption>BindingDemonSpawn</SelectedAbilityBonusOption>

this will allow Ceresa to get the actual ability.

Also, i recommend that you add to the ability bonus option what I suggested before about the gamemodifier with just a provides tag. It will give you the tool tip when you hover over the icon in the unit screen.

I didn't check your spell. I only did these few changes to see the ablity in game.

Reply #8 Top

Related question, I don't remember how to lift the limit on 1 summon per spell per caster? 

Reply #9 Top

Quoting Nibelung44, reply 9
Related question, I don't remember how to lift the limit on 1 summon per spell per caster? 

If I am not mistaken, you need to set in each of the spells <CanStack>0</CanStack> to 1.

 

 

Reply #10 Top

Polistes your prereq in the spelldef is messed up. Copy the format you see in corespells.xml

Reply #11 Top

Quoting Gaunathor, reply 10

Quoting Nibelung44, reply 9Related question, I don't remember how to lift the limit on 1 summon per spell per caster? 

If I am not mistaken, you need to set in each of the spells <CanStack>0</CanStack> to 1.

 

 

 

seems simple. Now a bit more difficult, how to limit that to a particular condition or number (i.e as many fire elementals as you have fire shards?)

Reply #12 Top


@heavenfall so the format in the OP is correct but the later one is not? This is hard lol.

Reply #13 Top

No, op is nOt correct. If you want a trait and a level as prereq you need two different ones. 

I can't copy the xml on this pad.

Reply #14 Top

This is the right xml for the spelldef

           <Prereq>
                <Type>AbilityBonusOption</Type>
                <Target>Unit</Target>
                <Attribute>Binding</Attribute>
            </Prereq>

         <Prereq>
            <Type>UnitStat</Type>
            <Attribute>UnitStat_Level</Attribute>
            <Value>4</Value>
        </Prereq>


keep in mind that "Binding" needs a new internalname to remove conflict with the existing abilitybonusoption with the same name.

Also you can remove this line

<AbilityBonusType>Champion_Talent</AbilityBonusType>

from the abilitybonusoption.