
Originally Posted by
Digg
Hey guys,
I tried posting this over at ffxiah Forums but it got moved to some diffuse dead space so I'll try here aswell
With the addition of the new "Mekira-oto +1", the Gavialis Helm - could it be really nice with some input on how to get this to work properly in Gearswap. I am very familiar with spellcast but putting up new rules in lua is a bit unlikely for me atm. Appreciate any help! And I'm sure this will help others aswell

This is what I'm doing. Mote already had most of the logic in place for switching elemental belt/gorgets, so I just modified that a bit.
Code:
function is_sc_element_today(spell)
if spell.type ~= 'WeaponSkill' then
return
end
local weaponskill_elements = S{}:
union(skillchain_elements[spell.skillchain_a]):
union(skillchain_elements[spell.skillchain_b]):
union(skillchain_elements[spell.skillchain_c])
if weaponskill_elements:contains(world.day_element) then
return true
else
return false
end
end
Then you can query the function in job_post_precast() (assuming you use Mote's). It will return true if the day is aligned with whichever WS you're using. You'll have to make a set containing just the helm somewhere in init_gear_sets() i.e. sets.WSDayBonus = { head="Gavialis Helm" }
Code:
job_post_precast(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' then
if is_sc_element_today(spell) then
equip(sets.WSDayBonus)
end
end
end
If you want to exclude any WS's or lock it down to only working with certain WS, you'd have to do something like this.
Code:
if spell.type == 'WeaponSkill' then
if spell.english ~= 'Stardiver' then
equip(sets.WSDayBonus)
end
end