Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --!!INIT!!--
- include('no_interruptions.lua')
- include('spam_protection.lua')
- include('how_about_no.lua')
- include('organizer-lib')
- --Command Aliases--
- send_command('alias pdt gs c pdt')
- send_command('alias mdt gs c mdt')
- send_command('alias acc gs c acc')
- send_command('alias spi gs c spi')
- send_command('alias cp gs c cp')
- send_command('alias kite gs c kite')
- send_command('bind F12 pdt')
- send_command('bind ^F12 kite')
- send_command('bind F11 mdt')
- send_command('bind ^F9 acc')
- send_command('bind F10 spi')
- send_command('bind F9 gs c status')
- send_command('bind ^` gs c shield')
- -- Called when this job file is unloaded (eg: job change)
- function file_unload()
- send_command('unbind ^`')
- send_command('unbind f9')
- send_command('unbind ^f9')
- send_command('unbind f11')
- send_command('unbind f12')
- send_command('unbind ^f12')
- send_command('unbind f10')
- end
- --Main()--
- function get_sets()
- TankCape = { name="Rudianos's Mantle", augments={'HP+60','HP+20','Eva.+20 /Mag. Eva.+20','Enmity+10',}}
- FCCape = { name="Rudianos's Mantle", augments={'HP+60','HP+20','Eva.+20 /Mag. Eva.+20','"Fast Cast"+10',}}
- --Command Triggers--
- PDTTrigger = 1
- KITETrigger = 0
- MDTTrigger = 0
- AccTrigger = 0
- SpellInt = 0
- CPTrigger = 0
- ShadowType = 'None'
- ShieldType = 'Ochain'
- target_distance = 6
- organizer_items = {
- main="Brilliance",
- main2="Almace",
- sub="Aegis",
- sub2="Ochain",
- ring2="Warp Ring",
- ring1="Dim. Ring (Mea)",
- }
- select_default_macro_book()
- --Idle Sets--
- sets.Idle = {}
- sets.Idle.Standard = {
- ammo = "Homiliary",
- head = "Jumalik Helm",
- neck = "Sanctity Necklace",
- lear = "Ethereal Earring",
- rear = "Infused Earring",
- body = "Jumalik Mail",
- hands = "Souveran Handschuhs",
- rring = "Paguroidea Ring",
- lring = "Sheltered Ring",
- back = TankCape,
- waist = "Flume Belt +1",
- legs = "Carmine Cuisses +1",
- feet = "Souveran Schuhs"
- }
- sets.Idle.PDT = {
- ammo = "Staunch Tathlum",
- head = "Souveran Schaller",
- neck = "Loricate Torque +1",
- lear = "Ethereal Earring",
- rear = "Thureous Earring",
- body = "Reverence Surcoat +3",
- hands = "Souveran Handschuhs",
- rring = "Warden's Ring",
- lring = "Defending Ring",
- back = TankCape,
- waist = "Flume Belt +1",
- legs = "Chevalier's Cuisses +1",
- feet = "Souveran Schuhs"
- }
- sets.Idle.MDT = set_combine(sets.Idle.PDT, {
- back = "Reiki Cloak"
- })
- sets.Idle.Regen = sets.Idle.Standard
- sets.Idle.Refresh = sets.Idle.Standard
- --Misc Sets--
- sets.Enmity = {
- ammo = "Sapience Orb",
- head = "Loess Barbuta +1",
- neck = "Unmoving Collar +1",
- lear = "Cryptic Earring",
- rear = "Friomisi Earring",
- body = "Rev. Surcoat +3",
- hands = "Souveran Handschuhs",
- rring = "Apeile Ring",
- lring = "Apeile Ring +1",
- back = TankCape,
- waist = "Creed Baudrier",
- legs = "Cab. Breeches",
- feet = "Souveran Schuhs"
- }
- --TP Sets--
- sets.engaged = {
- ammo = "Ginsen",
- head = "Carmine Mask +1",
- neck = "Asperity Necklace",
- lear = "Brutal Earring",
- rear = "Telos Earring",
- body = "Emet Harness +1",
- hands = "Leyline Gloves",
- lring = "Hetairoi Ring",
- rring = "Petrov Ring",
- back = "Phalangite Mantle",
- waist = "Windbuffet Belt +1",
- legs = "Carmine Cuisses +1",
- feet = "Carmine Greaves +1",
- }
- sets.engaged.Acc = set_combine(sets.engaged, {
- neck = "Combatant's Torque",
- lear = "Digni. Earring",
- waist = "Kentarch Belt +1",
- lring = "Cacoethic Ring +1",
- rring = "Ramuh Ring +1"
- })
- --WS Sets--
- sets.precast = {}
- sets.precast.WS = {
- ammo = "Floestone",
- neck = "Fotia Gorget",
- waist = "Fotia Belt",
- head = "Carmine Mask +1",
- lear = "Brutal Earring",
- rear = "Telos Earring",
- body = "Emet Harness +1",
- hands = "Leyline Gloves",
- lring = "Hetairoi Ring",
- rring = "Petrov Ring",
- back = "Phalangite Mantle",
- legs = "Carmine Cuisses +1",
- feet = "Carmine Greaves +1",
- }
- sets.precast.WS['Sanguine Blade'] = {
- ammo = "Pemphredo Tathlum",
- head = "Jumalik Helm",
- neck = "Baetyl Pendant",
- lear = "Novio Earring",
- rear = "Friomisi Earring",
- --body = "",
- hands = "Leyline Gloves",
- lring = "Shiva Ring +1",
- rring = "Shiva Ring +1",
- --back = "",
- waist = "Yamabuki-no-Obi",
- --legs = "",
- --feet = ""
- }
- --Spells--
- --Pre Cast--
- sets.precast.FC = {
- ammo = "Sapience Orb",
- head = "Carmine Mask",
- neck = "Orunmila's Torque",
- lear = "Loquac. Earring",
- rear = "Odnowa Earring +1",
- body = "Rev. Surcoat +3",
- hands = "Leyline Gloves",
- lring = "Kishar Ring",
- rring = "Weather. Ring +1",
- back = FCCape,
- --waist
- legs = "Enif Cosciales",
- feet = "Carmine Greaves +1",
- }
- sets.precast['Enhancing Magic'] = set_combine(sets.precast.FC, {
- waist = "Siegel Sash",
- })
- sets.precast['Ninjutsu'] = sets.precast.FC
- sets.precast.FC.Cure = set_combine(sets.precast.FC, {ear1="Nourish. Earring +1",ear2="Mendicant's Earring",body="Jumalik Mail"})
- --Mid Cast--
- sets.midcast = {}
- sets.midcast['Enhancing Magic'] = {
- ammo = "Sapience Orb",
- head = "Carmine Mask +1",
- neck = "Incanter's Torque",
- ear1 = "Augment. Earring",
- ear2 = "Andoaa Earring",
- --body = "Shab. Cuirass +1",
- rring = "Stikini Ring",
- lring = "Stikini Ring",
- waist = "Olympus Sash",
- back = "Merciful Cape",
- legs = "Carmine Cuisses +1"
- }
- sets.midcast.Phalanx = set_combine(sets.midcast['Enhancing Magic'], {
- hands = "Souveran Handschuhs",
- feet = "Souveran Schuhs",
- })
- sets.midcast.SpellInterrupt = set_combine(sets.Idle.PDT, {
- ammo = "Staunch Tathlum",
- head = "Souveran Schaller",
- neck = "Willpower Torque",
- rear = "Halasz Earring",
- --hands = "Rawhide Gloves",
- rring = "Evanescence Ring",
- waist = "Rumination Sash",
- legs = "Founder's Hose",
- --feet = "",
- })
- sets.midcast.Cure = set_combine(sets.Enmity, {
- head="Souveran Schaller",
- body="Jumalik Mail",
- neck="Phalaina Locket",
- legs="Founder's Hose",
- back="Solemnity Cape",
- ear1="Nourish. Earring +1",
- ear2="Mendicant's Earring",
- hands="Macabre Gauntlets +1"})
- sets.midcast.Flash = set_combine(sets.Enmity, {waist="Goading Belt"})
- sets.midcast.Enlight = {
- ammo = "Sapience Orb",
- head = "Jumalik Helm",
- neck = "Incanter's Torque",
- --ear1 = "Augment. Earring",
- --ear2 = "Andoaa Earring",
- body = "Rev. Surcoat +3",
- rring = "Stikini Ring",
- lring = "Stikini Ring",
- waist = "Asklepian Belt",
- back = "Altruistic Cape",
- legs = "Carmine Cuisses +1"
- }
- --Job Abilites--
- sets.precast.JA = {}
- sets.precast.JA['Provoke'] = sets.Enmity
- sets.precast.JA['Invincible'] = set_combine(sets.Enmity, {legs="Cab. Breeches"})
- sets.precast.JA['Fealty'] = set_combine(sets.Enmity, {body="Cab. Surcoat"})
- sets.precast.JA['Chivalry'] = set_combine(sets.Enmity, {hands="Cab. Gauntlets"})
- sets.precast.JA['Cover'] = set_combine(sets.Enmity, {head="Rev. Coronet"})
- sets.precast.JA['Rampart'] = set_combine(sets.Enmity, {head="Cab. Coronet"})
- sets.precast.JA['Sentinel'] = set_combine(sets.Enmity, {feet="Cab. Leggings"})
- sets.precast.JA['Shield Bash'] = set_combine(sets.Enmity, {hands="Cab. Gauntlets"})
- sets.precast.JA['Intervene'] = sets.precast.JA['Shield Bash']
- end
- --Precast Core--
- function precast(spell, action)
- if check_ready(spell) then
- --Magic--
- if spell.action_type == 'Magic' then
- precast_magic(spell)
- end
- --Job Ability--
- if spell.type == 'JobAbility' then
- precast_ja(spell)
- end
- --Weaponskills--
- if spell.type == "WeaponSkill" then
- precast_weaponskill(spell)
- end
- --AutoCancel Ichi--
- if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and
- (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
- cancel_spell()
- end
- --Disability Swap--
- if buffactive['terror'] or buffactive['petrification']
- or buffactive['stun'] or buffactive['sleep'] then
- if MDTTrigger == 1 then
- equip(sets.Idle.MDT)
- else
- equip(sets.Idle.PDT)
- end
- cancel_spell()
- end
- spam_protection_on(spell)
- else
- cancel_spell()
- end
- end
- --Midcast Core--
- function midcast(spell, action)
- if spell.action_type == "Magic" then
- midcast_magic(spell)
- end
- end
- --Aftercast Core--
- function aftercast(spell, action)
- if spam_protection_off(spell)then
- --Shadow Track--
- if string.find(spell.name,'Utsusemi') and not spell.interrupted then
- if spell.name == 'Utsusemi: Ichi' then
- ShadowType = 'Ichi'
- elseif spell.name == 'Utsusemi: Ni' then
- ShadowType = 'Ni'
- end
- end
- --Aftercast Function Trigger--
- if player.status == "Engaged" then
- aftercast_engaged()
- else
- aftercast_idle()
- end
- end
- end
- --Status Change Core--
- function status_change(new, old)
- if check_ready_status() then
- --Aftercast Function Trigger--
- if player.status == "Engaged" then
- aftercast_engaged()
- else
- aftercast_idle()
- end
- end
- end
- --Custom Command Engine--
- function self_command(command)
- --PDT Trigger--
- if command == 'pdt' then
- if PDTTrigger == 1 then
- add_to_chat(170, 'PDT Toggled - Max Damage')
- PDTTrigger = 0
- else
- add_to_chat(170, 'PDT Toggled - Max PDT')
- PDTTrigger = 1
- end
- end
- --MDT Trigger--
- if command == 'mdt' then
- if MDTTrigger == 1 then
- add_to_chat(170, 'MDT Toggled - Max Damage')
- MDTTrigger = 0
- else
- add_to_chat(170, 'MDT Toggled - Max MDT')
- MDTTrigger = 1
- end
- end
- --Acc Trigger--
- if command == 'acc' then
- if AccTrigger == 1 then
- add_to_chat(170, 'Acc Toggled - Max Damage')
- AccTrigger = 0
- else
- add_to_chat(170, 'Acc Toggled - Max Acc')
- AccTrigger = 1
- end
- end
- --SpellInterrupt Trigger--
- if command == 'spi' then
- if SpellInt == 1 then
- add_to_chat(170, 'Spell Interrupt Set Off')
- SpellInt = 0
- else
- add_to_chat(170, 'Spell Interrupt Set On')
- SpellInt = 1
- end
- end
- --Cap 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
- --Kiting Lock--
- if command == 'kite' then
- if KITETrigger == 1 then
- enable('legs')
- add_to_chat(170, 'Kiting Off')
- KITETrigger = 0
- else
- equip({legs="Carmine Cuisses +1"})
- disable('legs')
- add_to_chat(170, 'Kiting On')
- KITETrigger = 1
- end
- end
- --Status Reporter--
- if command == 'status' then
- local msg = 'Trigger Status Report: '
- if KITETrigger == 1 then
- msg = msg .. 'Kiting On, '
- end
- if CPTrigger == 1 then
- msg = msg .. 'Cp Cape Locked, '
- end
- if SpellInt == 1 then
- msg = msg .. 'Spell Interruption Set On, '
- end
- if PDTTrigger == 1 then
- msg = msg .. 'PDT Set Locked'
- else
- if MDTTrigger == 1 then
- msg = msg .. 'MDT Set Locked'
- else
- msg = msg .. 'DPS Set Locked'
- end
- end
- add_to_chat(170, msg)
- end
- --Shield Switch--
- if command == "shield" then
- if ShieldType == 'Ochain' then
- ShieldType = 'Aegis'
- equip({sub="Aegis"})
- add_to_chat(170, 'Aegis Equipped')
- else
- ShieldType = 'Ochain'
- equip({sub="Ochain"})
- add_to_chat(170, 'Ochain Equipped')
- end
- end
- --Aftercast Function Trigger--
- if player.status == "Engaged" then
- aftercast_engaged()
- else
- aftercast_idle()
- end
- end
- --Subfunction for Magic Precast--
- function precast_magic(spell, action)
- --Ninjutsu--
- if spell.skill == 'Ninjutsu' then
- equip(sets.precast['Ninjutsu'])
- --Enhancing--
- elseif spell.skill == 'Enhancing Magic' then
- equip(sets.precast['Enhancing Magic'])
- elseif spell.skill == 'Healing Magic' then
- if spell.english == "Raise" then
- equip(sets.precast.FC)
- else
- equip(sets.precast.FC.Cure)
- end
- --Default--
- else
- equip(sets.precast.FC)
- end
- end
- --Subfunction for Job Ability Precast--
- function precast_ja(spell, action)
- --2hr Trigger--
- if spell.english == "Invincible" then
- equip(sets.precast.JA['Invincible'])
- elseif spell.english == "Provoke" then
- equip(sets.precast.JA['Provoke'])
- elseif spell.english == "Fealty" then
- equip(sets.precast.JA['Fealty'])
- elseif spell.english == "Chivalry" then
- equip(sets.precast.JA['Chivalry'])
- elseif spell.english == "Cover" then
- equip(sets.precast.JA['Cover'])
- elseif spell.english == "Rampart" then
- equip(sets.precast.JA['Rampart'])
- elseif spell.english == "Sentinel" then
- equip(sets.precast.JA['Sentinel'])
- elseif spell.english == "Shield Bash" then
- equip(sets.precast.JA['Shield Bash'])
- elseif spell.english == "Intervene" then
- equip(sets.precast.JA['Intervene'])
- --Default--
- else
- equip(sets.Enmity)
- end
- end
- --Subfunction for Weapon Skill Precast--
- function precast_weaponskill(spell, action)
- --Sanguine Blade--
- if spell.english == "Sanguine Blade" then
- equip(sets.precast.WS['Sanguine Blade'])
- --Default--
- else
- equip(sets.precast.WS)
- --Moonshade Trigger--
- if player.tp < 2750 then
- equip({lear = 'Moonshade Earring'})
- end
- end
- end
- --Subfunction for Midcast Magic--
- function midcast_magic(spell, action)
- --Cancel Ni Shadows before Ichi--
- if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
- send_command('cancel Copy Image')
- send_command('cancel Copy Image (2)')
- end
- if spell.skill == 'Divine Magic' then
- if spell.english == "Flash" then
- equip(sets.midcast.Flash)
- elseif spell.english == "Enlight" or spell.english == "Enlight II" then
- equip(sets.midcast.Enlight)
- else
- equip(sets.Enmity)
- end
- --MidCast Gear for Enhancing Magic--
- elseif spell.skill == 'Enhancing Magic' then
- --Phalanx Trigger--
- if spell.english == "Phalanx" then
- equip(sets.midcast.Phalanx)
- elseif spell.english == "Crusade" then
- equip(sets.Enmity)
- elseif string.find(spell.english,"Protect") or string.find(spell.english, "Shell") then
- equip(sets.Enmity, {rring="Sheltered Ring"})
- --Default Enhancing--
- else
- equip(sets.midcast['Enhancing Magic'])
- end
- elseif spell.skill == 'Healing Magic' then
- if spell.english == "Raise" then
- equip(sets.Enmity)
- else
- equip(sets.midcast.Cure)
- end
- --Default--
- else
- equip(sets.Enmity)
- end
- if spell.english == "Refresh" or string.find(spell.english,'Cure') or string.find(spell.english,'Cura') and spell.target.type == "SELF" then
- equip({waist="Gishdubar Sash"})
- end
- if SpellInt == 1 then
- equip(sets.midcast.SpellInterrupt)
- end
- end
- --Aftercast Swap while Idle--
- function aftercast_idle()
- --PDT Swap--
- if PDTTrigger == 1 then
- equip(sets.Idle.PDT)
- --MDT Swap--
- elseif MDTTrigger == 1 then
- equip(sets.Idle.MDT)
- --Refresh Idle--
- elseif player.mpp < 50 then
- equip(set_combine(sets.Idle.Standard, {waist = "Fucho-no-Obi"}))
- --Default--
- else
- equip(sets.Idle.Standard)
- end
- end
- --Aftercast Swap for TP--
- function aftercast_engaged()
- --PDT Swap--
- if PDTTrigger == 1 then
- equip(sets.Idle.PDT)
- --MDT Swap--
- elseif MDTTrigger == 1 then
- equip(sets.Idle.MDT)
- --Acc Swap--
- elseif AccTrigger == 1 then
- equip(sets.engaged.Acc)
- --Default--
- else
- equip(sets.engaged)
- end
- --Disability Swap--
- if buffactive['terror'] or buffactive['petrification']
- or buffactive['stun'] or buffactive['sleep'] then
- if MDTTrigger == 1 then
- equip(sets.Idle.MDT)
- else
- equip(sets.Idle.PDT)
- end
- end
- --Wake Up--
- if buffactive['sleep'] and player.hp > 100 and player.status == "Engaged" then
- equip({head="Frenzy Sallet"})
- end
- end
- --Buff Function--
- function buff_change(buff,gain)
- --Disability Swap--
- if buffactive['terror'] or buffactive['petrification']
- or buffactive['stun'] or buffactive['sleep'] then
- if MDTTrigger == 1 then
- equip(sets.Idle.MDT)
- else
- equip(sets.Idle.PDT)
- end
- end
- --Wake Up--
- if buff == "sleep" and player.hp > 100 and player.status == "Engaged" then
- equip({head="Frenzy Sallet"})
- end
- end
- -- Select default macro book on initial load or subjob change.
- function select_default_macro_book()
- -- Default macro set/book
- set_macro_page(1, 19)
- end
- function set_macro_page(set,book)
- if not tonumber(set) then
- add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
- return
- end
- if set < 1 or set > 10 then
- add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
- return
- end
- if book then
- if not tonumber(book) then
- add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
- return
- end
- if book < 1 or book > 20 then
- add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
- return
- end
- send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
- else
- send_command('@input /macro set '..tostring(set))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement