<?xml version="1.0"?>
<!DOCTYPE spellcast PUBLIC "spellcast" "spellcast.dtd">
<spellcast>
<config debug="false" requireversion="2.17"/>
<variables>
<var name="highevamobs">Mamool Ja Lurker|Kirin|Suzaku|Genbu|Seiryu|Byakko</var>
<var name="sa">false</var>
</variables>
<sets>
<group name="Samurai|SAM" default="yes">
<set name="idle">
<head>Fancy Spectacles</head>
<body>Shinimusha Hara-ate</body>
<hands>Ochimusha Kote</hands>
<legs>Shinimusha Haidate</legs>
<feet>Askar Gambieras</feet>
</set>
<set name="Melee">
<head>Walahra Turban</head>
<neck>Chivalrous Chain</neck>
<lear>Bushinomimi</lear>
<rear>Brutal Earring</rear>
<body>Haubergeon</body>
<hands>Dusk Gloves</hands>
<lring>Sniper's Ring</lring>
<rring>Rajas Ring</rring>
<back>Amemet Mantle +1</back>
<waist>Warwolf Belt</waist>
<legs>Shura Haidate</legs>
<feet>Hmn. Sune-Ate</feet>
</set>
<set name="WS" baseset="Melee">
<head>Optical Hat</head>
<hands>Myochin Kote +1</hands>
<feet>Askar Gambieras</feet>
</set>
<set name="STR" baseset="WS">
<hands>Myochin Kote +1</hands>
<lring>Ruby Ring</lring>
<head>Wyvern Helm</head>
</set>
<set name="Meditate">
<head>Myochin Kabuto</head>
<hands>Saotome Kote</hands>
</set>
</group>
<group name="LowAcc" inherit="Samurai">
<set name="WS" baseset="Melee" basegroup="Samurai">
<head>Wyvern Helm</head>
</set>
</group>
<group name="HighAcc" inherit="Samurai">
<set name="Melee" baseset="Melee" basegroup="Samurai">
<head>Optical Hat</head>
<waist>Potent Belt</waist>
</set>
<set name="WS" baseset="Melee">
<hands>Myochin Kote +1</hands>
</set>
</group>
<group name="Tank" inherit="Samurai">
<set name="Melee" baseset="Melee" basegroup="Samurai">
<head>Arhat's Jinpachi</head>
<waist>Warwolf Belt</waist>
<legs>Myochin Haidate +1</legs>
<rear>Avenger's Earring</rear>
<feet>Myochin Sune-Ate</feet>
<body>Arhat's Gi</body>
<hands>Saotome Kote</hands>
<rring>Phalanx Ring</rring>
<lring>Phalanx Ring</lring>
</set>
<set name="WS" baseset="WS" basegroup="HighAcc"/>
</group>
</sets>
<rules>
<action type="equip" set="idle" when="idle"/>
<if status="engaged">
<if mode="or" target="$highevamobs" buffactive="Blind|Flash">
<action type="equip" set="Melee" setgroup="HighAcc" when="Engaged|AfterCast"/>
<action type="addtochat" when="Engaged|AfterCast">Engaged: HighAcc for %Target</action>
</if>
<else>
<action type="equip" set="Melee" when="Engaged|AfterCast"/>
<action type="addtochat" when="Engaged|AfterCast">Engaged: Normal for %Target</action>
</else>
</if>
<else>
<action type="equip" set="idle" when="idle|aftercast"/>
</else>
<!-- Sometimes when engaging the %Target is empty, this gets around that -->
<if spell="autoset" status="engaged" target="">
<action type="command" when="engaged">wait 1; input /ma Stun .engagehack</action>
</if>
<if advanced='"%SpellTarget"=".engagehack"'>
<if mode="or" target="$highevamobs" buffactive="Blind|Flash">
<action type="equip" set="Melee" setgroup="HighAcc" when="PreCast"/>
<action type="addtochat" when="PreCast">Workaround: HighAcc for %Target</action>
</if>
<action type="cancelspell"/>
</if>
<if type="weaponskill">
<action type="castdelay" delay="0.5"/>
<if mode="or" buffactive="Sneak Attack" advanced='"$sa"="true"'>
<if notbuffactive="Sneak Attack">
<action type="addtochat">SA workaround</action>
</if>
<action type="equip" set="STR"/>
<action type="addtochat">STR set for %Target</action>
</if>
<else>
<if mode="or" target="$highevamobs" buffactive="Blind|Flash">
<action type="equip" set="WS" setgroup="HighAcc"/>
<action type="addtochat">HighAcc WS for %Target</action>
</if>
<else>
<action type="equip" set="WS"/>
<action type="addtochat">Normal WS for %Target</action>
</else>
</else>
<action type="aftercastdelay" delay="1"/>
<if spell="Tachi: Yukikaze|Tachi: Gekko|Tachi: Hobaku|Impulse Drive">
<action type="equip">
<neck>Snow Gorget</neck>
</action>
<action type="addtochat">Adding Snow Gorget</action>
</if>
</if>
<elseif spell="Sneak Attack">
<action type="var" cmd="set sa true"/>
<action type="command">wait 2; sc var set sa false</action>
</elseif>
<elseif spell="Meditate">
<action type="castdelay" delay="1"/>
<action type="equip" when="Precast" set="Meditate"/>
<action type="aftercastdelay" delay="1"/>
<action type="addtochat">Meditate gear</action>
</elseif>
<elseif spell="Warding Circle">
<action type="castdelay" delay="1"/>
<action type="equip" when="Precast">
<head>Myochin Kabuto</head>
</action>
<action type="aftercastdelay" delay="1"/>
<action type="addtochat">Kabuto for Warding Circle</action>
</elseif>
</rules>
</spellcast>