Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Original File: MNK.xml
- -- Generated By: SpellcastLua 0.12 (beta)
- spellcast = {}
- spellcast.vars = {
- ['gear'] = 1,
- }
- spellcast.group = 'MNK'
- spellcast.groups = {
- {
- name = 'MNK',
- {
- name = 'TP',
- items = {
- main = 'Rigor Baghnakhs',
- ammo = 'Thew Bomblet',
- head = 'Thurandaut Chapeau',
- neck = 'Asperity Necklace',
- lear = 'Steelflash Earring',
- rear = 'Bladeborn Earring',
- body = 'Thaumas Coat',
- hands = 'Melee Gloves +2',
- lring = 'Rajas Ring',
- rring = 'Epona's Ring',
- back = 'Atheling Mantle',
- waist = 'Black Belt',
- legs = 'Manibozho Brais',
- feet = 'Manibozho Boots',
- },
- locks = {}
- },
- {
- name = 'Idle',
- items = {
- ammo = 'Thew Bomblet',
- head = 'Oce. Headpiece +1',
- neck = 'Wiglen Gorget',
- lear = 'Steelflash Earring',
- rear = 'Bladeborn Earring',
- body = 'Thaumas Coat',
- hands = 'Melee Gloves +2',
- lring = 'Paguroidea Ring',
- rring = 'Sheltered Ring',
- back = 'Atheling Mantle',
- waist = 'Black Belt',
- legs = 'Manibozho Brais',
- feet = 'Hermes' Sandals',
- },
- locks = {}
- },
- {
- name = 'MidACC',
- base_set = 'TP',
- items = {
- body = 'Manibozho Jerkin',
- },
- locks = {}
- },
- {
- name = 'HighACC',
- base_set = 'TP',
- items = {
- body = 'Manibozho Jerkin',
- waist = 'Anguinus Belt',
- },
- locks = {}
- },
- {
- name = 'Ascetics',
- items = {
- ammo = 'Tantra Tathlum',
- head = 'Thurandaur Chapeau',
- neck = 'Rancor Collar',
- lear = 'Brutal Earring',
- rear = 'Kemas Earring',
- body = 'Kirin's Osode',
- hands = 'Heafoc Mitts',
- lring = 'Rajas Ring',
- rring = 'Pyrosoul Ring',
- back = 'Atheling mantle',
- waist = 'Warwolf Belt',
- legs = 'Manibozho Brais',
- feet = 'Tantra Gaiters +2',
- },
- locks = {}
- },
- {
- name = 'Resting',
- items = {
- back = 'Melee Cape',
- },
- locks = {}
- },
- {
- name = 'Asuran',
- items = {
- ammo = 'Thew Bomblet',
- head = 'Aias Bonnet',
- neck = 'Justiciar's Torque',
- lear = 'Aesir Ear Pendant',
- rear = 'Merman's Earring',
- body = 'Kirin's Osode',
- hands = 'Melee Gloves +2',
- lring = 'Rajas Ring',
- rring = 'Pyrosoul Ring',
- back = 'Atheling mantle',
- waist = 'Caudata Belt',
- legs = 'Tantra Hose +2',
- feet = 'Tantra Gaiters +2',
- },
- locks = {}
- },
- {
- name = 'Shijin',
- items = {
- ammo = 'Demonry Core',
- head = 'Thurandaut Chapeau',
- neck = 'Justiciar's Torque',
- lear = 'Steelflash Earring',
- rear = 'Bladeborn Earring',
- body = 'Manibozho Jerkin',
- hands = 'Thurandaut Gloves',
- lring = 'Rajas Ring',
- rring = 'Epona Ring',
- back = 'Atheling Mantle',
- waist = 'Caudata Belt',
- legs = 'Manibozho Brais',
- feet = 'Scopuli Nails',
- },
- locks = {}
- },
- {
- name = 'WS',
- base_set = 'Asuran',
- items = {
- head = 'Ocelo. Headpiece +1',
- hands = 'Heafoc Mitts',
- feet = 'Tantra Gaiters +2',
- },
- locks = {}
- },
- {
- name = 'Cata',
- items = {
- ammo = 'Thew Bomblet',
- head = 'Thurandaut Chapeau',
- neck = 'Atemis Medal',
- lear = 'Hecate's Earring',
- rear = 'Moldavite Earring',
- body = 'Kirin's Osode',
- hands = 'Heafoc Mitts',
- lring = 'Rajas Ring',
- rring = 'Pyrosoul Ring',
- back = 'Atheling Mantle',
- waist = 'Anguinus Belt',
- legs = 'Manibozho Brais',
- feet = 'Tantra Gaiters +2',
- },
- locks = {}
- },
- {
- name = 'ImpetusUp',
- items = {
- body = 'Thaumas Coat',
- },
- locks = {}
- },
- {
- name = 'Perfect Counter',
- items = {
- head = 'Tantra Crown +2',
- },
- locks = {}
- },
- {
- name = 'Chakra',
- items = {
- ammo = 'Tantra Tathlum',
- head = 'Genbu's Kabuto',
- rear = 'Kemas Earring',
- body = 'Temple Cyclas',
- hands = 'Melee Gloves +2',
- lring = 'Rajas Ring',
- rring = 'Spiral Ring',
- back = 'Melee Cape',
- waist = 'Caudata Belt',
- feet = 'Thurandaut Boots',
- },
- locks = {}
- },
- {
- name = 'Chi Blast',
- items = {
- head = 'Temple Crown',
- body = 'Kirin's Osode',
- lring = 'Dark Ring',
- rring = 'Dark Ring',
- back = 'Melee Cape',
- waist = 'Crudelis Belt',
- feet = 'Thurandaut Boots',
- },
- locks = {}
- },
- {
- name = 'PDT',
- items = {
- ammo = 'Tantra Tathlum',
- head = 'Arh. Jinpachi +1',
- neck = 'Twilight Torque',
- lear = 'Brutal Earring',
- rear = 'Darkness Earring',
- body = 'Arhat's Gi +1',
- hands = 'Tantra Gloves +1',
- lring = 'Rajas Ring',
- rring = 'Jelly Ring',
- back = 'Shadow Mantle',
- waist = 'Black Belt',
- legs = 'Tantra Hose +2',
- feet = 'Thurandaut Boots',
- },
- locks = {}
- },
- {
- name = 'MDT',
- items = {
- ammo = 'Thew Bomblet',
- head = 'Ganesha's Mask',
- neck = 'Twilight Torque',
- lear = 'Merman's Earring',
- rear = 'Merman's Earring',
- body = 'Avalon Breastplate',
- hands = 'Thurandaut Gloves',
- lring = 'Dark Ring',
- rring = 'Dark Ring',
- back = 'Mollusca Mantle',
- waist = 'Black Belt',
- legs = 'Manibozho Brais',
- feet = 'Manibozho Boots',
- },
- locks = {}
- },
- {
- name = 'MDTShellV',
- items = {
- ammo = 'Thew Bomblet',
- head = 'Ganesha's Mask',
- neck = 'Twilight Torque',
- body = 'Avalon Breastplate',
- hands = 'Thurandaut Gloves',
- lring = 'Dark Ring',
- rring = 'Dark Ring',
- back = 'Mollusca Mantle',
- waist = 'Black Belt',
- legs = 'Manibozho Brais',
- feet = 'Manibozho Boots',
- },
- locks = {}
- },
- {
- name = 'Turtle',
- items = {
- ammo = 'Tantra Tathlum',
- head = 'Arh. Jinpachi +1',
- neck = 'Twilight Torque',
- lear = 'Merman's Earring',
- rear = 'Merman's Earring',
- body = 'Avalon Breastplate',
- hands = 'Thurandaut Gloves',
- lring = 'Epona's RIng',
- rring = 'Dark Ring',
- back = 'Mollusca Mantle',
- waist = 'Black Belt',
- legs = 'Manibozho Brais',
- feet = 'Thrandaut Boots',
- },
- locks = {}
- },
- {
- name = 'Weap',
- items = {
- main = 'Rigor Baghnakhs',
- },
- locks = {}
- },
- },
- {
- {
- items = {
- hands = 'Temple Gloves',
- },
- locks = {}
- },
- {
- items = {
- feet = 'Melee Gaiters',
- },
- locks = {}
- },
- {
- items = {
- feet = 'Temple Gaiters',
- },
- locks = {}
- },
- {
- items = {
- head = 'Temple Crown',
- },
- locks = {}
- },
- {
- base_set = 'TP',
- items = {
- lear = 'Loquac. earring',
- },
- locks = {}
- },
- {
- items = {},
- locks = {
- head = true,
- }
- },
- {
- items = {},
- locks = {
- rear = true,
- }
- },
- {
- items = {},
- locks = {
- lear = true,
- }
- },
- {
- items = {},
- locks = {
- rring = true,
- }
- },
- {
- items = {},
- locks = {
- lring = true,
- }
- },
- },
- }
- function pretarget(spell, action)
- if spellcast.precast_equip then
- equip(spellcast.precast_equip)
- spellcast.precast_equip = nil
- return
- end
- spellcast.pass = { 'precast' }
- local s = { spell = spell,
- original_spell = spell,
- equip = {},
- locks = {} }
- local rules = function()
- -- BEGIN RULES
- if windower.wc_match(player.status, 'Engaged') then
- if spellcast.buffactive('Impetus') then
- spellcast.equip(s, 'ImpetusUp')
- elseif spellcast.buffactive('Perfect Counter') then
- spellcast.equip(s, 'Perfect Counter')
- end
- end
- if windower.wc_match(s.spell.type, 'WeaponSkill') then
- if windower.wc_match(s.spell.english, 'Ascetic's Fury') then
- spellcast.equip(s, 'Ascetics')
- add_to_chat(32, '****Ascetics Equipped****')
- end
- if windower.wc_match(s.spell.english, 'Asuran Fists') then
- spellcast.equip(s, 'Asuran')
- add_to_chat(32, '****Asuran Equipped****')
- end
- if windower.wc_match(s.spell.english, 'Shijin Spiral') then
- spellcast.equip(s, 'Shijin')
- add_to_chat(32, '****Shijin Equipped****')
- end
- if windower.wc_match(s.spell.english, 'Combo|Shoulder Tackle|One Inch Punch|Backhand Blow|Raging Fist|Spinning Attack|Howling FIst|Dragon Kick|Tornado Kick') then
- spellcast.equip(s, 'ws')
- add_to_chat(32, '****WS Equipped****')
- end
- elseif windower.wc_match(s.spell.type, 'JobAbility') then
- if windower.wc_match(s.spell.english, 'Boost') then
- spellcast.equip(s, spellcast.groups[2][1])
- end
- if windower.wc_match(s.spell.english, 'Counterstance') then
- spellcast.equip(s, spellcast.groups[2][2])
- end
- if windower.wc_match(s.spell.english, 'Impetus') then
- spellcast.equip(s, 'ImpetusUp')
- end
- if windower.wc_match(s.spell.english, 'Dodge') then
- spellcast.equip(s, spellcast.groups[2][3])
- end
- if windower.wc_match(s.spell.english, 'Focus') then
- spellcast.equip(s, spellcast.groups[2][4])
- end
- if windower.wc_match(s.spell.english, 'Chakra') then
- spellcast.equip(s, 'Chakra')
- end
- if windower.wc_match(s.spell.english, 'Chi Blast') then
- spellcast.equip(s, 'Chi Blast')
- end
- if windower.wc_match(s.spell.english, 'Perfect Counter') then
- spellcast.equip(s, 'Perfect Counter')
- end
- end
- if player.equipment.body == 'empty' or player.equipment.head == 'empty' or player.equipment.legs == 'empty' or player.equipment.feet == 'empty' or player.equipment.hands == 'empty' then
- add_to_chat(32, '***YOU NEKKID BRO***')
- if windower.wc_match(player.status, 'Engaded') then
- spellcast.equip(s, 'TP')
- end
- end
- if player.equipment.main == 'empty' then
- add_to_chat(32, '***ReEquipping Weap***')
- spellcast.equip(s, 'Weap')
- end
- if windower.wc_match(s.spell.english, 'Spectral Jig') then
- send_command('cancel 71')
- elseif windower.wc_match(s.spell.type, 'Ninjutsu') and not spellcast.buffactive('Silence|Sleep|Stun|Terror') and windower.wc_match(s.spell.english, 'Utsusemi*') then
- spellcast.equip(s, spellcast.groups[2][5])
- end
- if windower.wc_match(s.spell.english, 'Stone V') then
- if spellcast.get_var(s, 'GEAR') == '0' then
- add_to_chat(204, '--------------------Melee Hose LOCKED--------------------')
- send_command('input /equip legs "Melee Hose +2"')
- spellcast.disable('Legs')
- send_command('sc var set GEAR 1')
- cancel_spell()
- elseif spellcast.get_var(s, 'GEAR') == '1' then
- add_to_chat(204, '--------------------Melee Hose UNLOCKED--------------------')
- spellcast.enable('Legs')
- send_command('sc var set GEAR 0')
- if windower.wc_match(player.status, 'Idle') then
- send_command('sc set Idle')
- elseif windower.wc_match(player.status, 'Engaged') then
- send_command('sc set TP')
- end
- cancel_spell()
- end
- end
- if windower.wc_match(s.spell.english, 'Water V') then
- if spellcast.get_var(s, 'GEAR') == '0' then
- add_to_chat(204, '--------------------Melee Gloves LOCKED--------------------')
- send_command('input /equip hands "Melee Gloves +2"')
- spellcast.disable('Hands')
- send_command('sc var set GEAR 1')
- cancel_spell()
- elseif spellcast.get_var(s, 'GEAR') == '1' then
- add_to_chat(204, '--------------------Melee Gloves UNLOCKED-----------------')
- spellcast.enable('Hands')
- send_command('sc var set GEAR 0')
- if windower.wc_match(player.status, 'Idle') then
- send_command('sc set Idle')
- elseif windower.wc_match(player.status, 'Engaged') then
- send_command('sc set TP')
- end
- cancel_spell()
- end
- end
- if windower.wc_match(s.spell.english, 'Thunder V') then
- add_to_chat(204, '----------STNA Removing debuff----------')
- send_command('input //stna')
- cancel_spell()
- end
- if windower.wc_match(s.spell.english, 'Stonega IV') then
- if spellcast.buffactive('slow') then
- send_command('input /p Slowed ')
- end
- if spellcast.buffactive('paralysis') then
- send_command('input /p Paralysed ')
- end
- if spellcast.buffactive('petrification') then
- send_command('input /p Petrified ')
- end
- if spellcast.buffactive('charm') then
- send_command('input /p Charmed !! Please sleep me! ')
- end
- if spellcast.buffactive('Amnesia') then
- send_command('input /p Amnesia ')
- end
- if spellcast.buffactive('Sleep') then
- send_command('input /p zzz Please wake me ')
- end
- if spellcast.buffactive('Silence') then
- send_command('input /p Silenced ')
- end
- if spellcast.buffactive('Attack Down') then
- send_command('input /p Attack Down ')
- end
- if spellcast.buffactive('Accuracy Down') then
- send_command('input /p Acc Down ')
- end
- end
- if windower.wc_match(player.equipment.head, 'Reraise Hairpin') and not spellcast.buffactive('Reraise') then
- spellcast.equip(s, spellcast.groups[2][6])
- add_to_chat(204, '. . . . . . . . . . . . . . - - Reraise Hairpin Locked - - . . . . . . . . . . . . . .')
- elseif windower.wc_match(player.equipment.right_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
- spellcast.equip(s, spellcast.groups[2][7])
- add_to_chat(204, '. . . . . . . . . . . . . . - - Reraise Earring Locked - - . . . . . . . . . . . . . .')
- elseif windower.wc_match(player.equipment.left_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
- spellcast.equip(s, spellcast.groups[2][8])
- add_to_chat(204, '. . . . . . . . . . . . . . - - Reraise Earring Locked - - . . . . . . . . . . . . . .')
- end
- if windower.wc_match(player.equipment.right_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
- spellcast.equip(s, spellcast.groups[2][9])
- add_to_chat(204, '. . . . . . . . . . . . . . - - EXP Ring Locked - - . . . . . . . . . . . . . .')
- elseif windower.wc_match(player.equipment.left_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
- spellcast.equip(s, spellcast.groups[2][10])
- add_to_chat(204, '. . . . . . . . . . . . . . - - EXP Ring Locked - - . . . . . . . . . . . . . .')
- end
- -- END RULES
- end
- rules()
- if s.spell.name ~= spell.name then
- spellcast.precast_equip = s.equip
- cancel_spell()
- send_command(spell.prefix .. ' "' .. s.spell.name .. '" ' .. spell.target.raw)
- else
- equip(s.equip)
- end
- end
- function midcast(spell, action)
- spellcast.pass = { 'midcast' }
- local s = { spell = spell,
- original_spell = spell,
- equip = {},
- locks = {} }
- local rules = function()
- -- BEGIN RULES
- if windower.wc_match(player.status, 'Engaged') then
- if spellcast.buffactive('Impetus') then
- spellcast.equip(s, 'ImpetusUp')
- elseif spellcast.buffactive('Perfect Counter') then
- spellcast.equip(s, 'Perfect Counter')
- end
- end
- if not windower.wc_match(s.spell.type, 'WeaponSkill') and windower.wc_match(s.spell.type, 'JobAbility') then
- if windower.wc_match(s.spell.english, 'Impetus') then
- spellcast.equip(s, 'ImpetusUp')
- end
- if windower.wc_match(s.spell.english, 'Perfect Counter') then
- spellcast.equip(s, 'Perfect Counter')
- end
- end
- if not windower.wc_match(s.spell.english, 'Spectral Jig') and windower.wc_match(s.spell.type, 'Ninjutsu') and not spellcast.buffactive('Silence|Sleep|Stun|Terror') then
- if windower.wc_match(s.spell.english, 'Utsusemi*') then
- if windower.wc_match(s.spell.english, 'Utsusemi: Ichi') and spellcast.buffactive('Copy Image|Copy Image (2)|Copy Image (3)') then
- send_command('cancel 66')
- send_command('cancel 444')
- send_command('cancel 445')
- end
- elseif windower.wc_match(s.spell.english, 'Monomi*') and spellcast.buffactive('Sneak') and windower.wc_match(s.original_spell.target.type, 'Self') then
- send_command('cancel 71')
- end
- end
- if windower.wc_match(player.equipment.head, 'Reraise Hairpin') and not spellcast.buffactive('Reraise') then
- spellcast.equip(s, spellcast.groups[2][6])
- elseif windower.wc_match(player.equipment.right_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
- spellcast.equip(s, spellcast.groups[2][7])
- elseif windower.wc_match(player.equipment.left_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
- spellcast.equip(s, spellcast.groups[2][8])
- end
- if windower.wc_match(player.equipment.right_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
- spellcast.equip(s, spellcast.groups[2][9])
- elseif windower.wc_match(player.equipment.left_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
- spellcast.equip(s, spellcast.groups[2][10])
- end
- -- END RULES
- end
- rules()
- equip(s.equip)
- end
- function aftercast(spell, action)
- spellcast.pass = { 'aftercast' }
- local s = { spell = spell,
- original_spell = spell,
- equip = {},
- locks = {} }
- local rules = function()
- -- BEGIN RULES
- if not windower.wc_match(player.status, 'Engaged') then
- spellcast.equip(s, 'Idle')
- else
- spellcast.equip(s, 'TP')
- end
- if windower.wc_match(player.status, 'Engaged') then
- if spellcast.buffactive('Impetus') then
- spellcast.equip(s, 'ImpetusUp')
- elseif spellcast.buffactive('Perfect Counter') then
- spellcast.equip(s, 'Perfect Counter')
- else
- spellcast.equip(s, 'TP')
- end
- end
- if windower.wc_match(s.spell.type, 'WeaponSkill') then
- if windower.wc_match(s.spell.english, 'Ascetic's Fury') then
- spellcast.equip(s, 'TP')
- end
- if windower.wc_match(s.spell.english, 'Asuran Fists') then
- spellcast.equip(s, 'TP')
- end
- if windower.wc_match(s.spell.english, 'Shijin Spiral') then
- spellcast.equip(s, 'TP')
- end
- if windower.wc_match(s.spell.english, 'Combo|Shoulder Tackle|One Inch Punch|Backhand Blow|Raging Fist|Spinning Attack|Howling FIst|Dragon Kick|Tornado Kick') then
- spellcast.equip(s, 'TP')
- end
- elseif windower.wc_match(s.spell.type, 'JobAbility') then
- if windower.wc_match(s.spell.english, 'Boost') then
- send_command('wait 15;input /echo **********Boost Ready**********')
- end
- if windower.wc_match(s.spell.english, 'Counterstance') then
- send_command('wait 296;input /echo **********Counter Stance Ready**********')
- end
- if windower.wc_match(s.spell.english, 'Impetus') then
- spellcast.equip(s, 'ImpetusUp')
- send_command('input /echo Impetus active Locking Body!')
- send_command('wait 296;input /echo **********Dodge Focus Impetus Ready!**********')
- end
- if windower.wc_match(s.spell.english, 'Chakra') then
- send_command('wait 296;input /echo **********Chakra Ready**********')
- end
- if windower.wc_match(s.spell.english, 'Chi Blast') then
- send_command('wait 180;input /echo **********Chi Blast Ready**********')
- end
- if windower.wc_match(s.spell.english, 'Perfect Counter') then
- spellcast.equip(s, 'Perfect Counter')
- send_command('input /echo Perfect Counter active Locking Head!')
- send_command('wait 60;input /echo **********Perfect Counter Ready**********')
- end
- end
- if windower.wc_match(player.equipment.head, 'Reraise Hairpin') and not spellcast.buffactive('Reraise') then
- spellcast.equip(s, spellcast.groups[2][6])
- elseif windower.wc_match(player.equipment.right_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
- spellcast.equip(s, spellcast.groups[2][7])
- elseif windower.wc_match(player.equipment.left_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
- spellcast.equip(s, spellcast.groups[2][8])
- end
- if windower.wc_match(player.equipment.right_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
- spellcast.equip(s, spellcast.groups[2][9])
- elseif windower.wc_match(player.equipment.left_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
- spellcast.equip(s, spellcast.groups[2][10])
- end
- -- END RULES
- end
- rules()
- equip(s.equip)
- end
- function status_change(spell, action)
- spellcast.pass = { 'autoset', player.status }
- local s = { spell = spell,
- original_spell = spell,
- equip = {},
- locks = {} }
- local rules = function()
- -- BEGIN RULES
- if windower.wc_match(s.spell.english, 'autoset') then
- if spellcast.when('resting') then
- spellcast.equip(s, 'Resting')
- end
- if spellcast.when('idle') then
- spellcast.equip(s, 'Idle')
- end
- if spellcast.when('engaged') then
- spellcast.equip(s, 'TP')
- end
- end
- if windower.wc_match(player.status, 'Engaged') then
- if spellcast.buffactive('Impetus') then
- if spellcast.when('Engaged|Precast|Midcast|AfterCast') then
- spellcast.equip(s, 'ImpetusUp')
- end
- elseif not spellcast.buffactive('Perfect Counter') and spellcast.when('Engaged|AfterCast') then
- spellcast.equip(s, 'TP')
- end
- end
- if windower.wc_match(s.spell.type, 'WeaponSkill') then
- if windower.wc_match(s.spell.english, 'Ascetic's Fury') and spellcast.when('engaged|precast') then
- spellcast.equip(s, 'Ascetics')
- end
- elseif windower.wc_match(s.spell.type, 'JobAbility') then
- if windower.wc_match(s.spell.english, 'Impetus') and spellcast.when('All') then
- spellcast.equip(s, 'ImpetusUp')
- end
- if windower.wc_match(s.spell.english, 'Perfect Counter') and spellcast.when('All') then
- spellcast.equip(s, 'Perfect Counter')
- end
- end
- if windower.wc_match(s.spell.english, 'Stone V') then
- if spellcast.get_var(s, 'GEAR') == '0' then
- spellcast.disable('Legs')
- cancel_spell()
- elseif spellcast.get_var(s, 'GEAR') == '1' then
- spellcast.enable('Legs')
- cancel_spell()
- end
- end
- if windower.wc_match(s.spell.english, 'Water V') then
- if spellcast.get_var(s, 'GEAR') == '0' then
- spellcast.disable('Hands')
- cancel_spell()
- elseif spellcast.get_var(s, 'GEAR') == '1' then
- spellcast.enable('Hands')
- cancel_spell()
- end
- end
- if windower.wc_match(s.spell.english, 'Thunder V') then
- cancel_spell()
- end
- if windower.wc_match(player.equipment.head, 'Reraise Hairpin') and not spellcast.buffactive('Reraise') then
- if spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
- spellcast.equip(s, spellcast.groups[2][6])
- end
- elseif windower.wc_match(player.equipment.right_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
- if spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
- spellcast.equip(s, spellcast.groups[2][7])
- end
- elseif windower.wc_match(player.equipment.left_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') and spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
- spellcast.equip(s, spellcast.groups[2][8])
- end
- if windower.wc_match(player.equipment.right_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
- if spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
- spellcast.equip(s, spellcast.groups[2][9])
- end
- elseif windower.wc_match(player.equipment.left_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') and spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
- spellcast.equip(s, spellcast.groups[2][10])
- end
- -- END RULES
- end
- rules()
- equip(s.equip)
- end
- -- UTILITY FUNCTIONS
- function spellcast.buffactive(name)
- for k, v in pairs(buffactive) do
- if windower.wc_match(k, name) then
- return true
- end
- end
- return false
- end
- function spellcast.changelock(s, slot, lock)
- local slot_list = { 'main', 'sub', 'range', 'ammo',
- 'head', 'neck', 'lear', 'rear',
- 'body', 'hands', 'lring', 'rring',
- 'back', 'waist', 'legs', 'feet' }
- if windower.wc_match('all', slot) then
- for k, v in pairs(slot_list) do
- if lock then
- s.locks[v] = true
- else
- s.locks[v] = nil
- end
- end
- else
- for k, v in pairs(slot_list) do
- if windower.wc_match(v, slot) then
- if lock then
- s.locks[v] = true
- else
- s.locks[v] = nil
- end
- end
- end
- end
- end
- function spellcast.changespell(s, name)
- name = tostring(name):lower()
- if s.spell.name:lower() ~= name then
- local spell = gearswap.r_spells[gearswap.validabils.english['/ma'][name]]
- local abil = gearswap.r_abilities[gearswap.validabils.english['/ja'][name]]
- if spell then
- if abil and abil.prefix == '/pet' then
- if player.main_job_id == BLU then
- s.spell = spell
- elseif (player.main_job_id == BST or player.main_job_id == SMN or
- player.sub_job_id == BST or player.sub_job_id == SMN) and pet.isvalid then
- s.spell = abil
- end
- else
- s.spell = spell
- end
- elseif abil then
- s.spell = abil
- end
- end
- end
- function spellcast.disable(slot)
- local slot_list = { main = 'main', sub = 'sub', range = 'range', ammo = 'ammo',
- head = 'head', neck = 'neck', lear = 'left_ear', rear = 'right_ear',
- body = 'body', hands = 'hands', lring = 'left_ring', rring = 'right_ring',
- back = 'back', waist = 'waist', legs = 'legs', feet = 'feet' }
- if windower.wc_match('all', slot) then
- disable('main', 'sub', 'range', 'ammo',
- 'head', 'neck', 'left_ear', 'right_ear',
- 'body', 'hands', 'left_ring', 'right_ring',
- 'back', 'waist', 'legs', 'feet')
- else
- for k, v in pairs(slot_list) do
- if windower.wc_match(k, slot) then
- disable(v)
- end
- end
- end
- end
- function spellcast.enable(slot)
- local slot_list = { main = 'main', sub = 'sub', range = 'range', ammo = 'ammo',
- head = 'head', neck = 'neck', lear = 'left_ear', rear = 'right_ear',
- body = 'body', hands = 'hands', lring = 'left_ring', rring = 'right_ring',
- back = 'back', waist = 'waist', legs = 'legs', feet = 'feet' }
- if windower.wc_match('all', slot) then
- enable('main', 'sub', 'range', 'ammo',
- 'head', 'neck', 'left_ear', 'right_ear',
- 'body', 'hands', 'left_ring', 'right_ring',
- 'back', 'waist', 'legs', 'feet')
- else
- for k, v in pairs(slot_list) do
- if windower.wc_match(k, slot) then
- enable(v)
- end
- end
- end
- end
- function spellcast.equip(s, set, group)
- if set ~= nil and set ~= '' then
- group = group or spellcast.group or player.main_job
- local base_set, set_base_set, set_base_group = '', '', ''
- if type(set) ~= 'table' then
- set = tostring(set)
- base_set, set = set:match('^(.-)|?([^|]*)$')
- for k, v in ipairs(spellcast.groups) do
- if v.name and windower.wc_match(group, v.name) then
- for q, r in ipairs(v) do
- if r.name and windower.wc_match(set, r.name) then
- set = r
- if r.base_group then
- if type(r.base_group) ~= 'function' then
- set_base_group = r.base_group
- else
- set_base_group = r.base_group()
- end
- end
- if r.base_set then
- if type(r.base_set) ~= 'function' then
- set_base_set = r.base_set
- else
- set_base_set = r.base_set()
- end
- end
- break
- end
- end
- end
- end
- end
- if set_base_set ~= '' then
- if set_base_group ~= '' then
- spellcast.equip(s, set_base_set, set_base_group)
- else
- spellcast.equip(s, set_base_set, group)
- end
- end
- if base_set ~= '' then
- spellcast.equip(s,base_set,group)
- end
- if type(set) == 'table' then
- if set.base_set then
- base_set = type(set.base_set) ~= 'function' and set.base_set or set.base_set(s)
- spellcast.equip(s, base_set, set.base_group or group)
- end
- for k, v in pairs(set.items) do
- if not s.locks[k] then
- s.equip[k] = v
- end
- end
- for k, v in pairs(set.locks) do
- s.locks[k] = v
- end
- end
- end
- end
- function spellcast.get_var(s, name)
- local normalized_name = tostring(name):lower()
- local match = nil
- local match_len = 0
- for k, v in pairs(spellcast.vars) do
- local len = k:len()
- if len > match_len and normalized_name:sub(1, len) == k then
- match = v
- match_len = len
- end
- end
- if match == nil then
- if type(match) == 'function' then
- match = match(s)
- end
- return match .. name:sub(match_len + 1)
- end
- return '$' .. name
- end
- function spellcast.when(test)
- if windower.wc_match('all', test) then
- return true
- end
- for k, v in pairs(spellcast.pass) do
- if windower.wc_match(v, test) then
- return true
- end
- end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement