|
GearSwap: Need help changing weapon
By militades 2020-05-24 00:17:06
Hi All,
Not sure if this question has been asked before, if there is something similar and I didn't see it, you can refer me to that thread. I'm no programmer so I'm struggling to alter the lua I ripped of the internet to do the following: -
1. Change weapon based on keystroke
This is what I added not sure what I am doing wrong (bold are what I added)
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
end
function user_setup()
state.OffenseMode:options('Normal', 'Acc')
state.HybridMode:options('Normal', 'PDT', 'Reraise')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.PhysicalDefenseMode:options('PDT', 'HP', 'Reraise', 'Charm')
state.MagicalDefenseMode:options('MDT', 'HP', 'Reraise', 'Charm')
state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MP', 'Knockback', 'MP_Knockback'}
state.CombatWeapon = M('KOTR','Savage')
state.EquipShield = M(false, 'Equip Shield w/Defense')
update_defense_mode()
-- Allows the use of Ctrl + ~ and Alt + ~ for 2 more macros of your choice.
send_command('bind !` input /ja "Intervene" <stnpc>') --Ctrl'~'
send_command('bind ^` input /ja "Invincible" <me>') --Alt'~'
send_command('bind ^f11 gs c cycle MagicalDefenseMode') --^ means ctrl
send_command('bind !f11 gs c cycle ExtraDefenseMode') -- ! means alt
send_command('bind @f1 gs c cycle CombatWeapon')
send_command('bind @f10 gs c toggle EquipShield') --@ means windows button
send_command('bind @f11 gs c toggle EquipShield')
select_default_macro_book()
end
function init_gear_sets()
--------------------------------------
-- Weapons
--------------------------------------
sets.weapon = {}
sets.weapon.KOTR = {main="Excalibur",}
sets.weapon.Savage = {main="Kaja Sword",}
end
-- Equip Weapon
function equip_weapon(weaponSet)
if state.weapon.value ~= 'KOTR' then
equip(sets.weapon.KOTR)
end
if state.weapon.value ~= 'Savage' then
equip(sets.weapon.Savage)
end
return weaponSet
end
Any help is greatly appreciated
--- Edited post to show what I did instead of the chunk --
[+]
By militades 2020-05-24 10:03:27
My entire lua file below, if someone can point me in the right direction how do I create the keybind to change the weapon.
I'm trying to do it as I am using 2 seperate lua files now for the 2 weapons. Was thinking of simplifying my updating with only 1 lua and a keybind to select weapon.
-------------------------------------------------------------------------------------------------------------------
-- 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()
state.Buff.Sentinel = buffactive.sentinel or false
state.Buff.Cover = buffactive.cover or false
state.Buff.Doom = buffactive.Doom or false
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')
state.HybridMode:options('Normal', 'PDT', 'Reraise')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.PhysicalDefenseMode:options('PDT', 'HP', 'Reraise', 'Charm')
state.MagicalDefenseMode:options('MDT', 'HP', 'Reraise', 'Charm')
state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MP', 'Knockback', 'MP_Knockback'}
state.CombatWeapon = M('KOTR','Savage')
state.EquipShield = M(false, 'Equip Shield w/Defense')
update_defense_mode()
-- Allows the use of Ctrl + ~ and Alt + ~ for 2 more macros of your choice.
send_command('bind !` input /ja "Intervene" <stnpc>') --Ctrl'~'
send_command('bind ^` input /ja "Invincible" <me>') --Alt'~'
send_command('bind ^f11 gs c cycle MagicalDefenseMode') --^ means ctrl
send_command('bind !f11 gs c cycle ExtraDefenseMode') -- ! means alt
send_command('bind @f1 gs c cycle CombatWeapon')
send_command('bind @f10 gs c toggle EquipShield') --@ means windows button
send_command('bind @f11 gs c toggle EquipShield')
select_default_macro_book()
end
function user_unload()
send_command('unbind ^f11')
send_command('unbind !f11')
send_command('unbind @f10')
send_command('unbind @f11')
send_command('unbind @f1')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Enmity sets
--------------------------------------
-- Extra Full Enmity sets. Apply these on top of melee or defense sets.
sets.Enmity = {
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Moonlight Necklace",
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
left_ring="Provocare Ring",
right_ring="Eihwaz Ring",
}
--------------------------------------
-- Precast sets
--------------------------------------
-- Precast sets to enhance JAs
sets.precast.JA = sets.Enmity
sets.precast.JA['Invincible'] = set_combine(sets.Enmity, {legs={ name="Cab. Breeches +2", augments={'Enhances "Invincible" effect',}},})
sets.precast.JA['Holy Circle'] = set_combine(sets.Enmity, {feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},})
sets.precast.JA['Shield Bash'] = set_combine(sets.Enmity, {hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},left_ear="Knightly Earring",})
sets.precast.JA['Sentinel'] = set_combine(sets.Enmity, {feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},})
sets.precast.JA['Rampart'] = set_combine(sets.Enmity, {head={ name="Cab. Coronet +2", augments={'Enhances "Iron Will" effect',}},})
sets.precast.JA['Fealty'] = set_combine(sets.Enmity, {body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},})
sets.precast.JA['Divine Emblem'] = set_combine(sets.Enmity, {feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},})
sets.precast.JA['Cover'] = set_combine(sets.Enmity, {body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},})
-- add mnd for Chivalry
sets.precast.JA['Chivalry'] = set_combine(sets.Enmity,
{
head="Caballarius Coronet +2",
body="Caballarius Surcoat +1",
hands="Caballarius Gauntlets +1",
legs="Caballarius Breeches +2",
feet="Caballarius Leggings +1",
left_ring="Star Ring",
right_ring="Star Ring",
})
-- Fast cast sets for spells
sets.precast.FC =
{
ammo="Incantor Stone",
head={ name="Carmine Mask +1", augments={'Accuracy+20','Mag. Acc.+12','"Fast Cast"+4',}},
feet={ name="Odyssean Greaves", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Chance of successful block +2','"Fast Cast"+3','Mag. Acc.+12 "Mag.Atk.Bns."+12',}},
right_ear="Enchntr. Earring +1",
left_ear="Loquac. Earring",
left_ring="Prolix Ring",
back={ name="Rudianos's Mantle", augments={'MND+20','Eva.+20 /Mag. Eva.+20','MND+10','"Fast Cast"+10','Spell interruption rate down-10%',}},
}
sets.precast.FC['Enhancing Magic'] = sets.precast.FC
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
left_ear="Zwazo Earring",
neck="Sanctity Necklace",
body="Sulevia's Plate. +2",
feet="Sulev. Leggings +2",
waist="Caudata Belt",
back={ name="Rudianos's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%',}},
}
sets.precast.WS.Acc = {
left_ear="Zwazo Earring",
neck="Sanctity Necklace",
body="Sulevia's Plate. +2",
feet="Sulev. Leggings +2",
waist="Caudata Belt",
back={ name="Rudianos's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%',}},
}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS,
{
neck={ name="Kgt. Beads +2", augments={'Path: A',}},
waist="Soil Belt",
})
sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS.Acc,
{
neck={ name="Kgt. Beads +2", augments={'Path: A',}},
waist="Soil Belt",
})
sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {ring1="Leviathan Ring",ring2="Aquasoul Ring"})
sets.precast.WS['Requiescat'].Acc = set_combine(sets.precast.WS.Acc, {ring1="Leviathan Ring"})
sets.precast.WS['Chant du Cygne'] = set_combine(sets.precast.WS, {hands="Buremte Gloves",waist="Zoran's Belt"})
sets.precast.WS['Chant du Cygne'].Acc = set_combine(sets.precast.WS.Acc, {waist="Zoran's Belt"})
sets.precast.WS['Sanguine Blade'] =
{
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Moonlight Necklace",
body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},
hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
back="Moonlight Cape",
}
sets.precast.WS['Atonement'] = {ammo="Iron Gobbet",
head="Reverence Coronet +1",neck=gear.ElementalGorget,ear1="Creed Earring",ear2="Steelflash Earring",
body="Reverence Surcoat +1",hands="Reverence Gauntlets +1",ring1="Rajas Ring",ring2="Vexer Ring",
back="Fierabras's Mantle",waist=gear.ElementalBelt,legs="Reverence Breeches +1",feet="Caballarius Leggings"}
--------------------------------------
-- Midcast sets
--------------------------------------
sets.midcast.FastRecast = {
ammo="Staunch Tathlum +1",
left_ear="Knightly Earring",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Moonlight Necklace",
legs={ name="Cab. Breeches +2", augments={'Enhances "Invincible" effect',}},
feet={ name="Odyssean Greaves", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Chance of successful block +2','"Fast Cast"+3','Mag. Acc.+12 "Mag.Atk.Bns."+12',}},
back={ name="Rudianos's Mantle", augments={'MND+20','Eva.+20 /Mag. Eva.+20','MND+10','"Fast Cast"+10','Spell interruption rate down-10%',}},
}
sets.midcast.Flash = set_combine(sets.Enmity, sets.midcast.FastRecast,
{
right_ear="Beatific Earring",
left_ring="Stikini Ring +1",
right_ring="Stikini Ring +1",
})
sets.midcast.Stun = sets.midcast.Flash
sets.midcast.Cure = set_combine(sets.Enmity,sets.midcast.FastRecast,{
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Odyssean Greaves", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Chance of successful block +2','"Fast Cast"+3','Mag. Acc.+12 "Mag.Atk.Bns."+12',}},
right_ear="Beatific Earring",
right_ring="Stikini Ring +1",
left_ring="Stikini Ring +1",
waist="Chuq'aba Belt",
})
sets.midcast['Enhancing Magic'] = set_combine(sets.Enmity,sets.midcast.FastRecast,{
right_ear="Beatific Earring",
left_ring="Stikini Ring +1",
right_ring="Stikini Ring +1",
})
sets.midcast.Protect = {right_ring="Sheltered Ring", left_ring="Stikini Ring +1",head={ name="Carmine Mask +1", augments={'Accuracy+20','Mag. Acc.+12','"Fast Cast"+4',}},}
sets.midcast.Shell = {right_ring="Sheltered Ring", left_ring="Stikini Ring +1",head={ name="Carmine Mask +1", augments={'Accuracy+20','Mag. Acc.+12','"Fast Cast"+4',}},}
--------------------------------------
-- Idle/resting/defense/etc sets
--------------------------------------
sets.Reraise = {}
sets.resting = {
neck="Coatl Gorget +1",
body="Vermillion Cloak",
left_ring="Star Ring",
right_ring="Star Ring",
}
sets.fashion = {
main="Excalibur",
sub="Ochain",
ammo="Staunch Tathlum +1",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Moonlight Necklace",
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Coatl Gorget +1",
waist="Chuq'aba Belt",
left_ear="Upsurge Earring",
right_ear="Impreg. Earring",
left_ring="Stikini Ring +1",
right_ring="Stikini Ring +1",
back="Aptitude Mantle +1",
}
-- Idle sets
sets.idle = {
main="Kaja Sword",
ammo="Staunch Tathlum +1",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Coatl Gorget +1",
waist="Chuq'aba Belt",
left_ear="Upsurge Earring",
right_ear="Impreg. Earring",
left_ring="Stikini Ring +1", -- Magic skill +8 Refresh +1
right_ring="Stikini Ring +1", -- Magic skill +8 Refresh +1
back="Aptitude Mantle +1",
}
sets.idle.Town = {
main="Kaja Sword",
sub="Ochain",
ammo="Staunch Tathlum +1",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Coatl Gorget +1",
waist="Chuq'aba Belt",
left_ear="Upsurge Earring",
right_ear="Impreg. Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.idle.Weak = {
main="Kaja Sword",
ammo="Staunch Tathlum +1",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Coatl Gorget +1",
waist="Chuq'aba Belt",
left_ear="Upsurge Earring",
right_ear="Impreg. Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.idle.Weak.Reraise = set_combine(sets.idle.Weak, sets.Reraise)
sets.Kiting = {}
sets.latent_refresh = {}
--------------------------------------
-- Defense sets
--------------------------------------
-- Extra defense sets. Apply these on top of melee or defense sets.
sets.Knockback = {}
sets.MP = {}
sets.MP_Knockback = {}
-- If EquipShield toggle is on (Win+F10 or Win+F11), equip the weapon/shield combos here
-- when activating or changing defense mode:
sets.PhysicalShield = {sub="Ochain",} -- Ochain
sets.MagicalShield = {sub="Aegis",} -- Aegis
-- Basic defense sets.
sets.defense.PDT = {
neck={ name="Kgt. Beads +2", augments={'Path: A',}},
head={ name="Cab. Coronet +2", augments={'Enhances "Iron Will" effect',}},
body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},
hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},
legs={ name="Cab. Breeches +2", augments={'Enhances "Invincible" effect',}},
feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
waist="Flume Belt +1",
left_ring="Provocare Ring",
right_ring="Eihwaz Ring",
}
sets.defense.HP = {
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck={ name="Kgt. Beads +2", augments={'Path: A',}},
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
waist="Flume Belt +1",
left_ring="Provocare Ring",
right_ring="Eihwaz Ring",
}
sets.defense.Reraise = {}
sets.defense.Charm = {}
sets.defense.Capacity = {
back="Aptitude Mantle +1",
}
-- To cap MDT with Shell IV (52/256), need 76/256 in gear.
-- Shellra V can provide 75/256, which would need another 53/256 in gear.
sets.defense.MDT = {sub="Aegis",}
--------------------------------------
-- Weapons
--------------------------------------
sets.weapon = {}
sets.weapon.KOTR = {main="Excalibur",}
sets.weapon.Savage = {main="Kaja Sword",}
--------------------------------------
-- Engaged sets
--------------------------------------
sets.engaged = {
ammo="Aurgelmir Orb +1",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +2",
hands="Sulev. Gauntlets +2",
legs="Sulev. Cuisses +2",
feet="Sulev. Leggings +2",
neck="Sanctity Necklace",
waist="Tempus Fugit +1",
left_ear="Mache Earring +1",
right_ear="Balder Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.engaged.Acc = {
ammo="Aurgelmir Orb +1",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +2",
hands="Sulev. Gauntlets +2",
legs="Sulev. Cuisses +2",
feet="Sulev. Leggings +2",
neck="Sanctity Necklace",
waist="Tempus Fugit +1",
left_ear="Mache Earring +1",
right_ear="Balder Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.engaged.DW = {
main="Kaja Sword",
main="Iztaasu +2",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +2",
hands="Sulev. Gauntlets +2",
legs="Sulev. Cuisses +2",
feet="Sulev. Leggings +2",
neck="Moonlight Necklace",
waist="Tempus Fugit +1",
left_ear="Mache Earring +1",
right_ear="Balder Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.engaged.DW.Acc = {
main="Kaja Sword",
main="Iztaasu +2",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +2",
hands="Sulev. Gauntlets +2",
legs="Sulev. Cuisses +2",
feet="Sulev. Leggings +2",
neck="Moonlight Necklace",
waist="Tempus Fugit +1",
left_ear="Mache Earring +1",
right_ear="Balder Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.engaged.PDT = set_combine(sets.engaged, {
neck="Unmoving Collar",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
waist="Flume Belt +1",
})
sets.engaged.Acc.PDT = set_combine(sets.engaged.Acc, {
neck="Unmoving Collar",
head={ name="Cab. Coronet +2", augments={'Enhances "Iron Will" effect',}},
body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},
hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},
legs={ name="Cab. Breeches +2", augments={'Enhances "Invincible" effect',}},
feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
waist="Flume Belt +1",
})
sets.engaged.Reraise = set_combine(sets.engaged, sets.Reraise)
sets.engaged.Acc.Reraise = set_combine(sets.engaged.Acc, sets.Reraise)
sets.engaged.DW.PDT = set_combine(sets.engaged.DW, {})
sets.engaged.DW.Acc.PDT = set_combine(sets.engaged.DW.Acc, {})
sets.engaged.DW.Reraise = set_combine(sets.engaged.DW, sets.Reraise)
sets.engaged.DW.Acc.Reraise = set_combine(sets.engaged.DW.Acc, sets.Reraise)
--------------------------------------
-- Custom buff sets
--------------------------------------
sets.buff.Doom = {}
sets.buff.Cover = {body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_midcast(spell, action, spellMap, eventArgs)
-- If DefenseMode is active, apply that gear over midcast
-- choices. Precast is allowed through for fast cast on
-- spells, but we want to return to def gear before there's
-- time for anything to hit us.
-- Exclude Job Abilities from this restriction, as we probably want
-- the enhanced effect of whatever item of gear applies to them,
-- and only one item should be swapped out.
if state.DefenseMode.value ~= 'None' and spell.type ~= 'JobAbility' then
handle_equipping_gear(player.status)
eventArgs.handled = true
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Called when the player's status changes.
function job_state_change(field, new_value, old_value)
classes.CustomDefenseGroups:clear()
classes.CustomDefenseGroups:append(state.ExtraDefenseMode.current)
if state.EquipShield.value == true then
classes.CustomDefenseGroups:append(state.DefenseMode.current .. 'Shield')
end
classes.CustomMeleeGroups:clear()
classes.CustomMeleeGroups:append(state.ExtraDefenseMode.current)
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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)
update_defense_mode()
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
if state.Buff.Doom then
idleSet = set_combine(idleSet, sets.buff.Doom)
end
return idleSet
end
-- Equip Weapon
function equip_weapon(weaponSet)
if state.weapon.value == 'KOTR' then
equip(sets.weapon.KOTR)
end
if state.weapon.value == 'Savage' then
equip(sets.weapon.Savage)
end
return weaponSet
end
-- Modify the default melee set after it was constructed.
function customize_melee_set(meleeSet)
if state.Buff.Doom then
meleeSet = set_combine(meleeSet, sets.buff.Doom)
end
return meleeSet
end
function customize_defense_set(defenseSet)
if state.ExtraDefenseMode.value ~= 'None' then
defenseSet = set_combine(defenseSet, sets[state.ExtraDefenseMode.value])
end
if state.EquipShield.value == true then
defenseSet = set_combine(defenseSet, sets[state.DefenseMode.current .. 'Shield'])
end
if state.Buff.Doom then
defenseSet = set_combine(defenseSet, sets.buff.Doom)
end
return defenseSet
end
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.ExtraDefenseMode.value ~= 'None' then
msg = msg .. ', Extra: ' .. state.ExtraDefenseMode.value
end
if state.EquipShield.value == true then
msg = msg .. ', Force Equip Shield'
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
add_to_chat(122, msg)
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function update_defense_mode()
if player.equipment.main == 'Kaja Sword' and not classes.CustomDefenseGroups:contains('Kheshig Blade') then
classes.CustomDefenseGroups:append('Kaja Sword')
end
if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
if player.equipment.sub and not player.equipment.sub:contains('Shield') and
player.equipment.sub ~= 'Aegis' and player.equipment.sub ~= 'Ochain' then
state.CombatForm:set('DW')
else
state.CombatForm:reset()
end
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 == 'WAR' then
set_macro_page(4, 1)
elseif player.sub_job == 'DNC' then
set_macro_page(4, 2)
elseif player.sub_job == 'NIN' then
set_macro_page(4, 2)
else
set_macro_page(2, 2)
end
end
--[[ ******************************************************
Code that runs once, when we first swap to our PLD job
****************************************************** --]]
-- Puts on our fashion set, lockstyle it, then switch
-- to our idle set.
send_command('wait 1;gs equip fashion;wait 1;input /lockstyle on;wait 1;gs equip idle')
By militades 2020-05-25 00:16:58
Figured out my problem for those interested in doing something similar
The appropriate place to add the weapon changes are in the melee/idle functions
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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)
update_defense_mode()
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
if state.Buff.Doom then
idleSet = set_combine(idleSet, sets.buff.Doom)
end
if state.CombatWeapon.value == 'KOTR' then
idleSet = set_combine(idleSet, sets.weapons.KOTR)
end
if state.CombatWeapon.value == 'Savage' then
idleSet = set_combine(idleSet, sets.weapons.Savage)
end
return idleSet
end
-- Modify the default melee set after it was constructed.
function customize_melee_set(meleeSet)
if state.Buff.Doom then
meleeSet = set_combine(meleeSet, sets.buff.Doom)
end
if state.CombatWeapon.value == 'KOTR' then
meleeSet = set_combine(meleeSet, sets.weapons.KOTR)
end
if state.CombatWeapon.value == 'Savage' then
meleeSet = set_combine(meleeSet, sets.weapons.Savage)
end
return meleeSet
end
function customize_defense_set(defenseSet)
if state.ExtraDefenseMode.value ~= 'None' then
defenseSet = set_combine(defenseSet, sets[state.ExtraDefenseMode.value])
end
if state.EquipShield.value == true then
defenseSet = set_combine(defenseSet, sets[state.DefenseMode.current .. 'Shield'])
end
if state.Buff.Doom then
defenseSet = set_combine(defenseSet, sets.buff.Doom)
end
if state.CombatWeapon.value == 'KOTR' then
defenseSet = set_combine(defenseSet, sets.weapons.KOTR)
end
if state.CombatWeapon.value == 'Savage' then
defenseSet = set_combine(defenseSet, sets.weapons.Savage)
end
return defenseSet
end
My lua file for reference, I did some changes which defers from my previous post (e.g. weapons instead of weapon etc)
-------------------------------------------------------------------------------------------------------------------
-- 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()
state.Buff.Sentinel = buffactive.sentinel or false
state.Buff.Cover = buffactive.cover or false
state.Buff.Doom = buffactive.Doom or false
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')
state.HybridMode:options('Normal', 'PDT', 'Reraise')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.PhysicalDefenseMode:options('PDT', 'HP','Normal', 'Reraise', 'Charm')
state.MagicalDefenseMode:options('MDT', 'HP', 'Normal', 'Reraise', 'Charm')
state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MP', 'Knockback', 'MP_Knockback'}
state.CombatWeapon = M{['description']='Weapon Selection','KOTR','Savage'}
state.EquipShield = M(false, 'Equip Shield w/Defense')
update_defense_mode()
-- Allows the use of Ctrl + ~ and Alt + ~ for 2 more macros of your choice.
send_command('bind !` input /ja "Intervene" <stnpc>') --Ctrl'~'
send_command('bind ^` input /ja "Invincible" <me>') --Alt'~'
send_command('bind ^f11 gs c cycle MagicalDefenseMode') --^ means ctrl
send_command('bind !f11 gs c cycle ExtraDefenseMode') -- ! means alt
send_command('bind @f1 gs c cycle CombatWeapon')
send_command('bind @f10 gs c toggle EquipShield') --@ means windows button
send_command('bind @f11 gs c toggle EquipShield')
select_default_macro_book()
end
function user_unload()
send_command('unbind ^f11')
send_command('unbind !f11')
send_command('unbind @f10')
send_command('unbind @f11')
send_command('unbind @f1')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Enmity sets
--------------------------------------
-- Extra Full Enmity sets. Apply these on top of melee or defense sets.
sets.Enmity = {
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Moonlight Necklace",
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
left_ring="Provocare Ring",
right_ring="Eihwaz Ring",
}
--------------------------------------
-- Precast sets
--------------------------------------
-- Precast sets to enhance JAs
sets.precast.JA = sets.Enmity
sets.precast.JA['Invincible'] = set_combine(sets.Enmity, {legs={ name="Cab. Breeches +2", augments={'Enhances "Invincible" effect',}},})
sets.precast.JA['Holy Circle'] = set_combine(sets.Enmity, {feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},})
sets.precast.JA['Shield Bash'] = set_combine(sets.Enmity, {hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},left_ear="Knightly Earring",})
sets.precast.JA['Sentinel'] = set_combine(sets.Enmity, {feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},})
sets.precast.JA['Rampart'] = set_combine(sets.Enmity, {head={ name="Cab. Coronet +2", augments={'Enhances "Iron Will" effect',}},})
sets.precast.JA['Fealty'] = set_combine(sets.Enmity, {body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},})
sets.precast.JA['Divine Emblem'] = set_combine(sets.Enmity, {feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},})
sets.precast.JA['Cover'] = set_combine(sets.Enmity, {body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},})
-- add mnd for Chivalry
sets.precast.JA['Chivalry'] = set_combine(sets.Enmity,
{
head="Caballarius Coronet +2",
body="Caballarius Surcoat +1",
hands="Caballarius Gauntlets +1",
legs="Caballarius Breeches +2",
feet="Caballarius Leggings +1",
left_ring="Star Ring",
right_ring="Star Ring",
})
-- Fast cast sets for spells
sets.precast.FC =
{
ammo="Incantor Stone",
head={ name="Carmine Mask +1", augments={'Accuracy+20','Mag. Acc.+12','"Fast Cast"+4',}},
feet={ name="Odyssean Greaves", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Chance of successful block +2','"Fast Cast"+3','Mag. Acc.+12 "Mag.Atk.Bns."+12',}},
waist="Tempus Fugit +1",
right_ear="Enchntr. Earring +1",
left_ear="Loquac. Earring",
left_ring="Prolix Ring",
back={ name="Rudianos's Mantle", augments={'MND+20','Eva.+20 /Mag. Eva.+20','MND+10','"Fast Cast"+10','Spell interruption rate down-10%',}},
}
sets.precast.FC['Enhancing Magic'] = sets.precast.FC
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
left_ear="Zwazo Earring",
neck="Sanctity Necklace",
body="Sulevia's Plate. +2",
feet="Sulev. Leggings +2",
waist="Caudata Belt",
back={ name="Rudianos's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%',}},
}
sets.precast.WS.Acc = {
left_ear="Zwazo Earring",
neck="Sanctity Necklace",
body="Sulevia's Plate. +2",
feet="Sulev. Leggings +2",
waist="Caudata Belt",
back={ name="Rudianos's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%',}},
}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS,
{
neck={ name="Kgt. Beads +2", augments={'Path: A',}},
waist="Soil Belt",
})
sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS.Acc,
{
neck={ name="Kgt. Beads +2", augments={'Path: A',}},
waist="Soil Belt",
})
sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {ring1="Leviathan Ring",ring2="Aquasoul Ring"})
sets.precast.WS['Requiescat'].Acc = set_combine(sets.precast.WS.Acc, {ring1="Leviathan Ring"})
sets.precast.WS['Chant du Cygne'] = set_combine(sets.precast.WS, {hands="Buremte Gloves",waist="Zoran's Belt"})
sets.precast.WS['Chant du Cygne'].Acc = set_combine(sets.precast.WS.Acc, {waist="Zoran's Belt"})
sets.precast.WS['Sanguine Blade'] =
{
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Moonlight Necklace",
body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},
hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
back="Moonlight Cape",
}
sets.precast.WS['Atonement'] = {ammo="Iron Gobbet",
head="Reverence Coronet +1",neck=gear.ElementalGorget,ear1="Creed Earring",ear2="Steelflash Earring",
body="Reverence Surcoat +1",hands="Reverence Gauntlets +1",ring1="Rajas Ring",ring2="Vexer Ring",
back="Fierabras's Mantle",waist=gear.ElementalBelt,legs="Reverence Breeches +1",feet="Caballarius Leggings"}
--------------------------------------
-- Midcast sets
--------------------------------------
sets.midcast.FastRecast = {
ammo="Staunch Tathlum +1",
left_ear="Knightly Earring",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Moonlight Necklace",
legs={ name="Cab. Breeches +2", augments={'Enhances "Invincible" effect',}},
feet={ name="Odyssean Greaves", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Chance of successful block +2','"Fast Cast"+3','Mag. Acc.+12 "Mag.Atk.Bns."+12',}},
back={ name="Rudianos's Mantle", augments={'MND+20','Eva.+20 /Mag. Eva.+20','MND+10','"Fast Cast"+10','Spell interruption rate down-10%',}},
}
sets.midcast.Flash = set_combine(sets.Enmity, sets.midcast.FastRecast,
{
right_ear="Beatific Earring",
left_ring="Stikini Ring +1",
right_ring="Stikini Ring +1",
})
sets.midcast.Stun = sets.midcast.Flash
sets.midcast.Cure = set_combine(sets.Enmity,sets.midcast.FastRecast,{
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Odyssean Greaves", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Chance of successful block +2','"Fast Cast"+3','Mag. Acc.+12 "Mag.Atk.Bns."+12',}},
right_ear="Beatific Earring",
right_ring="Stikini Ring +1",
left_ring="Stikini Ring +1",
waist="Chuq'aba Belt",
})
sets.midcast['Enhancing Magic'] = set_combine(sets.Enmity,sets.midcast.FastRecast,{
right_ear="Beatific Earring",
left_ring="Stikini Ring +1",
right_ring="Stikini Ring +1",
})
sets.midcast.Protect = {right_ring="Sheltered Ring", left_ring="Stikini Ring +1",head={ name="Carmine Mask +1", augments={'Accuracy+20','Mag. Acc.+12','"Fast Cast"+4',}},}
sets.midcast.Shell = {right_ring="Sheltered Ring", left_ring="Stikini Ring +1",head={ name="Carmine Mask +1", augments={'Accuracy+20','Mag. Acc.+12','"Fast Cast"+4',}},}
--------------------------------------
-- Idle/resting/defense/etc sets
--------------------------------------
sets.Reraise = {}
sets.resting = {
neck="Coatl Gorget +1",
body="Vermillion Cloak",
left_ring="Star Ring",
right_ring="Star Ring",
}
sets.fashion = {
main="Excalibur",
sub="Ochain",
ammo="Staunch Tathlum +1",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Moonlight Necklace",
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Coatl Gorget +1",
waist="Chuq'aba Belt",
left_ear="Upsurge Earring",
right_ear="Impreg. Earring",
left_ring="Stikini Ring +1",
right_ring="Stikini Ring +1",
back="Aptitude Mantle +1",
}
-- Idle sets
sets.idle = {
ammo="Staunch Tathlum +1",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Coatl Gorget +1",
waist="Chuq'aba Belt",
left_ear="Upsurge Earring",
right_ear="Impreg. Earring",
left_ring="Stikini Ring +1", -- Magic skill +8 Refresh +1
right_ring="Stikini Ring +1", -- Magic skill +8 Refresh +1
back="Aptitude Mantle +1",
}
sets.idle.Town = {
main="Kaja Sword",
sub="Ochain",
ammo="Staunch Tathlum +1",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Coatl Gorget +1",
waist="Chuq'aba Belt",
left_ear="Upsurge Earring",
right_ear="Impreg. Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.idle.Weak = {
ammo="Staunch Tathlum +1",
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Coatl Gorget +1",
waist="Chuq'aba Belt",
left_ear="Upsurge Earring",
right_ear="Impreg. Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.idle.Weak.Reraise = set_combine(sets.idle.Weak, sets.Reraise)
sets.Kiting = {}
sets.latent_refresh = {}
--------------------------------------
-- Defense sets
--------------------------------------
-- Extra defense sets. Apply these on top of melee or defense sets.
sets.Knockback = {}
sets.MP = {}
sets.MP_Knockback = {}
-- If EquipShield toggle is on (Win+F10 or Win+F11), equip the weapon/shield combos here
-- when activating or changing defense mode:
sets.PhysicalShield = {sub="Ochain",} -- Ochain
sets.MagicalShield = {sub="Aegis",} -- Aegis
-- Basic defense sets.
sets.defense.PDT = {
neck={ name="Kgt. Beads +2", augments={'Path: A',}},
head={ name="Cab. Coronet +2", augments={'Enhances "Iron Will" effect',}},
body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},
hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},
legs={ name="Cab. Breeches +2", augments={'Enhances "Invincible" effect',}},
feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
waist="Flume Belt +1",
left_ring="Provocare Ring",
right_ring="Eihwaz Ring",
}
sets.defense.HP = {
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck={ name="Kgt. Beads +2", augments={'Path: A',}},
body={ name="Souv. Cuirass +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
waist="Flume Belt +1",
left_ring="Provocare Ring",
right_ring="Eihwaz Ring",
}
sets.defense.Reraise = {}
sets.defense.Charm = {}
sets.defense.Capacity = {
back="Aptitude Mantle +1",
}
-- To cap MDT with Shell IV (52/256), need 76/256 in gear.
-- Shellra V can provide 75/256, which would need another 53/256 in gear.
sets.defense.MDT = {sub="Aegis",}
--------------------------------------
-- Weapons
--------------------------------------
sets.weapons = {}
sets.weapons.KOTR = {main="Excalibur",}
sets.weapons.Savage = {main="Kaja Sword",}
--------------------------------------
-- Engaged sets
--------------------------------------
sets.engaged = {
ammo="Aurgelmir Orb +1",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +2",
hands="Sulev. Gauntlets +2",
legs="Sulev. Cuisses +2",
feet="Sulev. Leggings +2",
neck="Sanctity Necklace",
waist="Tempus Fugit +1",
left_ear="Mache Earring +1",
right_ear="Balder Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.engaged.Acc = {
ammo="Aurgelmir Orb +1",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +2",
hands="Sulev. Gauntlets +2",
legs="Sulev. Cuisses +2",
feet="Sulev. Leggings +2",
neck="Sanctity Necklace",
waist="Tempus Fugit +1",
left_ear="Mache Earring +1",
right_ear="Balder Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.engaged.DW = {
main="Kaja Sword",
main="Iztaasu +2",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +2",
hands="Sulev. Gauntlets +2",
legs="Sulev. Cuisses +2",
feet="Sulev. Leggings +2",
neck="Moonlight Necklace",
waist="Tempus Fugit +1",
left_ear="Mache Earring +1",
right_ear="Balder Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.engaged.DW.Acc = {
main="Kaja Sword",
main="Iztaasu +2",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +2",
hands="Sulev. Gauntlets +2",
legs="Sulev. Cuisses +2",
feet="Sulev. Leggings +2",
neck="Moonlight Necklace",
waist="Tempus Fugit +1",
left_ear="Mache Earring +1",
right_ear="Balder Earring",
left_ring="Moonlight Ring",
right_ring="Moonlight Ring",
back="Aptitude Mantle +1",
}
sets.engaged.PDT = set_combine(sets.engaged, {
neck={ name="Kgt. Beads +2", augments={'Path: A',}}, -- Tanking +10 Enimity VIT/MND +10
head={ name="Souv. Schaller +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},
hands={ name="Souv. Handsch. +1", augments={'HP+65','Shield skill +15','Phys. dmg. taken -4',}},
legs={ name="Souv. Diechlings +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
waist="Flume Belt +1",
})
sets.engaged.Acc.PDT = set_combine(sets.engaged.Acc, {
neck="Sanctity Necklace",
head={ name="Cab. Coronet +2", augments={'Enhances "Iron Will" effect',}},
body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},
hands={ name="Cab. Gauntlets +2", augments={'Enhances "Chivalry" effect',}},
legs={ name="Cab. Breeches +2", augments={'Enhances "Invincible" effect',}},
feet={ name="Cab. Leggings +2", augments={'Enhances "Guardian" effect',}},
back={ name="Rudianos's Mantle", augments={'HP+60','Eva.+20 /Mag. Eva.+20','VIT+10','Enmity+10','Damage taken-5%',}},
waist="Flume Belt +1",
})
sets.engaged.Reraise = set_combine(sets.engaged, sets.Reraise)
sets.engaged.Acc.Reraise = set_combine(sets.engaged.Acc, sets.Reraise)
sets.engaged.DW.PDT = set_combine(sets.engaged.DW, {})
sets.engaged.DW.Acc.PDT = set_combine(sets.engaged.DW.Acc, {})
sets.engaged.DW.Reraise = set_combine(sets.engaged.DW, sets.Reraise)
sets.engaged.DW.Acc.Reraise = set_combine(sets.engaged.DW.Acc, sets.Reraise)
--------------------------------------
-- Custom buff sets
--------------------------------------
sets.buff.Doom = {}
sets.buff.Cover = {body={ name="Cab. Surcoat +2", augments={'Enhances "Fealty" effect',}},}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_midcast(spell, action, spellMap, eventArgs)
-- If DefenseMode is active, apply that gear over midcast
-- choices. Precast is allowed through for fast cast on
-- spells, but we want to return to def gear before there's
-- time for anything to hit us.
-- Exclude Job Abilities from this restriction, as we probably want
-- the enhanced effect of whatever item of gear applies to them,
-- and only one item should be swapped out.
if state.DefenseMode.value ~= 'None' and spell.type ~= 'JobAbility' then
handle_equipping_gear(player.status)
eventArgs.handled = true
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Called when the player's status changes.
function job_state_change(field, new_value, old_value)
classes.CustomDefenseGroups:clear()
classes.CustomDefenseGroups:append(state.ExtraDefenseMode.current)
if state.EquipShield.value == true then
classes.CustomDefenseGroups:append(state.DefenseMode.current .. 'Shield')
end
classes.CustomMeleeGroups:clear()
classes.CustomMeleeGroups:append(state.ExtraDefenseMode.current)
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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)
update_defense_mode()
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
if state.Buff.Doom then
idleSet = set_combine(idleSet, sets.buff.Doom)
end
if state.CombatWeapon.value == 'KOTR' then
idleSet = set_combine(idleSet, sets.weapons.KOTR)
end
if state.CombatWeapon.value == 'Savage' then
idleSet = set_combine(idleSet, sets.weapons.Savage)
end
return idleSet
end
-- Modify the default melee set after it was constructed.
function customize_melee_set(meleeSet)
if state.Buff.Doom then
meleeSet = set_combine(meleeSet, sets.buff.Doom)
end
if state.CombatWeapon.value == 'KOTR' then
meleeSet = set_combine(meleeSet, sets.weapons.KOTR)
end
if state.CombatWeapon.value == 'Savage' then
meleeSet = set_combine(meleeSet, sets.weapons.Savage)
end
return meleeSet
end
function customize_defense_set(defenseSet)
if state.ExtraDefenseMode.value ~= 'None' then
defenseSet = set_combine(defenseSet, sets[state.ExtraDefenseMode.value])
end
if state.EquipShield.value == true then
defenseSet = set_combine(defenseSet, sets[state.DefenseMode.current .. 'Shield'])
end
if state.Buff.Doom then
defenseSet = set_combine(defenseSet, sets.buff.Doom)
end
if state.CombatWeapon.value == 'KOTR' then
defenseSet = set_combine(defenseSet, sets.weapons.KOTR)
end
if state.CombatWeapon.value == 'Savage' then
defenseSet = set_combine(defenseSet, sets.weapons.Savage)
end
return defenseSet
end
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.ExtraDefenseMode.value ~= 'None' then
msg = msg .. ', Extra: ' .. state.ExtraDefenseMode.value
end
if state.EquipShield.value == true then
msg = msg .. ', Force Equip Shield'
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
add_to_chat(122, msg)
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function update_defense_mode()
if player.equipment.main == 'Kaja Sword' and not classes.CustomDefenseGroups:contains('Kheshig Blade') then
classes.CustomDefenseGroups:append('Kaja Sword')
end
if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
if player.equipment.sub and not player.equipment.sub:contains('Shield') and
player.equipment.sub ~= 'Aegis' and player.equipment.sub ~= 'Ochain' then
state.CombatForm:set('DW')
else
state.CombatForm:reset()
end
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 == 'WAR' then
set_macro_page(4, 1)
elseif player.sub_job == 'DNC' then
set_macro_page(4, 2)
elseif player.sub_job == 'NIN' then
set_macro_page(4, 2)
else
set_macro_page(2, 2)
end
end
--[[ ******************************************************
Code that runs once, when we first swap to our PLD job
****************************************************** --]]
-- Puts on our fashion set, lockstyle it, then switch
-- to our idle set.
send_command('wait 1;gs equip fashion;wait 1;input /lockstyle on;wait 1;gs equip idle')
[+]
Necro Bump Detected!
[139 days between previous and next post]
Ragnarok.Obijam
Serveur: Ragnarok
Game: FFXI
Posts: 2
By Ragnarok.Obijam 2020-10-11 09:22:27
Just wanted to say thank you for posting this. Was exactly what i was looking for and worked perfectly.
Hi All,
Not sure if this question has been asked before, if there is something similar and I didn't see it, you can refer me to that thread. I'm no programmer so I'm struggling to alter the lua I ripped of the internet to do the following: -
1. Change weapon based on keystroke
This is what I added not sure what I am doing wrong (bold are what I added)
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
end
function user_setup()
state.OffenseMode:options('Normal', 'Acc')
state.HybridMode:options('Normal', 'PDT', 'Reraise')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.PhysicalDefenseMode:options('PDT', 'HP', 'Reraise', 'Charm')
state.MagicalDefenseMode:options('MDT', 'HP', 'Reraise', 'Charm')
state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MP', 'Knockback', 'MP_Knockback'}
state.CombatWeapon = M('KOTR','Savage')
state.EquipShield = M(false, 'Equip Shield w/Defense')
update_defense_mode()
-- Allows the use of Ctrl + ~ and Alt + ~ for 2 more macros of your choice.
send_command('bind !` input /ja "Intervene" <stnpc>') --Ctrl'~'
send_command('bind ^` input /ja "Invincible" <me>') --Alt'~'
send_command('bind ^f11 gs c cycle MagicalDefenseMode') --^ means ctrl
send_command('bind !f11 gs c cycle ExtraDefenseMode') -- ! means alt
send_command('bind @f1 gs c cycle CombatWeapon')
send_command('bind @f10 gs c toggle EquipShield') --@ means windows button
send_command('bind @f11 gs c toggle EquipShield')
select_default_macro_book()
end
function init_gear_sets()
--------------------------------------
-- Weapons
--------------------------------------
sets.weapon = {}
sets.weapon.KOTR = {main="Excalibur",}
sets.weapon.Savage = {main="Kaja Sword",}
end
-- Equip Weapon
function equip_weapon(weaponSet)
if state.weapon.value ~= 'KOTR' then
equip(sets.weapon.KOTR)
end
if state.weapon.value ~= 'Savage' then
equip(sets.weapon.Savage)
end
return weaponSet
end
Any help is greatly appreciated
--- Edited post to show what I did instead of the chunk --
|
|