Cor Double-up Gs Problem

Eorzea Time
 
 
 
Langues: JP EN FR DE
users online
Forum » FFXI » Jobs » Corsair » Cor Double-up gs problem
Cor Double-up gs problem
 Asura.Massacres
Offline
Serveur: Asura
Game: FFXI
user: hamany9
Posts: 28
By Asura.Massacres 2018-05-25 18:00:26
Link | Citer | R
 
Ok I have a problem with gearswap when it comes to double up. GS won't equip luzaf's ring and regal neck, Only swaps gear for phantom roll.
Code
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job.  Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------

--[[
    gs c toggle LuzafRing -- Toggles use of Luzaf Ring on and off
    
    Offense mode is melee or ranged.  Used ranged offense mode if you are engaged
    for ranged weaponskills, but not actually meleeing.
    
    Weaponskill mode, if set to 'Normal', is handled separately for melee and ranged weaponskills.
--]]


-- Initialization function for this job file.
function get_sets()
    mote_include_version = 2
    
    -- Load and initialize the include file.
    include('Mote-Include.lua')
end

-- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
function job_setup()
    -- Whether to use Luzaf's Ring
    state.LuzafRing = M(false, "Luzaf's Ring")
    -- Whether a warning has been given for low ammo
    state.warned = M(false)

    define_roll_values()
end

-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------

-- Setup vars that are user-dependent.  Can override this function in a sidecar file.
function user_setup()
    state.OffenseMode:options('Melee', 'Acc', 'DT')
    state.RangedMode:options('Normal', 'Acc')
    state.WeaponskillMode:options('Normal', 'Acc', 'Att', 'Mod')
    state.CastingMode:options('Normal', 'Resistant')
    state.IdleMode:options('Normal', 'PDT', 'Refresh')

    gear.RAbullet = "Chrono Bullet"
    gear.WSbullet = "Chrono Bullet"
    gear.MAbullet = "Chrono Bullet"
    gear.QDbullet = "Animikii Bullet"
    options.ammo_warning_limit = 15

    -- Additional local binds
    send_command('bind ^` input /ja "Double-up" <me>')
    send_command('bind !` input /ja "Bolter\'s Roll" <me>')
    send_command('wait 6;input /lockstyleset 100')

    select_default_macro_book()
end


-- Called when this job file is unloaded (eg: job change)
function user_unload()
    send_command('unbind ^`')
    send_command('unbind !`')
end

