Since you seem genuinely interested in learning how to make this on your own, I'm going to write this all in pseudocode. It's really because I'm tired and lazy, but I also insist that might help you follow the logic better by not having to translate the code in your head.
As a disclaimer though, I've honestly only looked at two other Spellcast XMLs before, so I don't have a lot of experience with the latest and greatest special functions. There may be examples here that can be written better, but the logic behind everything should still apply.
There are a couple of main tips you may want to keep in mind. You probably already understand some of this, but just to cover the basics:
- You should use only one section of the rules to handle equipping your idle/engaged gear. In this case, you have the first rule in your XML, <if spell="autoset"> area, and the rules at the bottom for Impetus/HF/and buffnotactive etc. Stick to just one, so that when you come back to change your engaged sets, you don't have to look through all your rules for anything related to TP gear. This also goes for weaponskills, JAs, spells, triggers, etc. Keep things organized and simple!
- You should avoid redundant rules. In your first rule, you equip the set Engaged when you are engaged; and yet, you do this again as your very last rule.
- If, else, and ifelses are the backbones of your rules, so it's important to understand when and where to use them:
- An
if will open a set of conditions--or you can think of them like "questions." If buffactive="Impetus" means "Is Impetus on? If so, do everything in the brackets below." Once one of the questions is answered "yes," all other questions in a series will be ignored. Once another if is read, a new set of conditions starts.
-
Elseifs are best used when you need to ask more than one question in the same series of conditions. However, this question is only asked if all preceding questions answered "no," so this question is worded a little differently. Be careful about this, because maybe, like the following example, you don't necessarily need the previous answers to be "no."
For example: In your bit with Impetus and HF sets, your first question is "Is Impetus on?" and your second question is "If Impetus is not on, is Hundred Fists on?"
On the otherhand, it's good to use elseifs when several rows of ifs are not necessary.
For example: In your lists of weaponskills, you can change all but the first if into elseifs. Why? Because it's a given that if the weaponskill is Asuran Fists, it can't be Victory Smite, or Fury, etc.
-
Elses can be used as a fallback, or whenever it's unnecessary to ask any questions after all the other answers before it was "no."
For example: In your list of weaponskills, you can rewrite the order so that your fallback case is the WeaponSkill set, which needs no condition since it will only be read if all other questions answered "no"
Code
elseif type="weaponskill"
if spell="Asuran"
equip Asuran
elseif spell="Victory"
equip Victory
elseif spell="Fury"
equip Fury
else
equip WeaponSkill
- Order is important in your sets of conditions! Again, once a question is answered "yes," the code will immediately skip over the rest of the elseifs and elses in the set and pick up wherever it finds a new if. So make sure that answering yes to a previous question won't interfere with one of your later questions. If it does, you may either need to change the order or create a new set of conditions.
For example: In your bit with Impetus and HF sets, you are first asking if you have Impetus on; if you do, it will equip that set and skip over all proceeding elses and ifelses. It will never ask if you have Hundred Fists on. Of course, this doesn't seem right since HF set should take priority. I'd suggest making it the first question.
- Learn to use if, ifelses, and elses to do more than add functionality--use them to organize your sections.
For example: If you change <if type="JobAbility"> to <elseif type="JobAbility"> and wrap your WS rules in an <elseif type="WeaponSkill">, your code will look cleaner and execute better, even though the output looks the same to you. It's not hugely important, but it's great when your XML gets bigger and more complicated.
Code
rules
if spell="autoset"
do idle/engaged stuff
elseif type="jobability"
do job ability stuff
elseif type="weaponskill"
do weaponskill stuff
- Essentially, you want as little code as possible that will still accomplish what you need to. This will make it a lot easier to go back and change/update things later on.
Now, specifically, to answer your question. Your rules will "work," but not well, and it will be annoying to change later on. First, you probably want to remove the rules you put for Impetus and HF at the bottom, and rewrite the first rule to incorporate them like this:
Code
if spell="autoset"
if status="idle"
equip idle
elseif status="engaged"
if buffactive="HF"
equip HF
elseif buffactive="Impetus"
equip Impetus
else
equip Engaged
As for groups, they're fairly simple, but I don't use them and I'm not sure when they are ideal to use (for different weapons?), so my explanation would probably sound more technical than helpful to you without a logical example. For my jobs, I've always stuck to using variable toggles instead. Variable toggles help to simplify your rules for what sets to equip. For example, I may create a variable called "impStatus," and create a rule to toggle this variable into the above code:
Code
if spell="autoset"
if buffactive="Impetus"
set $impStatus impUp
else
set $impStatus impDown
if status="idle"
equip idle
elseif status="engaged"
if buffactive="HF"
equip HF
elseif buffactive="Impetus"
equip Impetus
else
equip Engaged
However, although this variable is nice to have, we aren't using it for anything... But what if we simplify your code a little bit by naming your default TP set "Engaged-impDown" and your Impetus TP set "Engaged-impUp" and using this variable in the rules of your code:
Code
if spell="autoset"
if buffactive="Impetus"
set $impStatus impUp
else
set $impStatus impDown
if status="idle"
equip idle
elseif status="engaged"
if buffactive="HF"
equip HF
else
equip Engaged-$impStatus
You can use this for a variety of things like low/high accuracy, low/high haste situations, etc. If you wanted to add accuracy as a variable, and even Hundred Fists (what if you HF something with high evasion), your rule might look like this:
Code
if spell="autoset"
if buffactive="Impetus"
set $impStatus impUp
else
set $impStatus impDown
if buffactive="Hundred Fists"
set $HF HFUp
else
set $HF HFDown
if status="idle"
equip idle
elseif status="engaged"
equip Engaged-$impStatus-$myAcc-$HF
But how would you decide the value for the variable myAcc? You can declare your var myAcc as highAcc by default, then add a trigger that will toggle it whenever you use it. You can use this trigger by typing /ja "Trigger1" <me> in game. This code would go outside of <if spell="autoset">; I would put it directly after, but before <if type="JobAbility">.
Code
elseif spell="Trigger*"
if spell="Trigger1"
if $myAcc == lowAcc
set $myAcc highAcc
else
set $myAcc lowAcc
if spell="Trigger2"
control another variable here!
But remember to make a set for every possible situation! Otherwise, you'll get an error if the XML can't find the set it wants to load. If you want a set for every possible combination of the above, you'd end up with a lot of sets, probably more than you need/want:
set Engaged-impOn-lowAcc-HFOff
set Engaged-impOff-lowAcc-HFOff
set Engaged-impOn-highAcc-HFOff
set Engaged-impOff-highAcc-HFOff
set Engaged-impOn-lowAcc-HFOn
set Engaged-impOff-lowAcc-HFOn
set Engaged-impOn-highAcc-HFOn
set Engaged-impOff-highAcc-HFOn
But maybe you don't care whether Impetus is on or off during Hundred Fists. So instead you can use wildcard (*) to simplify these. Wildcard simply means that anything can go there, as long as the rest of the string matches:
set Engaged-impOn-lowAcc-HFOff
set Engaged-impOff-lowAcc-HFOff
set Engaged-impOn-highAcc-HFOff
set Engaged-impOff-highAcc-HFOff
set Engaged-*-lowAcc-HFOn (replaces both set Engaged-impOn-lowAcc-HFOn and set Engaged-impOff-lowAcc-HFOn)
set Engaged-*-highAcc-HFOn (replaces both set Engaged-impOn-highAcc-HFOn and set Engaged-impOff-highAcc-HFOn)
The great part is you can use these toggles for your WS sets too!
Code
elseif type="weaponskill"
if spell="Victory Smite"
equip set VS-$impStatus-$myAcc
(And then remember to make all the possible VS-$impStatus-$myAcc sets.)
I think that covers everything you seemed to need for now, and hopefully I successfully taught you at least one thing out of this.
It's time for me to stop procrastinating work now @___________@~