I just gave an example of how you would do it. You could probably have a function that would get your max HP when wearing your Pre set and set the HP value in a variable some where. I also didn't account for non 50% jobs like pld or drk.
so.... something like this
Code:
function update_HB_threshold()
equip(sets.HB.Pre)
-- most of these local vars and current_threshold would probably be defined in get_sets()
local half_thresh = S{'BLM', 'WHM', 'RDM', 'BLU', 'SMN', 'SCH', 'BRD'}
local third_thresh = S{'PLD', 'DRK', 'NIN'}
if half_thresh[player.sub_job] then
current_threshold = floor(player.max_hp / 2)
elseif third_thresh[player.sub_job] then
current_threshold = floor(player.max_hp / 2)
else
current_threshold = -1
end
end
function self_command(command)
if command == 'update HB' then
update_HB_threshold()
end
end
function midcast(spell, action)
local magic_types = S{'BlackMagic', 'WhiteMagic', 'SummoningMagic', 'BlueMagic', 'Singing', 'Geomancy', 'Ninjutsu'} -- Not sure these are the right types
if magic_types[spell.type] then
if player.hp < current_threshold then
equip(sets.HB.Pre)
end
end
end