Item Search
     
BG-Wiki Search
Closed Thread
Page 295 of 302 FirstFirst ... 245 285 293 294 295 296 297 ... LastLast
Results 5881 to 5900 of 6036

Thread: Gearswap Help Thread!     submit to reddit submit to twitter

  1. #5881

    Quote Originally Posted by Spicyryan View Post
    So I made up this rule to toggle backwards on my tp/dt sets. It works forwards and then backwards, but can't look back from the first set to the last set. Throws a concatenate error.

    Any advice?
    here you go
    Code:
    elseif command == 'toggle backwards' then
        if DT == true then
            DT_ind = DT_ind -1
            if DT_ind == 0 then
                DT_ind = #sets.DT.index
            end
            send_command('@input /echo <----- DT Set changed to ' .. sets.DT.index[DT_ind] .. ' ----->')
            ChangeGear(sets.DT[sets.DT.index[DT_ind]])
        elseif DT == false then
            TP_ind = TP_ind -1
            TizonaAM3_ind = TizonaAM3_ind -1
            if TP_ind == 0 then
                TP_ind = #sets.TP.index
            end
            if TizonaAM3_ind == 0 then
                TizonaAM3_ind = #sets.TizonaAM3.index
            end
            if TizonaAM3 == true then
                ChangeGear(sets.TizonaAM3[sets.TizonaAM3.index[TizonaAM3_ind]])
                send_command('@input /echo <----- Tizona TP Set changed to ' .. sets.TizonaAM3.index[TizonaAM3_ind] .. ' ----->')
            else
                ChangeGear(sets.TP[sets.TP.index[TP_ind]])
                send_command('@input /echo <----- TP Set changed to ' .. sets.TP.index[TP_ind] .. ' ----->')
            end
        end

  2. #5882
    Old Merits
    Join Date
    Nov 2015
    Posts
    1,181
    BG Level
    6
    FFXI Server
    Asura
    WoW Realm
    Cho'gall

    Is there a way to make a rule for different behaviors based on trusts being active or not (for a non-mote file as well)?

  3. #5883

    Quote Originally Posted by Nyarlko View Post
    Is there a way to make a rule for different behaviors based on trusts being active or not (for a non-mote file as well)?
    yes this will return true if a given name is in your allience
    Code:
    function check_in_party(name)--returs true if given name is in allience
         for pt_num,pt in ipairs(alliance) do
             for pos,party_position in ipairs(pt) do
                 if party_position.name == name then
                    return true
                 end
             end
         end
    end

  4. #5884
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,750
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by Radec View Post
    Your conditions are going to want to be like this instead, copy/paste/change for each _Ind

    Code:
    if DT_ind < 1 then DT_ind = #sets.DT.index end
    "If index less than 1, use highest index" rather than "If index greater than highest index, use 1"
    Thanks for that, makes sense.

    Quote Originally Posted by dlsmd View Post
    here you go
    Code:
    elseif command == 'toggle backwards' then
        if DT == true then
            DT_ind = DT_ind -1
            if DT_ind == 0 then
                DT_ind = #sets.DT.index
            end
            send_command('@input /echo <----- DT Set changed to ' .. sets.DT.index[DT_ind] .. ' ----->')
            ChangeGear(sets.DT[sets.DT.index[DT_ind]])
        elseif DT == false then
            TP_ind = TP_ind -1
            TizonaAM3_ind = TizonaAM3_ind -1
            if TP_ind == 0 then
                TP_ind = #sets.TP.index
            end
            if TizonaAM3_ind == 0 then
                TizonaAM3_ind = #sets.TizonaAM3.index
            end
            if TizonaAM3 == true then
                ChangeGear(sets.TizonaAM3[sets.TizonaAM3.index[TizonaAM3_ind]])
                send_command('@input /echo <----- Tizona TP Set changed to ' .. sets.TizonaAM3.index[TizonaAM3_ind] .. ' ----->')
            else
                ChangeGear(sets.TP[sets.TP.index[TP_ind]])
                send_command('@input /echo <----- TP Set changed to ' .. sets.TP.index[TP_ind] .. ' ----->')
            end
        end
    Thank you as always :D

  5. #5885

    Quote Originally Posted by Spicyryan View Post
    Thanks for that, makes sense.



    Thank you as always :D
    you could also use this to minimize it as much as posible
    Code:
    elseif command == 'toggle backwards' then
        if DT == true then
            DT_ind = ((DT_ind % #sets.DT.index)==1 and #sets.DT.index or DT_ind-1)
            send_command('@input /echo <----- DT Set changed to ' .. sets.DT.index[DT_ind] .. ' ----->')
            ChangeGear(sets.DT[sets.DT.index[DT_ind]])
        elseif DT == false then
            TP_ind = ((TP_ind % #sets.TP.index)==1 and #sets.TP.index or TP_ind-1)
            TizonaAM3_ind = ((TizonaAM3_ind % #sets.TizonaAM3.index)==1 and #sets.TizonaAM3.index or TizonaAM3_ind-1)
            if TizonaAM3 == true then
                ChangeGear(sets.TizonaAM3[sets.TizonaAM3.index[TizonaAM3_ind]])
                send_command('@input /echo <----- Tizona TP Set changed to ' .. sets.TizonaAM3.index[TizonaAM3_ind] .. ' ----->')
            else
                ChangeGear(sets.TP[sets.TP.index[TP_ind]])
                send_command('@input /echo <----- TP Set changed to ' .. sets.TP.index[TP_ind] .. ' ----->')
            end
        end

  6. #5886
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,750
    BG Level
    8
    FFXI Server
    Asura

    I have a rule that works, but I find it to be written poorly by me.

    Code:
    function pc_JA(spell, act)
    	if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia'}) and spell.type == 'WeaponSkill' or spell.type == 'Ability' then
    		cancel_spell() return end
    	if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Silence'}) and spell.type == 'Magic' or spell.type == 'Ninjutsu' then
    		cancel_spell() return end
    What would be the best way to rewrite that?

    I was breaking my GS down into tiers of more and more basic a version for newer players or those intimidated by gearswap by ripping stuff out of it, and that rule kept glaring at me.

  7. #5887
    Melee Summoner
    Join Date
    Oct 2014
    Posts
    48
    BG Level
    1

    DT_ind = ((DT_ind % #sets.DT.index)==1 and #sets.DT.index or DT_ind-1)
    Code:
    local n = #sets.DT.index
    
    DT_ind = n - (n+1-DT_ind)%n
    Pretty sure that works.

  8. #5888

    Quote Originally Posted by trv View Post
    Code:
    local n = #sets.DT.index
    
    DT_ind = n - (n+1-DT_ind)%n
    Pretty sure that works.
    yes it does but i was trying to keep it as short as possible, on one line, with as few checks as possible to the count of how many objects in the table, without using local variables
    to keep it as close to this as possible
    (cycle up)
    Code:
    DT_ind = (DT_ind % #sets.DT.index)+1
    the best i could do was
    (cycle down)
    Code:
    DT_ind = ((DT_ind % #sets.DT.index)==1 and #sets.DT.index or DT_ind-1)
    and no you can just change +1 to -1

  9. #5889
    Old Merits
    Join Date
    Nov 2015
    Posts
    1,181
    BG Level
    6
    FFXI Server
    Asura
    WoW Realm
    Cho'gall

    Quote Originally Posted by dlsmd View Post
    yes this will return true if a given name is in your allience
    Code:
    function check_in_party(name)--returs true if given name is in allience
         for pt_num,pt in ipairs(alliance) do
             for pos,party_position in ipairs(pt) do
                 if party_position.name == name then
                    return true
                 end
             end
         end
    end
    Thanks. ^^ Now I just need to figure out where to stick it so that it only checks on player status change, and then how to make it save the value so I change modes based on true/false.

  10. #5890
    E. Body
    Join Date
    May 2008
    Posts
    2,082
    BG Level
    7
    FFXI Server
    Siren

    I'm trying to add in a Flurry rule for my COR lua, and although it appears to be detecting and changing to a Flurry preshot set when the buff is active, it isn't responding to the command (both the keybind and the in-game command) that's supposed to switch between Flurry I and II. I'm sure it's something stupid but I could use a second set of eyes.

    Spoiler: show

    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.
        Acc on offense mode (which is intended for melee) will currently use .Acc weaponskill
        mode for both melee and ranged weaponskills.  Need to fix that in core.
    --]]
    
    
    -- 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")
    	-- Detect Triple Shot
    	state.Buff['Triple Shot'] = buffactive['Triple Shot'] or false
        -- Whether a warning has been given for low ammo
        state.warned = M(false)
    	state.Obi = 'ON' -- Turn Default Obi ON or OFF Here --
    
        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','Ranged','MaxAcc')
        state.RangedMode:options('Normal', 'Acc')
        state.WeaponskillMode:options('Normal', 'Acc', 'Att', 'Mod')
        state.CastingMode:options('Normal', 'Resistant','STP','STP_AF3')
        state.IdleMode:options('PDT', 'Refresh','Normal','STP')
    	
    	
    	PreshotIndex = 1
    	PreshotArray = {'Any','RDM'}
    	send_command('bind ^` gs c flur')
    	
    	
        gear.RAbullet = "Chrono Bullet"
        gear.WSbullet = "Chrono Bullet"
        gear.MAbullet = "Chrono Bullet"
        gear.QDbullet = "Animikii Bullet"
    	gear.MAcape = { name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','AGI+10','Weapon skill damage +10%',}}
    	gear.PRcape = "Camulus's Mantle"
    	gear.TPcape = { name="Camulus's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10',}}
    	gear.Savagecape = { name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%',}}
    	gear.QDcape = { name="Gunslinger's Cape", augments={'Enmity-2','"Mag.Atk.Bns."+5','"Phantom Roll" ability delay -2','Weapon skill damage +2%',}}
    	gear.RAcape = { name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','Rng.Acc.+10','"Store TP"+10',}}
    	gear.LastStandcape = { name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','Weapon skill damage +10%',}}
    	gear.SnapShot_MND= { name="Camulus's Mantle", augments={'MND+20','Accuracy+20 Attack+20','"Snapshot"+10',}}
    	
    	
    	gear.DT_HerculeanGloves = { name="Herculean Gloves", augments={'Accuracy+30','Damage taken-3%','AGI+2','Attack+10',}}
    	
    	gear.MABHercLegs = { name="Herculean Trousers", augments={'INT+7','"Mag.Atk.Bns."+23','Accuracy+13 Attack+13','Mag. Acc.+18 "Mag.Atk.Bns."+18',}}
    	
    	gear.AccHercBoots = { name="Herculean Boots", augments={'Accuracy+25 Attack+25','Crit. hit damage +5%','DEX+7','Accuracy+1',}}
    	gear.MABHercBoots = { name="Herculean Boots", augments={'"Mag.Atk.Bns."+21','MND+5','Mag. Acc.+19 "Mag.Atk.Bns."+19',}}
    	gear.WSDHercBoots = { name="Herculean Boots", augments={'Weapon skill damage +4%','STR+10','Accuracy+8',}}
    	gear.TAHercBoots = { name="Herculean Boots", augments={'Accuracy+26','"Triple Atk."+4','AGI+9','Attack+4',}}
    	gear.DTHercBoots = { name="Herculean Boots", augments={'Accuracy+30','Damage taken-3%','STR+10','Attack+10',}}
    	gear.HerculeanHelmMAB = { name="Herculean Helm", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic dmg. taken -4%','MND+3','Mag. Acc.+12','"Mag.Atk.Bns."+15',}}
    	
    	
    	gear.Snapshot_TaeonHead = { name="Taeon Chapeau", augments={'"Snapshot"+5','"Snapshot"+5',}}
    	gear.Snapshot_TaeonBody = { name="Taeon Tabard", augments={'"Snapshot"+5','"Snapshot"+5',}}
    	
    	
    	
    	options.ammo_warning_limit = 15
    
    
        -- Additional local binds
    end
    
    
    -- Called when this job file is unloaded (eg: job change)
    function user_unload()
    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="Chasseur's Frac +1"}
    	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.Obi = {}
    	sets.Obi.Thunder = {waist='Hachirin-no-Obi'}
    	sets.Obi.Water = {waist='Hachirin-no-Obi'}
    	sets.Obi.Fire = {waist='Hachirin-no-Obi'}
    	sets.Obi.Ice = {waist='Hachirin-no-Obi'}
    	sets.Obi.Wind = {waist='Hachirin-no-Obi'}
    	sets.Obi.Earth = {waist='Hachirin-no-Obi'}
    	sets.Obi.Light = {waist='Hachirin-no-Obi'}
    	sets.Obi.Dark = {waist='Hachirin-no-Obi'}
    
    	
    	sets.precast.CorsairRoll = {head="Lanun Tricorne",neck="Regal Necklace",hands="Chasseur's Gants +1",back="Camulus's Mantle"}
    	
    	sets.precast.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="Chas. Culottes +1"})
    	sets.precast.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="Chass. Bottes +1"})
    	sets.precast.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="Chasseur's tricorne +1"})
    	sets.precast.CorsairRoll["Tactician's Roll"] = set_combine(sets.precast.CorsairRoll, {body="Chasseur's Frac +1"})
    	sets.precast.CorsairRoll["Allies' Roll"] = set_combine(sets.precast.CorsairRoll, {hands="Chasseur's Gants +1"})
    	
    	sets.precast.LuzafRing = {ring1="Luzaf's Ring"}
    	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="Carmine Mask",neck="Baetyl Pendant", ear1="Loquac. Earring",ear2="Enchntr. Earring +1",
    		body="Dread Jupon",hands="Leyline Gloves", ring1="Weatherspoon Ring +1",feet="Carmine Greaves +1"}
    
    	sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})
    
    	
    	-- Preshot --
    	sets.Preshot = {}
    	---No Flurry needs 60, has 58
    	sets.Preshot.Fomalhaut = {
    								head=gear.Snapshot_TaeonHead, --10
    								body=gear.Snapshot_TaeonBody, --10
    								hands="Carmine Fin. Ga. +1", --8
    								back=gear.SnapShot_MND, --10
    								waist="Impulse Belt",--3
    								legs="Adhemar Kecks", ---9
    								feet="Meghanada jambeaux +1"} --8}
    
    	
    	---Flurry I needs 45, has 55
    	sets.Preshot.Fomalhaut.Any = set_combine(sets.Preshot.Fomalhaut,{waist="Yemaya Belt"})
    				
    
    	--Flurry II needs 30
    	sets.Preshot.Fomalhaut.RDM = set_combine(sets.Preshot.Fomalhaut.Any,{head="Chasseur's Tricorne +1",body="Laksamana's Frac +3",ear1="Moonshade earring",})
    		
    		
    		
    		
           
    	-- Weaponskill sets
    	-- Default set for any weaponskill that isn't any more specifically defined
    	sets.precast.WS = {
    		head="Dampening Tam",neck=gear.ElementalGorget,ear1="Moonshade earring",ear2="Brutal earring",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands",ring1="Epona's ring",ring2="Regal Ring",
    		back=gear.TPcape,waist=gear.ElementalBelt,legs="Samnuha Tights",feet=gear.TAHercBoots}
    
    
    	-- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
    	sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS, {head="Adhemar Bonnet +1",body="Abnoba Kaftan",ring2="Begruding Ring",feet=gear.AccHercBoots})
    	
    	
    	sets.precast.WS['Requiescat'] = {
    		head="Dampening Tam",neck=gear.ElementalGorget,ear1="Moonshade earring",ear2="Brutal earring",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Epona's ring",ring1="Rufescent Ring",
    		back=gear.TPcape,waist=gear.ElementalBelt,legs="Samnuha Tights",feet="Carmine Greaves +1"}
    	
    	sets.precast.WS['Swift Blade'] = {
    		head="Adhemar Bonnet +1",neck=gear.ElementalGorget,ear1="Cessance earring",ear2="Brutal earring",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Epona's ring",ring1="Regal Ring",
    		back=gear.Savagecape,waist=gear.ElementalBelt,legs="Meg. Chausses +2",feet="Carmine Greaves +1"}
    	
    	
    	
    	sets.precast.WS['Savage Blade'] = {
    		head="Lilitu Headpiece",neck="Caro Necklace",ear1="Moonshade earring",ear2="Ishvara earring",
    		body="Laksamana's Frac +3",hands="Meghanada Gloves +2",ring1="Rufescent Ring",ring2="Regal Ring",
    		back=gear.Savagecape,waist="Prosilio Belt +1",legs="Carmine Cuisses +1",feet=gear.WSDHercBoots}
    
    	sets.precast.WS['Savage Blade'].Acc = {
    		head="Carmine Mask +1",neck="Fotia Gorget",ear1="Moonshade earring",ear2="Ishvara earring",
    		body="Meg. Cuirie +2",hands="Meghanada Gloves +2",ring1="Rufescent Ring",ring2="Regal Ring",
    		back=gear.Savagecape,waist="Prosilio Belt +1",legs="Carmine Cuisses +1",feet=gear.WSDHercBoots}	
    		
    		
    	sets.precast.WS['Savage Blade'].Mod = {
    		head="Adhemar Bonnet +1",neck="Caro Necklace",ear1="Moonshade earring",ear2="Ishvara earring",
    		body="Laksamana's Frac +3",hands="Meghanada Gloves +2",ring1="Rufescent Ring",ring2="Regal Ring",
    		back=gear.Savagecape,waist="Prosilio Belt +1",legs="Carmine Cuisses +1",feet=gear.WSDHercBoots}
    	
    	sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {head="Carmine Mask +1",hands="Carmine Fin. Ga.",ring2="Rufescent Ring",legs="Carmine cuisses +1",feet="Carmine Greaves +1"})
    
    	sets.precast.WS['Last Stand'] = {ammo=gear.WSbullet,
    		head="Meghanada Visor +1",neck=gear.ElementalGorget,ear1="Moonshade Earring",ear2="Ishvara earring",
    		body="Laksamana's Frac +3",hands="Meghanada Gloves +2",ring1="Dingir Ring",ring2="Regal Ring",
    		back=gear.LastStandcape,waist=gear.ElementalBelt,legs="Meg. Chausses +2",feet="Meghanada jambeaux +1"}
    
    	sets.precast.WS['Last Stand'].Acc = {ammo=gear.WSbullet,
    		head="Meghanada Visor +1",neck=gear.ElementalGorget,ear1="Moonshade Earring",ear2="Telos earring",
    		body="Laksamana's Frac +3",hands="Meghanada Gloves +2",ring1="Dingir Ring",ring2="Regal Ring",
    		back=gear.LastStandcape,waist=gear.ElementalBelt,legs="Meg. Chausses +2",feet="Meghanada jambeaux +1"}
    		
    	sets.precast.WS['Last Stand'].Mod = {ammo=gear.WSbullet,
    		head="Meghanada Visor +1",neck="Iskur Gorget",ear1="Moonshade Earring",ear2="Telos earring",
    		body="Laksamana's Frac +3",hands="Meghanada Gloves +2",ring1="Dingir Ring",ring2="Regal Ring",
    		back=gear.LastStandcape,waist=gear.ElementalBelt,legs="Meg. Chausses +2",feet="Meghanada jambeaux +1"}	
    		
    
    	sets.precast.WS['Wildfire'] = {ammo=gear.MAbullet,
    		 head=gear.HerculeanHelmMAB,neck="Baetyl Pendant",lear="Crematio Earring",rear="Friomisi earring",
    		 body="Samnuha coat",hands="Carmine Fin. Ga. +1",ring1="Dingir Ring",ring2="Arvina Ringlet +1",
    		back=gear.MAcape,waist=gear.ElementalObi,legs=gear.MABHercLegs,feet=gear.MABHercBoots}
    
    	sets.precast.WS['Wildfire'].Brew = {ammo=gear.MAbullet,
    		 head=gear.HerculeanHelmMAB,neck="Baetyl Pendant",lear="Crematio Earring",rear="Friomisi earring",
    		 body="Samnuha coat",hands="Carmine Fin. Ga. +1", ring1="Dingir Ring",ring2="Arvina Ringlet +1",
    		back=gear.MAcape,waist=gear.ElementalObi,legs=gear.MABHercLegs,feet=gear.MABHercBoots}
    	
    	sets.precast.WS['Leaden Salute'] = {ammo=gear.MAbullet,
    		 head="Pixie Hairpin +1",neck="Baetyl Pendant",lear="Moonshade Earring",rear="Friomisi earring",
    		 body="Samnuha coat",hands="Carmine Fin. Ga. +1", ring1="Dingir Ring",ring2="Archon Ring",
    		back=gear.MAcape,waist=gear.ElementalObi,legs=gear.MABHercLegs,feet=gear.MABHercBoots}
    	
    	sets.precast.WS['Wildfire'] = {ammo=gear.MAbullet,
    		 head=gear.HerculeanHelmMAB,neck="Baetyl Pendant",ear1="Crematio Earring",ear2="Friomisi earring",
    		 body="Samnuha coat",hands="Carmine Fin. Ga. +1",ring1="Dingir Ring",ring2="Arvina Ringlet +1",
    		back=gear.MAcape,waist=gear.ElementalObi,legs=gear.MABHercLegs,feet=gear.MABHercBoots}
    	
    		
    		
    	sets.precast.WS['Aeolian Edge'] = {ammo=gear.QDbullet,
    		 head=gear.HerculeanHelmMAB,neck="Baetyl Pendant",lear="Moonshade Earring",rear="Friomisi earring",
    		 body="Samnuha coat",hands="Carmine Fin. Ga. +1", ring1="Dingir Ring",ring2="Acumen Ring",
    		back=gear.MAcape,waist=gear.ElementalObi,legs=gear.MABHercLegs,feet=gear.MABHercBoots}
    	
    	
    	-- Midcast Sets
    	sets.midcast.FastRecast = {
    		head="Carmine Mask",neck="Jeweled collar", ear1="Loquac. Earring",
    		body="Dread Jupon",hands="Leyline Gloves", ring1="Weatherspoon Ring +1",feet="Carmine Greaves +1"}
    		
    	-- Specific spells
    	sets.midcast.Utsusemi = sets.midcast.FastRecast
    
    	
    	---Full damage QD set
    	sets.midcast.CorsairShot = {ammo=gear.QDbullet,
    		 head=gear.HerculeanHelmMAB,neck="Baetyl Pendant",lear="Crematio Earring",rear="Friomisi earring",
    		 body="Samnuha coat",hands="Carmine Fin. Ga. +1", ring1="Acumen Ring",ring2="Dingir Ring",
    		back=gear.QDcape,waist=gear.ElementalObi,legs=gear.MABHercLegs,feet=gear.MABHercBoots}
    	
    	--Potency+AF3 boots set--
    	sets.midcast.CorsairShot.Acc = {ammo=gear.QDbullet,
    		 head=gear.HerculeanHelmMAB,neck="Sanctity Necklace",lear="Crematio Earring",rear="Friomisi earring",
    		 body="Samnuha coat",hands="Carmine Fin. Ga. +1", ring1="Acumen Ring",ring2="Arvina Ringlet +1",
    		back=gear.QDcape,waist=gear.ElementalObi,legs=gear.MABHercLegs,feet="Chass. Bottes +1"}
    	
    		
    	---STP set---
    	sets.midcast.CorsairShot.STP = {ammo=gear.QDbullet,
    		 head="Pursuer's Beret",neck="Iskur Gorget",ear1="Dedition Earring",ear2="Telos Earring",
    		 body="Mummu Jacket +1",hands="Adhemar Wristbands +1", ring1="Ilabrat Ring",ring2="Petrov ring",
    		back=gear.RAcape,waist="Goading Belt",legs="Chasseur's Culottes +1",feet="Carmine Greaves +1"}
    	
    
    	--STP+AF3 boots set
    	sets.midcast.CorsairShot.STP_AF3 = {ammo=gear.QDbullet,
    		 head="Pursuer's Beret",neck="Iskur Gorget",ear1="Digni. Earring",ear2="Dedition Earring",
    		 body="Mummu Jacket +1",hands="Adhemar Wristbands +1", ring1="Ilabrat Ring",ring2="Petrov ring",
    		back=gear.RAcape,waist="Goading Belt",legs="Chasseur's Culottes +1",feet="Chass. Bottes +1"}
    
    	sets.midcast.CorsairShot['Light Shot'] = {ammo=gear.QDbullet,
    		 head=gear.HerculeanHelmMAB,neck="Sanctity Necklace",lear="Digni. Earring",rear="Gwati Earring",
    		 body="Samnuha coat",hands="Leyline gloves", ring1="Stikini Ring",ring2="Weatherspoon Ring +1",
    		back=gear.MAcape,waist="Eschan Stone",legs=gear.MABHercLegs,feet=gear.MABHercBoots}
    
    	sets.midcast.CorsairShot['Dark Shot'] = sets.midcast.CorsairShot['Light Shot']
    
    
    	-- Ranged gear
    	sets.midcast.RA = {ammo=gear.RAbullet,
    		head="Pursuer's Beret",neck="Iskur Gorget",ear1="Enervating Earring",ear2="Telos Earring",
    		body="Mummu Jacket +1",hands="Adhemar Wristbands",ring1="Petrov Ring",ring2="Ilabrat Ring",
    		back=gear.RAcape,waist="Yemaya Belt",legs="Adhemar Kecksr",feet="Meg. Jam. +1"}
    		
    	sets.midcast.TS = {ammo=gear.RAbullet,
    		head="Oshosi Mask",neck="Iskur Gorget",ear1="Enervating Earring",ear2="Telos Earring",
    		body="Chasseur's Frac +1",hands="Adhemar Wristbands",ring1="Petrov Ring",ring2="Ilabrat Ring",
    		back=gear.RAcape,waist="Yemaya Belt",legs="Adhemar Kecks",feet="Meg. Jam. +1"}
    
    	sets.midcast.RA.Acc = {ammo=gear.RAbullet,
    		head="Meghanada Visor +1",neck="Iskur Gorget",ear1="Enervating Earring",ear2="Telos Earring",
    		body="Laksamana's Frac +3",hands="Meghanada Gloves +2",ring1="Cacoethic Ring +1",ring2="Regal Ring",
    		back=gear.RAcape,waist="Yemaya Belt",legs="Meg. Chausses +2",feet="Meg. Jam. +1"}
    	
    
    
    	
    	-- Sets to return to when not performing an action.
    	
    	-- Resting sets
    	sets.resting = {neck="Bathy Choker +1",ring1="Sheltered Ring",ring2="Paguroidea Ring"}
    	
    
    	-- Idle sets
    	sets.idle = {ammo=gear.RAbullet,
    		head="Meghanada Visor +1",neck="Bathy Choker +1", ear1="Ethereal earring", ear2="Hearty earring",
    		body="Meg. Cuirie +2", hands=gear.DT_HerculeanGloves,ring1="Sheltered Ring",ring2="Paguroidea Ring",
    		back="Shadow mantle",waist="Flume belt",legs="Carmine Cuisses +1",feet=gear.DTHercBoots
    		}
    		
    	sets.idle.Refresh = {ammo=gear.RAbullet,
    		head="Rawhide Mask",neck="Loricate Torque +1", ear1="Ethereal earring", ear2="Hearty earring",
    		body="Meg. Cuirie +2", hands={ name="Herculean Gloves", augments={'Attack+12','Pet: Phys. dmg. taken -1%','"Refresh"+2','Accuracy+17 Attack+17','Mag. Acc.+16 "Mag.Atk.Bns."+16',}},ring1="Defending ring",ring2={ name="Dark Ring", augments={'Magic dmg. taken -6%','Phys. dmg. taken -4%',}},
    		back="Shadow mantle",waist="Flume belt",legs="Carmine Cuisses +1",feet={ name="Herculean Boots", augments={'Enmity-2','INT+7','"Refresh"+2','Accuracy+12 Attack+12',}}
    		}
    
    
    	sets.idle.PDT = {ammo=gear.RAbullet,
    		head="Meghanada Visor +1",neck="Loricate Torque +1", ear1="Genmei earring", ear2="Hearty earring",
    		body="Meg. Cuirie +2", hands=gear.DT_HerculeanGloves,left_ring={ name="Dark Ring", augments={'Magic dmg. taken -6%','Phys. dmg. taken -4%',}},right_ring="Defending Ring",
    		back="Shadow mantle",waist="Flume belt",legs="Carmine Cuisses +1",feet=gear.DTHercBoots
    		}
    	
    	sets.idle.STP = {ammo=gear.RAbullet,
    		 head="Pursuer's Beret",neck="Ainia Collar",ear1="Dedition Earring",ear2="Telos Earring",
    		 body="Mummu Jacket +1",hands="Adhemar Wristbands", ring1="Rajas Ring",ring2="Petrov ring",
    		back=gear.RAcape,waist="Goading Belt",legs="Chasseur's Culottes +1",feet="Carmine Greaves +1"}
    
    	
    
    	-- Defense sets
    	sets.defense.PDT = {
    		head="Lithelimb Cap",neck="Loricate Torque +1", ear1="Ethereal earring", ear2="Hearty earring",
    		body="Emet Harness +1", hands="Umuthi Gloves",ring1="Defending ring",ring2="Dark ring",
    		back="Shadow mantle",waist="Flume belt",legs="Meg. Chausses +2",feet={ name="Herculean Boots", augments={'Phys. dmg. taken -5%','STR+8','Accuracy+13','Attack+3',}}}
    
    	sets.defense.MDT = {
    		head="Lithelimb Cap",neck="Loricate Torque +1", ear1="Ethereal earring", ear2="Hearty earring",
    		body="Meg. Cuirie +2", hands="Umuthi Gloves",ring1="Defending ring",ring2="Dark ring",
    		back="Shadow mantle",waist="Flume belt",legs="Iuitl tights +1",feet={ name="Herculean Boots", augments={'Phys. dmg. taken -5%','STR+8','Accuracy+13','Attack+3',}}}
    	
    
    	sets.Kiting = {legs="Carmine Cuisses +1"}
    	-- buff sets
    	 sets.buff['Triple Shot'] = {body="Chasseur's Frac +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
    	
    	--For /NIN
    	sets.engaged.Melee = {ammo=gear.RAbullet,
    		head="Adhemar Bonnet +1",neck="Iskur Gorget", ear1="Dedition Earring",ear2="Suppanomimi",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Epona's ring",ring2="Petrov ring",
    		back=gear.TPcape,waist="Windbuffet Belt +1",legs="Samnuha Tights",feet=gear.TAHercBoots}
    	
    		sets.engaged.Acc = {ammo=gear.RAbullet,
    		head="Dampening Tam",neck="Combatant's Torque", ear1="Suppanomimi",ear2="Telos Earring",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Epona's ring",ring2="Ramuh Ring +1",
    		back=gear.TPcape,waist="Olseni belt",legs="Samnuha Tights",feet=gear.TAHercBoots}
    	
    	
    	
    	
    	--for /DNC
    	sets.engaged.Melee2 = {ammo=gear.RAbullet,
    		head="Adhemar Bonnet +1",neck="Iskur Gorget", ear1="Brutal Earring", ear2="Suppanomimi",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Epona's ring",ring2="Petrov ring",
    		back=gear.TPcape,waist="Reiki Yotai",legs="Samnuha Tights",feet=gear.TAHercBoots}
    	
    	
    	sets.engaged.MidAcc = {ammo=gear.RAbullet,
    		head="Dampening Tam",neck="Combatant's Torque", ear1="Suppanomimi",ear2="Telos Earring",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Epona's ring",ring2="Ramuh Ring +1",
    		back=gear.TPcape,waist="Kentarch Belt +1",legs="Samnuha Tights",feet=gear.TAHercBoots}
    	
    	sets.engaged.Acc = {ammo=gear.RAbullet,
    		head="Dampening Tam",neck="Combatant's Torque", ear1="Suppanomimi",ear2="Telos Earring",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Epona's ring",ring2="Ramuh Ring +1",
    		back=gear.TPcape,waist="Olseni belt",legs="Samnuha Tights",feet=gear.TAHercBoots}
    	
    	
    	
    
    	--for /DNC
    	sets.engaged.Acc2 = {ammo=gear.RAbullet,
    		head="Dampening Tam",neck="Combatant's Torque", ear1="Suppanomimi",ear2="Telos Earring",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Epona's ring",ring2="Ramuh Ring +1",
    		back=gear.TPcape,waist="Reiki Yotai",legs="Samnuha Tights",feet=gear.TAHercBoots}
    	
    
    	---Ideally want /NIN for this
    		
    	sets.engaged.MaxAcc = {ammo=gear.RAbullet,
    		head="Carmine Mask +1",neck="Combatant's Torque", ear1="Zennaroi Earring",ear2="Telos Earring",
    		body="Adhemar Jacket +1",hands="Floral Gauntlets",ring1="Cacoethic Ring +1",ring2="Ramuh Ring +1",
    		back=gear.TPcape,waist="Olseni belt",legs="Carmine Cuisses +1",feet=gear.TAHercBoots}
    	
    	
    	----Think all this is broken
    	
    	sets.engaged.Melee.DW = {ammo=gear.RAbullet,
    		head="Adhemar Bonnet +1",neck="Asperity necklace", ear1="Brutal Earring", ear2="Cessance Earring",
    		body="Adhemar Jacket +1",hands="Floral Gauntlets",ring1="Epona's ring",ring2="Petrov ring",
    		back=gear.TPcape,waist="Windbuffet Belt +1",legs="Samnuha Tights",feet=gear.TAHercBoots}
    
    	sets.engaged.Acc.DW = {ammo=gear.RAbullet,
    		head="Dampening Tam",neck="Combatant's Torque", ear1="Suppanomimi",ear2="Cessance Earring",
    		body="Adhemar Jacket +1",hands="Adhemar Wristbands",ring1="Epona's ring",ring2="Ramuh Ring +1",
    		back=gear.TPcape,waist="Olseni belt",legs="Samnuha Tights",feet=gear.TAHercBoots}
    		
    	sets.engaged.Acc2.DW = {ammo=gear.RAbullet,
    		head="Dampening Tam",neck="Combatant's Torque", ear1="Digni. Earring",ear2="Cessance Earring",
    		body="Adhemar Jacket +1",hands="Floral Gauntlets",ring1="Epona's ring",ring2="Ramuh Ring +1",
    		back=gear.TPcape,waist="Olseni belt",legs="Carmine Cuisses",feet=gear.TAHercBoots}
    
    	
    	
    	sets.engaged.Ranged = {ammo=gear.RAbullet,
    		head="Meghanada Visor +1",neck="Loricate Torque +1",ear1="Genmei earring", ear2="Hearty earring",
    		body="Meg. Cuirie +2", hands=gear.DT_HerculeanGloves,left_ring={ name="Dark Ring", augments={'Magic dmg. taken -6%','Phys. dmg. taken -4%',}},right_ring="Defending Ring",
    		back="Shadow mantle",waist="Flume belt",legs="Meg. Chausses +2",feet=gear.DTHercBoots
    		}
    		
    	sets.engaged.TS = {ammo=gear.RAbullet,
    		head="Meghanada Visor +1",neck="Bathy Choker +1", ear1="Genmei earring", ear2="Hearty earring",
    		body="Meg. Cuirie +2", hands=gear.DT_HerculeanGloves,ring1="Sheltered Ring",ring2="Paguroidea Ring",
    		back="Shadow mantle",waist="Flume belt",legs="Meg. Chausses +2",feet=gear.DTHercBoots
    		}
    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.
    
            -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
    function self_command(command)
    				if command == 'flur' then -- Flurry Level Toggle --
    						PreshotIndex = (PreshotIndex % #PreshotArray) + 1
    						add_to_chat(158,'Flurry Level: ' ..PreshotArray[PreshotIndex])
    						status_change(player.status)
    				end
    end
    
    
    
    
    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
    	
    	
    	---Snapshot/Flurry handling
    	if spell.english == 'Ranged' then
    					equipSet = sets.Preshot
    					add_to_chat(57,"Flurry Level "..PreshotArray[PreshotIndex])
    				if buffactive['Flurry'] then
    					add_to_chat(122,"Flurry found")
    					if PreshotArray[PreshotIndex] == 'RDM' then
    						if  equipSet[player.equipment.range].RDM then 
    							equipSet =  equipSet[player.equipment.range].RDM
    						end
    				else
    					if  equipSet[player.equipment.range].Any then 
    						equipSet =  equipSet[player.equipment.range].Any
    					end
    				end
    		else
    				if  equipSet[player.equipment.range] then 
    					equipSet =  equipSet[player.equipment.range]
    		end
    					add_to_chat(122,"No flurry")
    				end
       
    					equip(equipSet)
    	
    	end
    	
    	
    	
    	
        -- Define proper defaults for weaponskills that use obis
        if spell.english == 'Leaden Salute' then
            gear.default.obi_waist = "Eschan Stone"
    		--gear.default.obi_ring = "Arvina Ringlet +1"
        elseif spell.english == 'Wildfire' then
            gear.default.obi_waist = "Eschan Stone"
    		--gear.default.obi_ring = "Arvina Ringlet +1"
    	elseif spell.type == 'CorsairShot' then
            gear.default.obi_waist = "Eschan Stone"
    		--gear.default.obi_ring = "Arvina Ringlet +1"
    	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.type == 'CorsairShot' and state.CastingMode.value == 'STP' then
            classes.CustomClass = 'STP'
    	elseif spell.type == 'CorsairShot' and state.CastingMode.value == 'STP_AF3' then
            classes.CustomClass = 'STP_AF3'	
        elseif spell.english == 'Fold' and buffactive['Bust'] == 2 then
            if sets.precast.FoldDoubleBust then
                equip(sets.precast.FoldDoubleBust)
                eventArgs.handled = true
            end
        end
    		
    end
    
    
    
                    
    
    
    
    
    
    
    
    function job_post_midcast(spell, action, spellMap, eventArgs)
    		if spell.action_type == 'Ranged Attack' and buffactive['Triple Shot'] then
    		equip(sets.midcast.TS)
    		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
    function job_self_command(cmdParams, eventArgs)
    	if command == 'coffer' then
    		cycle = 0
    		invCount = windower.ffxi.get_bag_info(0).count
    		if invCount == 80 then
    			add_to_chat(140,'Inv. full. Ending cycle')
    		elseif player.inventory["Velkk Coffer"] then
    			send_command('input /item "Velkk Coffer"')
    			cycle = 1
    		else
    			add_to_chat(140,'No Coffers found in inv.')
    			send_command('findall Velkk Coffer')
    		end
    		if cycle == 1 then
    			send_command('wait 2;gc c coffer')
    		end
    	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"},
            ["Runeist's Roll"]   = {lucky=4, unlucky=8, bonus="Magic Evasion"},
        }
    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
    	
    	if spell.type == 'CorsairShot' and player.inventory["Trump Card"] and player.inventory["Trump Card"].count < 10 then
    			add_to_chat(104, 'Low on trump cards!')
    	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

  11. #5891
    Radsourceful

    Join Date
    Jul 2007
    Posts
    1,964
    BG Level
    6
    FFXI Server
    Bismarck

    Move your flurry code into the job_self_command block, the self_command function is overwritten by the mote version in the include file.

  12. #5892
    E. Body
    Join Date
    May 2008
    Posts
    2,082
    BG Level
    7
    FFXI Server
    Siren

    Ah, ok- I was under the impression that stuff in the job file took priority over the includes.

    Hrrm actually that doesn't seem to be working either

  13. #5893

    Quote Originally Posted by Kyte View Post
    I'm trying to add in a Flurry rule for my COR lua, and although it appears to be detecting and changing to a Flurry preshot set when the buff is active, it isn't responding to the command (both the keybind and the in-game command) that's supposed to switch between Flurry I and II. I'm sure it's something stupid but I could use a second set of eyes.
    are you using a Fomalhaut (range weapon) for the test
    in not that is the reason why its not working
    the only range weapon you have in your code is the Fomalhaut any other weapon will never equip gear except for sets.Preshot

  14. #5894
    E. Body
    Join Date
    May 2008
    Posts
    2,082
    BG Level
    7
    FFXI Server
    Siren

    I am yeah, and again it actually is switching correctly for Flurry up/down- I just can't get the command that changes the PreshotIndex from 1 to 2 to work.

  15. #5895

    Quote Originally Posted by Kyte View Post
    I am yeah, and again it actually is switching correctly for Flurry up/down- I just can't get the command that changes the PreshotIndex from 1 to 2 to work.
    put this in job_self_command
    Code:
        if cmdParams[1] == 'flur' then -- Flurry Level Toggle --
            PreshotIndex = (PreshotIndex % #PreshotArray) + 1
            add_to_chat(158,'Flurry Level: ' ..PreshotArray[PreshotIndex])
            status_change(player.status)
        end
    and remove the self_command function because it already in use by motes include

  16. #5896
    E. Body
    Join Date
    May 2008
    Posts
    2,082
    BG Level
    7
    FFXI Server
    Siren

    Thanks, that fixed the issue.

  17. #5897

    Quote Originally Posted by Kyte View Post
    Thanks, that fixed the issue.
    also this should minimize your code for job_precast
    Code:
        if spell.english == 'Ranged' then
            equipSet = sets.Preshot
            add_to_chat(57,"Flurry Level "..PreshotArray[PreshotIndex])
            if buffactive['Flurry'] then
                add_to_chat(122,"Flurry found")
                if equipSet[player.equipment.range][PreshotArray[PreshotIndex]] then 
                    equipSet =  equipSet[player.equipment.range][PreshotArray[PreshotIndex]]
                elseif equipSet[player.equipment.range].Any then
                    equipSet =  equipSet[player.equipment.range].Any
                end
            else
                if equipSet[player.equipment.range] then 
                    equipSet =  equipSet[player.equipment.range]
                end
                add_to_chat(122,"No flurry")
            end
            equip(equipSet)
        end
    in other words if you add more to PreshotArray all you need to do is add more to aka sets.Preshot[player.equipment.range].<newaddition> you should never need to adjust your code
    it also catches if you forgot to add the additional PreshotArray to your gear

  18. #5898
    New Merits
    Join Date
    Jul 2011
    Posts
    245
    BG Level
    4
    FFXIV Character
    Already Banned
    FFXIV Server
    Hyperion
    FFXI Server
    Quetzalcoatl

    Fixed

  19. #5899
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,750
    BG Level
    8
    FFXI Server
    Asura

    For some reason my "dont fuck yourself while you can't act" rule isn't fully working.

    When I am petrified, asleep, stunned, terrored, or amnesiaed, if I try to WS it rightfully does nothing rather than get my stuck in that gear which is a real problem while being hit and suddenly losing 50% DT until I act again which I can't while under most of those effects.

    However, for some reason if I try to cast then it still goes through and I sit there in fast cast gear (say, under the effect of the terror spam in this month's ambuscade). So, where in my rule is the problem?

    I know the has any buff rule works because if I am hit with those (sans silence or amnesia) it tosses on my DT set in a separate rule.

    My Gearswap
    Code:
    function pc_JA(spell, act)
    	if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia'}) and spell.type == 'WeaponSkill' or spell.type == 'Ability' then
    		cancel_spell() return end
    	if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Silence'}) and spell.type == 'Magic' or spell.type == 'Ninjutsu' then
    		cancel_spell() return end

  20. #5900
    Radsourceful

    Join Date
    Jul 2007
    Posts
    1,964
    BG Level
    6
    FFXI Server
    Bismarck

    Quote Originally Posted by Spicyryan View Post
    For some reason my "dont fuck yourself while you can't act" rule isn't fully working.

    When I am petrified, asleep, stunned, terrored, or amnesiaed, if I try to WS it rightfully does nothing rather than get my stuck in that gear which is a real problem while being hit and suddenly losing 50% DT until I act again which I can't while under most of those effects.

    However, for some reason if I try to cast then it still goes through and I sit there in fast cast gear (say, under the effect of the terror spam in this month's ambuscade). So, where in my rule is the problem?

    I know the has any buff rule works because if I am hit with those (sans silence or amnesia) it tosses on my DT set in a separate rule.

    My Gearswap
    Code:
    function pc_JA(spell, act)
    	if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia'}) and spell.type == 'WeaponSkill' or spell.type == 'Ability' then
    		cancel_spell() return end
    	if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Silence'}) and spell.type == 'Magic' or spell.type == 'Ninjutsu' then
    		cancel_spell() return end
    On mobile but going to say it'll work if you add that to pc_magic as well as pc_ja

Similar Threads

  1. Replies: 6547
    Last Post: 2014-07-08, 22:45