Skip to content

Instantly share code, notes, and snippets.

@z16
Created October 28, 2014 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save z16/228a8a076b9d714d3b51 to your computer and use it in GitHub Desktop.
Save z16/228a8a076b9d714d3b51 to your computer and use it in GitHub Desktop.
function precast(spell,action)
handled = send_precast_action(spell)
if handled then print('handled') return end
if midaction() then print('midaction') cancel_spell() return end
local equipSet = nil
if spell.type=="JobAbility" then
equipSet = sets.JA
if equipSet[spell.english] then
equipSet = equipSet[spell.english]
print('JA specific equip')
else
print('JA general equip')
end
elseif spell.type=="WeaponSkill" then
if player.target.distance>6 then
message('Target too far away!')
cancel_spell()
print('WS distance')
return
end
equipSet = ws_gear(spell)
print('WS equip')
elseif spell.type=="Ninjutsu" or string.find(spell.type,"Magic") then
equipSet = sets.precast
if equipSet[spell.type] then
equipSet = equipSet[spell.type]
print('Magic specific equip')
else
print('Magic general equip')
end
end
if equipSet then
print('Equipping')
equip(process_locks(equipSet,spell))
end
print('Not equipping')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment