Code:
function get_sets()
AccIndex = 1
AccArray = {"LowACC","MidACC","HighACC","Lentus"} -- 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. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. Can Delete Lentus If You Don't Need It. --
WeaponIndex = 1
WeaponArray = {"Tsurumaru","AnaheraBlade"} -- Default TP Set Is Tsurumaru. Can Delete Any Weapons/Sets That You Don't Need Or Replace/Add The New Weapons That You Want To Use. --
IdleIndex = 2
IdleArray = {"Movement","Regen"} -- Default Idle Set Is Regen --
Armor = 'None'
Twilight = 'None'
Reive = 'None'
Capacity = 'None'
warning = false
Attack = 'OFF' -- Set Default Attack Set ON or OFF Here --
Seigan = 'ON' -- Set Default Seigan Set ON or OFF Here --
Third_Eye = 'ON' -- Set Default Third Eye Set ON or OFF Here --
Samurai_Roll = 'ON' -- Set Default SAM Roll ON or OFF Here --
ammo_warning_limit = 10 -- Set Ammo Limit Check Here --
target_distance = 10 -- Set Default Distance Here --
select_default_macro_book() -- Change Default Macro Book At The End --
sc_map = {SC1="TachiFudo", SC2="TachiRana", SC3="NamasArrow"} -- 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 = {
head="Sakonji Kabuto +1",
neck="Wiglen Gorget",
ear1="Dawn Earring",
ear2="Sanare Earring",
body="Mes. Haubergeon",
hands="Onimusha-no-Kote",
ring1="Defending Ring",
ring2="Paguroidea Ring",
back="Repulse Mantle",
waist="Flume Belt +1",
legs="Wakido Haidate +1",
feet="Sak. Sune-Ate +1"}
sets.Idle.Regen.Tsurumaru = set_combine(sets.Idle.Regen,{
main="Tsurumaru",
sub="Bloodrain Strap",
range="Cibitshavore",
ammo="Tulfaire Arrow"})
sets.Idle.Regen.AnaheraBlade = set_combine(sets.Idle.Regen,{
main="Anahera Blade",
sub="Bloodrain Strap",
range="Cibitshavore",
ammo="Tulfaire Arrow"})
sets.Twilight = {head="Twilight Helm",body="Twilight Mail"}
sets.Reive = {neck="Adoulin's Refuge +1"}
sets.Capacity = {back="Mecisto. Mantle"}
-- Preshot Set --
sets.Preshot = {}
-- Midshot Sets --
sets.Midshot = {}
sets.Midshot.MidACC = set_combine(sets.Midshot,{})
sets.Midshot.HighACC = set_combine(sets.Midshot.MidACC,{})
-- TP Base Set --
sets.TP = {}
-- Tsurumaru TP Sets --
sets.TP.Tsurumaru = {
main="Tsurumaru",
sub="Bloodrain Strap",
range="Cibitshavore",
head="Otomi Helm",
neck="Rioter's Collar",
ear1="Steelflash Earring",
ear2="Bladeborn Earring",
body="Mes. Haubergeon",
hands="Wakido Kote +1",
ring1="Rajas Ring",
ring2="K'ayres Ring",
back={ name="Takaha Mantle", augments={'STR+2','"Zanshin"+2','"Store TP"+2',}},
waist="Cetl Belt",
legs="Xaddi Cuisses",
feet="Sak. Sune-Ate +1"}
sets.TP.Tsurumaru.MidACC = set_combine(sets.TP.Tsurumaru,{
head="Yaoyotl Helm"})
sets.TP.Tsurumaru.HighACC = set_combine(sets.TP.Tsurumaru.MidACC,{
waist="Olseni Belt",
feet="Otronif Boots +1"})
-- Tsurumaru(SAM Roll) TP Sets --
sets.TP.Tsurumaru.STP = set_combine(sets.TP.Tsurumaru,{})
sets.TP.Tsurumaru.MidACC.STP = set_combine(sets.TP.Tsurumaru.MidACC,{})
sets.TP.Tsurumaru.HighACC.STP = set_combine(sets.TP.Tsurumaru.HighACC,{})
-- AnaheraBlade(AM Down) TP Sets --
sets.TP.AnaheraBlade = {
main="Anahera Blade",
sub="Bloodrain Strap",
range="Cibitshavore",
head="Otomi Helm",
neck="Rioter's Collar",
ear1="Steelflash Earring",
ear2="Bladeborn Earring",
body="Mes. Haubergeon",
hands="Wakido Kote +1",
ring1="Rajas Ring",
ring2="K'ayres Ring",
back={ name="Takaha Mantle", augments={'STR+2','"Zanshin"+2','"Store TP"+2',}},
waist="Cetl Belt",
legs="Xaddi Cuisses",
feet="Sak. Sune-Ate +1"}
sets.TP.AnaheraBlade.MidACC = set_combine(sets.TP.AnaheraBlade,{
head="Yaoyotl Helm"})
sets.TP.AnaheraBlade.HighACC = set_combine(sets.TP.AnaheraBlade.MidACC,{
head="Yaoyotl Helm",
waist="Olseni Belt",
feet="Otronif Boots +1"})
-- AnaheraBlade(AM Up) TP Sets --
sets.TP.AnaheraBlade.AM = set_combine(sets.TP.AnaheraBlade,{})
sets.TP.AnaheraBlade.MidACC.AM = set_combine(sets.TP.AnaheraBlade.AM,{})
sets.TP.AnaheraBlade.HighACC.AM = set_combine(sets.TP.AnaheraBlade.MidACC.AM,{})
-- AnaheraBlade(AM Down: Ionis) TP Sets --
sets.TP.AnaheraBlade.Ionis = set_combine(sets.TP.AnaheraBlade,{})
sets.TP.AnaheraBlade.MidACC.Ionis = set_combine(sets.TP.AnaheraBlade.Ionis,{})
sets.TP.AnaheraBlade.HighACC.Ionis = set_combine(sets.TP.AnaheraBlade.MidACC.Ionis,{})
-- AnaheraBlade(AM Up: Ionis) TP Sets --
sets.TP.AnaheraBlade.AM.Ionis = set_combine(sets.TP.AnaheraBlade.AM,{})
sets.TP.AnaheraBlade.MidACC.AM.Ionis = set_combine(sets.TP.AnaheraBlade.AM.Ionis,{})
sets.TP.AnaheraBlade.HighACC.AM.Ionis = set_combine(sets.TP.AnaheraBlade.MidACC.AM.Ionis,{})
-- AnaheraBlade(AM Down: SAM Roll) TP Sets --
sets.TP.AnaheraBlade.STP = set_combine(sets.TP.AnaheraBlade,{})
sets.TP.AnaheraBlade.MidACC.STP = set_combine(sets.TP.AnaheraBlade.MidACC,{})
sets.TP.AnaheraBlade.HighACC.STP = set_combine(sets.TP.AnaheraBlade.HighACC,{})
-- AnaheraBlade(AM Up: SAM Roll) TP Sets --
sets.TP.AnaheraBlade.AM.STP = set_combine(sets.TP.AnaheraBlade.STP,{})
sets.TP.AnaheraBlade.MidACC.AM.STP = set_combine(sets.TP.AnaheraBlade.MidACC.STP,{})
sets.TP.AnaheraBlade.HighACC.AM.STP = set_combine(sets.TP.AnaheraBlade.HighACC.STP,{})
-- AnaheraBlade(AM Down: Ionis + SAM Roll) TP Sets --
sets.TP.AnaheraBlade.Ionis.STP = set_combine(sets.TP.AnaheraBlade.STP,{})
sets.TP.AnaheraBlade.MidACC.Ionis.STP = set_combine(sets.TP.AnaheraBlade.MidACC.STP,{})
sets.TP.AnaheraBlade.HighACC.Ionis.STP = set_combine(sets.TP.AnaheraBlade.HighACC.STP,{})
-- AnaheraBlade(AM Up: Ionis + SAM Roll) TP Sets --
sets.TP.AnaheraBlade.AM.Ionis.STP = set_combine(sets.TP.AnaheraBlade.AM.STP,{})
sets.TP.AnaheraBlade.MidACC.AM.Ionis.STP = set_combine(sets.TP.AnaheraBlade.MidACC.AM.STP,{})
sets.TP.AnaheraBlade.HighACC.AM.Ionis.STP = set_combine(sets.TP.AnaheraBlade.HighACC.AM.STP,{})
-- Seigan TP Set --
sets.TP.Seigan = {head="Unkai Kabuto +2"}
-- Third Eye TP Set --
sets.TP['Third Eye'] = {legs="Sakonji Haidate +1"}
-- PDT/MDT Sets --
sets.PDT = {
head="Otronif Mask +1",
neck="Agitator's Collar",
ear1="Steelflash Earring",
ear2="Bladeborn Earring",
body="Otro. Harness +1",
hands="Otronif Gloves +1",
ring1="Defending Ring",
ring2="Patricius Ring",
back="Repluse Mantle",
waist="Flume Belt +1",
legs="Otronif Brais +1",
feet="Otronif Boots +1"}
sets.MDT = set_combine(sets.PDT,{
head="Ogier's Helm",
ear1="Merman's Earring",
ear2="Sanare Earring",
body="Nocturnus Mail",
ring1="Shadow Ring",
back="Engulfer Cape",
waist="Resolute Belt"})
-- Hybrid Sets --
sets.TP.Hybrid = set_combine(sets.PDT,{
ear1="Steelflash Earring",
ear2="Bladeborn Earring",
hands="Sakonji Kote +1",
ring1="Patricius Ring",
back="Mollusca Mantle"})
sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{
head="Yaoyotl Helm",
ear1="Steelflash Earring",
ear2="Bladeborn Earring",
body="Sakonji Domaru +1",
hands="Wakido Kote +1"})
sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{
body="Mes. Haubergeon",
waist="Dynamic Belt +1",
legs="Xaddi Cuisses"})
-- WS Base Set --
sets.WS = {
head="Otomi Helm",
neck="Fotia Gorget",
ear1="Moonshade Earring",
ear2="Brutal Earring",
body="Sakonji Domaru +1",
hands="Miki. Gauntlets",
ring1="Rajas Ring",
ring2="Pyrosoul Ring",
back="Buquwik Cape",
waist="Fotia Belt",
legs="Wakido Haidate +1",
feet="Sak. Sune-Ate +1"}
-- Tachi: Fudo Sets --
sets.WS["Tachi: Fudo"] = {
head="Otomi Helm",
neck="Fotia Gorget",
ear1="Moonshade Earring",
ear2="Brutal Earring",
body="Sakonji Domaru +1",
hands="Miki. Gauntlets",
ring1="Ifrit Ring",
ring2="Ifrit Ring",
back="Buquwik Cape",
waist="Fotia Belt",
legs="Wakido Haidate +1",
feet="Sak. Sune-Ate +1"}
sets.WS["Tachi: Fudo"].MidACC = set_combine(sets.WS["Tachi: Fudo"],{
hands="Miki. Gauntlets"})
sets.WS["Tachi: Fudo"].HighACC = set_combine(sets.WS["Tachi: Fudo"].MidACC,{
back="Vespid Mantle"})
-- Tachi: Fudo(4 Hits) Set --
sets.WS["Tachi: Fudo"].Lentus = set_combine(sets.WS["Tachi: Fudo"],{
ring2="Rajas Ring"})
-- Tachi: Fudo(SAM Roll) Sets --
sets.WS["Tachi: Fudo"].STP = set_combine(sets.WS["Tachi: Fudo"],{})
sets.WS["Tachi: Fudo"].MidACC.STP = set_combine(sets.WS["Tachi: Fudo"].MidACC,{})
sets.WS["Tachi: Fudo"].HighACC.STP = set_combine(sets.WS["Tachi: Fudo"].HighACC,{})
-- Tachi: Fudo(Attack) Set --
sets.WS["Tachi: Fudo"].ATT = set_combine(sets.WS["Tachi: Fudo"],{
head="Yaoyotl Helm",
hands="Miki. Gauntlets"})
-- Tachi: Shoha Sets --
sets.WS["Tachi: Shoha"] = {
head="Otomi Helm",
neck="Fotia Gorget",
ear1="Moonshade Earring",
ear2="Brutal Earring",
body="Sakonji Domaru +1",
hands="Miki. Gauntlets",
ring1="Ifrit Ring",
ring2="Ifrit Ring",
back="Buquwik Cape",
waist="Fotia Belt",
legs="Wakido Haidate +1",
feet="Sak. Sune-Ate +1"}
sets.WS["Tachi: Shoha"].MidACC = set_combine(sets.WS["Tachi: Shoha"],{
hands="Miki. Gauntlets"})
sets.WS["Tachi: Shoha"].HighACC = set_combine(sets.WS["Tachi: Shoha"].MidACC,{
back="Vespid Mantle"})
-- Tachi: Shoha(4 Hits) Set --
sets.WS["Tachi: Shoha"].Lentus = set_combine(sets.WS["Tachi: Shoha"],{})
-- Tachi: Shoha(SAM Roll) Sets --
sets.WS["Tachi: Shoha"].STP = set_combine(sets.WS["Tachi: Shoha"],{})
sets.WS["Tachi: Shoha"].MidACC.STP = set_combine(sets.WS["Tachi: Shoha"].MidACC,{})
sets.WS["Tachi: Shoha"].HighACC.STP = set_combine(sets.WS["Tachi: Shoha"].HighACC,{})
-- Tachi: Kasha Sets --
sets.WS["Tachi: Kasha"] = {
head="Otomi Helm",
neck="Fotia Gorget",
ear1="Moonshade Earring",
ear2="Brutal Earring",
body="Sakonji Domaru +1",
hands="Miki. Gauntlets",
ring1="Ifrit Ring",
ring2="Ifrit Ring",
back="Buquwik Cape",
waist="Fotia Belt",
legs="Wakido Haidate +1",
feet="Sak. Sune-Ate +1"}
sets.WS["Tachi: Kasha"].MidACC = set_combine(sets.WS["Tachi: Kasha"],{
hands="Miki. Gauntlets"})
sets.WS["Tachi: Kasha"].HighACC = set_combine(sets.WS["Tachi: Kasha"].MidACC,{
back="Vespid Mantle"})
-- Tachi: Kasha(Lentus) Set --
sets.WS["Tachi: Kasha"].Lentus = set_combine(sets.WS["Tachi: Kasha"],{})
-- Tachi: Kasha(SAM Roll) Sets --
sets.WS["Tachi: Kasha"].STP = set_combine(sets.WS["Tachi: Kasha"],{})
sets.WS["Tachi: Kasha"].MidACC.STP = set_combine(sets.WS["Tachi: Kasha"].MidACC,{})
sets.WS["Tachi: Kasha"].HighACC.STP = set_combine(sets.WS["Tachi: Kasha"].HighACC,{})
-- Tachi: Kasha(Attack) Set --
sets.WS["Tachi: Kasha"].ATT = set_combine(sets.WS["Tachi: Kasha"],{
head="Yaoyotl Helm",
hands="Miki. Gauntlets"})
-- Namas Arrow Sets --
sets.WS["Namas Arrow"] = {
ammo="Tulfaire Arrow",
head="Sakonji Kabuto +1",
neck="Fotia Gorget",
ear1="Vulcan's Pearl",
ear2="Vulcan's Pearl",
body="Phorcys Korazin",
hands="Unkai Kote +2",
ring1="Pyrosoul Ring",
ring2="Pyrosoul Ring",
back="Buquwik Cape",
waist="Fotia Belt",
legs="Wakido Haidate +1",
feet="Waki. Sune-Ate +1"}
sets.WS["Namas Arrow"].MidACC = set_combine(sets.WS["Namas Arrow"],{})
sets.WS["Namas Arrow"].HighACC = set_combine(sets.WS["Namas Arrow"].MidACC,{
body="Kyujutsugi"})
-- Apex Arrow Sets --
sets.WS["Apex Arrow"] = {
ammo="Tulfaire Arrow",
head="Sakonji Kabuto +1",
neck="Fotia Gorget",
ear1="Auster's Peral",
ear2="Dawn Earring",
body="Kyujutsugi",
hands="Unkai Kote +2",
ring1="Garuda Ring +1",
ring2="Garuda Ring +1",
back="Ik Cape",
waist="Fotia Belt",
legs="Wakido Haidate +1",
feet="Sak. Sune-Ate +1"}
sets.WS["Apex Arrow"].MidACC = set_combine(sets.WS["Apex Arrow"],{})
sets.WS["Apex Arrow"].HighACC = set_combine(sets.WS["Apex Arrow"].MidACC,{
body="Kyujutsugi"})
-- JA Sets --
sets.JA = {}
sets.JA.Meditate = {head="Myochin Kabuto",hands="Sao. Kote +2",back={ name="Takaha Mantle", augments={'STR+1','"Zanshin"+1','"Store TP"+1','Meditate eff. dur. +4',}}}
sets.JA["Warding Circle"] = {head="Wakido Kabuto +1"}
sets.JA["Meikyo Shisui"] = {feet="Sak. Sune-Ate +1"}
-- Night Set --
sets.Night = {ear2="Lugra Earring"}
-- Waltz Set --
sets.Waltz = {}
sets.Precast = {}
-- Fastcast Set --
sets.Precast.FastCast = {
neck="Orunmila's Torque",
ear1="Loquac. Earring",
ring1="Prolix Ring",
ring2="Veneficium Ring"}
sets.Midcast = {}
-- Magic Haste Set --
sets.Midcast.Haste = set_combine(sets.PDT,{})
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 == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
cancel_spell()
send_command('Aggressor')
elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
cancel_spell()
send_command('ThirdEye')
elseif spell.english == "Meditate" and player.tp > 2990 then -- Cancel Meditate If TP Is Above 290 --
cancel_spell()
add_to_chat(123, spell.name .. ' Canceled: ['..player.tp..' TP]')
elseif spell.action_type == 'Ranged Attack' and spell.target.distance > 24.9 then
cancel_spell()
add_to_chat(123, spell.name..' Canceled: [Out of Range]')
return
elseif spell.type == 'WeaponSkill' and player.status == 'Engaged' then
if spell.skill == 'Archery' then
if spell.target.distance > 16+target_distance then
cancel_spell()
add_to_chat(123, spell.name..' Canceled: [Out of Range]')
return
end
else
if spell.target.distance > target_distance then
cancel_spell()
add_to_chat(123, spell.name..' Canceled: [Out of Range]')
return
end
end
end
end
function precast(spell,action)
local check_ammo
local check_ammo_count = 1
if spell.action_type == 'Ranged Attack' then
check_ammo = player.equipment.ammo
if player.equipment.ammo == 'empty' or player.inventory[check_ammo].count <= check_ammo_count then
add_to_chat(123, spell.name..' Canceled: [Out of Ammo]')
cancel_spell()
return
else
equip(sets.Preshot)
if player.inventory[check_ammo].count <= ammo_warning_limit and player.inventory[check_ammo].count > 1 and not warning then
add_to_chat(8, '***** [Low Ammo Warning!] *****')
warning = true
elseif player.inventory[check_ammo].count > ammo_warning_limit and warning then
warning = false
end
end
elseif 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 buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
equipSet = equipSet["STP"]
end
if buffactive.Sekkanoki then -- Equip Unkai Kote +2 When Sekkanoki Is On --
equipSet = set_combine(equipSet,{hands="Unkai Kote +2"})
end
if buffactive.Sengikori then -- Equip Unkai Sune-ate +2 When Sengikori Is On --
equipSet = set_combine(equipSet,{feet="Unkai Sune-ate +2"})
end
if (spell.english == "Tachi: Fudo" or spell.english == "Tachi: Shoha") and (player.tp > 2990 or buffactive.Sekkanoki or (player.tp > 1990 and buffactive.Hagakure)) then -- Equip Vulcan's Pearl When You Have 300 TP or Sekkanoki On or 200+ TP For Hagakure --
equipSet = set_combine(equipSet,{ear2="Vulcan's Pearl"})
end
equip(equipSet)
end
elseif spell.type == "JobAbility" then
if sets.JA[spell.english] then
equip(sets.JA[spell.english])
end
elseif spell.action_type == 'Magic' then
if string.find(spell.english,'Utsusemi') 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.FastCast)
end
else
equip(sets.Precast.FastCast)
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
if Twilight == 'Twilight' then
equip(sets.Twilight)
end
if Reive == 'Reive' then
equip(sets.Reive)
end
if Capacity == 'Capacity' then
equip(sets.Capacity)
end
end
function midcast(spell,action)
if spell.action_type == 'Ranged Attack' then
equipSet = sets.Midshot
if equipSet[AccArray[AccIndex]] then
equipSet = equipSet[AccArray[AccIndex]]
end
equip(equipSet)
elseif spell.action_type == 'Magic' then
if string.find(spell.english,'Utsusemi') then
if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
send_command('@wait 1.7;cancel Copy Image*')
end
equip(sets.Midcast.Haste)
elseif spell.english == 'Monomi: Ichi' then
if buffactive['Sneak'] then
send_command('@wait 1.7;cancel sneak')
end
equip(sets.Midcast.Haste)
else
equip(sets.Midcast.Haste)
end
end
end
function aftercast(spell,action)
if not spell.interrupted then
if spell.type == "WeaponSkill" then
send_command('wait 0.2;gs c TP')
elseif spell.english == "Warding Circle" then -- Warding Circle Countdown --
send_command('wait 260;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..': [OFF]')
end
end
status_change(player.status)
end
function status_change(new,old)
if Armor == 'PDT' then
equip(sets.PDT)
elseif Armor == 'MDT' then
equip(sets.MDT)
elseif new == 'Engaged' then
equipSet = sets.TP
if Armor == 'Hybrid' and equipSet["Hybrid"] then
equipSet = equipSet["Hybrid"]
end
if equipSet[WeaponArray[WeaponIndex]] then
equipSet = equipSet[WeaponArray[WeaponIndex]]
end
if equipSet[AccArray[AccIndex]] then
equipSet = equipSet[AccArray[AccIndex]]
end
if buffactive["Aftermath: Lv.3"] and equipSet["AM3"] then
equipSet = equipSet["AM3"]
end
if buffactive.Ionis and equipSet["Ionis"] then
equipSet = equipSet["Ionis"]
end
if buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
equipSet = equipSet["STP"]
end
if buffactive.Seigan and Seigan == 'ON' then -- Use Seigan Toggle For Seigan TP Set --
equipSet = set_combine(equipSet,sets.TP.Seigan)
end
if buffactive["Third Eye"] and Third_Eye == 'ON' then -- Use Third Eye Toggle For Third Eye TP Set --
equipSet = set_combine(equipSet,sets.TP["Third Eye"])
end
equip(equipSet)
else
equipSet = sets.Idle
if equipSet[IdleArray[IdleIndex]] then
equipSet = equipSet[IdleArray[IdleIndex]]
end
if equipSet[WeaponArray[WeaponIndex]] then
equipSet = equipSet[WeaponArray[WeaponIndex]]
end
equip(equipSet)
end
if Twilight == 'Twilight' then
equip(sets.Twilight)
end
if Reive == 'Reive' then
equip(sets.Reive)
end
if Capacity == 'Capacity' then
equip(sets.Capacity)
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 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;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 == "perfect defense" then -- PD Timer --
if gain then
send_command('timers create "Perfect Defense" 57 down')
else
send_command('timers delete "Perfect Defense"')
add_to_chat(123,'PD: [OFF]')
end
elseif buff == "yaegasumi" then -- Yaegasumi Timer --
if gain then
send_command('timers create "Yaegasumi" 45 down')
else
send_command('timers delete "Yaegasumi"')
add_to_chat(123,'Yaegasumi: [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 buff == "sleep" and gain and player.hp > 200 and player.status == "Engaged" then -- Equip Berserker's Torque When You Are Asleep & Have 200+ HP --
equip({neck="Berserker's Torque"})
else
if not midaction() then
status_change(player.status)
end
end
if name == "Meikyo Shisui" then
if gain then
enable("feet")
equip({feet="Sakonji Sune-Ate"})
disable("feet")
else
enable("feet")
end
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
add_to_chat(158,'Accuracy Level: '..AccArray[AccIndex])
status_change(player.status)
elseif command == 'C17' then -- Main Weapon Toggle --
WeaponIndex = (WeaponIndex % #WeaponArray) + 1
add_to_chat(158,'Main Weapon: '..WeaponArray[WeaponIndex])
status_change(player.status)
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 -- Reive Toggle --
if Reive == 'Reive' then
Reive = 'None'
add_to_chat(123,'Reive Set: [Unlocked]')
else
Reive = 'Reive'
add_to_chat(158,'Reive Set: [Locked]')
end
status_change(player.status)
elseif command == 'C18' then -- Capacity Toggle --
if Capacity == 'Capacity' then
Capacity = 'None'
add_to_chat(123,'Capacity Set: [Unlocked]')
else
Capacity = 'Capacity'
add_to_chat(158,'Capacity Set: [Locked]')
end
status_change(player.status)
elseif command == 'C16' then -- Seigan Toggle --
if Seigan == 'ON' then
Seigan = 'OFF'
add_to_chat(123,'Seigan Set: [Unlocked]')
else
Seigan = 'ON'
add_to_chat(158,'Seigan Set: [Locked]')
end
status_change(player.status)
elseif command == 'C12' then -- Third Eye Toggle --
if Third_Eye == 'ON' then
Third_Eye = 'OFF'
add_to_chat(123,'Third Eye Set: [Unlocked]')
else
Third_Eye = 'ON'
add_to_chat(158,'Third Eye Set: [Locked]')
end
status_change(player.status)
elseif command == 'C11' then -- SAM Roll Toggle --
if Samurai_Roll == 'ON' then
Samurai_Roll = 'OFF'
add_to_chat(123,'SAM Roll: [OFF]')
else
Samurai_Roll = 'ON'
add_to_chat(158,'SAM Roll: [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 == 'C3' then -- Twilight Toggle --
if Twilight == 'Twilight' then
Twilight = 'None'
add_to_chat(123,'Twilight Set: [Unlocked]')
else
Twilight = 'Twilight'
add_to_chat(158,'Twilight Set: [Locked]')
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 == 'C10' then -- Cancel Meikyo Shisui --
send_command('Cancel Meikyo Shisui')
add_to_chat(123,'Meikyo Shisui: [OFF]')
elseif command == 'C6' then -- Idle Toggle --
IdleIndex = (IdleIndex % #IdleArray) + 1
add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
status_change(player.status)
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 refine_waltz(spell,action)
if spell.type ~= 'Waltz' then
return
end
if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" 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 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(8, downgrade)
end
cancel_spell()
return
end
if missingHP > 0 then
add_to_chat(8,'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, 12)
elseif player.sub_job == 'DNC' then
set_macro_page(2, 12)
elseif player.sub_job == 'NIN' then
set_macro_page(3, 12)
else
set_macro_page(1, 12)
end
end