My current spellcast works to a point, but since I was getting "can't find set engaged" errors, I changed my ranged/staff set to Engaged.
So now even if I'm meleeing, it changes back to the ranged set after an action like a weaponskill.
Assistance would be great and please ignore all the gimpy gear, my COR is a work in progress. <_<
Code
<spellcast xmlns:xi="http://www.w3.org/2001/XInclude">
<config
Debug="false"
ShowGearSwaps="False"
/>
<sets>
<group default="yes" name="Cor">
<set name="Engaged">
<head>Commodore tricorne</head>
<neck>Rancor Collar</neck>
<lear>Volley Earring</lear>
<rear>Navarch's Earring</rear>
<body>Nvrch. Frac +2</body>
<hands>Nvrch. Gants +1</hands>
<lring>Arewe Ring</lring>
<rring>Arewe Ring</rring>
<back>Terebellum Mantle</back>
<waist>Commodore Belt</waist>
<legs>Mirador trousers</legs>
<feet>War boots</feet>
</set>
<set name="Ranged">
<head>Commodore tricorne</head>
<neck>Rancor Collar</neck>
<lear>Volley Earring</lear>
<rear>Navarch's Earring</rear>
<body>Nvrch. Frac +2</body>
<hands>Nvrch. Gants +1</hands>
<lring>Arewe Ring</lring>
<rring>Arewe Ring</rring>
<back>Terebellum Mantle</back>
<waist>Commodore Belt</waist>
<legs>Mirador trousers</legs>
<feet>War boots</feet>
</set>
<set name="Snapshot" baseset="Ranged">
<head>Aurore Beret</head>
<body>Skopos Jerkin</body>
<legs>Nvrch. Culottes +1</legs>
<waist>Impulse Belt</waist>
<back>Navarch's Mantle</back>
</set>
<set name="Idle" BaseSet="Ranged">
<lear>Merman's earring</lear>
<lring>Dark Ring</lring>
<head>Ocelomeh headpiece +1</head>
<neck>Twilight Torque</neck>
<body>Mirke wardecors</body>
<hands>Melaco mittens</hands>
<back></back>
<waist></waist>
<legs>Desultor Tassets</legs>
<feet>Hermes' Sandals</feet>
<rear>Merman's earring</rear>
<rring>Dark Ring</rring>
</set>
<set name="IdleRegen" BaseSet="Ranged">
<head>Oce. Headpiece +1</head>
<hands>Navarch's Gants +2</hands>
<neck>Wiglen Gorget</neck>
<lring>Paguroidea Ring</lring>
<rring>Sheltered Ring</rring>
<back>Shadow Mantle</back>
<legs>Thaumas Kecks</legs>
<feet>Hermes' Sandals</feet>
</set>
<set name="PDT" BaseSet="Idle">
<head>Fugacity Beret</head>
<neck>Twilight Torque</neck>
<lear>Volley Earring</lear>
<rear>Black Earring</rear>
<body>Dst. Harness +1</body>
<hands>Melaco mittens</hands>
<lring>Dark Ring</lring>
<rring>Dark Ring</rring>
<back>Mollusca Mantle</back>
<waist>Lieutenant's Sash</waist>
<legs>Desultor Tassets</legs>
<feet>Dst. Leggings +1</feet>
</set>
<set name="Detonator" BaseSet="Ranged" />
<set name="Slugshot" BaseSet="Detonator" />
<set name="Wildfire">
<lring>Stormsoul Ring</lring>
<head>Thaumas Hat</head>
<neck>Stoicheion Medal</neck>
<lear>Hecate's Earring</lear>
<rear>Strophadic Earring</rear>
<body>Athos's Tabard</body>
<hands>Athos's Gloves</hands>
<back>Forban Cape</back>
<waist>Aquiline Belt</waist>
<legs>Thaumas Kecks</legs>
<feet>Nvrch. Bottes +2</feet>
<rring>Stormsoul Ring</rring>
</set>
<set name="Salute" BaseSet="Wildfire">
<lring>Stormsoul Ring</lring>
<head>Pandinus beret</head>
<neck>Stoicheion Medal</neck>
<lear>Hecate's Earring</lear>
<rear>Sortiarius Earring</rear>
<body>Loki's kaftan</body>
<hands>Athos's Gloves</hands>
<back>Forban Cape</back>
<waist>Aquiline Belt</waist>
<legs>Nvrch. Culottes +1</legs>
<feet>Nvrch. Bottes +1</feet>
<rring>Stormsoul Ring</rring>
</set>
<set name="Laststand">
<lring>Stormsoul Ring</lring>
<head>Ocelomeh headpiece +1</head>
<neck>Light gorget</neck>
<lear>Drone earring</lear>
<rear>Moonshade earring</rear>
<body>Kudzu aketon</body>
<hands>Athos's Gloves</hands>
<back>Terebellum mantle</back>
<waist>Light Belt</waist>
<legs>Mirador trousers</legs>
<feet>Nvrch. Bottes +1</feet>
<rring>Stormsoul Ring</rring>
</set>
<set name="WFObi" BaseSet="Wildfire">
<waist>Karin Obi</waist>
</set>
<set name="QuickDraw" BaseSet="Ranged">
<lring>Stormsoul Ring</lring>
<ammo>Orichalcum Bullet</ammo>
<head>Pandinus beret</head>
<neck>Stoicheion Medal</neck>
<lear>Hecate's Earring</lear>
<rear>Sortiarius Earring</rear>
<body>Loki's kaftan</body>
<hands>Schutzen mittens</hands>
<back>Forban Cape</back>
<waist>Aquiline Belt</waist>
<legs>Mirador trousers</legs>
<feet>Nvrch. Bottes +1</feet>
<rring>Stormsoul Ring</rring>
</set>
<set name="QDMacc" BaseSet="QuickDraw">
<head>Nvrch. Tricorne +2</head>
<back>Navarch's Mantle</back>
</set>
<set name="QDObi" BaseSet="QuickDraw">
<waist>Karin Obi</waist>
</set>
<set name="EngagedMelee">
<head>Ocelomeh headpiece +1</head>
<neck>Rancor Collar</neck>
<lear>Brutal earring</lear>
<rear>Suppanomimi</rear>
<body>Toci's harness</body>
<hands>Dusk gloves +1</hands>
<lring>Epona's ring</lring>
<rring>Rajas Ring</rring>
<back>Atheling mantle</back>
<waist>Twilight belt</waist>
<legs>Ocelot trousers</legs>
<feet>Athos's boots</feet>
</set>
</group>
</sets>
<rules>
<if status="engaged">
<if EquipMain="Chatoyant staff">
<action type="equip" when="engaged|aftercast" set="Engaged" />
</if>
<elseif EquipMain="Lux pugio">
<action type="equip" when="engaged|aftercast" set="EngagedMelee" />
</elseif>
</if>
<if status="idle">
<equip when="idle" set="Idle" />
</if>
<if spell="ranged">
<castdelay delay=".2" />
<midcastdelay delay="2.4" />
<aftercastdelay delay="5" />
<equip when="precast" set="Snapshot">
<ammo>Bullet</ammo>
</equip>
<equip when="midcast" set="Ranged">
<ammo>Bullet</ammo>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Ice Shot|Wind Shot|Earth Shot|Thunder Shot|Water Shot">
<castdelay delay="0.5" />
<equip when="precast" set="Quickdraw">
<ammo>Bullet</ammo>
</equip>
<equip when="aftercast" set="%status">
<ammo>remove</ammo>
</equip>
</if>
<if spell="Fire Shot">
<castdelay delay="0.5" />
<if Mode="OR" Day="Firesday" WeatherElement="Fire">
<equip when="precast" set="QDObi">
<ammo>Bullet</ammo>
</equip>
<equip when="aftercast" set="%status">
<ammo>remove</ammo>
</equip>
</if>
<else>
<equip when="precast" set="Quickdraw" />
<equip when="aftercast" set="%status">
<ammo>remove</ammo>
</equip>
</else>
</if>
<if spell="Light Shot|Dark Shot">
<equip when="precast" set="QDMacc" />
<equip when="aftercast" set="%status">
<ammo>remove</ammo>
</equip>
</if>
<if commandprefix="/range|/weaponskill" EquipAmmo="Omphalos Bullet">
<cancelspell />
<equip>
<ammo>remove</ammo>
</equip>
<action type="command">input /echo Don't shoot that ***!</action>
<return />
</if>
<if spell="Random Deal">
<equip when="precast">
<body>Commodore Frac</body>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Tactician's Roll" baseset="PDT">
<equip when="precast">
<body>Nvrch. Frac +2</body>
<hands>Nvrch. Gants +2</hands>
<lring>Luzaf's Ring</lring>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Blitzer's Roll" baseset="PDT">
<equip when="precast">
<head>Nvrch. Tricorne +2</head>
<hands>Nvrch. Gants +2</hands>
<lring>Luzaf's Ring</lring>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Caster's Roll" baseset="PDT">
<equip when="precast">
<legs>Nvrch. Tricorne +2</legs>
<hands>Nvrch. Gants +2</hands>
<lring>Luzaf's Ring</lring>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Courser's Roll" baseset="PDT">
<equip when="precast">
<feet>Nvrch. Bottes +2</feet>
<hands>Nvrch. Gants +2</hands>
<lring>Luzaf's Ring</lring>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Miser's Roll|Companion's Roll" baseset="PDT">
<equip when="precast">
<hands>Nvrch. Gants +2</hands>
<lring>Luzaf's Ring</lring>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Corsair's Roll|Ninja Roll|Hunter's Roll|Chaos Roll|Magus's Roll|Healer's Roll|Puppet Roll|Choral Roll|Monk's Roll|Beast Roll|Samurai Roll|Evoker's Roll|Rogue's Roll|Warlock's Roll|Fighter's Roll|Drachen Roll|Gallant's Roll|Wizard's Roll|Dancer's Roll|Scholar's Roll">
<equip when="precast" baseset="PDT">
<head>Comm. Tricorne</head>
<hands>Nvrch. Gants +2</hands>
<lring>Luzaf's Ring</lring>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Double-Up">
<equip when="precast" baseset="PDT">
<lring>Luzaf's Ring</lring>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Utsusemi*">
<equip when="precast" set="Melee" />
</if>
<if spell="Triple Shot">
<equip when="precast">
<body>Nvrch. Frac +2</body>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Slug Shot">
<equip when="precast" set="Slugshot">
<ammo>Bullet</ammo>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Detonator">
<equip when="precast" set="Detonator">
<ammo>Bullet</ammo>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Last Stand">
<equip when="precast" set="Laststand">
<ammo>Bullet</ammo>
</equip>
<equip when="aftercast" set="%status" />
</if>
<if spell="Wildfire">
<if Mode="OR" Day="Firesday" WeatherElement="Fire">
<equip when="precast" set="WFObi">
<ammo>Orichalcum Bullet</ammo>
</equip>
</if>
<else>
<equip when="precast" set="Wildfire">
<ammo>Orichalcum Bullet</ammo>
</equip>
</else>
<equip when="aftercast" set="%status">
<ammo>remove</ammo>
</equip>
</if>
<if spell="Leaden Salute">
<equip when="precast" set="Salute">
<ammo>Orichalcum Bullet</ammo>
</equip>
<equip when="aftercast" set="%status">
<ammo>remove</ammo>
</equip>
</if>
</rules>
</spellcast>
