Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Blank Gearswap
- Save as Character_Job.lua in the data folder and the gearswap will load automatically when the Character / Job match.
- Green text is commented out and will have no effect on the code command structure.
- --Template from Kanryu of Ragnarok - Update v2.3 - 12/27/2017
- ]]
- --!!INIT!!--
- --Functions and Misc Commands that are set to execute when you first put on the job. This includes swaps to the right macro pages and job specific addons.
- res = require('resources')
- --Enable All--
- send_command('gs enable all')
- --Enables all gearslots after job change.
- --Set Macro Information and Lockstyle--
- send_command('input /macro book XX; wait .1;input /macro set YY;')
- --Set XX to the job's macro book, YY to the page, and ZZZ to your lockstyleset if desired.
- --Command Aliases-- Any custom commands for Windower should be put into this section.
- send_command('alias cp gs c cp') --CP Cape Lock
- send_command('alias dt gs c dt') --DT Trigger
- send_command('alias hyb gs c hyb') --Hybrid Trigger
- send_command('alias style gs c style') --Hybrid Trigger
- --Main()--
- function get_sets()
- --Variable Triggers--
- CPTrigger = 0
- --Sets CP Cape Lock setting to false on load. See Custom Command Engine located in self_command() for examples of variable usage.
- DTTrigger = 0
- --Sets PDT gear trigger to false on load.
- HybridTrigger = 0
- --Sets Hybrid gear trigger to false on load.
- --This section is for custom variables to be created and defined.--
- --Idle Sets--
- sets.Idle = {}
- --All set categories must be defined by a blank set before subsets can be created.
- --Standard Idle Set--
- sets.Idle.Standard = {
- main = "",
- sub = "",
- ranged = "",
- ammo = "",
- head = "",
- neck = "",
- lear = "",
- rear = "",
- body = "",
- hands = "",
- lring = "",
- rring = "",
- waist = "",
- legs = "",
- feet = "",
- }
- --DT Idle Set--
- sets.Idle.DT = set_combine(sets.Idle.Standard, {
- neck = "",
- body = "",
- lring = "",
- rring = "",
- })
- --Combines DT with the standard idle set. Only add pieces that actually change.
- --TP Sets--
- --Typically weapons are not included in these sets. You should not be changing weapons in jobs that use TP gearsets.--
- sets.engaged = {}
- --Standard TP Set--
- sets.engaged.Standard = {
- ammo = "",
- head = "",
- neck = "",
- lear = "",
- rear = "",
- body = "",
- hands = "",
- lring = "",
- rring = "",
- waist = "",
- legs = "",
- feet = "",
- }
- --DT Hybrid Set--
- sets.engaged.Hybrid = {
- ammo = "",
- head = "",
- neck = "",
- lear = "",
- rear = "",
- body = "",
- hands = "",
- lring = "",
- rring = "",
- waist = "",
- legs = "",
- feet = "",
- }
- --FullDT TP Set--
- sets.engaged.DT = {
- ammo = "",
- head = "",
- neck = "",
- lear = "",
- rear = "",
- body = "",
- hands = "",
- lring = "",
- rring = "",
- waist = "",
- legs = "",
- feet = "",
- }
- --Weaponskill Sets--
- sets.WS = {}
- sets.WS.Moonshade = S{'Weaponskill_Name',}
- --Add Moonshade Earring weaponskills to this list.
- --Default Generic WS Set--
- sets.WS.Standard = {
- ammo = "",
- head = "",
- neck = "",
- lear = "",
- rear = "",
- body = "",
- hands = "",
- lring = "",
- rring = "",
- waist = "",
- legs = "",
- feet = "",
- }
- --'WS Name' Set--
- sets.WS['WS_Name'] = {
- ammo = "",
- head = "",
- neck = "",
- lear = "",
- rear = "",
- body = "",
- hands = "",
- lring = "",
- rring = "",
- waist = "",
- legs = "",
- feet = "",
- }
- --Job Ability Sets--
- --[[Job Ability sets can be split into two categories, required when the JA is used or required when the JA is consumed.
- Relic 2 hr duration pieces are an example of pieces equipped when the JA is used. These types of gear are used in JA precast.
- Burst Affinity pieces are an example of pieces of that must be equipped when the JA is consumed.
- The second type of gear are triggered depending on their effects, like when casting a BLU spell in our Burst Affinity example.]]--
- sets.JA = {}
- --'Job Ability' Set--
- sets.JA['JA_Name'] = {
- body = "",
- }
- --Spell Sets--
- --[[Spellcasting Sets are split into two pieces; precast and midcast.
- Precast includes quick magic or fast cast gear.
- Midcast is the gear that you want to ultimately use when you complete the spell.]]--
- --Precast Sets--
- sets.precast = {}
- --Default FC Set--
- sets.precast.FC = {
- ammo = "",
- head = "",
- neck = "",
- lear = "",
- rear = "",
- body = "",
- hands = "",
- lring = "",
- rring = "",
- waist = "",
- legs = "",
- feet = "",
- }
- --'Magic Type' or 'Spell' Set--
- sets.precast['Spell or SpellType'] = {
- ammo = "",
- head = "",
- neck = "",
- lear = "",
- rear = "",
- body = "",
- hands = "",
- lring = "",
- rring = "",
- waist = "",
- legs = "",
- feet = "",
- }
- --Midcast Sets--
- sets.midcast = {}
- --Midcast sets are unique to the spell or type of magic being cast. A default set is not available.--
- sets.midcast['Spell or SpellType'] = {
- ammo = "",
- head = "",
- neck = "",
- lear = "",
- rear = "",
- body = "",
- hands = "",
- lring = "",
- rring = "",
- waist = "",
- legs = "",
- feet = "",
- }
- end
- --Precast Core--
- function precast(spell, action)
- --[[This function determine what pre-cast function to use for a specific action.
- This section can be fully populated in place of the sub-type precast section, however it does help
- with organization and debugging if they are separated.]]--
- --Magic Precast Handler--
- if spell.action_type == 'Magic' then
- precast_magic(spell)
- end
- --Job Ability Precast Handler--
- if spell.type == 'JobAbility' then
- precast_ja(spell)
- end
- --Weapon Skill Precast Handler--
- if spell.type == "WeaponSkill" then
- precast_weaponskill(spell)
- end
- end
- --Midcast Core--
- function midcast(spell, action)
- --[[This function determine what midcast function to use for a specific action.
- This section can be fully populated in place of the sub-type midcast section, however it does help
- with organization and debugging if they are separated.]]--
- --Magic Precast Handler--
- if spell.action_type == 'Magic' then
- midcast_magic(spell)
- end
- --Post Midcast--
- postmidcast(spell)
- --Executes post midcast function as the last resort in midcast. Helps overwride spell sets such as perpetuance gloves or obi.
- end
- --Post Midcast Core--
- function postmidcast(spell, action)
- --[[This function controls the equiping of Hachi Obi for Nukes.
- This function can be replicated for other spells using different magic types if required (Dark, Healing, Blue, etc).]]--
- if spell.skill == 'Elemental Magic' and spell.element == world.day_element or spell.element == world.weather_element then
- equip({waist="Hachirin-No-Obi"})
- end
- end
- --Aftercast Core--
- function aftercast(spell, action)
- --[[Aftercast core determines what aftercast process should be run to return to idle gear after performing an action.
- This section can be fully populated in place of the sub-type aftercast section, however it does help with
- organization and debugging if they are separated.]]--
- --Aftercast Function Trigger--
- if player.status == "Engaged" then
- aftercast_engaged()
- else
- aftercast_idle()
- end
- --Zone specific gear handling data call.
- local info = windower.ffxi.get_info()
- local zone = res.zones[info.zone].name
- --Replicate this section for each zone specific piece of gear.
- if zone:match('San d\'Oria') and not zone:match('Dynamis') then
- equip({body = "Kingdom Aketon"})
- end
- --Replicate this section for each zone specific piece of gear. Adoulin example.
- if zone:match('Adoulin') then
- equip({body = "Councilor's Garb"})
- end
- end
- --Custom Command Engine--
- function self_command(command)
- --DT Trigger--
- if command == 'dt' then
- if DTTrigger == 1 then
- add_to_chat(170, 'DT Toggled - Max Damage')
- DTTrigger = 0
- else
- add_to_chat(170, 'DT Toggled - Max DT')
- DTTrigger = 1
- end
- end
- --Enables DT mode so that TP and Idle sets swap to damage taken gear.--
- --Hybrid Trigger--
- if command == 'hyb' then
- if HybridTrigger == 1 then
- if DTTrigger == 1 then
- add_to_chat(170, 'Hybrid Toggled - Max Damage TP Restored (DT Override On)')
- HybridTrigger = 0
- else
- add_to_chat(170, 'Hybrid Toggled - Max Damage TP Restored')
- HybridTrigger = 0
- end
- else
- if DTTrigger == 1 then
- add_to_chat(170, 'Hybrid Toggled - Hybrid TP / DT Set Enabled (DT Override On)')
- HybridTrigger = 1
- else
- add_to_chat(170, 'Hybrid Toggled - Hybrid TP / DT Set Enabled')
- HybridTrigger = 1
- end
- end
- end
- --Enables Hybrid mode so that TP and Idle sets swap to hybrid DD (PDT + DD mix) gear.--
- --CP Cape Lock--
- if command == 'cp' then
- if CPTrigger == 1 then
- enable('back')
- add_to_chat(170, 'CP Cape Released')
- CPTrigger = 0
- else
- equip({back="Mecisto. Mantle"})
- disable('back')
- add_to_chat(170, 'CP Cape Locked')
- CPTrigger = 1
- end
- end
- --Locks Mechisto Manel on for CP parties. Replace mantle with Aptitude if you don't have Mechisto.
- --Lockstyle Command--
- if command == 'style' then
- style()
- end
- --Runs the lockstyle function.
- end
- --Subfunction for Magic Precast--
- function precast_magic(spell, action)
- --Enhancing Magic--
- if spell.skill == "Enhancing Magic" then
- equip(sets.precast['Enhancing Magic'])
- --Using Enhancing Magic as an example.
- --Enfeebling Magic--
- elseif spell.skill == "Enfeebling Magic" then
- equip(sets.precast['Enfeebling Magic'])
- --Using Enfeebling Magic as an example.
- else
- equip(sets.precast.FC)
- end
- end
- --Subfunction for Job Ability Precast--
- function precast_ja(spell, action)
- if spell.skill == "JA Name" then
- equip(sets.JA['JA_Name'])
- end
- --This trigger should be populated for each JA that has gear sets that are required on-use. Ex. 2-hr extension gear.
- end
- --Subfunction for Weaponskill Precast--
- function precast_weaponskill(spell, action)
- if spell.english == "WS_Name" then
- equip(sets.WS['WS_Name'])
- --Example of a weaponskill trigger.
- elseif spell.english == "WS_Name2" then
- equip(sets.WS['WS_Name2'])
- else
- equip(sets.WS.Standard)
- end
- if sets.WS.Moonshade:contains(spell.english) and player.tp < 2750 then
- equip({lear = 'Moonshade Earring'})
- end
- --Equip Moonshade Earring if the weaponskill benefits from it and the player has less than 2750 TP.
- --Additional rules will be required if +TP Bonus weapons are used.
- end
- --Subfunction for Midcast Magic--
- function midcast_magic(spell, action)
- --Enfeebling Magic--
- if spell.skill == "Enfeebling Magic" then
- equip(sets.midcast['Enfeebling Magic'])
- --Using Enfeebling Magic as an example of a basic midcast.
- --Enhancing Magic--
- elseif spell.skill == "Enhancing Magic" then
- --Regen Trigger--
- if string.find(spell.english,'Regen')then
- equip(sets.midcast['Regen'])
- --This regen section is an example of how to search for a specific spell-type rather than magic type.
- else
- equip(sets.midcast['Enhancing Magic'])
- end
- --Perp Hands Overwrite--
- if buffactive['Perpetuance'] then
- equip(sets.JA['Perpetuance'])
- end
- --[[This Perpetuance section is an example of merging a JA set with it's matching cast situation.
- In this case perpetuance gloves grant additional duration if the JA is active when the spell casts.
- The gloves are required to be equipped when the enhancing spell is cast, not when the JA is activated.]]--
- end
- --Using Enhancing Magic as an example of a more advanced midcast function.
- end
- --Aftercast Swap while Idle--
- function aftercast_idle()
- --DT Swap--
- if DTTrigger == 1 then
- equip(sets.Idle.DT)
- else
- equip(sets.Idle.Standard)
- end
- --Disability Swap--
- if buffactive['terror'] or buffactive['petrification']
- or buffactive['stun'] or buffactive['sleep'] then
- equip(sets.Idle.DT)
- end
- --Automatically swaps on DT set if stunned, terrored, petrified, or slept.
- end
- --Aftercast Swap while Engaged--
- function aftercast_engaged()
- --Non-Standard TP Function--
- if DTTrigger == 1 then
- equip(sets.engaged.DT)
- elseif HybridTrigger == 1 then
- equip(sets.engaged.Hybrid)
- else
- equip(sets.engaged.Standard)
- end
- --This decision ladder decides what TP set to return to. DT > HybridDT > TP
- --Disability Swap--
- if buffactive['terror'] or buffactive['petrification']
- or buffactive['stun'] or buffactive['sleep'] then
- equip(sets.Idle.DT)
- end
- --Automatically swaps on DT set if stunned, terrored, petrified, or slept.
- end
- --Buff Gain Function--
- function buff_change(buff,gain)
- --Handicap Protection--
- if buff == "terror" or buff == "petrification" or
- buff == "stun" or buff == "sleep" then
- --DT Gear On--
- if gain then
- equip(sets.Idle.DT)
- --Handicap Restore--
- else
- --Aftercast Function Trigger--
- aftercast()
- end
- end
- end
- --Status Change Core--
- function status_change(new, old)
- --Aftercast Function Trigger--
- if player.status == "Engaged" then
- aftercast_engaged()
- else
- aftercast_idle()
- end
- end
- --Stylelock Function--
- function style()
- --Lockstyle Function--
- send_command('input /lockstyleset XX;')
- --This function is not loaded automatically because of the delay when changing job / sub.
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement