
Originally Posted by
SephYuyX
Why do you prefer this way
Code:
function midcast(spell)
if spell.english == "Stoneskin" then
equip(sets.midcast.Stoneskin)
elseif sets.midcast[spell.skill] then
equip(sets.midcast[spell.skill])
end
if spell.element == world.weather_element or spell.element == world.day_element then
equip(sets.midcast.Obis[spell.element])
end
end
Over this way
Code:
function midcast(spell)
if spell.english == "Stoneskin" then
equip(sets.midcast.Stoneskin)
elseif spell.element == world.weather_element or spell.element == world.day_element then
equip(sets.midcast[spell.skill],sets.midcast.Obis[spell.element])
elseif sets.midcast[spell.skill] then
equip(sets.midcast[spell.skill])
end
end
actually i prefer this way because it will:
1) not equip obi for these abilitys'/jobability','/pet','/weaponskill','/monsterskill','/range' or for items
2) because you can get some of the benefits from your gear sets and your obi's
Code:
res = require 'resources'
function midcast(spell)
if spell.english == "Stoneskin" then
equip(sets.midcast.Stoneskin)
elseif sets.midcast[spell.skill] then
equip(sets.midcast[spell.skill], obi_select(spell))
end
end
function obi_select(spell)
local non_obi = S{'/jobability','/pet','/weaponskill','/monsterskill','/range'}
if not Typ.abilitys:contains(spell.prefix) and spell.action_type ~= "Item" then
local spell_element = (type(spell.element)=='number' and res.elements[spell.element] or res.elements:with('name', spell.element))
if spell_element.name == world.weather_element or spell_element.name == world.day_element then
return sets.midcast.Obis[spell_element.name]
end
return {}
end
return {}
end
example:
what happens with out obi triggered this is what you equip
Code:
sets.midcast['Elemental Magic'] = {
main="Lathi",
head="Nahtirah Hat",
neck="Orunmila's Torque",
ear1="Enchanter Earring +1",
ear2="Loquacious Earring",
body="Anhur Robe",
hands="Hagondes Cuffs",
lring="Prolix Ring",
rring="Veneficium Ring",
back="Swith Cape +1",
waist="Witful Belt",
legs="Artsieq Hose",
feet="Chelona Boots +1"}
but with obi triggered you will equip this
Code:
sets.midcast['Elemental Magic'] = {
main="Lathi",
head="Nahtirah Hat",
neck="Orunmila's Torque",
ear1="Enchanter Earring +1",
ear2="Loquacious Earring",
body="Anhur Robe",
hands="Hagondes Cuffs",
lring="Zodiac Ring"
rring="Veneficium Ring",
back="Twilight Cape",
waist=obi
legs="Artsieq Hose",
feet="Chelona Boots +1"}
how ever with your code when obi is triggered you will only equip this
Code:
sets.midcast['obi'] = {
lring="Zodiac Ring"
back="Twilight Cape",
waist=obi}