Assassin's Charge In THF Lua

Eorzea Time
 
 
 
Language: JP EN FR DE
users online
Forum » Windower » Support » Assassin's Charge in THF lua
Assassin's Charge in THF lua
Offline
Posts: 281
By Galkapryme 2019-10-18 02:45:48
Link | Quote | Reply
 
How do I configure Assassin's Charge for the THF lua. Essentially, I want it to be a buff active like SA and TA so that the gear stays equipped until the attack. The code I have only functions as a precast. Please assist.
Code
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job.  Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------

--[[
    Custom commands:

    gs c cycle treasuremode (set on ctrl-= by default): Cycles through the available treasure hunter modes.
    
    Treasure hunter modes:
        None - Will never equip TH gear
        Tag - Will equip TH gear sufficient for initial contact with a mob (either melee, ranged hit, or Aeolian Edge AOE)
        SATA - Will equip TH gear sufficient for initial contact with a mob, and when using SATA
        Fulltime - Will keep TH gear equipped fulltime

--]]

-- 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()
    state.Buff['Sneak Attack'] = buffactive['sneak attack'] or false
    state.Buff['Trick Attack'] = buffactive['trick attack'] or false
    state.Buff['Feint'] = buffactive['feint'] or false
    
    include('Mote-TreasureHunter')

    -- For th_action_check():
    -- JA IDs for actions that always have TH: Provoke, Animated Flourish
    info.default_ja_ids = S{35, 204}
    -- Unblinkable JA IDs for actions that always have TH: Quick/Box/Stutter Step, Desperate/Violent Flourish
    info.default_u_ja_ids = S{201, 202, 203, 205, 207}
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('Normal', 'Acc', 'RA', 'Mod')
    state.HybridMode:options('Normal', 'Evasion', 'PDT')
    state.RangedMode:options('Normal', 'Acc')
    state.WeaponskillMode:options('Normal', 'Acc', 'Mod')
    state.PhysicalDefenseMode:options('Evasion', 'PDT')


    gear.default.weaponskill_neck = "Fotia Gorget"
    gear.default.weaponskill_waist = "Fotia Belt"
    gear.AugQuiahuiz = {name="Quiahuiz Trousers", augments={'Haste+2','"Snapshot"+2','STR+8'}}

    -- Additional local binds
    send_command('bind f10 input /ja "Flee" <me>')
    send_command('bind f1 gs c cycle OffenseMode')
    send_command('bind f2 gs c cycle RangedMode')

    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
    --------------------------------------
    TaeonHands = {}
    TaeonHands.TA = {name="Taeon Gloves", augments={'DEX+6','Accuracy+17 Attack+17','"Triple Atk."+2'}}
    TaeonHands.Snap = {name="Taeon Gloves", augments={'Attack+22','"Snapshot"+8'}}

    TaeonHead = {}
    TaeonHead.Snap = { name="Taeon Chapeau", augments={'Accuracy+20 Attack+20','"Snapshot"+5','"Snapshot"+4',}}
	

    HercFeet = {}
    HercHead = {}
    HercLegs = {}
	HercVest = {}
    
    HercFeet.MAB={ name="Herculean Boots", augments={'Mag. Acc.+14 "Mag.Atk.Bns."+14','Weapon skill damage +4%','Mag. Acc.+6','"Mag.Atk.Bns."+6',}}
    HercFeet.TP = { name="Herculean Boots", augments={'Accuracy+22 Attack+22','"Triple Atk."+3','STR+5','Attack+11',}}
    --HercFeet.TH = { name="Herculean Boots", augments={'AGI+1','Weapon Skill Acc.+3','"Treasure Hunter"+1','Accuracy+19 Attack+19','Mag. Acc.+7 "Mag.Atk.Bns."+7',}}
    HercHead.MAB = {name="Herculean Helm", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Weapon skill damage +3%','INT+1','Mag. Acc.+3','"Mag.Atk.Bns."+8',}}
    HercHead.TP = { name="Herculean Helm", augments={'Accuracy+25','"Triple Atk."+4','AGI+6','Attack+14',}}

    HercLegs.TH = { name="Herculean Trousers", augments={'INT+8','Attack+3','"Treasure Hunter"+1','Accuracy+6 Attack+6','Mag. Acc.+13 "Mag.Atk.Bns."+13',}}
    HercLegs.MAB = { name="Herculean Trousers", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','Weapon skill damage +2%','STR+8','Mag. Acc.+5','"Mag.Atk.Bns."+6',}}
	HercVest.TH = { name="Herculean Vest", augments={'Magic dmg. taken -2%','Accuracy+5','"Treasure Hunter"+1','Mag. Acc.+9 "Mag.Atk.Bns."+9',}}

    Toutatis = {}
    Toutatis.STP = { name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10','Phys. dmg. taken-10%',}}
    Toutatis.DEX = { name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Evasion+5','"Dual Wield"+10','Evasion+15',}}
	Toutatis.AGI = { name="Toutatis's Cape", augments={'AGI+20','Accuracy+20 Attack+20','Enmity +10',}}
	Toutatis.RA = { name="Toutatis's Cape", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','Rng.Acc.+2','"Store TP"+10',}}
	Toutatis.WSD = { name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}}
	
	sets.Turms = {
	head="Turms Cap +1",
    body="Tu. Harness +1",
    hands="Turms Mittens +1",
    legs="Turms Subligar +1",
    feet="Turms Leggings +1",
    neck="Loricate Torque +1",
    waist="Flume Belt +1",
    left_ear="Thureous Earring",
    right_ear="Impreg. Earring",
    left_ring="Chirich Ring +1",
    right_ring="Chirich Ring +1",
    back=Toutatis.Dex,
	}

	-- Treasure Hunter - Gandring x2 TH+6
	
    sets.TreasureHunter = {
	head="Meghanada Visor +2",
    body=HercVest.TH, -- TH+1
    hands={ name="Plun. Armlets +1", augments={'Enhances "Perfect Dodge" effect',}}, -- TH+3
    legs=HercLegs.TH, -- TH+1
    feet="Skulk. Poulaines +1", -- TH+3
    neck="Asn. Gorget +2",
    waist="Chaac Belt", -- TH+1
    left_ear="Cessance Earring",
    right_ear="Telos Earring",
    left_ring="Epona's Ring",
    right_ring="Gere Ring",
	back=Toutatis.DEX,
}
    sets.TreasureHunterRA = set_combine(sets.TreasureHunter, {neck="Sanctity Necklace",left_ring="Hajduk Ring +1",
    right_ring="Hajduk Ring +1"})
	
    sets.ExtraRegen = {
	head="Turms Cap +1",
    body="Tu. Harness +1",
    hands="Turms Mittens +1",
    legs="Turms Subligar +1",
    feet="Turms Leggings +1",
    neck="Loricate Torque +1",
	left_ring="Chirich Ring +1",
    right_ring="Chirich Ring +1",
	}
	
	sets.Turms = {
	head="Turms Cap +1",
    body="Tu. Harness +1",
    hands="Turms Mittens +1",
    legs="Turms Subligar +1",
    feet="Turms Leggings +1",
    neck="Loricate Torque +1",
    waist="Flume Belt +1",
    left_ear="Thureous Earring",
    right_ear="Impreg. Earring",
    left_ring="Chirich Ring +1",
    right_ring="Chirich Ring +1",
    back=Toutatis.Dex,
	}
	
    sets.Kiting = {feet="Pillager's Poulaines +1"}
	
    sets.CapacityMantle = {back="Mecistopins Mantle"}

    sets.Organizer = {
        main="Odium",
        sub="Jugo Kukri",
        ammo="Izhiikoh",
        range="Raider's Boomerang"
    }

    sets.buff['Sneak Attack'] = {
    head="Mummu Bonnet +2",
    body="Mummu Jacket +2",
    hands="Skulker's Armlets +1",
    legs="Mummu Kecks +2",
    feet="Mummu Gamash. +2",
    neck="Asn. Gorget +2",
    waist="Chiner's Belt +1",
    left_ear="Sherida Earring",
    right_ear="Telos Earring",
    left_ring="Ramuh Ring +1",
    right_ring="Ramuh Ring +1",
    back=Toutatis.DEX
    }

    sets.buff['Trick Attack'] = {
	head="Mummu Bonnet +2",
    body="Plunderer's Vest +3",
    hands="Pillager's Armlets +1",
    legs="Mummu Kecks +2",
    feet="Mummu Gamash. +2",
    neck="Asn. Gorget +2",
    waist="Chaac Belt",
    left_ear="Sherida Earring",
    right_ear="Telos Earring",
    left_ring="Garuda Ring +1",
    right_ring="Garuda Ring +1",
    back=Toutatis.AGI
    }
	
	sets.buff['Assassin\'s Charge'] = {
    head="Turms Cap +1",
    body="Mummu Jacket +2",
    hands="Mummu Wrists +2",
    legs={ name="Plun. Culottes +3", augments={'Enhances "Feint" effect',}},
    feet={ name="Plun. Poulaines +3", augments={'Enhances "Assassin\'s Charge" effect',}},
    neck="Asn. Gorget +2",
    waist="Chiner's Belt +1",
    left_ear="Sherida Earring",
    right_ear="Telos Earring",
    left_ring="Demonry Ring",
    right_ring="Ramuh Ring +1",
    back={ name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Evasion+5','"Dual Wield"+10','Evasion+15',}},
}
	
	
	-- Actions we want to use to tag TH.
    sets.precast.Step = sets.TreasureHunter
    sets.precast.Flourish1 = sets.TreasureHunter
    sets.precast.JA.Provoke = sets.TreasureHunter

    --------------------------------------
    -- Precast sets
    --------------------------------------

    -- Precast sets to enhance JAs
    sets.precast.JA['Collaborator'] = {head="Skulker's's Bonnet +1"}
    sets.precast.JA['Accomplice'] = {head="Skulker's's Bonnet +1"}
    sets.precast.JA['Flee'] = {feet="Pillager's Poulaines +1"}
    sets.precast.JA['Hide'] = {body="Pillager's Vest +1"}
    sets.precast.JA['Conspirator'] = {"Skulker's Vest +1"} -- {body="Raider's Vest +2"}
    sets.precast.JA['Steal'] = {neck="Pentalagus Charm",hands="Thief's Kote",legs="Pillager's Culottes +1",feet="Pillager's Poulaines +1"}
    sets.precast.JA['Despoil'] = {legs="Skulker's Culottes +1",feet="Skulker's Poulaines +1"}
    sets.precast.JA['Perfect Dodge'] = {hands="Plunderer's Armlets +3"}
    sets.precast.JA['Feint'] = {"Plunderer's Culottes +3"} -- {legs="Assassin's Culottes +2"}
	

    sets.precast.JA['Sneak Attack'] = sets.buff['Sneak Attack']
    sets.precast.JA['Trick Attack'] = sets.buff['Trick Attack']
	sets.precast.JA['Assassin\'s Charge'] = sets.buff['Assassin\'s Charge']
	
	
	


    -- Waltz set (chr and vit)
    sets.precast.Waltz = {
	head="Mummu Bonnet +2",
    body="Meg. Cuirie +2",
    hands={ name="Buremte Gloves", augments={'Phys. dmg. taken -2%','Magic dmg. taken -2%','Rng.Atk.+10',}},
    legs="Dashing Subligar",
    feet={ name="Rawhide Boots", augments={'HP+50','Accuracy+15','Evasion+20',}},
    neck="Wiglen Gorget",
    waist="Chuq'aba Belt",
    left_ear="Impreg. Earring",
    right_ear="Oneiros Earring",
    left_ring="Epona's Ring",
    right_ring="Kunaji Ring",
    back="Solemnity Cape", 
	}

    -- Don't need any special gear for Healing Waltz.
    sets.precast.Waltz['Healing Waltz'] = {}


    -- Fast cast sets for spells
    sets.precast.FC = {head="Haruspex Hat",ear2="Loquacious Earring",hands="Thaumas Gloves",ring1="Prolix Ring",legs="Enif Cosciales"}

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


    -- Ranged snapshot gear
    sets.precast.RA = {
	head="Meghanada Visor +2",
    body="Meg. Cuirie +2",
    hands="Meg. Gloves +2",
    legs="Meg. Chausses +2",
    feet="Meg. Jam. +2",
    neck="Iskur Gorget",
    waist="Flax Sash",
    left_ear="Telos Earring",
    right_ear="Volley Earring",
    left_ring="Hajduk Ring +1",
    right_ring="Hajduk Ring +1",
    back=Toutatis.RA,
}


    -- Weaponskill sets

    -- Default set for any weaponskill that isn't any more specifically defined
    sets.precast.WS = {
    head="Meghanada Visor +2",
    body="Meg. Cuirie +2",
    hands="Meg. Gloves +2",
    legs="Plunderer's Culottes +3",
    feet="Meg. Jam. +2",
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear="Ishvara Earring",
    left_ring="Ramuh Ring +1",
    right_ring="Ramuh Ring +1",
    back=Toutatis.WSD,
}
   

    -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
    
    


    --------------------------------------
    -- Midcast sets
    --------------------------------------

    sets.midcast.FastRecast = {
        head="Whirlpool Mask",ear2="Loquacious Earring",
        body="Pillager's Vest",hands="Pillager's Armlets +1",
        back="Canny Cape",legs="Kaabnax Trousers",feet="Iuitl Gaiters +1"}

    -- Specific spells
    sets.midcast.Utsusemi = {
        head="Whirlpool Mask",neck="Magoraga Beads",ear2="Loquacious Earring",
        body="Pillager's Vest",hands="Pillager's Armlets +1",ring1="Beeline Ring",
        back="Canny Cape",legs="Kaabnax Trousers",feet="Iuitl Gaiters +1"}

    -- Ranged gear
    sets.midcast.RA = {
	head="Meghanada Visor +2",
    body="Meg. Cuirie +2",
    hands="Meg. Gloves +2",
    legs="Meg. Chausses +2",
    feet="Meg. Jam. +2",
    neck="Iskur Gorget",
    waist="Flax Sash",
    left_ear="Telos Earring",
    right_ear="Volley Earring",
    left_ring="Hajduk Ring +1",
    right_ring="Hajduk Ring +1",
    back="Moondoe Mantle +1",}

    sets.midcast.RA.Acc = {
	head="Meghanada Visor +2",
    body="Meg. Cuirie +2",
    hands="Meg. Gloves +2",
    legs="Meg. Chausses +2",
    feet="Meg. Jam. +2",
    neck="Iskur Gorget",
    waist="Flax Sash",
    left_ear="Telos Earring",
    right_ear="Volley Earring",
    left_ring="Hajduk Ring +1",
    right_ring="Hajduk Ring +1",
    back=Toutatis.RA,
}


    --------------------------------------
    -- Idle/resting/defense sets
    --------------------------------------

    -- Resting sets
    sets.resting = {head="Ocelomeh Headpiece +1",neck="Wiglen Gorget",
        ring1="Sheltered Ring",ring2="Paguroidea Ring"}


    -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)

    sets.idle = sets.Turms

    sets.idle.Town = set_combine(sets.Turms, {body="Councilor's Garb",feet="Pill. Poulaines +1"})
	

    sets.idle.Weak = sets.Turms


    -- Defense sets

    sets.defense.Evasion = sets.Turms

    sets.defense.PDT = {
        head="Pillager's Bonnet +1",neck="Twilight Torque",
        body="Iuitl Vest",hands="Pillager's Armlets +1",ring1="Defending Ring",ring2=gear.DarkRing.physical,
        back="Iximulew Cape",waist="Flume Belt",legs="Pillager's Culottes +1",feet="Iuitl Gaiters +1"}

    sets.defense.MDT = {
        head="Pillager's Bonnet +1",neck="Twilight Torque",
        body="Pillager's Vest +1",hands="Pillager's Armlets +1",ring1="Defending Ring",ring2="Shadow Ring",
        back="Engulfer Cape",waist="Flume Belt",legs="Pillager's Culottes +1",feet="Iuitl Gaiters +1"}


    --------------------------------------
    -- Melee sets
    --------------------------------------

    -- Normal melee group
    -- Triple Attack 35%, Triple Attack Damage 42%, ACC 1173, Attack 1129
    sets.engaged = {
	head={ name="Adhemar Bonnet +1", augments={'STR+12','DEX+12','Attack+20',}}, -- Trip.Attk. 4%
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}}, -- Trip.Attk. 4%
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}}, -- Trip.Attk. 4%
    legs="Meg. Chausses +2", -- Trip.Attk. 5%
    feet="Plun. Poulaines +1", -- Trip.Attk. 3%
    neck="Asn. Gorget +2", -- Trip.Attk. 4%
    waist="Chiner's Belt +1", -- Trip.Attk. 2%
    left_ear="Sherida Earring",
    right_ear="Telos Earring",
    left_ring="Epona's Ring",
    right_ring="Gere Ring", -- Trip.Attk. 3%
    back=Toutatis.DEX,
}
    sets.engaged.Acc = {
	head="Meghanada Visor +2",
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands="Meg. Gloves +2",
    legs="Meg. Chausses +2",
    feet="Meg. Jam. +2",
    neck="Asn. Gorget +2",
    waist="Kentarch Belt +1",
    left_ear="Sherida Earring",
    right_ear="Telos Earring",
    left_ring="Chirich Ring +1",
    right_ring="Chirich Ring +1",
    back=Toutatis.DEX,
}

sets.engaged.RA = {
    head={ name="Adhemar Bonnet +1", augments={'STR+12','DEX+12','Attack+20',}}, -- Trip.Attk. 4%
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}}, -- Trip.Attk. 4%
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}}, -- Trip.Attk. 4%
    legs="Meg. Chausses +2", -- Trip.Attk. 5%
    feet="Plun. Poulaines +1", -- Trip.Attk. 3%
    neck="Asn. Gorget +2", -- Trip.Attk. 4%
    waist="Chiner's Belt +1", -- Trip.Attk. 2%
    left_ear="Sherida Earring",
    right_ear="Telos Earring",
    left_ring="Epona's Ring",
    right_ring="Gere Ring", -- Trip.Attk. 3%
    back=Toutatis.DEX,
}
        
    
    sets.engaged.Evasion = set_combine(sets.Turms, {neck="Asn. Gorget +2",waist="Kentarch Belt +1",left_ear="Sherida Earring",right_ear="Telos Earring"})
	
    

end


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

-- Run after the general precast() is done.
function job_post_precast(spell, action, spellMap, eventArgs)
    if spell.english == 'Aeolian Edge' and state.TreasureMode.value ~= 'None' then
        equip(sets.TreasureHunter)
    elseif spell.english=='Sneak Attack' or spell.english=='Trick Attack' or spell.type == 'WeaponSkill' then
        if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
            equip(sets.TreasureHunter)
        end
    end
end

-- Run after the general midcast() set is constructed.
function job_post_midcast(spell, action, spellMap, eventArgs)
    if state.TreasureMode.value ~= 'None' and spell.action_type == 'Ranged Attack' then
        equip(sets.TreasureHunter)
    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)
    -- Weaponskills wipe SATA/Feint.  Turn those state vars off before default gearing is attempted.
    if spell.type == 'WeaponSkill' and not spell.interrupted then
        state.Buff['Sneak Attack'] = false
        state.Buff['Trick Attack'] = false
        state.Buff['Feint'] = false
    end
end

-- Called after the default aftercast handling is complete.
function job_post_aftercast(spell, action, spellMap, eventArgs)
    -- If Feint is active, put that gear set on on top of regular gear.
    -- This includes overlaying SATA gear.
    check_buff('Feint', eventArgs)
end

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

-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff, gain)
    if state.Buff[buff] ~= nil then
        if not midaction() then
            handle_equipping_gear(player.status)
        end
    end
end


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

function get_custom_wsmode(spell, spellMap, defaut_wsmode)
    local wsmode

    if state.Buff['Sneak Attack'] then
        wsmode = 'SA'
    end
    if state.Buff['Trick Attack'] then
        wsmode = (wsmode or '') .. 'TA'
    end

    return wsmode
end


-- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).
function job_handle_equipping_gear(playerStatus, eventArgs)
    -- Check that ranged slot is locked, if necessary
    check_range_lock()

    -- Check for SATA when equipping gear.  If either is active, equip
    -- that gear specifically, and block equipping default gear.
    check_buff('Sneak Attack', eventArgs)
    check_buff('Trick Attack', eventArgs)
end


function customize_idle_set(idleSet)
    if player.hpp < 80 then
        idleSet = set_combine(idleSet, sets.ExtraRegen)
    end

    return idleSet
end


function customize_melee_set(meleeSet)
    if state.TreasureMode.value == 'Fulltime' then
        meleeSet = set_combine(meleeSet, sets.TreasureHunter)
    end


    return meleeSet
end


-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
    th_update(cmdParams, eventArgs)
end

-- Function to display the current relevant user state when doing an update.
-- Return true if display was handled, and you don't want the default info shown.
function display_current_job_state(eventArgs)
    local msg = 'Melee'
    
    if state.CombatForm.has_value then
        msg = msg .. ' (' .. state.CombatForm.value .. ')'
    end
    
    msg = msg .. ': '
    
    msg = msg .. state.OffenseMode.value
    if state.HybridMode.value ~= 'Normal' then
        msg = msg .. '/' .. state.HybridMode.value
    end
    msg = msg .. ', WS: ' .. state.WeaponskillMode.value
    
    if state.DefenseMode.value ~= 'None' then
        msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
    end
    
    if state.Kiting.value == true then
        msg = msg .. ', Kiting'
    end

    if state.PCTargetMode.value ~= 'default' then
        msg = msg .. ', Target PC: '..state.PCTargetMode.value
    end

    if state.SelectNPCTargets.value == true then
        msg = msg .. ', Target NPCs'
    end
    
    msg = msg .. ', TH: ' .. state.TreasureMode.value

    add_to_chat(122, msg)

    eventArgs.handled = true
end

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

-- State buff checks that will equip buff gear and mark the event as handled.
function check_buff(buff_name, eventArgs)
    if state.Buff[buff_name] then
        equip(sets.buff[buff_name] or {})
        if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
            equip(sets.TreasureHunter)
        end
        eventArgs.handled = true
    end
	
function idle_town_values ()
sets.idle.Town = S{
    "Ru'Lude Gardens",
    "Upper Jeuno",
    "Lower Jeuno",
    "Port Jeuno",
    "Port Windurst",
    "Windurst Waters",
    "Windurst Woods",
    "Windurst Walls",
    "Heavens Tower",
    "Port San d'Oria",
    "Northern San d'Oria",
    "Southern San d'Oria",
    "Port Bastok",
    "Bastok Markets",
    "Bastok Mines",
    "Metalworks",
    "Aht Urhgan Whitegate",
	"Al Zahbi",
	"South Sandoria [S]",
	"Bastok Markets [S]",
	"Windurst Waters [S]",
    "Tavnazian Safehold",
    "Nashmau",
    "Selbina",
    "Mhaura",
	"Rabao",
    "Norg",
    "Eastern Adoulin",
    "Western Adoulin",
    "Kazham"
}
end

end





-- Function to lock the ranged slot if we have a ranged weapon equipped.
function check_range_lock()
    if player.equipment.range ~= 'empty' then
        disable('range', 'ammo')
    else
        enable('range', 'ammo')
    end
end


-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
    -- Default macro set/book
    if player.sub_job == 'DNC' then
        set_macro_page(1, 6)
    elseif player.sub_job == 'WAR' then
        set_macro_page(3, 6)
    elseif player.sub_job == 'NIN' then
        set_macro_page(4, 6)
    else
        set_macro_page(1, 6)
    end
end


Offline
Posts: 281
By Galkapryme 2019-10-18 02:47:43
Link | Quote | Reply
 
Would appreciate any help.
Offline
Posts: 281
By Galkapryme 2019-10-18 09:16:52
Link | Quote | Reply
 
Wish I could get ahold of Arislan
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2019-10-18 09:55:56
Link | Quote | Reply
 
I don't actually recommend using Assassin's Charge, but to answer your question, you would use the following function:
Code
check_buff("Assassin's Charge", eventArgs)


Specifically, in your job_post_aftercast function, like this:
Code
function job_post_aftercast(spell, action, spellMap, eventArgs)
    -- If Feint is active, put that gear set on on top of regular gear.
    -- This includes overlaying SATA gear.
    check_buff('Feint', eventArgs)

    check_buff("Assassin's Charge", eventArgs)
end


You will need to make sure that these are set up in your job_setup and init_gear_sets functions, respectively:
Code
state.Buff["Assassin's Charge"] = buffactive["Assassin's Charge"] or false
Code
sets.buff["Assassin's Charge"] = {body="whatever"}

(looks like you have the second, but not the first)

Also, your check_buff function is not properly closed. The "end" on line 656 should be on line 620.
Offline
Posts: 1186
By Boshi 2019-10-18 11:12:21
Link | Quote | Reply
 
iirc it’s only good for mandau mercy stroke
Offline
Posts: 281
By Galkapryme 2019-10-18 11:34:33
Link | Quote | Reply
 
You mentioned you wouldn't use Assassin's Charge. I'm curious as to why not. Given that it forces a Triple or Quadruple attack, I can swap out Triple or Quad Attack gear for gear with higher DEX or Critical Hit Rate while the buff is active.
 Fenrir.Melphina
Offline
Server: Fenrir
Game: FFXI
user: melphina
Posts: 1410
By Fenrir.Melphina 2019-10-18 11:40:01
Link | Quote | Reply
 
Quote:
iirc it’s only good for mandau mercy stroke

It's just as good in Mandalic Stab and Rudra's Storm as it is in Mercy Stroke. The reason assassin's charge isn't very good is because it's scaled poorly with Ilvl. When assassin's charge came out at level 75 things were very different from now. That was the blau/sirocco era, and our triple attack peaked at 10% with merits. We couldn't even cap gear haste back then. Thief's high haste build could only reach 22% via Wahlahra Turban, Rapparee harness, Homam Hands, Legs, Feet, and Swift Belt, or 24% if you were among the lucky elite to actually own a Speed Belt. Back then assassin's charge was very impactful, and being able to spike a weaponskill with it once every 5 minutes was worth the merit. Today we can easily cap haste and reach beyond 50% triple attack in gear, so one more triple attack on a weaponskill every 5 minutes isn't nearly as significant.

I used to have 5/5 feint 5/5 assassin's charge merits at lvl 75. I've completely unmerited assassin's charge and put the merits into Aura Steal since. I'd much rather be able to steal a buff like warcry every once in a while, and our upgraded relic hat even augments Aura Steal so it can absorb 2 buffs instead of 1.

Quote:
You mentioned you wouldn't use Assassin's Charge. I'm curious as to why not. Given that it forces a Triple or Quadruple attack, I can swap out Triple or Quad Attack gear for gear with higher DEX or Critical Hit Rate while the buff is active.


Literally just because of how badly it scaled with Ilvl and how little impact forcing one more triple attack every 5 minutes has. If you can benefit from the accuracy gain from ambush or if you can steal any useful damage buff with aura steal either of those two would be better in the current meta (5/5 feint is better than ever and is still mandatory though).
Offline
Posts: 281
By Galkapryme 2019-10-18 12:17:24
Link | Quote | Reply
 
Thanks for the feedback. I'm a slightly more than passive THF. Indeed, I don't study most of these jobs THAT deeply; I just feel I use them well enough. However, I imagine as I start playing THF more, I'll start using Aura Steal, which I once viewed as kind of useless in partying or NM zergs. I only remember using it and Larceny strategically back when AATT first came out, and I had to steal it's 1-hour.

All that said, the code worked great. Thank you.
 Fenrir.Melphina
Offline
Server: Fenrir
Game: FFXI
user: melphina
Posts: 1410
By Fenrir.Melphina 2019-10-18 12:22:46
Link | Quote | Reply
 
Well, to be fair. If assassin's charge were a 1 minute recast I'd still keep it. It would line up with my sneak attack timer so I could combine it with every sneak attacked weaponskill. It just doesn't feel very good with a 5 minute cooldown anymore, but it did when it first came out.
Offline
Posts: 281
By Galkapryme 2019-10-19 08:50:06
Link | Quote | Reply
 
I dropped it down to 1 merit and am raising Aura Steal (which I had at 3).
 Valefor.Yandaime
Offline
Server: Valefor
Game: FFXI
user: Yandaime
Posts: 747
By Valefor.Yandaime 2019-10-19 09:10:55
Link | Quote | Reply
 
Galkapryme said: »
Thanks for the feedback. I'm a slightly more than passive THF. Indeed, I don't study most of these jobs THAT deeply; I just feel I use them well enough. However, I imagine as I start playing THF more, I'll start using Aura Steal, which I once viewed as kind of useless in partying or NM zergs. I only remember using it and Larceny strategically back when AATT first came out, and I had to steal it's 1-hour.

All that said, the code worked great. Thank you.


Aura Steal works on SPs? I thought only Larceny could do that?
 Fenrir.Melphina
Offline
Server: Fenrir
Game: FFXI
user: melphina
Posts: 1410
By Fenrir.Melphina 2019-10-19 09:26:31
Link | Quote | Reply
 
He did say he used both Aura steal and Larceny strategically when AATT first came out. Only Larceny can steal a 1 hour ability. I used it to take Manafont from AATT as well when Divine Might II was new just so he couldn't murderball everyone. Aura Steal is for everything else, and there's quite a few useful buffs to absorb. After feint I think it's a toss up between that and Ambush which merits are most useful. Since my gear sets are already filled with accuracy I went with 5/5 Aura Steal to guarantee the absorb effect.