Ever realize that switching out gear that has MP+ on it is a waste if you haven't used that MP up?
Ever wanted to squeeze every little extra bit of MP out that you can?
Ever wanted to be able to simply change out one piece of gear at a time once the MP is used?
This is the spot for you.
The following pieces of code will allow you to only switch out the pieces of gear that you've used the extra MP from. Starting with the smallest boost to the largest, so you the maximum benefit from all your pieces of MP+ gear, even the ones that only add a small amount. Of course, this can be tailored to allow you to switch out pieces that give MP, but you might deem more important to swap out anyway. The following will have various parts, going both in the variables section and the rules section. I'll try to explain as easily as I can, but if there's any questions, feel free to PM me on the forums, where I go by the same name: Fiarlia.
This section is NOT code and are should not be placed into spellcast at all. this table is simply included to make the sections of variables easier for you to fill out. Enter the amount of MP given in each slot when using your MAX MP set; (“Standard” set in my XML) If you never change a piece of gear when casting any spell (other things like resting DO NOT COUNT, only when casting), enter zero for the value, like my backpiece. I do change it out to rest, but that's the only time I do. So it gets a value of zero. My ammo never changes unless I'm meleeing, again, a zero. I left my gear and values in to give an example of how it's done.
Gear Slot Name of gear MP gained from gear
body Duelist's Tabard 24
head Duelist's Chapeau 14
hands Duelist's Gloves 18
legs Duelist's Tights 16
feet River Gaiters 35
back Rainbow Cape 0
wais tQiqirn Sash +1 14
neck Bead Necklace +1 22
ammo Phantom Tathlum 0
lear Antivenom Earring 15
rear Astral Earring 25
lring Ether Ring 40
rring Serket Ring 50
sub Bugard Strap +1 0
Next is the part where we start using the information of this table and inserting it into variables:
These variables are for ordering the gear locks. Using the above table, place them in order from largest MP amount to smallest.
<variables>
<var name="gear14mp">50</var>
<var name="gear13mp">40</var>
<var name="gear12mp">35</var>
<var name="gear11mp">25</var>
<var name="gear10mp">24</var>
<var name="gear09mp">22</var>
<var name="gear08mp">18</var>
<var name="gear07mp">16</var>
<var name="gear06mp">15</var>
<var name="gear05mp">14</var>
<var name="gear04mp">14</var>
<var name="gear03mp">0</var>
<var name="gear02mp">0</var>
<var name="gear01mp">0</var>
These variables correspond to the name of each gear slot in the same order as listed above. List them in the same order. If there are multiple slots with the same MP amount, list whichever you want to be allowed to switch first as being closer to “gear01slot”. The order of any slot with an MP amount of zero does not matter.
<var name="gear14slot">rring</var>
<var name="gear13slot">lring</var>
<var name="gear12slot">feet</var>
<var name="gear11slot">rear</var>
<var name="gear10slot">body</var>
<var name="gear09slot">neck</var>
<var name="gear08slot">hands</var>
<var name="gear07slot">legs</var>
<var name="gear06slot">rear</var>
<var name="gear05slot">waist</var>
<var name="gear04slot">head</var>
<var name="gear03slot">sub</var>
<var name="gear02slot">back</var>
<var name="gear01slot">ammo</var>
For each of these values, equip your full MP gear, change to each subjob and list your maximum MP. If you ever change your Max MP gearset, change these values to match. Likewise if lvling up a subjob changes your Max MP.
NOTE: This is used and written for my Red Mage. While these codes will work for any job, most people certainly won't have a need for many of the subjobs listed here. If there is a subjob listed that you will never use, simply delete that line. If you use a subjob that I do not have listed, such as Scholar, simply add another line using the same exact format that I'm using. Also take note that even if multiple subjobs have the same MP amount, you need to list them all seperately because of the way the rules are written.
<var name="BLMMaxMP">953</var>
<var name="WHMMaxMP">934</var>
<var name="DRKMaxMP">877</var>
<var name="SMNMaxMp">992</var>
<var name="NINMaxMP">856</var>
<var name="WARMaxMP">856</var>
<var name="BRDMaxMP">856</var>
</variables>
That's the end of the variables, and all that you had to edit. The next portion simply needs to be dumped into your rules section. It's best to place this near the top of your rules, but not required.
<if CommandPrefix="/magic|/song|/ninjutsu" notSpell="autoset">
<action type="equip" when="precast" set="FastCast" />
<if notstatus="Engaged">
<action type="equip" when="aftercast" set="Idle$Kiting" />
</if>
<action type="Disable" slot="$gear14slot|$gear13slot|$gear12slot|$gear11slot|$gear10slot|$gear09slot|$gear08slot|$gear07slot|$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
<if advanced='%MP<=($%SubJobMaxMP-$gear14mp-$gear13mp-$gear12mp-$gear11mp-$gear10mp-$gear09mp-$gear08mp-$gear07mp-$gear06mp-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear14slot|$gear13slot|$gear12slot|$gear11slot|$gear10slot|$gear09slot|$gear08slot|$gear07slot|$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</if>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear13mp-$gear12mp-$gear11mp-$gear10mp-$gear09mp-$gear08mp-$gear07mp-$gear06mp-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear13slot|$gear12slot|$gear11slot|$gear10slot|$gear09slot|$gear08slot|$gear07slot|$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear12mp-$gear11mp-$gear10mp-$gear09mp-$gear08mp-$gear07mp-$gear06mp-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear12slot|$gear11slot|$gear10slot|$gear09slot|$gear08slot|$gear07slot|$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear11mp-$gear10mp-$gear09mp-$gear08mp-$gear07mp-$gear06mp-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear11slot|$gear10slot|$gear09slot|$gear08slot|$gear07slot|$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear10mp-$gear09mp-$gear08mp-$gear07mp-$gear06mp-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear10slot|$gear09slot|$gear08slot|$gear07slot|$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear09mp-$gear08mp-$gear07mp-$gear06mp-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear09slot|$gear08slot|$gear07slot|$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear08mp-$gear07mp-$gear06mp-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear08slot|$gear07slot|$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear07mp-$gear06mp-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear07slot|$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear06mp-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear06slot|$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear05mp-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear05slot|$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear04mp-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear04slot|$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear03mp-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear03slot|$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear02mp-$gear01mp)'>
<action type="enable" slot="$gear02slot|$gear01slot" />
</elseif>
<elseif advanced='%MP<=($%SubJobMaxMP-$gear01mp)'>
<action type="enable" slot="$gear01slot" />
</elseif>
</if>
And that's it. Once you've changed the variables and put everything in the proper place within your XML, you are ready to go!
A few notes; I currently don't have this set for Level Synch. These Locks only take place when you're casting magic. These will not prevent gearswaps during Autosets, Weapon Skills, Job Abilities, or Pet Commands. If you wish to restrict gearswaps during any of those conditions, a bit more must be added to the rule. For more information on how to restrict other actions, please see the spellcast rules page by clicking here.
Make sure that if you're restricting other things for gearswaps you include
Mode="OR"
in the rule line.
I hope everyone enjoys this and finds it useful! Feel free to PM me with questions, suggestions and/or praise ( >_>. . . what? <_<) if you want!