Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- *** Credit goes to Flippant for helping me with Gearswap *** --
- -- ** I Use Some of Motenten's Functions ** --
- function get_sets()
- AccIndex = 1
- AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
- IdleIndex = 1
- IdleArray = {'Movement','Regen'} -- Default Idle Set Is Movement --
- TypeIndex = 1
- Armor = 'None'
- Obi = 'ON' -- Set Default Obi ON or OFF Here --
- Attack = 'OFF' -- Set Default Attack WS Set ON or OFF Here --
- Migawari = 'OFF' -- Set Default Migawari Body ON or OFF Here --
- Rancor = 'OFF' -- Set Default Rancor ON or OFF Here --
- target_distance = 5 -- Set Default Distance Here --
- select_default_macro_book() -- Change Default Macro Book At The End --
- -- Gavialis Helm --
- elements = {}
- elements.equip = {head="Gavialis Helm"}
- elements["Blade: Shun"] = S{"Light","Lightning","Fire"}
- sc_map = {SC1="BladeHi", SC2="UtsusemiSan", SC3="UtsusemiNi"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
- sets.Idle = {}
- -- Idle/Town Sets --
- sets.Idle.Regen = {}
- sets.Idle.Movement = set_combine(sets.Idle.Regen,{
- feet="Danzo Sune-Ate"})
- -- Normal TP Sets --
- sets.TP = {}
- sets.TP.MidACC = set_combine(sets.TP,{})
- sets.TP.HighACC = set_combine(sets.TP.MidACC,{})
- -- March x2 --
- -- March + Haste + Haste Samba --
- -- Geo Haste --
- -- Mid Haste: 19% - 22% In Gear --
- sets.TP.MidHaste = {}
- sets.TP.MidACC.MidHaste = set_combine(sets.TP.MidHaste,{})
- sets.TP.HighACC.MidHaste = set_combine(sets.TP.MidACC.MidHaste,{})
- -- Embrava + (Haste or March) --
- -- Embrava Haste: 7% DW In Gear --
- sets.TP.EmbravaHaste = {}
- sets.TP.MidACC.EmbravaHaste = set_combine(sets.TP.EmbravaHaste,{})
- sets.TP.HighACC.EmbravaHaste = set_combine(sets.TP.MidACC.EmbravaHaste,{})
- -- March x2 + Haste --
- -- Embrava + (March x2 or March + Haste) --
- -- Geo Haste + (March or Haste or Embrava) --
- -- Max Haste: Can Drop All DW Gear --
- sets.TP.MaxHaste = {}
- sets.TP.MidACC.MaxHaste = set_combine(sets.TP.MaxHaste,{})
- sets.TP.HighACC.MaxHaste = set_combine(sets.TP.MidACC.MaxHaste,{})
- -- TP Rancor Neck --
- sets.TP.Rancor = {neck="Rancor Collar"}
- -- TP Migawari Set --
- sets.TP.Migawari = {body="Hattori Ningi +1"}
- -- PDT/MDT Sets --
- sets.PDT = {}
- sets.MDT = set_combine(sets.PDT,{})
- -- Hybrid/Evasion Sets --
- sets.TP.Hybrid = set_combine(sets.PDT,{})
- sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{})
- sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{})
- sets.Evasion = set_combine(sets.PDT,{})
- -- WS Base Set --
- sets.WS = {}
- -- Blade: Hi Sets --
- sets.WS["Blade: Hi"] = {}
- sets.WS["Blade: Hi"].MidACC = set_combine(sets.WS["Blade: Hi"],{})
- sets.WS["Blade: Hi"].HighACC = set_combine(sets.WS["Blade: Hi"].MidACC,{})
- -- Blade: Hi(Attack) Set --
- sets.WS["Blade: Hi"].ATT = set_combine(sets.WS["Blade: Hi"],{})
- -- Blade: Shun Sets --
- sets.WS["Blade: Shun"] = {}
- sets.WS["Blade: Shun"].MidACC = set_combine(sets.WS["Blade: Shun"],{})
- sets.WS["Blade: Shun"].HighACC = set_combine(sets.WS["Blade: Shun"].MidACC,{})
- -- Blade: Shun(Attack) Set --
- sets.WS["Blade: Shun"].ATT = set_combine(sets.WS["Blade: Shun"],{})
- sets.WS.Exenterator = {}
- sets.WS.Evisceration = {}
- sets.WS["Sanguine Blade"] = {}
- -- Waltz Set --
- sets.Waltz = {}
- sets.Precast = {}
- -- Fastcast Set --
- sets.Precast.FastCast = {}
- -- Utsusemi Precast Set --
- sets.Precast.Utsusemi = set_combine(sets.Precast.FastCast,{neck="Magoraga Beads",body="Mochi. Chainmail +1"})
- sets.Midcast = {}
- -- -- Magic Haste/Utsusemi Set --
- sets.Midcast.Haste = set_combine(sets.PDT,{hands="Mochizuki Tekko +1",feet="Hattori Kyahan +1"})
- -- Migawari Magic Set --
- sets.Midcast.Migawari = {}
- -- Ninjutsu Set --
- sets.Midcast.Ninjutsu = {}
- -- Elemental Ninjutsu Set --
- sets.Midcast.Elemental_Ninjutsu {}
- end
- function pretarget(spell,action)
- if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
- cancel_spell()
- send_command('input /item "Echo Drops" <me>')
- elseif spell.english == "Yonin" and buffactive.Yonin then -- Change Yonin To Innin If Yonin Is On --
- cancel_spell()
- send_command('Innin')
- elseif spell.english == "Innin" and buffactive.Innin then -- Change Innin To Yonin If Innin Is On --
- cancel_spell()
- send_command('Yonin')
- elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
- cancel_spell()
- send_command('Aggressor')
- elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
- cancel_spell()
- add_to_chat(123, spell.name..' Canceled: [Out of Range]')
- return
- end
- end
- function precast(spell,action)
- if spell.type == "WeaponSkill" then
- if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
- cancel_spell()
- add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
- return
- else
- equipSet = sets.WS
- if equipSet[spell.english] then
- equipSet = equipSet[spell.english]
- end
- if Attack == 'ON' then
- equipSet = equipSet["ATT"]
- end
- if equipSet[AccArray[AccIndex]] then
- equipSet = equipSet[AccArray[AccIndex]]
- end
- if elements[spell.name] and elements[spell.name]:contains(world.day_element) then
- equipSet = set_combine(equipSet,elements.equip)
- end
- if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
- equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
- end
- if TypeIndex == 1 and spell.english == "Blade: Hi" then
- if world.time <= (7*60) or world.time >= (17*60) then -- Equip Lugra Earring +1 & Lugra Earring From Dusk To Dawn --
- equipSet = set_combine(equipSet,{ear1="Lugra Earring +1",ear2="Lugra Earring"})
- elseif player.tp > 2990 then
- equipSet = set_combine(equipSet,{ear1="Auster's Pearl"}) -- 3000 TP: Equip Auster's Pearl --
- end
- end
- if TypeIndex == 1 and spell.english == "Blade: Shun" and player.tp > 2990 then
- if world.time <= (7*60) or world.time >= (17*60) then -- 3000 TP: Equip Lugra Earring +1 From Dusk To Dawn --
- equipSet = set_combine(equipSet,{ear1="Lugra Earring +1"})
- else
- equipSet = set_combine(equipSet,{ear1="Jupiter's Pearl"}) -- 3000 TP: Equip Jupiter's Pearl --
- end
- end
- equip(equipSet)
- end
- elseif spell.action_type == 'Magic' then
- if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
- cancel_spell()
- add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
- return
- else
- if spell.english:startswith('Utsusemi') then
- if spell.english == 'Utsusemi: San' then
- if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
- cancel_spell()
- add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
- return
- else
- equip(sets.Precast.Utsusemi)
- end
- elseif spell.english == 'Utsusemi: Ni' then
- if buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
- send_command('cancel Copy Image*')
- end
- equip(sets.Precast.Utsusemi)
- else
- equip(sets.Precast.Utsusemi)
- end
- else
- equip(sets.Precast.FastCast)
- end
- end
- elseif spell.type == "Waltz" then
- refine_waltz(spell,action)
- equip(sets.Waltz)
- elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
- cast_delay(0.2)
- send_command('cancel Sneak')
- end
- end
- function midcast(spell,action)
- equipSet = {}
- if spell.action_type == 'Magic' then
- equipSet = sets.Midcast
- if spell.english:startswith('Utsusemi') then
- if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
- send_command('@wait 1.7;cancel Copy Image*')
- end
- equipSet = equipSet.Haste
- elseif spell.english == 'Monomi: Ichi' then
- if buffactive['Sneak'] then
- send_command('@wait 1.7;cancel sneak')
- end
- equipSet = equipSet.Haste
- elseif spell.english:startswith('Tonko') then
- equipSet = equipSet.Haste
- elseif spell.english == 'Migawari: Ichi' then
- equipSet = equipSet.Migawari
- elseif spell.english:startswith('Katon') or spell.english:startswith('Suiton') or spell.english:startswith('Doton') or spell.english:startswith('Hyoton') or spell.english:startswith('Huton') or spell.english:startswith('Raiton') then
- equipSet = equipSet.Elemental_Ninjutsu
- if (world.day_element == spell.element or world.weather_element == spell.element) and Obi == 'ON' then
- equipSet = set_combine(equipSet,{waist="Hachirin-no-Obi"})
- end
- elseif equipSet[spell.skill] then
- equipSet = equipSet[spell.skill]
- end
- elseif equipSet[spell.english] then
- equipSet = equipSet[spell.english]
- end
- equip(equipSet)
- end
- function aftercast(spell,action)
- if spell.type == "WeaponSkill" and not spell.interrupted then
- send_command('wait 0.2;gs c TP')
- end
- status_change(player.status)
- end
- function status_change(new,old)
- check_equip_lock()
- if Armor == 'PDT' then
- equip(sets.PDT)
- elseif Armor == 'MDT' then
- equip(sets.MDT)
- elseif Armor == 'EVA' then
- equip(sets.Evasion)
- elseif new == 'Engaged' then
- equipSet = sets.TP
- if Armor == 'Hybrid' and equipSet["Hybrid"] then
- equipSet = equipSet["Hybrid"]
- end
- if equipSet[AccArray[AccIndex]] then
- equipSet = equipSet[AccArray[AccIndex]]
- end
- if (buffactive.Haste and buffactive.March == 2) or (buffactive.Embrava and (buffactive.March == 2 or (buffactive.March and buffactive.Haste))) or (buffactive[580] and (buffactive.March or buffactive.Haste or buffactive.Embrava)) and equipSet["MaxHaste"] then
- equipSet = equipSet["MaxHaste"]
- end
- if buffactive.Embrava and (buffactive.March or buffactive.Haste) and equipSet["EmbravaHaste"] then
- equipSet = equipSet["EmbravaHaste"]
- end
- if ((buffactive.March == 1 and buffactive.Haste and buffactive["Haste Samba"]) or buffactive.March == 2 or buffactive[580]) and equipSet["MidHaste"] then
- equipSet = equipSet["MidHaste"]
- end
- if Rancor == 'ON' then -- Use Rancor Toggle For Rancor Collar --
- equipSet = set_combine(equipSet,sets.TP.Rancor)
- end
- equip(equipSet)
- else
- equipSet = sets.Idle
- if equipSet[IdleArray[IdleIndex]] then
- equipSet = equipSet[IdleArray[IdleIndex]]
- end
- if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
- equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
- end
- if world.time <= (7*60) or world.time >= (17*60) then -- Equip Hachi. Kyahan +1 From Dusk To Dawn --
- equipSet = set_combine(equipSet,{feet="Hachi. Kyahan +1"})
- end
- if world.area:endswith('Adoulin') then
- equipSet = set_combine(equipSet,{body="Councilor's Garb"})
- end
- equip(equipSet)
- end
- if buffactive.Migawari and Migawari == 'ON' then -- Use Migawari Toggle To Lock Hattori Ningi +1 When You Have Migawari On --
- equip(sets.TP.Migawari)
- end
- end
- function buff_change(buff,gain)
- buff = string.lower(buff)
- if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
- if gain then
- send_command('timers create "Aftermath: Lv.3" 180 down;wait 150;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 15;input /echo Aftermath: Lv.3 [WEARING OFF IN 15 SEC.];wait 5;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
- else
- send_command('timers delete "Aftermath: Lv.3"')
- add_to_chat(123,'AM3: [OFF]')
- end
- elseif buff == 'weakness' then -- Weakness Timer --
- if gain then
- send_command('timers create "Weakness" 300 up')
- else
- send_command('timers delete "Weakness"')
- end
- end
- if not midaction() then
- status_change(player.status)
- end
- end
- -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
- function self_command(command)
- if command == 'C1' then -- Accuracy Toggle --
- AccIndex = (AccIndex % #AccArray) + 1
- status_change(player.status)
- add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
- elseif command == 'C5' then -- Auto Update Gear Toggle --
- status_change(player.status)
- add_to_chat(158,'Auto Update Gear')
- elseif command == 'C2' then -- Hybrid Toggle --
- if Armor == 'Hybrid' then
- Armor = 'None'
- add_to_chat(123,'Hybrid Set: [Unlocked]')
- else
- Armor = 'Hybrid'
- add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
- end
- status_change(player.status)
- elseif command == 'C7' then -- PDT Toggle --
- if Armor == 'PDT' then
- Armor = 'None'
- add_to_chat(123,'PDT Set: [Unlocked]')
- else
- Armor = 'PDT'
- add_to_chat(158,'PDT Set: [Locked]')
- end
- status_change(player.status)
- elseif command == 'C15' then -- MDT Toggle --
- if Armor == 'MDT' then
- Armor = 'None'
- add_to_chat(123,'MDT Set: [Unlocked]')
- else
- Armor = 'MDT'
- add_to_chat(158,'MDT Set: [Locked]')
- end
- status_change(player.status)
- elseif command == 'C10' then -- Migawari Set Toggle --
- if Migawari == 'ON' then
- Migawari = 'OFF'
- add_to_chat(123,'Migawari Set: [Unlocked]')
- else
- Migawari = 'ON'
- add_to_chat(158,'Migawari Set: [Locked]')
- end
- status_change(player.status)
- elseif command == 'C3' then -- Evasion Toggle --
- if Armor == 'EVA' then
- Armor = 'None'
- add_to_chat(123,'Evasion Set: [Unlocked]')
- else
- Armor = 'EVA'
- add_to_chat(158,'Evasion Set: [Locked]')
- end
- status_change(player.status)
- elseif command == 'C16' then -- Rancor Toggle --
- if Rancor == 'ON' then
- Rancor = 'OFF'
- add_to_chat(123,'Rancor: [OFF]')
- else
- Rancor = 'ON'
- add_to_chat(158,'Rancor: [ON]')
- end
- status_change(player.status)
- elseif command == 'C9' then -- Attack Toggle --
- if Attack == 'ON' then
- Attack = 'OFF'
- add_to_chat(123,'Attack: [OFF]')
- else
- Attack = 'ON'
- add_to_chat(158,'Attack: [ON]')
- end
- status_change(player.status)
- elseif command == 'C11' then -- Obi Toggle --
- if Obi == 'ON' then
- Obi = 'OFF'
- add_to_chat(123,'Obi: [OFF]')
- else
- Obi = 'ON'
- add_to_chat(158,'Obi: [ON]')
- end
- status_change(player.status)
- elseif command == 'C8' then -- Distance Toggle --
- if player.target.distance then
- target_distance = math.floor(player.target.distance*10)/10
- add_to_chat(158,'Distance: '..target_distance)
- else
- add_to_chat(123,'No Target Selected')
- end
- elseif command == 'C6' then -- Idle Toggle --
- IdleIndex = (IdleIndex % #IdleArray) + 1
- status_change(player.status)
- add_to_chat(158,'Idle Set: ' .. IdleArray[IdleIndex])
- elseif command == 'TP' then
- add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
- elseif command:match('^SC%d$') then
- send_command('//' .. sc_map[command])
- end
- end
- function check_equip_lock() -- Lock Equipment Here --
- if player.equipment.range ~= 'empty' then
- disable('range','ammo')
- elseif player.equipment.left_ring == "Warp Ring" or player.equipment.left_ring == "Capacity Ring" or player.equipment.right_ring == "Warp Ring" or player.equipment.right_ring == "Capacity Ring" then
- disable('ring1','ring2')
- elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
- disable('back')
- else
- enable('range','ammo','ring1','ring2','back')
- end
- end
- function refine_waltz(spell,action)
- if spell.type ~= 'Waltz' then
- return
- end
- if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" or spell.name == "Divine Waltz II" then
- return
- end
- local newWaltz = spell.english
- local waltzID
- local missingHP
- if spell.target.type == "SELF" then
- missingHP = player.max_hp - player.hp
- elseif spell.target.isallymember then
- local target = find_player_in_alliance(spell.target.name)
- local est_max_hp = target.hp / (target.hpp/100)
- missingHP = math.floor(est_max_hp - target.hp)
- end
- if missingHP ~= nil then
- if player.sub_job == 'DNC' then
- if missingHP < 40 and spell.target.name == player.name then
- add_to_chat(123,'Full HP!')
- cancel_spell()
- return
- elseif missingHP < 150 then
- newWaltz = 'Curing Waltz'
- waltzID = 190
- elseif missingHP < 300 then
- newWaltz = 'Curing Waltz II'
- waltzID = 191
- else
- newWaltz = 'Curing Waltz III'
- waltzID = 192
- end
- else
- return
- end
- end
- local waltzTPCost = {['Curing Waltz'] = 20, ['Curing Waltz II'] = 35, ['Curing Waltz III'] = 50}
- local tpCost = waltzTPCost[newWaltz]
- local downgrade
- if player.tp < tpCost and not buffactive.trance then
- if player.tp < 20 then
- add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
- cancel_spell()
- return
- elseif player.tp < 35 then
- newWaltz = 'Curing Waltz'
- elseif player.tp < 50 then
- newWaltz = 'Curing Waltz II'
- end
- downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
- end
- if newWaltz ~= spell.english then
- send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
- if downgrade then
- add_to_chat(158, downgrade)
- end
- cancel_spell()
- return
- end
- if missingHP > 0 then
- add_to_chat(158,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
- end
- end
- function find_player_in_alliance(name)
- for i,v in ipairs(alliance) do
- for k,p in ipairs(v) do
- if p.name == name then
- return p
- end
- end
- end
- end
- function sub_job_change(newSubjob, oldSubjob)
- select_default_macro_book()
- end
- function set_macro_page(set,book)
- if not tonumber(set) then
- add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
- return
- end
- if set < 1 or set > 10 then
- add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
- return
- end
- if book then
- if not tonumber(book) then
- add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
- return
- end
- if book < 1 or book > 20 then
- add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
- return
- end
- send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
- else
- send_command('@input /macro set '..tostring(set))
- end
- end
- function select_default_macro_book()
- -- Default macro set/book
- if player.sub_job == 'WAR' then
- set_macro_page(1, 8)
- elseif player.sub_job == 'DNC' then
- set_macro_page(2, 8)
- else
- set_macro_page(1, 8)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement