Code
<?xml version="1.0" ?>
<spellcast>
<config>
RequireVersion="2.46"
debug="false"
showgearswaps="false"
HideErrors="false"
quickcommands="true"
showspellinfo="false"
DefaultAftercast="Idle"
NormalSet="Idle"
RestingSet="Resting"
EngagedSet="DRKStoreTP"
</config>
<sets>
<group default="yes" name="Dark Knight">
<set name="Resting">
</set>
<set name="Idle">
</set>
<set name="DRKStoreTP" >
<main>Ragnarok</main>
<sub>Rose Strap</sub>
<ammo>Hagneia Stone</ammo>
<head>Bale Burgeonet +2</head>
<neck>Houyi Gorget</neck>
<lear>Brutal Earring</lear>
<rear>Bale Earring</rear>
<body>Ace's Mail</body>
<hands>Bale Gauntlets +2</hands>
<lring>Rajas Ring</lring>
<rring>Tyrant's Ring</rring>
<back>Tactical Mantle</back>
<waist>Goading Belt</waist>
<legs>Calmecac Trousers</legs>
<feet>Ace's Leggings</feet>
</set>
<set name="Aftermathset">
</set>
<set name="DRKWSset" >
<ammo>Fracas Grenade</ammo>
<head>Mekira-oto</head>
<neck>Breeze Gorget</neck>
<lear>Brutal Earring</lear>
<rear>Bale Earring</rear>
<body>Ace's Mail</body>
<hands>Heafoc Mitts</hands>
<lring>Rajas Ring</lring>
<rring>Pyrosoul Ring</rring>
<back>Atheling Mantle</back>
<waist>Breeze Belt</waist>
<legs>Bale Flanchard +2</legs>
<feet>Dilaram's Sollerets</feet>
</set>
<set name="DarkMagicset">
</set>
<set name="Fastcastset">
</set>
</group>
</sets>
<rules>
<if status = "dead">
<cancelspell/>
<return/>
</if>
<if BuffActive="Sleep|Petrification|Stun|Terror|Charm">
<return/>
</if>
<if Type="*Magic|BardSong|Ninjutsu" BuffActive="Silence">
<return/>
</if>
<if Type="Weaponskill|JobAbility|PetCommand" BuffActive="Amnesia">
<cancelspell/>
<return/>
</if>
<if status="idle">
<equip when="idle|aftercast" set="Idle" />
</if>
<if status="resting">
<equip when="resting" set="Resting"/>
</if>
<if Status="Engaged">
<equip When="engaged|aftercast" Set="DRKStoreTP" />
<if BuffActive="Aftermath*">
<equip when="engaged|aftercast" set="Aftermathset"/>
</if>
</if>
<if type="*Magic">
<equip when="midcast" set="Fastcastset" />
<if skill="DarkMagic">
<equip when="precast" set="DarkMagicset" />
</if>
</if>
<if type="Weaponskill">
<if SpellTargetDistanceGT="5">
<addtochat color="121">Target out of range!!</addtochat>
<cancelspell />
<return />
</if>
<if tplt="100">
<addtochat color="121">Not enough TP!!</addtochat>
<cancelspell />
<return />
</if>
<equip when="precast" set="DRKWSset" />
</if>
</rules>
</spellcast>
THAT is what I should have put. My desire to help was greater than my knowledge. Sorry about that.
Now I understand that your 3 states are Idle, Resting and Engaged. Idle and Engaged have a sub-state of Casting which breaks down into Precast, Midcast and Aftercast.
Therefor, any action you can perform while Idle or Engaged must redirect you back to the appropriate state when you're finished performing the action. The reason why it's so important that the rules regarding those two states include the additional "|aftercast" in order for the rule to function properly, is that you can cast while either Idle or Engaged, and while to us players this is very obvious, for Spellcast, it MUST be defined, and that's one way you can do it.
It's really a matter of common sense but with unfamiliar territory, things like that aren't always readily apparent.
*Edit: Added a few special features*