Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------------------------------------
- -- An example of setting up user-specific global handling of certain events.
- -- This is for personal globals, as opposed to library globals.
- ------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------------------------------
- -- Job-specific hooks for standard casting events.
- -------------------------------------------------------------------------------------------------------------------
- function user_job_precast(spell, action, spellMap, eventArgs)
- custom_aftermath_timers_precast(spell)
- end
- function user_post_precast(spell, action, spellMap, eventArgs)
- if spell.type == 'WeaponSkill' then
- if is_sc_element_today(spell) or is_sc_element_weather(spell) then
- equip({neck="Fotia Gorget", waist="Fotia Belt"})
- end
- send_command('wait 0.2;gs c TP')
- end
- end
- function user_post_midcast(spell, action, spellMap, eventArgs)
- if spell.skill == 'Elemental Magic' then
- if spell.element == world.day_element or spell.element == world.weather_element then
- equip({back="Twilight Cape", waist="Hachirin-no-Obi"})
- end
- elseif spell.skill == 'Healing Magic' then
- if spell.english:startswith('Cure') and world.day_element == 'Light' or world.weather_element == 'Light' then
- equip({waist="Hachirin-no-Obi"})
- end
- end
- end
- function user_job_aftercast(spell, action, spellMap, eventArgs)
- custom_aftermath_timers_aftercast(spell)
- end
- -------------------------------------------------------------------------------------------------------------------
- -- User code that supplements standard library decisions.
- -------------------------------------------------------------------------------------------------------------------
- ------------------------------------------------------------------------------
- -- You must have an OffenseMode option:'Capacity' for the following to work.
- -- Ex. state.OffenseMode:options('Normal', 'Acc', 'Capacity')
- ------------------------------------------------------------------------------
- function user_customize_idle_set(idleSet)
- if state.OffenseMode.value == 'Capacity' then
- idleSet = set_combine(idleSet, {back="Mecisto. Mantle"})
- end
- return idleSet
- end
- function user_customize_melee_set(meleeSet)
- if state.OffenseMode.value == 'Capacity' then
- meleeSet = set_combine(meleeSet, {back="Mecisto. Mantle"})
- end
- return meleeSet
- end
- function user_customize_defense_set(defenseSet)
- if state.OffenseMode.value == 'Capacity' then
- defenseSet = set_combine(defenseSet, {back="Mecisto. Mantle"})
- end
- return defenseSet
- end
- -------------------------------------------------------------------------------------------------------------------
- -- User code that supplements self-commands.
- -------------------------------------------------------------------------------------------------------------------
- -- Called for custom player commands.
- function user_job_self_command(cmdParams, eventArgs)
- if cmdParams[1]:lower() == 'tp' then
- add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
- end
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Utility specific functions.
- -------------------------------------------------------------------------------------------------------------------
- function is_sc_element_today(spell) -- Returns true if WS-element matches day-element. Otherwise returns false.
- 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 is_sc_element_weather(spell) -- Returns true if WS-element matches weather-element. Otherwise returns false.
- 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.weather_element) then
- return true
- else
- return false
- end
- end
- -----------------------------------------------------------
- -- Test function to use to avoid modifying library files.
- -----------------------------------------------------------
- function user_test(params)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement