function precast(spell) if spell.english == "Impact" then equip(sets['precast_FastCast'],{body="Twilight Cloak"}) if not buffactive['elemental seal'] then add_to_chat(8,'––––- Elemental Seal is down ––––-') end
elseif spell.english == "Cure" then if not buffactive.aurorastorm then add_to_chat(8,'––––- Aurorastorm is down ––––-') end
elseif spell.english == "Cure II" then if not buffactive.aurorastorm then add_to_chat(8,'––––- Aurorastorm is down ––––-') end
elseif spell.english == "Cure III" then if not buffactive.aurorastorm then add_to_chat(8,'––––- Aurorastorm is down ––––-') end
elseif spell.english == "Cure IV" then if not buffactive.aurorastorm then add_to_chat(8,'––––- Aurorastorm is down ––––-') end
elseif spell.skill=='ElementalMagic' and spell.cast_time < 3 then equip(sets.midcast_ElementalMagic) if spell.element == 'Earth' then equip({neck="Quanpur Necklace"}) end if spell.element == world.weather_element or spell_element == world.day_element and sets.Obi[spell.element] then equip(sets.Obi[spell.element]) end elseif spell.english == 'Stun' then equip(sets['precast_Stun']) if not buffactive.thunderstorm then add_to_chat(8,'––––- Thunderstorm is down ––––-') elseif not buffactive.klimaform then add_to_chat(8,'–––––- Klimaform is down –––––-') end if stuntarg ~= 'Shantotto' then send_command('@input /t '..stuntarg..' –– Byrth Stunned!!! –– ') end else equip(sets['precast_FastCast']) end
if (buffactive.alacrity or buffactive.celerity) and world.weather_element == spell.element then equip({feet='Argute Loafers +2'}) end
end
function midcast(spell) if string.find(spell.english,'Cur') then equip(sets.midcast_Cure) if spell.element == world.weather_element or spell_element == world.day_element then equip({main="Chatoyant Staff"},sets.Obi[spell.element]) end if buffactive.rapture then equip({head="Savant's Bonnet +2"}) end
elseif spell.english == "Impact" then local tempset = sets["midcast_Impact"] tempset['body'] = "Twilight Cloak" tempset['head'] = empty equip(tempset) if spell.element == world.weather_element or spell_element == world.day_element then equip(sets.Obi[spell.element]) end if sets.staves.damage[spell.element] then equip(sets.staves.damage[spell.element]) end elseif spell.skill=="ElementalMagic" then if string.find(spell.english,'helix') then equip(sets['midcast_Helix']) else equip(sets.midcast_ElementalMagic) if spell.element=='Earth' then equip({neck="Quanpur Necklace"}) end if spell.element == world.weather_element or spell_element == world.day_element then equip(sets.Obi[spell.element]) end end if buffactive.ebullience then equip({head="Savant's Bonnet +2"}) end if buffactive.klimform then equip ({feet="Savant's Loafers +2"}) end
elseif spell.english == 'Stoneskin' then equip(sets['midcast_Stoneskin']) elseif spell.skill == 'EnhancingMagic' then if spell.english == 'Embrava' then equip(sets['midcast_Embrava']) if not buffactive.perpetuance then add_to_chat(8,'––––- Perpetuance is down ––––-') end if not buffactive.accession then add_to_chat(8,'––––- Accession is down ––––-') end if not buffactive.penury then add_to_chat(8,'––––- Penury is down ––––-') end end if buffactive.perpetuance then equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"}) else equip(sets['midcast_EnhancingMagic']) end else weathercheck(spell.element,sets['midcast_'..spell.skill]) end
if spell.english == "Stoneskin" then send_command('@wait 1.4;cancel 37;') end
if spell.english == "Sneak" then send_command('@wait .8;cancel 71;') end
end
function aftercast(spell) equip(sets['aftercast_Idle'])
if spell.english == 'Sleep' or spell.english == 'Sleepga' then send_command('@wait 50;input /echo –––- '..spell.english..' is wearing off in 10 seconds –––-') elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then send_command('@wait 80;input /echo –––- '..spell.english..' is wearing off in 10 seconds –––-') elseif spell.english == 'Break' or spell.english == 'Breakga' then send_command('@wait 20;input /echo –––- '..spell.english..' is wearing off in 10 seconds –––-') end end function aftercast(spell,action) if not spell.english['Sublimation'] and buffactive['Sublimation: Activated'] and 'stunmode' ~= 'true' then equip(sets['aftercast_Idle_Sub']) elseif spell.english == 'Sublimation' and not buffactive['Sublimation: Activated'] and 'stunmode' ~= 'true' then equip(sets['aftercast_Idle_Sub']) else equip(sets['aftercast_Idle_noSub']) end end
function buff_change(status,gain_or_loss) if status == 'Sublimation: Activated' and gain_or_loss == 'loss' and'stunmode' ~= 'true' then equip(sets['aftercast_Idle_noSub']) sets.aftercast_Idle = sets.aftercast_Idle_noSub end end
– This function is user defined, but never called by GearSwap itself. It's just a user function that's only called from user functions. I wanted to check the weather and equip a weather-based set for some spells, so it made sense to make a function for it instead of replicating the conditional in multiple places.
function weathercheck(spell_element,set) if spell_element == world.weather_element or spell_element == world.day_element then equip(set,sets['Obi_'..spell_element]) else equip(set) end end
Murfhe Admin replied
603 weeks ago