Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- -- Initialization function that defines sets and variables to be used.
- -------------------------------------------------------------------------------------------------------------------
- -- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
- -- Initialization function for this job file.
- function get_sets()
- -- Load and initialize the include file.
- include('Mote-Include.lua')
- end
- -- Setup vars that are user-independent.
- function job_setup()
- state.Buff['Afflatus Solace'] = buffactive['afflatus solace'] or false
- end
- -- Setup vars that are user-dependent. Can override this function in a sidecar file.
- function user_setup()
- -- Options: Override default values
- options.OffenseModes = {'None', 'Normal'}
- options.DefenseModes = {'Normal'}
- options.WeaponskillModes = {'Normal'}
- options.CastingModes = {'Normal', 'Resistant', 'Dire'}
- options.IdleModes = {'Normal', 'PDT'}
- options.RestingModes = {'Normal'}
- options.PhysicalDefenseModes = {'PDT'}
- options.MagicalDefenseModes = {'MDT'}
- state.Defense.PhysicalMode = 'PDT'
- state.OffenseMode = 'None'
- -- Default macro set/book
- set_macro_page(1, 1)
- end
- -- Called when this job file is unloaded (eg: job change)
- function file_unload()
- if binds_on_unload then
- binds_on_unload()
- end
- end
- -- Define sets and vars used by this job file.
- function init_gear_sets()
- --------------------------------------
- -- Start defining the sets
- --------------------------------------
- -- Precast Sets
- -- Fast cast sets for spells
- sets.precast.FC = {main="Arka IV",sub="Curatio Grip",ammo="Incantor Stone",head="Nahtirah Hat",neck="Orison Locket",ear1="Loquacious Earring",hands="Gendewitha Gages",back="Swith Cape",legs="Orison Pantaloons +2",ear2="Magnetic earring"}
- sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
- sets.precast.FC['Healing Magic'] = set_combine(sets.precast.FC, {legs="Orison Pantaloons +2"})
- sets.precast.FC.StatusRemoval = sets.precast.FC['Healing Magic']
- sets.precast.FC.Cure = set_combine(sets.precast.FC['Healing Magic'], {main="Arka IV",sub="Curato Grip",ammo="Incantor Stone"})
- sets.precast.FC.Curaga = sets.precast.FC.Cure
- -- Precast sets to enhance JAs
- sets.precast.JA.Benediction = {body="Piety Briault"}
- -- Weaponskill sets
- -- Default set for any weaponskill that isn't any more specifically defined
- gear.default.weaponskill_neck = "Asperity Necklace"
- gear.default.weaponskill_waist = "Cetl Belt"
- sets.precast.WS = {head="Espial cap",neck="Breeze Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",body="Sublime Breastplate",hands="Espial bracers",ring1="Rajas Ring",ring2="K'ayres Ring",back="Blithe mantle",waist="Cetl Belt",legs="Espial hose",feet="Espial socks"}
- -- Midcast Sets
- sets.midcast.FastRecast = {main="Arka IV",sub="Curatio Grip",head="Nahtirah Hat",ear2="Loquacious Earring",back="Swith Cape",waist="Goading Belt",feet="Gendewitha Galoshes"}
- -- Cure sets
- gear.default.obi_waist = "Witful Belt"
- gear.default.obi_back = "Gwyddion's Cape"
- sets.midcast.Cure = {main="Arka IV",sub="Curatio Grip",ammo="Incantor Stone",head="Theophany Cap",neck="Orison Locket",ear1="Lifestorm Earring",ear2="Magnetic Earring",body="Theophany Briault",hands="Theophany Mitts",ring1="Ephedra Ring",ring2="Sirona's Ring",back="Gwyddion's Cape",waist="Witful Belt",legs="Orison Pantaloons +2",feet="Piety Duckbills"}
- sets.midcast.Curaga = {main="Arka IV",sub="Curatio Grip",ammo="Incantor Stone",head="Theophany Cap",neck="Orison Locket",ear1="Lifestorm Earring",ear2="Magnetic Earring",body="Heka's Kalasiris",hands="Theophany Mitts",ring1="Ephedra Ring",ring2="Sirona's Ring",back="Gwyddion's Cape",waist="Witful Belt",legs="Orison Pantaloons +2",feet="Piety Duckbills"}
- sets.midcast.CureMelee = {main="Arka IV",sub="Curatio Grip",ammo="Incantor Stone",head="Theophany Cap",neck="Orison Locket",ear1="Lifestorm Earring",ear2="Magnetic Earring",body="Theophany Briault",hands="Bokwus Gloves",ring1="Ephedra Ring",ring2="Sirona's Ring",back="Gwyddion's Cape",waist="Witful Belt",legs="Orison Pantaloons +2",feet="Piety Duckbills"}
- sets.midcast.Cursna = {legs="Theophany pantaloons",feet="Gendewitha Galoshes",back="Mending cape",ear2="Magnetic earring"}
- sets.midcast.StatusRemoval = {
- head="Orison Cap +2",legs="Orison Pantaloons +2"}
- -- 110 total Enhancing Magic Skill; caps even without Light Arts
- sets.midcast['Enhancing Magic'] = {main="Beneficus",ear2="Magnetic earring",body="Theophany Briault",legs="Piety Pantaloons", feet="Orison Duckbills +2"}
- sets.midcast.Stoneskin = {ear2="Magnetic earring",waist="Siegel Sash"}
- sets.midcast.Auspice = {feet="Orison Duckbills +2"}
- sets.midcast.BarElement = {main="Beneficus",ear2="Magnetic earring",legs="Piety Pantaloons", feet="Orison Duckbills +2"}
- sets.midcast.Regen = {head="Marduk's Tiara +1",ear2="Magnetic earring",body="Piety Briault",hands="Orison Mitts +2",legs="Theophany Pantaloons"}
- sets.midcast.Protectra = {feet="Piety Duckbills"}
- sets.midcast.Shellra = {legs="Piety Pantaloons"}
- -- Custom spell classes
- sets.midcast.MndEnfeebles = {sub="Mephitis Grip",head="Theophany Cap",neck="Enfeebling Torque",ear1="Loquac. Earring",hands="Bokwus Gloves",legs="Piety Pantaloons",ear2="Magnetic earring",feet="Uk'uxkaj Boots"}
- -- Sets to return to when not performing an action.
- -- Resting sets
- sets.resting = {main="Dark Staff",body="Piety Briault",hands="Tethyan Cuffs",feet="Avocat Pigaches"}
- -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
- sets.idle = {main="Arka IV",sub="Curatio Grip",body="Piety Briault",ear1="Moonshade Earring"}
- -- Defense sets
- sets.defense.PDT = {}
- sets.defense.MDT = {}
- -- 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
- -- Basic set for if no TP weapon is defined.
- sets.engaged = {main="Mjollnir",sub="Sors shield",body="Sublime Breastplate",neck="Asperity Necklace",waist="Cetl Belt",legs="Espial Hose",hands="Espial Bracers",ear1="Bladeborn Earring",ear2="Steelflash Earring",feet="Espial Socks",ring1="Rajas ring",ring2="K'ayres ring",head="Espial Cap",back="Blithe Mantle"}
- -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
- sets.buff['Divine Caress'] = {hands="Orison Mitts +2",back="Mending Cape"}
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Job-specific hooks that are called to process player actions at specific points in time.
- -------------------------------------------------------------------------------------------------------------------
- -- 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 spell.english == "Paralyna" and buffactive.Paralyzed then
- -- no gear swaps if we're paralyzed, to avoid blinking while trying to remove it.
- eventArgs.handled = true
- 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)
- if spell.action_type == 'Magic' then
- -- Default base equipment layer of fast recast.
- equip(sets.midcast.FastRecast)
- end
- end
- function job_post_midcast(spell, action, spellMap, eventArgs)
- -- Apply Divine Caress boosting items as highest priority over other gear, if applicable.
- if spellMap == 'StatusRemoval' and buffactive['Divine Caress'] then
- equip(sets.buff['Divine Caress'])
- end
- end
- -- Return true if we handled the aftercast work. Otherwise it will fall back
- -- to the general aftercast() code in Mote-Include.
- function job_aftercast(spell, action, spellMap, eventArgs)
- if not spell.interrupted then
- if state.Buff[spell.name] ~= nil then
- state.Buff[spell.name] = true
- elseif spell.name == "Afflatus Misery" then
- state.Buff['Afflatus Solace'] = false
- end
- end
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Customization hooks for idle and melee sets, after they've been automatically constructed.
- -------------------------------------------------------------------------------------------------------------------
- -- Custom spell mapping.
- function job_get_spell_map(spell, default_spell_map)
- if spell.action_type == 'Magic' then
- if (default_spell_map == 'Cure' or default_spell_map == 'Curaga') and player.status == 'Engaged' then
- return "CureMelee"
- elseif default_spell_map == 'Cure' and state.Buff['Afflatus Solace'] then
- return "CureSolace"
- elseif spell.skill == "Enfeebling Magic" then
- if spell.type == "WhiteMagic" then
- return "MndEnfeebles"
- else
- return "IntEnfeebles"
- end
- end
- end
- end
- -------------------------------------------------------------------------------------------------------------------
- -- General hooks for other 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
- state.Buff[buff] = gain
- end
- end
- -------------------------------------------------------------------------------------------------------------------
- -- User code that supplements self-commands.
- -------------------------------------------------------------------------------------------------------------------
- -- Called by the 'update' self-command.
- function job_update(cmdParams, eventArgs)
- if cmdParams[1] == 'user' and not areas.Cities:contains(world.area) then
- local needsArts =
- player.sub_job:lower() == 'sch' and
- not buffactive['Light Arts'] and
- not buffactive['Addendum: White'] and
- not buffactive['Dark Arts'] and
- not buffactive['Addendum: Black']
- if not buffactive['Afflatus Solace'] and not buffactive['Afflatus Misery'] then
- if needsArts then
- send_command('@input /ja "Afflatus Solace" <me>;wait 1.2;input /ja "Light Arts" <me>')
- else
- send_command('@input /ja "Afflatus Solace" <me>')
- end
- end
- end
- end
- -- Handle notifications of general user state change.
- function job_state_change(stateField, newValue)
- if stateField == 'OffenseMode' then
- if newValue == 'Normal' then
- disable('main','sub')
- else
- enable('main','sub')
- end
- elseif stateField == 'Reset' then
- if state.OffenseMode == 'None' then
- enable('main','sub')
- end
- end
- 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 defenseString = ''
- if state.Defense.Active then
- local defMode = state.Defense.PhysicalMode
- if state.Defense.Type == 'Magical' then
- defMode = state.Defense.MagicalMode
- end
- defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
- end
- local meleeString = ''
- if state.OffenseMode == 'Normal' then
- meleeString = 'Melee: Weapons locked, '
- end
- eventArgs.handled = true
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Utility functions specific to this job.
- -------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement