
Originally Posted by
Shadowmeld
its been a while since I have played, but if you want some control over whether to use the obi with one conflicting weather or not you could use logic similar to this...
Note 1: I have the following mappings
Code:
elements = {}
elements.use_on_single_conflict = false
elements.strong_against = {['Fire'] = 'Ice', ['Earth'] = 'Thunder', ['Water'] = 'Fire', ['Wind'] = 'Earth', ['Ice'] = 'Wind', ['Thunder'] = 'Water', ['Light'] = 'Dark', ['Dark'] = 'Light'}
elements.weak_against = {['Fire'] = 'Water', ['Earth'] = 'Wind', ['Water'] = 'Thunder', ['Wind'] = 'Ice', ['Ice'] = 'Fire', ['Thunder'] = 'Earth', ['Light'] = 'Dark', ['Dark'] = 'Light'}
Note 2: Logic code for using obi
Code:
function use_obi(spell, equip_set)
local use_obi = false
-- first check to see if any elemental obi rule matches
if(S{world.day_element, world.weather_element}:contains(spell.element)) then
-- If at least one matches, try to find out if there is also a weak element involved
if ( world.weather_element == elements.weak_against[spell.element] ) then
-- If weak weather is involved, but it is only single weather, check to see if use_on_single_conflict is set to true
if ( world.weather_id % 2 == 0 and elements.use_on_single_conflict) then
use_obi = true
end
elseif (world.day_element == elements.weak_against[spell.element]) then
-- If weak day is involved check for double weather or single weather + use_on_single_conflict set to true
if (world.weather_id % 2 == 1 or ( elements[use_on_single_conflict] and world.weather_id % 2 == 0) ) then
use_obi = true
end
end
end
if (use_obi) then
equip_set = set_combine(equip_set, { waist = "Hachirin-No-Obi"})
end
return equip_set
end
I am conflicted as to whether to use the example above on my blm lua (Montente's btw) or Qixacotl's example. I tried adding Qixacotl's and I don't think it's working. I placed it here:
Code:
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
if spellMap == 'Cure' or spellMap == 'Curaga' then
gear.default.obi_waist = "Bishop Sash"
elseif spell.skill == 'Elemental Magic' then
gear.default.obi_waist = "Sekhmet Corset"
if state.CastingMode.value == 'Proc' then
classes.CustomClass = 'Proc'
end
end
end
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Elemental Magic' then
if spell.element == world.day_element or spell.element == world.weather_element then
equip(sets.midcast['Elemental Magic'], {waist="Hachirin-No-Obi"})
end
elseif spell.skill == 'Healing Magic' then
if spell.name:startswith('Cure') and world.day_element == 'Light' or world.weather_element == 'Light' then
equip(sets.midcast.Cure, {waist="Hachirin-No-Obi"})
end
end
end
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
equip(sets.magic_burst)
end
end
function job_aftercast(spell, action, spellMap, eventArgs)
-- Lock feet after using Mana Wall.
if not spell.interrupted then
if spell.english == 'Mana Wall' then
enable('feet')
equip(sets.buff['Mana Wall'])
disable('feet')
elseif spell.skill == 'Elemental Magic' then
state.MagicBurst:reset()
end
end
end
Also, If I were to go with Shadowmeld's option, where do I add the elements (Note 1) and the coding for obi (Note 2) so that it works properly. New at this as well.