Code:
<if mode="OR" spell="Impetus" Buffactive="Impetus">
<equip set="TP Impetus" />
</if>
<if spell="autoset">
<if area="*Windurst*|Heavens*|*San d'Oria*|Chateau*|*Bastok*|Metalworks|*Jeuno*|Ru'Lude*|*Whitegate|Al Zahbi|Chocobo*|*Colosseum|Selbina|Mhaura|Kazham|Norg|Tavnazia*" notarea="Dynamis*|*[S]" notbuffactive="Besieged">
<action type="Equip" when="idle|engaged|resting|precast|midcast|aftercast" set="Town" />
</if>
<else>
<action type="equip" when="aftercast" set="IDLE"/>
</else>
<action type="equip" when="engaged" set="TP"/>
</if>
<if NotStatus="Engaged">
<if area="*Windurst*|Heavens*|*San d'Oria*|Chateau*|*Bastok*|Metalworks|*Jeuno*|Ru'Lude*|*Whitegate|Al Zahbi|Chocobo*|*Colosseum|Selbina|Mhaura|Kazham|Norg|Tavnazia*" notarea="Dynamis*|*[S]" notbuffactive="Besieged">
<action type="Equip" when="idle|engaged|resting|precast|midcast|aftercast" set="Town" />
</if>
<else>
<action type="equip" when="aftercast" set="IDLE"/>
</else>
</if>
<else>
<action type="equip" when="aftercast" set="TP"/>
</else>
The last part with the <else> makes you change gear if you're anything but not engaged, so if you are engaged, you'll use the set TP even if impetus is up. To fix this:
Code:
<if status="engaged">
<if mode="OR" spell="Impetus" Buffactive="Impetus">
<equip when="aftercast" set="TP Impetus" />
</if>
<else>
<equip when="aftercast" set="TP" />
</else>
</if>
<elseif NotStatus="Engaged">
<if area="*Windurst*|Heavens*|*San d'Oria*|Chateau*|*Bastok*|Metalworks|*Jeuno*|Ru'Lude*|*Whitegate|Al Zahbi|Chocobo*|*Colosseum|Selbina|Mhaura|Kazham|Norg|Tavnazia*" notarea="Dynamis*|*[S]" notbuffactive="Besieged">
<action type="Equip" when="idle|engaged|resting|precast|midcast|aftercast" set="Town" />
</if>
<else>
<action type="equip" when="aftercast" set="IDLE"/>
</else>
</elseif>
Working on WS piece soon.