-- Define sets and vars used by this job file.
function init_gear_sets()
    --------------------------------------
    -- Start defining the sets
    --------------------------------------
    
    -- Precast Sets

    -- Precast sets to enhance JAs
    
    sets.precast.JA['Triple Shot'] = {body="Navarch's Frac +2"}
    sets.precast.JA['Snake Eye'] = {legs="Lanun Culottes"}
    sets.precast.JA['Wild Card'] = {feet="Lanun Bottes"}
    sets.precast.JA['Random Deal'] = {body="Lanun Frac"}


    
    sets.precast.CorsairRoll = {head="Lanun tricorne +1",Neck="Regal necklace",hands="Chasseur's Gants +1",ring1="Barataria ring",ring2="Luzaf's ring",back="Camulus's mantle"}
    
    sets.precast.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="Navarch's Culottes +2"})
    sets.precast.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="Navarch's Bottes +2"})
    sets.precast.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="Navarch's Tricorne +2"})
    sets.precast.CorsairRoll["Tactician's Roll"] = set_combine(sets.precast.CorsairRoll, {body="Navarch's Frac +2"})
    sets.precast.CorsairRoll["Allies' Roll"] = set_combine(sets.precast.CorsairRoll, {hands="Chasseur's Gants +1"})
    
    sets.precast.LuzafRing = {ring2="Luzaf's Ring",neck="Regal necklace"}
    sets.precast.FoldDoubleBust = {hands="Lanun Gants"}
    
    sets.precast.CorsairShot = {head="Blood Mask"}
    

    -- Waltz set (chr and vit)
    sets.precast.Waltz = {
        head="Whirlpool Mask",
        body="Iuitl Vest",hands="Iuitl Wristbands",
        legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}
        
    -- Don't need any special gear for Healing Waltz.
    sets.precast.Waltz['Healing Waltz'] = {}

    -- Fast cast sets for spells
    
    sets.precast.FC = {head="Herculean Helm",neck="Orunmila's torque",ear1="Etiolation earring",ear2="Loquacious Earring",
    hands="Leyline Gloves",ring1="Prolix Ring",back="Swith cape",waist="Sailfi belt +1"}

    sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})


    sets.precast.RA = {ammo=gear.RAbullet,
        head="Meghanada Visor +1",Neck="Sanctity Necklace",ear1="Enervating earring",ear2="Neritic earring",
        body="Meg. Cuirie +1",hands="Carmine finger gauntlets +1",ring1="Ilabrat ring",ring2="Dingir ring",
        back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','Weapon skill damage +10%',}},waist="Yemaya Belt",legs="Adhemar kecks",feet="Meghanada jambeaux +1"}

       
    -- Weaponskill sets
    -- Default set for any weaponskill that isn't any more specifically defined
    sets.precast.WS = {
        head="Meghanada Visor +1",neck="Fotia gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
        body="Meg. Cuirie +1",hands="Meg. Gloves +1",ring1="Shukuyu ring",ring2="Epona's Ring",
        back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}},waist="Fotia belt",legs="Meg. Chausses +1",feet="Meg. Jam. +1"}


    -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
    sets.precast.WS['Evisceration'] = sets.precast.WS

    sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {legs="Meg. Chausses +1"})

    sets.precast.WS['Savage Blade'] = {
        head="Meghanada Visor +1",neck="Fotia gorget",ear1="Ishvara Earring",ear2="Cessance earring",
        body="Meg. Cuirie +1",hands="Meg. Gloves +2",ring1="Rufescent ring",ring2="Shukuyu ring",
        back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}},waist="Fotia belt",legs="Meg. Chausses +1",feet="Meg. Jam. +1"}

    sets.precast.WS['Last Stand'] = {ammo=gear.WSbullet,
        head="Meghanada Visor +1",neck="Fotia gorget",ear1="Ishvara Earring",ear2="Neritic Earring",
        body="Meg. Cuirie +1",hands="Meg. Gloves +2",ring1="Ilabrat ring",ring2="Dingir Ring",
        back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','Weapon skill damage +10%',}},waist="Fotia belt",legs="Meg. Chausses +1",feet="Meg. Jam. +1"}

    sets.precast.WS['Last Stand'].Acc = {ammo=gear.WSbullet,
        head="Meghanada Visor +1",neck="Fotia gorget",ear1="Ishvara Earring",ear2="Neritic Earring",
        body="Meg. Cuirie +1",hands="Meg. Gloves +2",ring1="Ilabrat ring",ring2="Dingir Ring",
        back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','Weapon skill damage +10%',}},waist="Fotia belt",legs="Meg. Chausses +1",feet="Meg. Jam. +1"}


    sets.precast.WS['Wildfire'] = {ammo=gear.MAbullet,
        head={ name="Herculean Helm", augments={'Mag. Acc.+18 "Mag.Atk.Bns."+18','Crit. hit damage +1%','INT+10','Mag. Acc.+1','"Mag.Atk.Bns."+12',}},neck="Fotia gorget",ear1="Friomisi Earring",ear2="Hecate's Earring",
        body={ name="Herculean Vest", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst dmg.+3%','Mag. Acc.+14','"Mag.Atk.Bns."+12',}},hands="Carmine finger gauntlets +1",
        ring1="Ilabrat Ring",ring2="Dingir Ring",back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','Weapon skill damage +10%',}},waist="Fotia belt",
        legs={ name="Herculean Trousers", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Phys. dmg. taken -1%','STR+5','Mag. Acc.+10','"Mag.Atk.Bns."+15',}},
        feet={ name="Herculean Boots", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Fast Cast"+1','STR+9','Mag. Acc.+6','"Mag.Atk.Bns."+14',}}}

    
    sets.precast.WS['Leaden Salute'] = {ammo=gear.MAbullet,
        head="Pixie hairpin +1",neck="Fotia gorget",ear1="Friomisi Earring",ear2="Hecate's Earring",
        body={ name="Herculean Vest", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst dmg.+3%','Mag. Acc.+14','"Mag.Atk.Bns."+12',}},hands="Carmine finger gauntlets +1",
        ring1="Archon Ring",ring2="Dingir Ring",back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','Weapon skill damage +10%',}},waist="Fotia belt",
        legs={ name="Herculean Trousers", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Phys. dmg. taken -1%','STR+5','Mag. Acc.+10','"Mag.Atk.Bns."+15',}},
        feet={ name="Herculean Boots", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Fast Cast"+1','STR+9','Mag. Acc.+6','"Mag.Atk.Bns."+14',}}}
    
    
    -- Midcast Sets
    sets.midcast.FastRecast = {
        head="Whirlpool Mask",
        body="Iuitl Vest",hands="Iuitl Wristbands",
        legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
        
    -- Specific spells
    sets.midcast.Utsusemi = sets.midcast.FastRecast

    sets.midcast.CorsairShot = {ammo=gear.QDbullet,
        head={ name="Herculean Helm", augments={'Mag. Acc.+18 "Mag.Atk.Bns."+18','Crit. hit damage +1%','INT+10','Mag. Acc.+1','"Mag.Atk.Bns."+12',}},neck="Baetyl pendant",ear1="Friomisi Earring",ear2="Hecate's Earring",
        body={ name="Herculean Vest", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst dmg.+3%','Mag. Acc.+14','"Mag.Atk.Bns."+12',}},hands="Carmine finger gauntlets +1",
        ring1="Acumen Ring",ring2="Dingir Ring",back="Gunslinger's cape",waist="Eschan stone",
        legs={ name="Herculean Trousers", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Phys. dmg. taken -1%','STR+5','Mag. Acc.+10','"Mag.Atk.Bns."+15',}},
        feet={ name="Herculean Boots", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Fast Cast"+1','STR+9','Mag. Acc.+6','"Mag.Atk.Bns."+14',}}}

    sets.midcast.CorsairShot.Acc = {ammo=gear.QDbullet,
        head={ name="Herculean Helm", augments={'Mag. Acc.+18 "Mag.Atk.Bns."+18','Crit. hit damage +1%','INT+10','Mag. Acc.+1','"Mag.Atk.Bns."+12',}},neck="Baetyl pendant",ear1="Friomisi Earring",ear2="Hecate's Earring",
        body={ name="Herculean Vest", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst dmg.+3%','Mag. Acc.+14','"Mag.Atk.Bns."+12',}},hands="Carmine finger gauntlets +1",
        ring1="Acumen Ring",ring2="Dingir Ring",back="Gunslinger's cape",waist="Eschan stone",
        legs={ name="Herculean Trousers", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Phys. dmg. taken -1%','STR+5','Mag. Acc.+10','"Mag.Atk.Bns."+15',}},
        feet={ name="Herculean Boots", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Fast Cast"+1','STR+9','Mag. Acc.+6','"Mag.Atk.Bns."+14',}}}

    sets.midcast.CorsairShot['Light Shot'] = {ammo=gear.QDbullet,
        head={ name="Herculean Helm", augments={'Mag. Acc.+18 "Mag.Atk.Bns."+18','Crit. hit damage +1%','INT+10','Mag. Acc.+1','"Mag.Atk.Bns."+12',}},neck="Baetyl pendant",ear1="Friomisi Earring",ear2="Hecate's Earring",
        body={ name="Herculean Vest", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst dmg.+3%','Mag. Acc.+14','"Mag.Atk.Bns."+12',}},hands="Carmine finger gauntlets +1",
        ring1="Acumen Ring",ring2="Dingir Ring",back="Gunslinger's cape",waist="Eschan stone",
        legs={ name="Herculean Trousers", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Phys. dmg. taken -1%','STR+5','Mag. Acc.+10','"Mag.Atk.Bns."+15',}},
        feet={ name="Herculean Boots", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Fast Cast"+1','STR+9','Mag. Acc.+6','"Mag.Atk.Bns."+14',}}}

    sets.midcast.CorsairShot['Dark Shot'] = {ammo=gear.QDbullet,
        head="Pixie hairpin +1",neck="Baetyl pendant",ear1="Friomisi Earring",ear2="Hecate's Earring",
        body={ name="Herculean Vest", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst dmg.+3%','Mag. Acc.+14','"Mag.Atk.Bns."+12',}},hands="Carmine finger gauntlets +1",
        ring1="Archon Ring",ring2="Dingir Ring",back="Gunslinger's cape",waist="Eschan stone",
        legs={ name="Herculean Trousers", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Phys. dmg. taken -1%','STR+5','Mag. Acc.+10','"Mag.Atk.Bns."+15',}},
        feet={ name="Herculean Boots", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Fast Cast"+1','STR+9','Mag. Acc.+6','"Mag.Atk.Bns."+14',}}}


    -- Ranged gear
    sets.midcast.RA =  {ammo=gear.RAbullet,
        head="Meghanada Visor +1",Neck="Iskur gorget",ear1="Enervating earring",ear2="Neritic earring",
        body="Meg. Cuirie +1",hands="Meg. Gloves +2",ring1="Ilabrat ring",ring2="Dingir ring",
        back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','Weapon skill damage +10%',}},waist="Yemaya Belt",legs="Meg. Chausses +1",feet="Meg. Jam. +1"}

    sets.midcast.RA.Acc =  {ammo=gear.RAbullet,
        head="Meghanada Visor +1",Neck="Iskur gorget",ear1="Enervating earring",ear2="Neritic earring",
        body="Meg. Cuirie +1",hands="Meg. Gloves +1",ring1="Ilabrat ring",ring2="Dingir ring",
        back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','Weapon skill damage +10%',}},waist="Yemaya Belt",legs="Meg. Chausses +1",feet="Meg. Jam. +1"}

    
    -- Sets to return to when not performing an action.
    
    -- Resting sets
    sets.resting =  {
        head="Rawhide mask",neck="Sanctity necklace",Ear1="Moonshade earring",Ear2="Infused earring",
        body="Jhakri robe +1",hands={ name="Herculean Gloves", augments={'Phys. dmg. taken -4%','STR+8','Accuracy+4','Attack+5',}},ring1="Sheltered Ring",ring2="Paguroidea Ring",
        waist="Fucho-no-obi",feet={ name="Herculean Boots", augments={'Attack+15','Phys. dmg. taken -3%','DEX+6','Accuracy+11',}}}

    -- Idle sets
    sets.idle = {ammo=gear.WSbullet,
        head={ name="Herculean Helm", augments={'Phys. dmg. taken -4%','Accuracy+14','Attack+11',}},neck="Loricate torque +1",Ear1="Etiolation earring",Ear2="Infused earring",
        body="Meg. Cuirie +1",hands={ name="Herculean Gloves", augments={'Phys. dmg. taken -4%','STR+8','Accuracy+4','Attack+5',}},ring1="Defending Ring",ring2="Patricius ring",
        back="Moonbeam cape",waist="Flume Belt",legs="Carmine cuisses +1",feet={ name="Herculean Boots", augments={'Accuracy+2','Phys. dmg. taken -5%','Attack+11',}}}


    sets.idle.Town = {ammo=gear.WSbullet,
        head={ name="Herculean Helm", augments={'Phys. dmg. taken -4%','Accuracy+14','Attack+11',}},neck="Regal necklace",Ear1="Etiolation earring",Ear2="Infused earring",
        body="Meg. Cuirie +1",hands={ name="Herculean Gloves", augments={'Phys. dmg. taken -4%','STR+8','Accuracy+4','Attack+5',}},ring1="Defending Ring",ring2="Patricius ring",
        back="Moonbeam cape",waist="Flume Belt",legs="Carmine cuisses +1",feet={ name="Herculean Boots", augments={'Accuracy+2','Phys. dmg. taken -5%','Attack+11',}}}
    
    -- Defense sets
    sets.defense.PDT = {ammo=gear.WSbullet,
        head={ name="Herculean Helm", augments={'Phys. dmg. taken -4%','Accuracy+14','Attack+11',}},neck="Loricate torque +1",Ear1="Etiolation earring",Ear2="Infused earring",
        body="Meg. Cuirie +1",hands={ name="Herculean Gloves", augments={'Phys. dmg. taken -4%','STR+8','Accuracy+4','Attack+5',}},ring1="Defending Ring",ring2="Patricius ring",
        back="Moonbeam cape",waist="Flume Belt",legs="Carmine cuisses",feet={ name="Herculean Boots", augments={'Accuracy+2','Phys. dmg. taken -5%','Attack+11',}}}

    sets.defense.MDT = {ammo=gear.WSbullet,
        head={ name="Herculean Helm", augments={'Phys. dmg. taken -4%','Accuracy+14','Attack+11',}},neck="Loricate torque +1",Ear1="Etiolation earring",Ear2="Infused earring",
        body="Meg. Cuirie +1",hands={ name="Herculean Gloves", augments={'Phys. dmg. taken -4%','STR+8','Accuracy+4','Attack+5',}},ring1="Defending Ring",ring2="Patricius ring",
        back="Moonbeam cape",waist="Flume Belt",legs="Carmine cuisses",feet={ name="Herculean Boots", augments={'Accuracy+2','Phys. dmg. taken -5%','Attack+11',}}}
    

    sets.Kiting = {feet="Carmine cuisses +1"}

    -- Engaged sets

    -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
    -- sets if more refined versions aren't defined.
    -- If you create a set with both offense and defense modes, the offense mode should be first.
    -- EG: sets.engaged.Dagger.Accuracy.Evasion
    
    -- Normal melee group
    sets.engaged.Melee = {ammo=gear.WSbullet,
        head={ name="Herculean Helm", augments={'Attack+15','"Triple Atk."+4','Accuracy+11',}},neck="Clotharius torque",ear1="Suppanomimi",ear2="Cessance Earring",
        body="Adhemar jacket",hands={ name="Herculean Gloves", augments={'Accuracy+24 Attack+24','Crit.hit rate+2','STR+9','Accuracy+8','Attack+15',}},ring1="Ilabrat Ring",ring2="Epona's Ring",
        back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}},waist="Kentarch belt +1",legs="Samnuha tights",
        feet={ name="Herculean Boots", augments={'Accuracy+21 Attack+21','"Triple Atk."+2','STR+5','Attack+13',}}}
    
    sets.engaged.Acc = {ammo=gear.WSbullet,
        head="Mummu bonnet +1",neck="Combatant's torque",ear1="Dignitary's earring",ear2="Cessance Earring",
        body="Adhemar jacket",hands={ name="Herculean Gloves", augments={'Accuracy+24 Attack+24','Crit.hit rate+2','STR+9','Accuracy+8','Attack+15',}},ring1="Cacoethic ring",ring2="Cacoethic ring +1",
        back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}},waist="Kentarch belt +1",legs="Carmine cuisses +1",
        feet={ name="Herculean Boots", augments={'Accuracy+21 Attack+21','"Triple Atk."+2','STR+5','Attack+13',}}}

    sets.engaged.DT = {ammo=gear.WSbullet,
        head={ name="Herculean Helm", augments={'Phys. dmg. taken -4%','Accuracy+14','Attack+11',}},neck="Loricate torque +1",Ear1="Suppanomimi",Ear2="Cessance Earring",
        body="Meg. Cuirie +1",hands={ name="Herculean Gloves", augments={'Phys. dmg. taken -4%','STR+8','Accuracy+4','Attack+5',}},ring1="Defending Ring",ring2="Patricius ring",
        back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}},waist="Kentarch belt +1",
        legs={ name="Herculean Trousers", augments={'Attack+11','Phys. dmg. taken -4%','AGI+8',}},feet={ name="Herculean Boots", augments={'Accuracy+2','Phys. dmg. taken -5%','Attack+11',}}}
    
    

end

-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------

-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
    -- Check that proper ammo is available if we're using ranged attacks or similar.
    if spell.action_type == 'Ranged Attack' or spell.type == 'WeaponSkill' or spell.type == 'CorsairShot' then
        do_bullet_checks(spell, spellMap, eventArgs)
    end

    -- gear sets
    if (spell.type == 'CorsairRoll' or spell.english == "Double-Up") and state.LuzafRing.value then
        equip(sets.precast.LuzafRing)
    elseif spell.type == 'CorsairShot' and state.CastingMode.value == 'Resistant' then
        classes.CustomClass = 'Acc'
    elseif spell.english == 'Fold' and buffactive['Bust'] == 2 then
        if sets.precast.FoldDoubleBust then
            equip(sets.precast.FoldDoubleBust)
            eventArgs.handled = true
        end
    end
end


-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_aftercast(spell, action, spellMap, eventArgs)
    if spell.type == 'CorsairRoll' and not spell.interrupted then
        display_roll_info(spell)
    end
end

-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------

-- Return a customized weaponskill mode to use for weaponskill sets.
-- Don't return anything if you're not overriding the default value.
function get_custom_wsmode(spell, spellMap, default_wsmode)
    if buffactive['Transcendancy'] then
        return 'Brew'
    end
end


-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
    if newStatus == 'Engaged' and player.equipment.main == 'Chatoyant Staff' then
        state.OffenseMode:set('Ranged')
    end
end


-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
    local msg = ''
    
    msg = msg .. 'Off.: '..state.OffenseMode.current
    msg = msg .. ', Rng.: '..state.RangedMode.current
    msg = msg .. ', WS.: '..state.WeaponskillMode.current
    msg = msg .. ', QD.: '..state.CastingMode.current

    if state.DefenseMode.value ~= 'None' then
        local defMode = state[state.DefenseMode.value ..'DefenseMode'].current
        msg = msg .. ', Defense: '..state.DefenseMode.value..' '..defMode
    end
    
    if state.Kiting.value then
        msg = msg .. ', Kiting'
    end
    
    if state.PCTargetMode.value ~= 'default' then
        msg = msg .. ', Target PC: '..state.PCTargetMode.value
    end

    if state.SelectNPCTargets.value then
        msg = msg .. ', Target NPCs'
    end

    msg = msg .. ', Roll Size: ' .. ((state.LuzafRing.value and 'Large') or 'Small')
    
    add_to_chat(122, msg)

    eventArgs.handled = true
end


-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------

function define_roll_values()
    rolls = {
        ["Corsair's Roll"]   = {lucky=5, unlucky=9, bonus="Experience Points"},
        ["Ninja Roll"]       = {lucky=4, unlucky=8, bonus="Evasion"},
        ["Hunter's Roll"]    = {lucky=4, unlucky=8, bonus="Accuracy"},
        ["Chaos Roll"]       = {lucky=4, unlucky=8, bonus="Attack"},
        ["Magus's Roll"]     = {lucky=2, unlucky=6, bonus="Magic Defense"},
        ["Healer's Roll"]    = {lucky=3, unlucky=7, bonus="Cure Potency Received"},
        ["Puppet Roll"]      = {lucky=4, unlucky=8, bonus="Pet Magic Accuracy/Attack"},
        ["Choral Roll"]      = {lucky=2, unlucky=6, bonus="Spell Interruption Rate"},
        ["Monk's Roll"]      = {lucky=3, unlucky=7, bonus="Subtle Blow"},
        ["Beast Roll"]       = {lucky=4, unlucky=8, bonus="Pet Attack"},
        ["Samurai Roll"]     = {lucky=2, unlucky=6, bonus="Store TP"},
        ["Evoker's Roll"]    = {lucky=5, unlucky=9, bonus="Refresh"},
        ["Rogue's Roll"]     = {lucky=5, unlucky=9, bonus="Critical Hit Rate"},
        ["Warlock's Roll"]   = {lucky=4, unlucky=8, bonus="Magic Accuracy"},
        ["Fighter's Roll"]   = {lucky=5, unlucky=9, bonus="Double Attack Rate"},
        ["Drachen Roll"]     = {lucky=3, unlucky=7, bonus="Pet Accuracy"},
        ["Gallant's Roll"]   = {lucky=3, unlucky=7, bonus="Defense"},
        ["Wizard's Roll"]    = {lucky=5, unlucky=9, bonus="Magic Attack"},
        ["Dancer's Roll"]    = {lucky=3, unlucky=7, bonus="Regen"},
        ["Scholar's Roll"]   = {lucky=2, unlucky=6, bonus="Conserve MP"},
        ["Bolter's Roll"]    = {lucky=3, unlucky=9, bonus="Movement Speed"},
        ["Caster's Roll"]    = {lucky=2, unlucky=7, bonus="Fast Cast"},
        ["Courser's Roll"]   = {lucky=3, unlucky=9, bonus="Snapshot"},
        ["Blitzer's Roll"]   = {lucky=4, unlucky=9, bonus="Attack Delay"},
        ["Tactician's Roll"] = {lucky=5, unlucky=8, bonus="Regain"},
        ["Allies's Roll"]    = {lucky=3, unlucky=10, bonus="Skillchain Damage"},
        ["Miser's Roll"]     = {lucky=5, unlucky=7, bonus="Save TP"},
        ["Companion's Roll"] = {lucky=2, unlucky=10, bonus="Pet Regain and Regen"},
        ["Avenger's Roll"]   = {lucky=4, unlucky=8, bonus="Counter Rate"},
    }
end

function display_roll_info(spell)
    rollinfo = rolls[spell.english]
    local rollsize = (state.LuzafRing.value and 'Large') or 'Small'

    if rollinfo then
        add_to_chat(104, spell.english..' provides a bonus to '..rollinfo.bonus..'.  Roll size: '..rollsize)
        add_to_chat(104, 'Lucky roll is '..tostring(rollinfo.lucky)..', Unlucky roll is '..tostring(rollinfo.unlucky)..'.')
    end
end


-- Determine whether we have sufficient ammo for the action being attempted.
function do_bullet_checks(spell, spellMap, eventArgs)
    local bullet_name
    local bullet_min_count = 1
    
    if spell.type == 'WeaponSkill' then
        if spell.skill == "Marksmanship" then
            if spell.element == 'None' then
                -- physical weaponskills
                bullet_name = gear.WSbullet
            else
                -- magical weaponskills
                bullet_name = gear.MAbullet
            end
        else
            -- Ignore non-ranged weaponskills
            return
        end
    elseif spell.type == 'CorsairShot' then
        bullet_name = gear.QDbullet
    elseif spell.action_type == 'Ranged Attack' then
        bullet_name = gear.RAbullet
        if buffactive['Triple Shot'] then
            bullet_min_count = 3
        end
    end
    
    local available_bullets = player.inventory[bullet_name] or player.wardrobe[bullet_name]
    
    -- If no ammo is available, give appropriate warning and end.
    if not available_bullets then
        if spell.type == 'CorsairShot' and player.equipment.ammo ~= 'empty' then
            add_to_chat(104, 'No Quick Draw ammo left.  Using what\'s currently equipped ('..player.equipment.ammo..').')
            return
        elseif spell.type == 'WeaponSkill' and player.equipment.ammo == gear.RAbullet then
            add_to_chat(104, 'No weaponskill ammo left.  Using what\'s currently equipped (standard ranged bullets: '..player.equipment.ammo..').')
            return
        else
            add_to_chat(104, 'No ammo ('..tostring(bullet_name)..') available for that action.')
            eventArgs.cancel = true
            return
        end
    end
    
    -- Don't allow shooting or weaponskilling with ammo reserved for quick draw.
    if spell.type ~= 'CorsairShot' and bullet_name == gear.QDbullet and available_bullets.count <= bullet_min_count then
        add_to_chat(104, 'No ammo will be left for Quick Draw.  Cancelling.')
        eventArgs.cancel = true
        return
    end
    
    -- Low ammo warning.
    if spell.type ~= 'CorsairShot' and state.warned.value == false
        and available_bullets.count > 1 and available_bullets.count <= options.ammo_warning_limit then
        local msg = '*****  LOW AMMO WARNING: '..bullet_name..' *****'
        --local border = string.repeat("*", #msg)
        local border = ""
        for i = 1, #msg do
            border = border .. "*"
        end
        
        add_to_chat(104, border)
        add_to_chat(104, msg)
        add_to_chat(104, border)

        state.warned:set()
    elseif available_bullets.count > options.ammo_warning_limit and state.warned then
        state.warned:reset()
    end
end

-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
    set_macro_page(1, 9)
end



Another question,Do you need to wear regal necklace during double up or just the initial Phantom roll cast?
Offline
Posts: 319
By aisukage 2018-05-25 20:38:55
Link | Citer | R
 
It's a mode you have to toggle on or off and line 26 states that when the lua is loaded this mode is set to false(off). So either change the "false" to "true" on line 26 so when you load up the lua it will automatically be ready to go. Otherwise you will need toggle it on manually or it won't equip it.

unless i missed it i don't see a key bind to toggle it. So you will have to manually toggle it using //gs c toggle LuzafRing or make your own bind like

send_command('bind !l gs c toggle LuzafRing)

Also no you don't need to wear regal necklace for double up. Only for the initial roll to apply the bonus.
 Asura.Massacres
Offline
Serveur: Asura
Game: FFXI
user: hamany9
Posts: 28
By Asura.Massacres 2018-05-25 20:45:11
Link | Citer | R
 
Thank you.