Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- -- Setup functions for this job. Generally should not be modified.
- -------------------------------------------------------------------------------------------------------------------
- -- Initialization function for this job file.
- function get_sets()
- include('organizer-lib')
- 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.Hasso = buffactive.Hasso or false
- state.Buff.Seigan = buffactive.Seigan or false
- state.Buff.Sekkanoki = buffactive.Sekkanoki or false
- state.Buff.Sengikori = buffactive.Sengikori or false
- state.Buff['Meikyo Shisui'] = buffactive['Meikyo Shisui'] or false
- state.Buff['Aftermath'] = buffactive['Aftermath: Lv.1'] or
- buffactive['Aftermath: Lv.2'] or
- buffactive['Aftermath: Lv.3'] or false
- no_swap_gear = S{"Warp Ring", "Dim. Ring (Dem)", "Dim. Ring (Holla)", "Dim. Ring (Mea)",
- "Trizek Ring", "Echad Ring", "Facility Ring", "Capacity Ring"}
- include('Mote-TreasureHunter')
- state.TreasureMode:set('Tag')
- end
- -------------------------------------------------------------------------------------------------------------------
- -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
- -------------------------------------------------------------------------------------------------------------------
- -- Setup vars that are user-dependent.
- function user_setup()
- state.OffenseMode:options('Normal', 'Acc')
- state.HybridMode:options('Normal', 'PDT', 'Reraise')
- state.WeaponskillMode:options('Normal', 'Acc', 'Mod')
- state.PhysicalDefenseMode:options('PDT', 'Reraise')
- update_combat_form()
- -- Additional local binds
- send_command('bind ^` input /ja "Hasso" <me>')
- send_command('bind !` input /ja "Seigan" <me>')
- state.Auto_Kite = M(false, 'Auto_Kite')
- moving = false
- send_command('lua l gearinfo')
- 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
- function user_unload()
- send_command('lua u gearinfo')
- 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.Meditate = {head="Wakido Kabuto +1",
- hands="Sakonji Kote +3",
- back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}}
- sets.precast.JA['Warding Circle'] = {head="Wakido Kabuto +1"}
- sets.precast.JA['Blade Bash'] = {hands="Sakonji Kote +3"}
- sets.precast.JA['Meikyo Shisui'] = {feet="Sak. Sune-Ate +3"}
- -- Waltz set (chr and vit)
- sets.precast.Waltz = {}
- -- Don't need any special gear for Healing Waltz.
- sets.precast.Waltz['Healing Waltz'] = {}
- -- Weaponskill sets
- -- Default set for any weaponskill that isn't any more specifically defined
- sets.precast.WS = {ammo="Knobkierrie",
- head={ name="Nyame Helm", augments={'Path: B',}},
- body={ name="Sakonji Domaru +3", augments={'Enhances "Overwhelm" effect',}},
- hands="Kasuga Kote +3",
- legs="Hiza. Hizayoroi +2",
- feet={ name="Sak. Sune-Ate +3", augments={'Enhances "Meikyo Shisui" effect',}},
- neck={ name="Sam. Nodowa +2", augments={'Path: A',}},
- waist={ name="Sailfi Belt +1", augments={'Path: A',}},
- left_ear="Moonshade Earring",
- right_ear={ name="Kasuga Earring +1", augments={'System: 1 ID: 1676 Val: 0','Accuracy+12','Mag. Acc.+12','Weapon skill damage +2%',}},
- left_ring="Epaminondas's Ring",
- right_ring="Sroda Ring",
- back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}}
- -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
- sets.precast.WS['Tachi: Fudo'] = set_combine(sets.precast.WS, {})
- sets.precast.WS['Tachi: Fudo'].Acc = set_combine(sets.precast.WS.Acc, {})
- sets.precast.WS['Tachi: Fudo'].Mod = set_combine(sets.precast.WS['Tachi: Fudo'], {})
- sets.precast.WS['Tachi: Shoha'] = set_combine(sets.precast.WS, {})
- sets.precast.WS['Tachi: Shoha'].Acc = set_combine(sets.precast.WS.Acc, {})
- sets.precast.WS['Tachi: Shoha'].Mod = set_combine(sets.precast.WS['Tachi: Shoha'], {})
- sets.precast.WS['Tachi: Rana'] = set_combine(sets.precast.WS, {})
- sets.precast.WS['Tachi: Rana'].Acc = set_combine(sets.precast.WS.Acc, {})
- sets.precast.WS['Tachi: Rana'].Mod = set_combine(sets.precast.WS['Tachi: Rana'], {})
- sets.precast.WS['Tachi: Kasha'] = set_combine(sets.precast.WS, {})
- sets.precast.WS['Tachi: Gekko'] = set_combine(sets.precast.WS, {})
- sets.precast.WS['Tachi: Yukikaze'] = set_combine(sets.precast.WS, {})
- sets.precast.WS['Tachi: Ageha'] = set_combine(sets.precast.WS, {})
- sets.precast.WS['Tachi: Jinpu'] = set_combine(sets.precast.WS, {hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
- neck="Sanctity Necklace",
- waist="Eschan Stone",
- left_ear="Novio Earring",
- right_ear="Friomisi Earring"})
- -- Midcast Sets
- sets.midcast.FastRecast = {
- head="Yaoyotl Helm",
- body="Otronif Harness +1",hands="Otronif Gloves",
- legs="Phorcys Dirs",feet="Otronif Boots +1"}
- -- Sets to return to when not performing an action.
- -- Resting sets
- sets.resting = {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.Field = {ammo="Staunch Tathlum",
- head={ name="Nyame Helm", augments={'Path: B',}},
- body="Nyame Mail",
- hands={ name="Nyame Gauntlets", augments={'Path: B',}},
- legs={ name="Nyame Flanchard", augments={'Path: B',}},
- feet="Nyame Sollerets",
- neck="Bathy Choker",
- waist="Plat. Mog. Belt",
- left_ear="Eabani Earring",
- right_ear="Odnowa Earring +1",
- left_ring="Shneddick Ring",
- right_ring="Paguroidea Ring",
- back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}}
- sets.idle.Town = set_combine(sets.idle.Field, {})
- sets.idle.Weak = set_combine(sets.idle.Field, {})
- -- Defense sets
- sets.defense.PDT = { }
- sets.defense.Reraise = {}
- sets.defense.MDT = {}
- sets.Kiting = {left_ring="Shneddick Ring"}
- sets.Reraise = {head="Twilight Helm",body="Twilight Mail"}
- -- 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
- -- Delay 450 GK, 25 Save TP => 65 Store TP for a 5-hit (25 Store TP in gear)
- sets.engaged = { ammo="Aurgelmir Orb +1",
- head="Kasuga Kabuto +2",
- body="Kasuga Domaru +2",
- hands="Wakido Kote +2",
- legs="Kasuga Haidate +2",
- feet="Kas. Sune-Ate +2",
- neck="Sam. Nodowa +2",
- waist="Sweordfaetels +1",
- left_ear="Telos Earring",
- right_ear="Kasuga Earring +1",
- left_ring="Niqmaddu Ring",
- right_ring="Chirich Ring +1",
- back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},}
- sets.engaged.Acc = set_combine(sets.engaged, {ammo="Ginsen",
- waist="Ioskeha Belt"})
- sets.engaged.PDT = set_combine(sets.engaged, {})
- sets.engaged.Acc.PDT = set_combine(sets.engaged.PDT, {})
- sets.engaged.Reraise = {}
- sets.buff.Sekkanoki = {hands="Kasuga Kote +2"}
- sets.buff.Sengikori = {feet="Kasuga Sune-ate +"}
- sets.buff['Meikyo Shisui'] = {feet="Sak. Sune-Ate +3"}
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Job-specific hooks for standard casting events.
- -------------------------------------------------------------------------------------------------------------------
- -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
- function job_pretarget(spell, action, spellMap, eventArgs)
- if spell.type == 'WeaponSkill' then
- -- Change any GK weaponskills to polearm weaponskill if we're using a polearm.
- if player.equipment.main=='Quint Spear' or player.equipment.main=='Quint Spear' then
- if spell.english:startswith("Tachi:") then
- send_command('@input /ws "Impulse Drive" '..spell.target.raw)
- eventArgs.cancel = true
- end
- end
- end
- end
- -- Run after the default precast() is done.
- -- eventArgs is the same one used in job_precast, in case information needs to be persisted.
- function job_post_precast(spell, action, spellMap, eventArgs)
- if spell.type:lower() == 'weaponskill' then
- if state.Buff.Sekkanoki then
- equip(sets.buff.Sekkanoki)
- end
- if state.Buff.Sengikori then
- equip(sets.buff.Sengikori)
- end
- if state.Buff['Meikyo Shisui'] then
- equip(sets.buff['Meikyo Shisui'])
- end
- end
- end
- -- Run after the default midcast() is done.
- -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
- function job_post_midcast(spell, action, spellMap, eventArgs)
- -- Effectively lock these items in place.
- if state.HybridMode.value == 'Reraise' or
- (state.DefenseMode.value == 'Physical' and state.PhysicalDefenseMode.value == 'Reraise') then
- equip(sets.Reraise)
- end
- 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_combat_form()
- end
- -- Set eventArgs.handled to true if we don't want the automatic display to be run.
- function display_current_job_state(eventArgs)
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Utility functions specific to this job.
- -------------------------------------------------------------------------------------------------------------------
- function update_combat_form()
- if areas.Adoulin:contains(world.area) and buffactive.ionis then
- state.CombatForm:set('Adoulin')
- else
- state.CombatForm:reset()
- 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(1, 2)
- end
- end
- -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
- function job_pretarget(spell, action, spellMap, eventArgs)
- end
- -- 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)
- end
- function precast(spell,abil)
- --equips favorite weapon if disarmed
- if player.equipment.main == "empty" or player.equipment.sub == "empty" then
- equip({main="Masamune",
- sub="Utu Grip"})
- end
- end
- -- Run after the default aftercast() is done.
- -- eventArgs is the same one used in job_aftercast, in case information needs to be persisted.
- function job_post_aftercast(spell, action, spellMap, eventArgs)
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Job-specific hooks for non-casting events.
- -------------------------------------------------------------------------------------------------------------------
- -- Called when the player's status changes.
- function job_status_change(newStatus, oldStatus, eventArgs)
- update_combat_weapon()
- update_melee_groups()
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Utility functions specific to this job.
- -------------------------------------------------------------------------------------------------------------------
- -- 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 buff == "Aftermath: Lv.3" or buff == "Aftermath" then
- classes.CustomMeleeGroups:clear()
- if (buff == "Aftermath: Lv.3" and gain) or buffactive["Aftermath: Lv.3"] then
- if player.equipment.main == "Kogarasumaru" then
- classes.CustomMeleeGroups:append('AM3')
- if gain then
- send_command('timers create "Aftermath: Lv.3" 180 down;wait 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
- else
- send_command('timers delete "Aftermath: Lv.3"')
- add_to_chat(123,'AM3: [OFF]')
- end
- end
- end
- if (buff == "Aftermath" and gain) or buffactive.Aftermath then
- if player.equipment.main == "Kogarasumaru" and state.HybridMode.value == 'PDT' then
- classes.CustomMeleeGroups:append('AM')
- end
- end
- end
- if buff == "Aftermath: Lv.3" or buff == "Aftermath" then
- handle_equipping_gear(player.status)
- end
- if buff == "sleep" and gain and player.hp > 200 and player.status == "Engaged" then
- equip({head="Vim Torque +1"})
- else
- handle_equipping_gear(player.status)
- end
- end
- -- Called by the 'update' self-command, for common needs.
- -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
- function job_update(cmdParams, eventArgs)
- update_combat_weapon()
- update_melee_groups()
- end
- -- Set eventArgs.handled to true if we don't want the automatic display to be run.
- function display_current_job_state(eventArgs)
- local msg = 'Melee'
- if state.CombatForm.has_value then
- msg = msg .. ' (' .. state.CombatForm.value .. ')'
- end
- if state.CombatWeapon.has_value then
- msg = msg .. ' (' .. state.CombatWeapon.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
- add_to_chat(122, msg)
- eventArgs.handled = true
- end
- function customize_idle_set(idleSet)
- if state.Auto_Kite.value == true then
- idleSet = set_combine(idleSet, sets.Kiting)
- end
- return idleSet
- end
- function job_handle_equipping_gear(playerStatus, eventArgs)
- check_gear()
- check_moving()
- end
- function job_update(cmdParams, eventArgs)
- handle_equipping_gear(player.status)
- end
- -- Select default macro book on initial load or subjob change.
- function select_default_macro_book()
- set_macro_page(1, 5)
- end
- function update_combat_weapon()
- state.CombatWeapon:set(player.equipment.main)
- end
- function update_melee_groups()
- classes.CustomMeleeGroups:clear()
- if buffactive['Aftermath: Lv.3'] and player.equipment.main == "Kogarasumaru" then
- classes.CustomMeleeGroups:append('AM3')
- end
- if buffactive.Aftermath and player.equipment.main == "Apocalypse" and state.HybridMode.value == 'PDT' then
- classes.CustomMeleeGroups:append('AM')
- end
- end
- function is_sc_element_today(spell)
- if spell.type ~= 'WeaponSkill' then
- return
- end
- local weaponskill_elements = S{}:
- union(skillchain_elements[spell.skillchain_a]):
- union(skillchain_elements[spell.skillchain_b]):
- union(skillchain_elements[spell.skillchain_c])
- if weaponskill_elements:contains(world.day_element) then
- return true
- else
- return false
- end
- end
- function job_self_command(cmdParams, eventArgs)
- gearinfo(cmdParams, eventArgs)
- end
- function gearinfo(cmdParams, eventArgs)
- if cmdParams[1] == 'gearinfo' then
- if type(cmdParams[4]) == 'string' then
- if cmdParams[4] == 'true' then
- moving = true
- elseif cmdParams[4] == 'false' then
- moving = false
- end
- end
- if not midaction() then
- job_update()
- end
- end
- end
- function check_moving()
- if state.DefenseMode.value == 'None' and state.Kiting.value == false then
- if state.Auto_Kite.value == false and moving then
- state.Auto_Kite:set(true)
- elseif state.Auto_Kite.value == true and moving == false then
- state.Auto_Kite:set(false)
- end
- end
- end
- function check_gear()
- if no_swap_gear:contains(player.equipment.left_ring) then
- disable("ring1")
- else
- enable("ring1")
- end
- if no_swap_gear:contains(player.equipment.right_ring) then
- disable("ring2")
- else
- enable("ring2")
- end
- end
- windower.register_event('zone change',
- function()
- if no_swap_gear:contains(player.equipment.left_ring) then
- enable("ring1")
- equip(sets.idle)
- end
- if no_swap_gear:contains(player.equipment.right_ring) then
- enable("ring2")
- equip(sets.idle)
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement