Lua Question - Mana Wall Lock-in

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » FFXI » Jobs » Black Mage » Lua Question - Mana Wall lock-in
Lua Question - Mana Wall lock-in
 Quetzalcoatl.Chanceikin
Offline
Server: Quetzalcoatl
Game: FFXI
Posts: 138
By Quetzalcoatl.Chanceikin 2017-01-03 18:34:03
Link | Quote | Reply
 
I have been trying to get a manawall set to lock in and stay in during the duration of the JA. Seen a few methods, but trying to implement them is killing me. This is the full lua - any help would be greatly appreciated.
Code
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job.  Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------

-- 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()

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('None', 'Normal')
    state.CastingMode:options('Normal', 'Resistant', 'Proc')
    state.IdleMode:options('Normal', 'PDT', 'Death')
    
    state.MagicBurst = M(false, 'Magic Burst')

    lowTierNukes = S{'Stone', 'Water', 'Aero', 'Fire', 'Blizzard', 'Thunder',
        'Stone II', 'Water II', 'Aero II', 'Fire II', 'Blizzard II', 'Thunder II',
        'Stone III', 'Water III', 'Aero III', 'Fire III', 'Blizzard III', 'Thunder III',
        'Stonega', 'Waterga', 'Aeroga', 'Firaga', 'Blizzaga', 'Thundaga',
        'Stonega II', 'Waterga II', 'Aeroga II', 'Firaga II', 'Blizzaga II', 'Thundaga II'}

    gear.macc_hagondes = {name="Hagondes Cuffs", augments={'Phys. dmg. taken -3%','Mag. Acc.+29'}}
    
    -- Additional local binds
    send_command('bind ^` input /ma Stun <t>')
    send_command('bind @` gs c activate MagicBurst')

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['Mana Wall'] = {back="Taranus's Cape",feet="Goetia Sabots +2"}

    sets.precast.JA.Manafont = {body="Sorcerer's Coat +2"}
    
    -- equip to maximize HP (for Tarus) and minimize MP loss before using convert
    sets.precast.JA.Convert = {}


    -- Fast cast sets for spells FAST CAST % 46  / Haste % 24

    sets.precast.FC = {ammo="Sapience Orb",
		head="Merlinic Hood",body="Zendik Robe",hands="Psycloth Manillas",ear1="Etiolation Earring",
		ear2="Loquacious Earring",back="Bane Cape",waist="Witful Belt",ring1="Evanescence Ring",
		legs="Psycloth Lappas",feet="Merlinic Crackows"}

    sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {head="Umuthi Hat",waist="Siegel Sash"})
	
	sets.precast.Refresh = set_combine(sets.precast.FC, {waist="Siegel Sash"})

    sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {head="Wicce Petasos",ear1="Barkarole Earring"})

    sets.precast.FC.Cure = set_combine(sets.precast.FC, {ear1="Mendicant's Earring",back="Pahtli Cape",legs="Doyen Pants",feet="Vanya Clogs"})

    sets.precast.FC.Curaga = sets.precast.FC.Cure
	
	sets.precast.Death = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Merlinic Hood",neck="Mizukage-no-Kubikazari",ear1="Friomisi Earring",ear2="Barkarole Earring",
		body="Amalric Doublet",hands="Amalric Gages",ring1="Archon ring",ring2="Mujin band",
		back="Bane Cape",waist="Hachirin-no-Obi",legs="Merlinic Shalwar",feet="Merlinic Crackows"}	

    -- Weaponskill sets
    -- Default set for any weaponskill that isn't any more specifically defined
    sets.precast.WS = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Jhakri Coronal +1",neck="Imbodla Necklace",ear1="Ishvara Earring",ear2="Moonshade Earring",
        body="Merlinic Jubbah",hands="Jhakri Cuffs +1",ring1="Shiva Ring",ring2="Shiva Ring",
        back="Aurist's Cape +1",waist="Fotia Belt",legs="Jhakri Slops +1",feet="Jhakri Pigaches +1"}

    -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
    sets.precast.WS['Vidohunir'] = {}
		
	sets.precast.WS['Myrkr'] = {ammo="Kalboron Stone",
        head="Merlinic Hood",neck="Nodens Gorget",ear1="Etiolation Earring",ear2="Loquacious Earring",
        body="Amalric Doublet",hands="Telchine Gloves",ring1="Globidonta Ring",ring2="",
        back="Bane Cape",waist="Fucho-no-obi",legs="Amalric Slops",feet="Medium's Sabots"}
    
    
    ---- Midcast Sets ----

    sets.midcast.FastRecast = {}

	---- Potency: 51% / Self: 10% ----
    sets.midcast.Cure = {head="Vanya Hood",neck="Nodens Gorget",ear1="Mendicant's Earring",ear2="Loquacious Earring",
		body="Zendik Robe",hands="Bokwus Gloves",ring1="Ephedra Ring",ring2="Globidonta Ring",
		back="Pahtli Cape",waist="Gishdubar Sash",legs="Psycloth Lappas",feet="Vanya Clogs"}

    sets.midcast.Curaga = sets.midcast.Cure

    sets.midcast['Enhancing Magic'] = {head="Befouled Crown",body="Telchine Chasuble",neck="Incanter's Torque",
		back="Perimede Cape",hands="Ayao's Gages"}
		
	sets.midcast.Refresh = set_combine(sets.midcast['Enhancing Magic'], {waist="Gishdubar Sash",back="Grapevine Cape",
		feet="Inspirited Boots"})
    
    sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {neck="Nodens Gorget",waist="Siegel Sash"})

    sets.midcast['Enfeebling Magic'] = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Merlinic Hood",neck="Erra Pendant",ear1="Barkarole Earring",ear2="Gwati Earring",
        body="Merlinic Jubbah",hands="Jhakri Cuffs +1",ring1="Globidonta Ring",ring2="Shiva Ring",
        back="Taranus's Cape",waist="Eschan Stone",legs="Psycloth Lappas",feet="Medium's Sabots"}
        
    sets.midcast.ElementalEnfeeble = sets.midcast['Enfeebling Magic']

    sets.midcast['Dark Magic'] = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Merlinic Hood",neck="Erra Pendant",ear1="Barkarole Earring",ear2="Gwati Earring",
        body="Psycloth Vest",hands="Jhakri Cuffs +1",ring1="Archon Ring",ring2="Evanescence Ring",
        back="Taranus's Cape",waist="Eschan Stone",legs="Merlinic Shalwar",feet="Merlinic Crackows"}

    sets.midcast.Drain = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Merlinic Hood",neck="Erra Pendant",ear1="Barkarole Earring",ear2="Gwati Earring",
        body="Merlinic Jubbah",hands="Jhakri Cuffs +1",ring1="Archon Ring",ring2="Evanescence Ring",
        back="Taranus's Cape",waist="Fucho-no-Obi",legs="Merlinic Shalwar",feet="Merlinic Crackows"}
    
    sets.midcast.Aspir = sets.midcast.Drain

    sets.midcast.Stun = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Merlinic Hood",neck="Erra Pendant",ear1="Barkarole Earring",ear2="Gwati Earring",
        body="Merlinic Jubbah",hands="Jhakri Cuffs +1",ring1="Archon Ring",ring2="Evanescence Ring",
        back="Taranus's Cape",waist="Eschan Stone",legs="Merlinic Shalwar",feet="Merlinic Crackows"}

    sets.midcast.BardSong = {}


    -- Elemental Magic sets
    
    sets.midcast['Elemental Magic'] = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Merlinic Hood",neck="Mizukage-no-Kubikazari",ear1="Barkarole Earring",ear2="Friomisi Earring",
        body="Merlinic Jubbah",hands="Amalric Gages",ring1="Mujin Band",ring2="Shiva Ring",
        back="Taranus's Cape",waist="Eschan Stone",legs="Merlinic Shalwar",feet="Merlinic Crackows"}

    sets.midcast['Elemental Magic'].Resistant = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Merlinic Hood",neck="Mizukage-no-Kubikazari",ear1="Barkarole Earring",ear2="Friomisi Earring",
        body="Merlinic Jubbah",hands="Amalric Gages",ring1="Mujin Band",ring2="Shiva Ring",
        back="Taranus's Cape",waist="Eschan Stone",legs="Merlinic Shalwar",feet="Merlinic Crackows"}

    sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'], {sub="Wizzan Grip",back="Taranus's Cape"})
    sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'], {sub="Wizzan Grip",back="Taranus's Cape"})
	
	sets.midcast.Death = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Merlinic Hood",neck="Mizukage-no-Kubikazari",ear1="Friomisi Earring",ear2="Barkarole Earring",
		body="Amalric Doublet",hands="Amalric Gages",ring1="Archon ring",ring2="Mujin band",
		back="Bane Cape",waist="Hachirin-no-Obi",legs="Merlinic Shalwar",feet="Merlinic Crackows"}


    -- Minimal damage gear for procs.
    sets.midcast['Elemental Magic'].Proc = {main="Earth Staff", sub="Mephitis Grip",ammo="Impatiens",
        head="Nahtirah Hat",neck="Twilight Torque",ear1="Bloodgem Earring",ear2="Loquacious Earring",
        body="Manasa Chasuble",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
        back="Swith Cape +1",waist="Channeler's Stone",legs="Nares Trews",feet="Rostrum Pumps"}


    
    -- Sets to return to when not performing an action.
    
    -- Resting sets
    sets.resting = {main="Bolelabunga",sub="Genbu's Shield",ammo="Pemphredo Tathlum",
        head="Umuthi Hat",neck="Loricate Torque +1",ear1="Infused Earring",ear2="Loquacious Earring",
        body="Vanya Robe",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Defending Ring",
        back="Solemnity Cape",waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Herald's Gaiters"}

    

    -- Idle sets
    
    -- Normal refresh idle set
    sets.idle = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Befouled Crown",neck="Loricate Torque +1",ear1="Infused Earring",ear2="Loquacious Earring",
        body="Jhakri Robe +1",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Defending Ring",
        back="Solemnity Cape",waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Herald's Gaiters"}

    -- Idle mode that keeps PDT gear on, but doesn't prevent normal gear swaps for precast/etc.
    sets.idle.PDT = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Vanya Hood",neck="Loricate Torque +1",ear1="Infused Earring",ear2="Loquacious Earring",
        body="Vanya Robe",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Defending Ring",
        back="Solemnity Cape",waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Herald's Gaiters"}

    -- Idle mode scopes:
    -- Idle mode when weak.
    sets.idle.Weak = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Befouled Crown",neck="Loricate Torque +1",ear1="Infused Earring",ear2="Loquacious Earring",
        body="Jhakri Robe +1",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Defending Ring",
        back="Solemnity Cape",waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Herald's Gaiters"}
    
    -- Town gear.
    sets.idle.Town = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Befouled Crown",neck="Loricate Torque +1",ear1="Infused Earring",ear2="Loquacious Earring",
        body="Jhakri Robe +1",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Defending Ring",
        back="Solemnity Cape",waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Herald's Gaiters"}
		
	sets.idle.Death = {main="Lathi",sub="Niobid Strap",ammo="Pemphredo Tathlum",
        head="Merlinic Hood",neck="Mizukage-no-Kubikazari",ear1="Friomisi Earring",ear2="Barkarole Earring",
		body="Amalric Doublet",hands="Amalric Gages",ring1="Archon ring",ring2="Mujin band",
		back="Bane Cape",waist="Hachirin-no-Obi",legs="Merlinic Shalwar",feet="Merlinic Crackows"}	
        
    -- Defense sets

    sets.defense.PDT = {main="Earth Staff",sub="Zuuxowu Grip",
        head="Nahtirah Hat",neck="Loricate Torque +1",
        body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
        back="Umbra Cape",waist="Hierarch Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}

    sets.defense.MDT = {ammo="Demonry Stone",
        head="Nahtirah Hat",neck="Loricate Torque +1",
        body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Shadow Ring",
        back="Tuilha Cape",waist="Hierarch Belt",legs="Bokwus Slops",feet="Hagondes Sabots"}

    sets.Kiting = {legs="Tatsu. Sitagoromo"}

    sets.latent_refresh = {waist="Fucho-no-obi"}

    -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
    
    sets.buff['Mana Wall'] = {
		neck="Loricate Torque +1",ear1="Ethereal Earring",body="Vrikodara Jupon",ring1="Vocane Ring",
		ring2="Defending Ring",back="Taranus's Cape",feet="Goetia Sabots +2"}

    sets.magic_burst = {neck="Mizukage-no-Kubikazari"}

    -- 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 = {ammo="Hasty Pinion +1",
        head="Jhakri Coronal +1",neck="Lissome Necklace",ear1="Brutal Earring",ear2="Telos Earring",
        body="Jhakri Robe +1",hands="Psycloth Manillas",ring1="Ramuh Ring +1",ring2="Cacoethic Ring +1",
        back="Aurist's Cape +1",waist="Goading Belt",legs="Jhakri Slops +1",feet="Medium's Sabots"}
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)
    if spellMap == 'Cure' or spellMap == 'Curaga' then
        gear.default.obi_waist = "Goading Belt"
    elseif spell.skill == 'Elemental Magic' then
        gear.default.obi_waist = "Sekhmet Corset"
        if state.CastingMode.value == 'Proc' then
            classes.CustomClass = 'Proc'
        end
    end
end


-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_midcast(spell, action, spellMap, eventArgs)

end

function job_post_midcast(spell, action, spellMap, eventArgs)
    if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
        equip(sets.magic_burst)
    end
end

function job_aftercast(spell, action, spellMap, eventArgs)
    -- Lock feet after using Mana Wall.
    if not spell.interrupted then
        if spell.english == 'Mana Wall' then
            enable('feet')
            equip(sets.buff['Mana Wall'])
            disable('feet')
        elseif spell.skill == 'Elemental Magic' then
            state.MagicBurst:reset()
        end
    end
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)
    -- Unlock feet when Mana Wall buff is lost.
    if buff == "Mana Wall" and not gain then
        enable('feet')
        handle_equipping_gear(player.status)
    end
end

-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
    if stateField == 'Offense Mode' then
        if newValue == 'Normal' then
            disable('main','sub','range')
        else
            enable('main','sub','range')
        end
    end
end


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

-- Custom spell mapping.
function job_get_spell_map(spell, default_spell_map)
    if spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble' then
        --[[ No real need to differentiate with current gear.
        if lowTierNukes:contains(spell.english) then
            return 'LowTierNuke'
        else
            return 'HighTierNuke'
        end
        --]]
    end
end

function customize_idle_set(idleSet)

    if buffactive['Mana Wall'] then
        idleSet = set_combine(idleSet, sets.buff['Mana Wall'])
    end
	
 
    return idleSet
end

-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
    if player.mpp < 51 then
        idleSet = set_combine(idleSet, sets.latent_refresh)
    end
    
    return idleSet
end

function job_buff_change(buff, gain)

	if state.Buff[buff] ~= nil then
		state.Buff[buff] = gain
		if not midaction() then
			handle_equipping_gear(player.status)
		end
	end
end

-- Function to display the current relevant user state when doing an update.
function display_current_job_state(eventArgs)
    display_current_caster_state()
    eventArgs.handled = true
end
 Ragnarok.Terazuma
Offline
Server: Ragnarok
Game: FFXI
user: Terazuma
Posts: 50
By Ragnarok.Terazuma 2017-01-03 18:42:14
Link | Quote | Reply
 
Code
function buff_change(buff,gain)
	if buff == "Mana Wall" then
		if gain then
			equip({feet="Wicce Sabots +1",back=Taranus_MAB})
			send_command('gs disable back')
			send_command('gs disable feet')
		else
			send_command('gs enable back')
			send_command('gs enable feet')
		end
	end
end


What I use, works well enough for me.
[+]
 Leviathan.Celebrindal
Offline
Server: Leviathan
Game: FFXI
Posts: 1641
By Leviathan.Celebrindal 2017-01-11 09:28:24
Link | Quote | Reply
 
I've seen info that the feet only need to be on for /ja activation, versus the practice of leaving them on(which I currently do). I think all of us would prefer harder hitting feet during mana wall if we don't need to lock the feet.
necroskull Necro Bump Detected! [1239 days between previous and next post]
 Fenrir.Kaldaek
Online
Server: Fenrir
Game: FFXI
Posts: 694
By Fenrir.Kaldaek 2020-06-03 12:41:28
Link | Quote | Reply
 
Leviathan.Celebrindal said: »
I've seen info that the feet only need to be on for /ja activation, versus the practice of leaving them on(which I currently do). I think all of us would prefer harder hitting feet during mana wall if we don't need to lock the feet.

Any update on this? Been looking around at BiS mana wall sets now that su5 has been out.

Thanks in advance.
Log in to post.