Auto En-spells

I have seen the question posted on the forums in several places, people asking how to have SpellCast swap in En-spells depending on certain conditions. This code will use the appropriate Enspell if double weather is present, if no double weather is present it will use the Enspell appropriate to the in game Day. This code also provides error checking for Light/Dark Day/Weather. The below code is able to be put into an existing spellcast xml for use with Redmage En-spells. To activate it, simply cast any En-spell, for example Enblizzard. This code was created by Irocky with assistance from Whitewing.

 
<!-- Put these variables above your <group> tags -->
 
<variables clear="false">
           <var name="Ice">blizzard</var>
           <var name="Fire">fire</var>
           <var name="Wind">aero</var>
           <var name="Earth">stone</var>
           <var name="Thunder">thunder</var>
           <var name="Water">water</var>
</variables>
 
<!-- put these anywhere in your <rules>, preferably towards the bottom -->
 
<if spell="En*" notspell="Energy*">
               <action type="equip" when="midcast" set="Your Enhancing Magic Set"/>
               <action type="equip" when="aftercast" set="Your Aftercast Set"/>
               <if Weather ="*x2" NotWeather="None|Light*|Dark*">
                        <action type = "ChangeSpell" Spell = "En$%WeatherElement"/>
               </if>
 
               <elseif NotDay = "Light*|Dark*">
                        <action type = "ChangeSpell" Spell = "En$%DayElement"/>
               </elseif>
 
</if>
plugins/spellcast/userxml/rdm/auto_en-spells.txt · Last modified: 2009/08/08 14:00 (external edit)
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0