Cast spell is a command that lets you perform give an effect to a target without having to attack them. You can cast spells on either yourself or a target.
XML[]
<skill>
<type value="cast-spell" />
<name value="eat_spinach_skill" />
<ep-cost value="20" />
<speed value="20" />
<anim-speed value="200" />
<animation path="models/swordman_standing.g3d" />
<sound enabled="false" />
<effects>
<effect name="popeye_strength" bias="beneficial"
stacking="overwrite" duration="30">
<multipliers>
<attack-strength value="2.0" />
<attack-speed value="1.5" />
</multipliers>
</effect>
</effects>
</skill>
<command>
<type value="cast-spell"/>
<name value="eat_spinach"/>
<image path="../../upgrades/spinach/spinach.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<affect value="self" />
<cycle value="false" />
<cast-spell-skill value="eat_spinach_skill"/>
</command>
Elements[]
Most elements are standard effect or command elements.
affect[]
Defines who the cast spell command can be used against. It is either self (the spell can only be casted on the user) or target (must specify a target to cast the spell on).
cycle[]
If true, the spell will be continuously casted until the caster is commanded to do something else, or the target dies. If false, it will cast the spell once, then stop.
Targeted spells[]
If using a spell with the affect value being target, then you can set a splash and projectile values. This is done the same way as in an attack skill. Note that you should
<start-time value="0.5" />
<projectile value="true">
<particle value="true" path="heal_proj.xml"/>
<sound enabled="false" />
</projectile>
<splash value="true">
<radius value="3"/>
<particle value="true" path="heal_splash.xml"/>
</splash>
Example[]
In this example, the spell is a mild healing spell which restores the health of units in the target's area for 500 HP over 5 seconds.
<skill>
<type value="cast-spell" />
<name value="cast-spell_skill" />
<ep-cost value="50" />
<speed value="75" />
<anim-speed value="75" />
<animation path="models/model.g3d"/>
<sound enabled="false"/>
<start-time value="0.5" />
<projectile value="true">
<particle value="true" path="particle_projectile.xml"/>
<sound enabled="false" />
</projectile>
<splash value="true">
<radius value="3"/>
<particle value="true" path="particle_splash.xml"/>
</splash>
<effects>
<effect name="healing_light" bias="beneficial" stacking="overwrite" duration="5">
<static-modifiers>
<hp-regeneration value="100"/>
</static-modifiers>
</effect>
</effects>
</skill>
<command>
<type value="cast-spell" />
<name value="healing_light" />
<image path="image.png" />
<unit-requirements/>
<upgrade-requirements/>
<cast-spell-skill value="cast-spell_skill" />
<affect value="target"/>
<cycle value="false" />
</command>