FANDOM


Here's my WAR .lua file. Find me in game if you have any questions.

Go back to my Gearswap page.

--[[ *************************************************************
 Wren's WAR gearswap .lua for SuperNova FFXI
 Save as windower/addons/GearSwap/data/WAR.lua
 
  2016-10-26 OC  - First version.
************************************************************* --]]
 
 --[[ ******************************************************
  Gearsets - define the various sets of gear we'll wear.
****************************************************** --]]
 
 function get_sets()
 
     -- fashion set is for looking nice while lockstyled.
    -- make sure you include your top-row equipment,
    -- especially if you use a ranged or throwing weapon.
    sets.fashion = {
        main        = "Bravura",
        sub         = "Pole Grip",
        range       = empty,
        ammo        = "Fire Bomblet",
        head        = "Hecatomb Cap +1",
        body        = "Askar Korazin",
        hands       = "Dusk Gloves +1",
        legs        = "Hachiryu Haidate",
        feet        = "Dusk Ledelsens +1"
    }
 
     -- idle set is worn when we're standing around doing
    -- nothing.
     sets.idle = {
        main        = "Bravura",
        sub         = "Pole Grip",
        range       = empty,
        ammo        = "Fire Bomblet",
        head        = "Walahra Turban",
        neck        = "Fortitude Torque",
        left_ear    = "Assault Earring",
        right_ear   = "Brutal Earring",
        body        = "Hachiryu Haramaki",
        hands       = "Hachiryu Kote",
        left_ring   = "Shadow Ring",
        right_ring  = "Rajas Ring",
        back        = "Shadow Mantle",
        waist       = "Sonic Belt +1",
        legs        = "Byakko's Haidate",
        feet        = "Aurum Sabatons"
    }
 
     -- our basic engaged set replaces some of our idle slots
    -- when we engage a foe.
    sets.engaged = {
        body        = "Armada Hauberk",
        hands       = "Dusk Gloves +1",
        left_ring   = "Toreador's Ring",
        back        = "Cerb. Mantle +1"
    }
 
     -- gear megatron torment
    sets.ws = {
         head        = "Hecatomb Cap +1",
        neck        = "Light Gorget", -- flame or light
        left_ear    = "Tmph. Earring +1",
        body        = "Armada Hauberk",
        hands       = "Hct. Mittens +1",
        left_ring   = "Flame Ring",
        waist       = "Warrior's Stone",
        legs        = "Hachiryu Haidate",
        feet        = "Hct. Leggings +1"
    }
 
 end
 
 --[[ ******************************************************
  Equip functions - put on the sets we defined above, and
 echo a note to our chat log so we know it worked.
****************************************************** --]]
 
 -- equip our idle set
 function equip_idle()
     windower.add_to_chat(8,'[Idle]')
    equip(sets.idle)
end

-- equip our engaged set
function equip_engaged()
    windower.add_to_chat(8,'[Engaged]')
    equip(sets.idle,sets.engaged)
end

-- equip our weapon skill set
function equip_ws(spell)
    windower.add_to_chat(8,'[Weapon Skill]')
    equip(sets.idle,sets.engaged,sets.ws)
end

-- the choose_set function figures out whether we're engaged with a
-- mob or not, and passes control to the relevant function above.
function choose_set()
    if player.status == "Engaged" then
        equip_engaged()
    else
         equip_idle()
    end
 end
 
 --[[ ******************************************************
  Casting functions - these functions run automatically when
 we cast a spell, use a job ability, rest for MP, and so on
****************************************************** --]]
 
 -- the precast function runs automatically BEFORE we
 -- begin casting a spell or job ability.  For our WAR,
 -- we want to equip ws gear for weapon skills
 function precast(spell)
     if spell.type == 'WeaponSkill' then
        equip_ws(spell)
    end
 end
 
 -- as a WAR we don't do anything mid-cast, because all
 -- our job abilities and WS are essentially insta-cast.
 function midcast(spell)
 end
 
 -- after we JA or WS, we want to return either to our
 -- engaged gear or our idle gear.  The choose_set function
 -- handles that for us.
 function aftercast(spell)
     choose_set()
end

-- status_change also calls the choose_set function, which
-- handles engaging and disengaging from combat.
function status_change(new,old)
    choose_set()
end

-- self_command function for WAR is used to toggle weapon skills,
-- and conditionally use abilities from our /sam subjob.
function self_command(m)
    -- toggle weapon skills
    if m == "W+" then
        if ws == "Metatron Torment" then
            ws = "Steel Cyclone"
        else
             ws = "Metatron Torment"
        end
         windower.add_to_chat(8,'[Current WS: ' .. ws .. ']')
        
     -- use seigan, then third eye, then hasso
    elseif m == "STH" and player.sub_job == "SAM" then
        local seigan  = windower.ffxi.get_ability_recasts()[139] or 0
        local hasso   = windower.ffxi.get_ability_recasts()[138] or 0
        local third   = windower.ffxi.get_ability_recasts()[133] or 0
        if third == 0 then
            if (seigan == 0) and (not buffactive.Seigan) and ((hasso == 0) or (not buffactive.Hasso)) then
                send_command('input /ja Seigan <me>;wait 1.2;input /ja "Third Eye" <me>;wait 1.2;input /ja Hasso <me>')
            else
                send_command('input /ja "Third Eye" <me>')
            end
         end
         
     -- use seigan, then third eye.
    elseif m == "ST" and player.sub_job == "SAM" then
        local seigan  = windower.ffxi.get_ability_recasts()[139] or 0
        local third   = windower.ffxi.get_ability_recasts()[133] or 0
        if seigan == 0 and third == 0 then
            send_command('input /ja Seigan <me>;wait 1.2;input /ja "Third Eye" <me>')
        elseif seigan == 0 then
            send_command('input /ja "Seigan" <me>')
        elseif third == 0 then
            send_command('input /ja "Third Eye" <me>')
        end
         
     -- use our weapon skill of choice.  if meditate recast is down, use it afterward.
    elseif m == "WS" then
        if player.sub_job == "SAM" then
            local meditate  = windower.ffxi.get_ability_recasts()[134] or 0
            local wsString = ""
            if meditate == 0 then
                wsString = 'input /ws "' .. ws .. '" <t>;wait 3.2;input /ja Meditate <me>'
            else
                wsString = 'input /ws "' .. ws .. '" <t>'
            end
             send_command(wsString)
        else
             send_command('input /ws "' .. ws .. '" <t>')
        end
     end
 end
 
 --[[ ******************************************************
  Code that runs once, when we first swap to our THF job
****************************************************** --]]
 
 -- weapon skill of choice
 ws = 'Metatron Torment'
 
 -- Finally, puts on our fashion set, lockstyle it, then switch to our idle set.
 send_command('wait 1;gs equip fashion;wait 1;input /lockstyle on;wait 1;gs equip idle')

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.