<elseif type="BlackMagic">
<if skill="ElementalMagic">
<!--%SpellElement will process first. If ThunderIV is cast then $SetStaff will be set to $Thunder -->
<var cmd="set SetStaff $%SpellElement" />
<!-- if Chainspelling, don't use precast or aftercast sets -->
<if buffActive="Chainspell">
<equip when="precast|midcast|aftercast" set="Nuke" />
<!-- handle uggy pendant -->
<if MPPAftercastLT="51"> <!-- if mp < 51% -->
<equip when="midcast">
<neck>Uggalepih Pendant</neck>
</equip>
</if>
<!-- Full Moon Artemis -->
<if Moon="Full*">
<equip when="midcast">
<neck>Artemis' Medal</neck>
</equip>
</if>
</if> <!-- end if Chainspelling -->
<!-- else, when not chainspelling, normal behavior -->
<else>
<equip when="precast" set="FastCast" />
<equip when="midcast" set="Nuke" />
<!-- handle uggy pendant -->
<if MPPAftercastLT="51"> <!-- if mp < 51% -->
<!-- equip uggy pendant -->
<equip when="midcast">
<neck>Uggalepih Pendant</neck>
</equip>
</if>
<!-- Full Moon Artemis -->
<if Moon="Full*">
<equip when="midcast">
<neck>Artemis' Medal</neck>
</equip>
</if>
<equip when="aftercast" set="$AfterCast" />
</else>
</if> <!-- end if elemental skill -->