Advertisement
Bokura

Bokura_DRG

Jan 28th, 2014
1,487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 30.03 KB | None | 0 0
  1. -- *** Credit goes to Flippant & Martel for helping me with this Gearswap *** --
  2. -- ** I Use Some of Motenten's Functions ** --
  3.  
  4. function get_sets()
  5.     AccIndex = 1
  6.     AccArray = {"LowACC","MidACC","HighACC","MaxACC"} -- 4 Levels Of Accuracy Sets For TP/WS/Hybrid/Jump. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. --
  7.     AttIndex = 1
  8.     AttArray = {"LowATT","HighATT","LowContent"} -- LowATT Is The Same As LowACC Set. MidACC, HighACC & MaxACC Take Priority Over These 2 Sets(HighATT & LowContent). --
  9.     IdleIndex = 1
  10.     IdleArray = {"Movement","Regen","Refresh"} -- Default Idle Set Is Movement --
  11.     Armor = 'None'
  12.     Twilight = 'None'
  13.     Rancor = 'ON' -- Set Default Rancor ON or OFF Here --
  14.     Brais = 'ON' -- Set Default High Jump Enmity Legs ON or OFF Here --
  15.     Samurai_Roll = 'ON' -- Set Default SAM Roll ON or OFF Here --
  16.     target_distance = 5 -- Set Default Distance Here --
  17.     select_default_macro_book() -- Change Default Macro Book At The End --
  18.  
  19.     -- Gavialis Helm --
  20.     elements = {}
  21.     elements.equip = {head="Gavialis Helm"}
  22.     elements.Stardiver = S{"Light","Dark","Earth"}
  23.  
  24.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  25.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  26.  
  27.     Healer_Type_Wyvern = S{"WHM","RDM","BLM","BLU","SCH","GEO","SMN"} -- 50% Healing Breath Trigger SubJob --
  28.     Hybrid_Type_Wyvern = S{"PLD","DRK","BRD","NIN","RUN"} -- 33% Healing Breath Trigger SubJob --
  29.  
  30.     sc_map = {SC1="Drakesbane", SC2="SpiritJump", SC3="SoulJump"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  31.  
  32.     sets.Idle = {}
  33.     -- Idle/Town Sets --
  34.     sets.Idle.Regen = {}
  35.     sets.Idle.Movement = set_combine(sets.Idle.Regen,{
  36.             legs="Blood Cuisses"})
  37.     sets.Idle.Refresh = set_combine(sets.Idle.Regen,{
  38.             head="Wivre Hairpin",
  39.             body="Twilight Mail",
  40.             hands="Ogier's Gauntlets",
  41.             feet="Ogier's Leggings"})
  42.  
  43.     -- Twilight Set --
  44.     sets.Twilight = {head="Twilight Helm",body="Twilight Mail"}
  45.  
  46.     -- TP Base Set --
  47.     sets.TP = {}
  48.  
  49.     -- Ryunohige(AM3 Down) TP Sets --
  50.     sets.TP.Ryunohige = {}
  51.     sets.TP.Ryunohige.MidACC = set_combine(sets.TP.Ryunohige,{})
  52.     sets.TP.Ryunohige.HighACC = set_combine(sets.TP.Ryunohige.MidACC,{})
  53.     sets.TP.Ryunohige.MaxACC = set_combine(sets.TP.Ryunohige.HighACC,{})
  54.  
  55.     -- Ryunohige(AM3 Up) TP Sets --
  56.     sets.TP.Ryunohige.AM3 = set_combine(sets.TP.Ryunohige,{})
  57.     sets.TP.Ryunohige.MidACC.AM3 = set_combine(sets.TP.Ryunohige.AM3,{})
  58.     sets.TP.Ryunohige.HighACC.AM3 = set_combine(sets.TP.Ryunohige.MidACC.AM3,{})
  59.     sets.TP.Ryunohige.MaxACC.AM3 = set_combine(sets.TP.Ryunohige.HighACC.AM3,{})
  60.  
  61.     -- Ryunohige(AM3 Down: Ionis) TP Sets --
  62.     sets.TP.Ryunohige.Ionis = set_combine(sets.TP.Ryunohige,{})
  63.     sets.TP.Ryunohige.MidACC.Ionis = set_combine(sets.TP.Ryunohige.MidACC,{})
  64.     sets.TP.Ryunohige.HighACC.Ionis = set_combine(sets.TP.Ryunohige.HighACC,{})
  65.     sets.TP.Ryunohige.MaxACC.Ionis = set_combine(sets.TP.Ryunohige.MaxACC,{})
  66.  
  67.     -- Ryunohige(AM3 Up: Ionis) TP Sets --
  68.     sets.TP.Ryunohige.AM3.Ionis = set_combine(sets.TP.Ryunohige.AM3,{})
  69.     sets.TP.Ryunohige.MidACC.AM3.Ionis = set_combine(sets.TP.Ryunohige.MidACC.AM3,{})
  70.     sets.TP.Ryunohige.HighACC.AM3.Ionis = set_combine(sets.TP.Ryunohige.HighACC.AM3,{})
  71.     sets.TP.Ryunohige.MaxACC.AM3.Ionis = set_combine(sets.TP.Ryunohige.MaxACC.AM3,{})
  72.  
  73.     -- Ryunohige(AM3 Down: SAM Roll) TP Sets --
  74.     sets.TP.Ryunohige.STP = set_combine(sets.TP.Ryunohige,{})
  75.     sets.TP.Ryunohige.MidACC.STP = set_combine(sets.TP.Ryunohige.MidACC,{})
  76.     sets.TP.Ryunohige.HighACC.STP = set_combine(sets.TP.Ryunohige.HighACC,{})
  77.     sets.TP.Ryunohige.MaxACC.STP = set_combine(sets.TP.Ryunohige.MaxACC,{})
  78.  
  79.     -- Ryunohige(AM3 Up: SAM Roll) TP Sets --
  80.     sets.TP.Ryunohige.AM3.STP =  set_combine(sets.TP.Ryunohige.AM3,{})
  81.     sets.TP.Ryunohige.MidACC.AM3.STP = set_combine(sets.TP.Ryunohige.MidACC.AM3,{})
  82.     sets.TP.Ryunohige.HighACC.AM3.STP = set_combine(sets.TP.Ryunohige.HighACC.AM3,{})
  83.     sets.TP.Ryunohige.MaxACC.AM3.STP = set_combine(sets.TP.Ryunohige.MaxACC.AM3,{})
  84.  
  85.     -- Ryunohige(AM3 Down: Ionis + SAM Roll) TP Sets --
  86.     sets.TP.Ryunohige.Ionis.STP =  set_combine(sets.TP.Ryunohige,{})
  87.     sets.TP.Ryunohige.MidACC.Ionis.STP = set_combine(sets.TP.Ryunohige.MidACC,{})
  88.     sets.TP.Ryunohige.HighACC.Ionis.STP = set_combine(sets.TP.Ryunohige.HighACC,{})
  89.     sets.TP.Ryunohige.MaxACC.Ionis.STP = set_combine(sets.TP.Ryunohige.MaxACC,{})
  90.  
  91.     -- Ryunohige(AM3 Up: Ionis + SAM Roll) TP Sets --
  92.     sets.TP.Ryunohige.AM3.Ionis.STP =  set_combine(sets.TP.Ryunohige.AM3,{})
  93.     sets.TP.Ryunohige.MidACC.AM3.Ionis.STP = set_combine(sets.TP.Ryunohige.MidACC.AM3,{})
  94.     sets.TP.Ryunohige.HighACC.AM3.Ionis.STP = set_combine(sets.TP.Ryunohige.HighACC.AM3,{})
  95.     sets.TP.Ryunohige.MaxACC.AM3.Ionis.STP = set_combine(sets.TP.Ryunohige.MaxACC.AM3,{})
  96.  
  97.     -- Gungnir TP Sets --
  98.     sets.TP.Gungnir = {}
  99.     sets.TP.Gungnir.MidACC = set_combine(sets.TP.Gungnir,{})
  100.     sets.TP.Gungnir.HighACC = set_combine(sets.TP.Gungnir.MidACC,{})
  101.     sets.TP.Gungnir.MaxACC = set_combine(sets.TP.Gungnir.HighACC,{})
  102.  
  103.     -- Gungnir(Ionis) TP Sets --
  104.     sets.TP.Gungnir.Ionis = set_combine(sets.TP.Gungnir,{})
  105.     sets.TP.Gungnir.MidACC.Ionis = set_combine(sets.TP.Gungnir.MidACC,{})
  106.     sets.TP.Gungnir.HighACC.Ionis = set_combine(sets.TP.Gungnir.HighACC,{})
  107.     sets.TP.Gungnir.MaxACC.Ionis = set_combine(sets.TP.Gungnir.MaxACC,{})
  108.  
  109.     -- Gungnir(SAM Roll) TP Sets --
  110.     sets.TP.Gungnir.STP = set_combine(sets.TP.Gungnir,{})
  111.     sets.TP.Gungnir.MidACC.STP = set_combine(sets.TP.Gungnir.MidACC,{})
  112.     sets.TP.Gungnir.HighACC.STP = set_combine(sets.TP.Gungnir.HighACC,{})
  113.     sets.TP.Gungnir.MaxACC.STP = set_combine(sets.TP.Gungnir.MaxACC,{})
  114.  
  115.     -- Gungnir(Ionis + SAM Roll) TP Sets --
  116.     sets.TP.Gungnir.Ionis.STP = set_combine(sets.TP.Gungnir,{})
  117.     sets.TP.Gungnir.MidACC.Ionis.STP = set_combine(sets.TP.Gungnir.MidACC,{})
  118.     sets.TP.Gungnir.HighACC.Ionis.STP = set_combine(sets.TP.Gungnir.HighACC,{})
  119.     sets.TP.Gungnir.MaxACC.Ionis.STP = set_combine(sets.TP.Gungnir.MaxACC,{})
  120.  
  121.     -- Rhongomiant TP Sets --
  122.     sets.TP.Rhongomiant = {}
  123.     sets.TP.Rhongomiant.MidACC = set_combine(sets.TP.Rhongomiant,{})
  124.     sets.TP.Rhongomiant.HighACC = set_combine(sets.TP.Rhongomiant.MidACC,{})
  125.     sets.TP.Rhongomiant.MaxACC = set_combine(sets.TP.Rhongomiant.HighACC,{})
  126.  
  127.     -- Rhongomiant(Ionis) TP Sets --
  128.     sets.TP.Rhongomiant.Ionis = set_combine(sets.TP.Rhongomiant,{})
  129.     sets.TP.Rhongomiant.MidACC.Ionis = set_combine(sets.TP.Rhongomiant.MidACC,{})
  130.     sets.TP.Rhongomiant.HighACC.Ionis = set_combine(sets.TP.Rhongomiant.HighACC,{})
  131.     sets.TP.Rhongomiant.MaxACC.Ionis = set_combine(sets.TP.Rhongomiant.MaxACC,{})
  132.  
  133.     -- Rhongomiant(SAM Roll) TP Sets --
  134.     sets.TP.Rhongomiant.STP = set_combine(sets.TP.Rhongomiant,{})
  135.     sets.TP.Rhongomiant.MidACC.STP = set_combine(sets.TP.Rhongomiant.MidACC,{})
  136.     sets.TP.Rhongomiant.HighACC.STP = set_combine(sets.TP.Rhongomiant.HighACC,{})
  137.     sets.TP.Rhongomiant.MaxACC.STP = set_combine(sets.TP.Rhongomiant.MaxACC,{})
  138.  
  139.     -- Rhongomiant(Ionis + SAM Roll) TP Sets --
  140.     sets.TP.Rhongomiant.Ionis.STP = set_combine(sets.TP.Rhongomiant,{})
  141.     sets.TP.Rhongomiant.MidACC.Ionis.STP = set_combine(sets.TP.Rhongomiant.MidACC,{})
  142.     sets.TP.Rhongomiant.HighACC.Ionis.STP = set_combine(sets.TP.Rhongomiant.HighACC,{})
  143.     sets.TP.Rhongomiant.MaxACC.Ionis.STP = set_combine(sets.TP.Rhongomiant.MaxACC,{})
  144.  
  145.     -- Upukirex TP Sets --
  146.     sets.TP.Upukirex = {}
  147.     sets.TP.Upukirex.MidACC = set_combine(sets.TP.Upukirex,{})
  148.     sets.TP.Upukirex.HighACC = set_combine(sets.TP.Upukirex.MidACC,{})
  149.     sets.TP.Upukirex.MaxACC = set_combine(sets.TP.Upukirex.HighACC,{})
  150.  
  151.     -- Upukirex(Ionis) TP Sets --
  152.     sets.TP.Upukirex.Ionis = set_combine(sets.TP.Upukirex,{})
  153.     sets.TP.Upukirex.MidACC.Ionis = set_combine(sets.TP.Upukirex.MidACC,{})
  154.     sets.TP.Upukirex.HighACC.Ionis = set_combine(sets.TP.Upukirex.HighACC,{})
  155.     sets.TP.Upukirex.MaxACC.Ionis = set_combine(sets.TP.Upukirex.MaxACC,{})
  156.  
  157.     -- Upukirex(SAM Roll) TP Sets --
  158.     sets.TP.Upukirex.STP = set_combine(sets.TP.Upukirex,{})
  159.     sets.TP.Upukirex.MidACC.STP = set_combine(sets.TP.Upukirex.MidACC,{})
  160.     sets.TP.Upukirex.HighACC.STP = set_combine(sets.TP.Upukirex.HighACC,{})
  161.     sets.TP.Upukirex.MaxACC.STP = set_combine(sets.TP.Upukirex.MaxACC,{})
  162.  
  163.     -- Upukirex(Ionis + SAM Roll) TP Sets --
  164.     sets.TP.Upukirex.Ionis.STP = set_combine(sets.TP.Upukirex,{})
  165.     sets.TP.Upukirex.MidACC.Ionis.STP = set_combine(sets.TP.Upukirex.MidACC,{})
  166.     sets.TP.Upukirex.HighACC.Ionis.STP = set_combine(sets.TP.Upukirex.HighACC,{})
  167.     sets.TP.Upukirex.MaxACC.Ionis.STP = set_combine(sets.TP.Upukirex.MaxACC,{})
  168.  
  169.     -- AM3 Rancor ON Mantle --
  170.     sets.TP.Rancor = {back="Rancorous Mantle"}
  171.  
  172.     -- PDT/MDT Sets --
  173.     sets.PDT = {}
  174.  
  175.     sets.MDT = set_combine(sets.PDT,{})
  176.  
  177.     -- Hybrid Sets --
  178.     sets.TP.Hybrid = set_combine(sets.PDT,{})
  179.     sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{})
  180.     sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{})
  181.     sets.TP.Hybrid.MaxACC = set_combine(sets.TP.Hybrid.HighACC,{})
  182.  
  183.     -- WS Base Set --
  184.     sets.WS = {}
  185.  
  186.     -- Drakesbane Sets --
  187.     sets.WS.Drakesbane = {}
  188.     sets.WS.Drakesbane.MidACC = set_combine(sets.WS.Drakesbane,{})
  189.     sets.WS.Drakesbane.HighACC = set_combine(sets.WS.Drakesbane.MidACC,{})
  190.     sets.WS.Drakesbane.MaxACC = set_combine(sets.WS.Drakesbane.HighACC,{})
  191.  
  192.     -- Drakesbane(Low Level Content) Set --
  193.     sets.WS.Drakesbane.LowContent = set_combine(sets.WS.Drakesbane,{
  194.             neck="Ganesha's Mala",
  195.             body="Phorcys Korazin",
  196.             waist="Windbuffet Belt +1"})
  197.  
  198.     -- Drakesbane(High Attack) Set --
  199.     sets.WS.Drakesbane.HighATT = set_combine(sets.WS.Drakesbane,{})
  200.  
  201.     -- Stardiver Sets --
  202.     sets.WS.Stardiver = {}
  203.     sets.WS.Stardiver.MidACC = set_combine(sets.WS.Stardiver,{})
  204.     sets.WS.Stardiver.HighACC = set_combine(sets.WS.Stardiver.MidACC,{})
  205.     sets.WS.Stardiver.MaxACC = set_combine(sets.WS.Stardiver.HighACC,{})
  206.  
  207.     -- Geirskogul Set --
  208.     sets.WS.Geirskogul = {}
  209.  
  210.     -- Camlann's Torment Set --
  211.     sets.WS["Camlann's Torment"] = {}
  212.  
  213.     sets.JA = {}
  214.     -- Jump Sets --
  215.     sets.JA.Jump = {}
  216.     sets.JA.Jump.MidACC = set_combine(sets.JA.Jump,{})
  217.     sets.JA.Jump.HighACC = set_combine(sets.JA.Jump.MidACC,{})
  218.     sets.JA.Jump.MaxACC = set_combine(sets.JA.Jump.HighACC,{})
  219.  
  220.     -- High Jump Sets --
  221.     sets.JA["High Jump"] = set_combine(sets.JA.Jump,{})
  222.     sets.JA["High Jump"].MidACC = set_combine(sets.JA.Jump.MidACC,{})
  223.     sets.JA["High Jump"].HighACC = set_combine(sets.JA.Jump.HighACC,{})
  224.     sets.JA["High Jump"].MaxACC = set_combine(sets.JA.Jump.MaxACC,{})
  225.  
  226.     -- Spirit Jump Sets --
  227.     sets.JA["Spirit Jump"] = set_combine(sets.JA.Jump,{
  228.             feet="Pelt. Schyn. +1"})
  229.     sets.JA["Spirit Jump"].MidACC = set_combine(sets.JA["Spirit Jump"],{})
  230.     sets.JA["Spirit Jump"].HighACC = set_combine(sets.JA["Spirit Jump"].MidACC,{})
  231.     sets.JA["Spirit Jump"].MaxACC = set_combine(sets.JA["Spirit Jump"].HighACC,{})
  232.  
  233.     -- Soul Jump Sets --
  234.     sets.JA["Soul Jump"] = set_combine(sets.JA.Jump,{
  235.             feet="Pelt. Schyn. +1"})
  236.     sets.JA["Soul Jump"].MidACC = set_combine(sets.JA.Jump.MidACC,{})
  237.     sets.JA["Soul Jump"].HighACC = set_combine(sets.JA.Jump.HighACC,{})
  238.     sets.JA["Soul Jump"].MaxACC = set_combine(sets.JA.Jump.MaxACC,{})
  239.  
  240.     -- Angon Set --
  241.     sets.JA.Angon = {ammo="Angon",ear1="Dragoon's Earring",hands="Ptero. Fin. G. +1"}
  242.  
  243.     sets.JA["Ancient Circle"] = {legs="Vishap Brais +1"}
  244.     sets.JA['Call Wyvern'] = {body="Ptero. Mail +1"}
  245.     sets.JA['Deep Breathing'] = {head="Ptero. Armet +1"}
  246.  
  247.     sets.Pet = {}
  248.     -- Wyvern +HP Set --
  249.     sets.Pet.WyvernHP = {
  250.             body="Wyvern Mail",
  251.             back="Updraft Mantle",
  252.             legs="Vishap Brais +1",
  253.             feet="Ptero. Greaves +1"}
  254.  
  255.     sets.JA["Spirit Link"] = set_combine(sets.Pet.WyvernHP,{head="Vishap Armet +1",hands="Pel. Vambraces +1"})
  256.  
  257.     sets.Pet["Steady Wing"] = set_combine(sets.Pet.WyvernHP)
  258.  
  259.     sets.Pet["Smiting Breath"] = {
  260.             head="Vishap Armet +1",
  261.             neck="Lancer's Torque",
  262.             ear1="Dragoon's Earring",
  263.             belt="Glassblower's Belt"}
  264.  
  265.     -- Healing Breath Trigger: +HP Gear --
  266.     sets.Healing_Breath_Trigger = {
  267.             head="Vishap Armet +1"}
  268.  
  269.     -- Healing Breath Set --
  270.     sets.Healing_Breath = set_combine(sets.Pet.WyvernHP,{
  271.             head="Ptero. Armet +1",
  272.             neck="Lancer's Torque",
  273.             belt="Glassblower's Belt"})
  274.  
  275.     -- Elemental Breath Set
  276.     sets.Elemental_Breath = {head="Ptero. Armet +1"}
  277.  
  278.     -- Waltz Set --
  279.     sets.Waltz = {}
  280.  
  281.     sets.Precast = {}
  282.     -- Fastcast Set --
  283.     sets.Precast.FastCast = {}
  284.  
  285.     sets.Midcast = {}
  286.     -- Magic Haste Set --
  287.     sets.Midcast.Haste = set_combine(sets.PDT,{})
  288.  
  289.     -- Stoneskin Set --
  290.     sets.Midcast.Stoneskin = {}
  291.  
  292.     -- Cure Set --
  293.     sets.Midcast.Cure = {
  294.             neck="Phalaina Locket",
  295.             ear1="Oneiros Earring",
  296.             ear2="Roundel Earring",
  297.             hands="Buremte Gloves",
  298.             ring1="Asklepian Ring",
  299.             ring2="Kunaji Ring",
  300.             belt="Chuq'aba Belt"}
  301. end
  302.  
  303. function pretarget(spell,action)
  304.     if midaction() or pet_midaction() then
  305.         cancel_spell()
  306.         return
  307.     elseif spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  308.         cancel_spell()
  309.         send_command('input /item "Echo Drops" <me>')
  310.     elseif spell.english == "Spirit Jump" and not pet.isvalid then -- Change Spirit Jump To Jump If Wyvern Is Not Present --
  311.         cancel_spell()
  312.         send_command('Jump')
  313.     elseif spell.english == "Soul Jump" and not pet.isvalid then -- Change Soul Jump To High Jump If Wyvern Is Not Present --
  314.         cancel_spell()
  315.         send_command('HighJump')
  316.     elseif spell.english == "Dismiss" and pet.hpp < 100 then -- Cancel Dismiss If Wyvern's HP Is Under 100% --
  317.         cancel_spell()
  318.         add_to_chat(123, spell.english .. ' Canceled: [' .. pet.hpp .. ']')
  319.         return
  320.     elseif spell.english == "Call Wyvern" and pet.isvalid then -- Change Call Wyvern To Dismiss If Wyvern Is Present --
  321.         cancel_spell()
  322.         send_command('Dismiss')
  323.     elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
  324.         cancel_spell()
  325.         send_command('Aggressor')
  326.     elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
  327.         cancel_spell()
  328.         send_command('ThirdEye')
  329.     elseif spell.english == "Meditate" and player.tp > 2900 then -- Cancel Meditate If TP Is Above 2900 --
  330.         cancel_spell()
  331.         add_to_chat(123, spell.name .. ' Canceled: ['..player.tp..' TP]')
  332.     elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  333.         cancel_spell()
  334.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  335.         return
  336.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  337.         degrade_spell(spell,Cure_Spells)
  338.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  339.         degrade_spell(spell,Curaga_Spells)
  340.     end
  341. end
  342.  
  343. function precast(spell,action)
  344.     if midaction() or pet_midaction() then
  345.         cancel_spell()
  346.         return
  347.     elseif spell.action_type == 'Ranged Attack' then
  348.         equip({ammo="Pebble"})
  349.     elseif spell.type == "WeaponSkill" then
  350.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  351.             cancel_spell()
  352.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  353.             return
  354.         else
  355.             equipSet = sets.WS
  356.             if equipSet[spell.english] then
  357.                 equipSet = equipSet[spell.english]
  358.             end
  359.             if equipSet[AccArray[AccIndex]] then
  360.                 equipSet = equipSet[AccArray[AccIndex]]
  361.             end
  362.             if equipSet[AttArray[AttIndex]] then
  363.                 equipSet = equipSet[AttArray[AttIndex]]
  364.             end
  365.             if elements[spell.name] and elements[spell.name]:contains(world.day_element) then
  366.                 equipSet = set_combine(equipSet,elements.equip)
  367.             end
  368.             if player.tp > 2990 or buffactive.Sekkanoki then -- Equip Kokou's Earring When You Have 3000 TP or Sekkanoki --
  369.                 equipSet = set_combine(equipSet,{ear1="Kokou's Earring"})
  370.             end
  371.             if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
  372.                 equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
  373.             end
  374.             equip(equipSet)
  375.         end
  376.     elseif spell.type == "JobAbility" then
  377.         equipSet = sets.JA
  378.         if equipSet[spell.english] then
  379.             equipSet = equipSet[spell.english]
  380.         end
  381.         if equipSet[AccArray[AccIndex]] then
  382.             equipSet = equipSet[AccArray[AccIndex]]
  383.         end
  384.         if spell.english == "High Jump" and Brais == 'ON' then -- Use High Jump Enmity Toggle To Equip Vishap Brais +1 For High Jump --
  385.             equipSet = set_combine(equipSet,{legs="Vishap Brais +1"})
  386.         end
  387.         equip(equipSet)
  388.     elseif spell.action_type == 'Magic' then
  389.         if buffactive.silence or spell.target.distance > 16+target_distance then
  390.             cancel_spell()
  391.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  392.             return
  393.         else
  394.             if spell.english == 'Utsusemi: Ni' then
  395.                 if buffactive['Copy Image (3)'] then
  396.                     cancel_spell()
  397.                     add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  398.                     return
  399.                 else
  400.                     equip(sets.Precast.FastCast)
  401.                 end
  402.             else
  403.                 equip(sets.Precast.FastCast)
  404.             end
  405.         end
  406.     elseif spell.type == "Waltz" then
  407.         refine_waltz(spell,action)
  408.         equip(sets.Waltz)
  409.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  410.         cast_delay(0.2)
  411.         send_command('cancel Sneak')
  412.     elseif spell.type == "PetCommand" then
  413.         equip(sets.Pet[spell.english])
  414.     end
  415.     if Twilight == 'Twilight' then
  416.         equip(sets.Twilight)
  417.     end
  418. end
  419.  
  420. function midcast(spell,action)
  421.     if pet_midaction() then
  422.         return
  423.     elseif spell.action_type == 'Ranged Attack' then
  424.         equip({ammo="Pebble"})
  425.     elseif spell.action_type == 'Magic' then
  426.         if (spell.english:startswith('Cur') or spell.english == "Wild Carrot" or spell.english == "Healing Breeze") and spell.english ~= "Cursna" then
  427.             equip(sets.Midcast.Cure)
  428.         elseif spell.english == "Stoneskin" then
  429.             if buffactive.Stoneskin then
  430.                 send_command('@wait 2.8;cancel stoneskin')
  431.             end
  432.             equip(sets.Midcast.Stoneskin)
  433.         elseif spell.english:startswith('Protect') or spell.english:startswith('Shell') then
  434.             if spell.target.name == player.name then
  435.                 equipSet = set_combine(equipSet,{ring2="Sheltered Ring"})
  436.             end
  437.         elseif spell.english == "Sneak" then
  438.             if spell.target.name == player.name and buffactive['Sneak'] then
  439.                 send_command('cancel sneak')
  440.             end
  441.             equip(sets.Midcast.Haste)
  442.         elseif spell.english:startswith('Utsusemi') then
  443.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  444.                 send_command('@wait 1.7;cancel Copy Image*')
  445.             end
  446.             equip(sets.Midcast.Haste)
  447.         elseif spell.english == 'Monomi: Ichi' then
  448.             if buffactive['Sneak'] then
  449.                 send_command('@wait 1.7;cancel sneak')
  450.             end
  451.             equip(sets.Midcast.Haste)
  452.         elseif Healer_Type_Wyvern:contains(player.sub_job) and player.hpp < 51 and pet.isvalid then
  453.             equip(sets.Healing_Breath_Trigger)
  454.         elseif Hybrid_Type_Wyvern:contains(player.sub_job) and player.hpp < 34 and pet.isvalid then
  455.             equip(sets.Healing_Breath_Trigger)
  456.         else
  457.             equip(sets.Midcast.Haste)
  458.         end
  459.     end
  460. end
  461.  
  462. function aftercast(spell,action)
  463.     if pet_midaction() then
  464.         return
  465.     elseif not spell.interrupted then
  466.         if spell.type == "WeaponSkill" then
  467.             send_command('wait 0.2;gs c TP')
  468.         elseif spell.english == "Angon" then -- Angon Timer/Countdown --
  469.             timer_angon()
  470.             send_command('wait 80;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;timers delete "Angon";input /echo '..spell.name..': [OFF]')
  471.         elseif spell.english == "Ancient Circle" then -- Ancient Circle Countdown --
  472.             send_command('wait 260;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..': [OFF]')
  473.         end
  474.     elseif not spell.type == "PetCommand" then
  475.         status_change(player.status)
  476.     end
  477. end
  478.  
  479. function status_change(new,old)
  480.     check_equip_lock()
  481.     if Armor == 'PDT' then
  482.         equip(sets.PDT)
  483.     elseif Armor == 'MDT' then
  484.         equip(sets.MDT)
  485.     elseif new == 'Engaged' then
  486.         equipSet = sets.TP
  487.         if Armor == 'Hybrid' and equipSet["Hybrid"] then
  488.             equipSet = equipSet["Hybrid"]
  489.         end
  490.         if equipSet[player.equipment.main] then
  491.             equipSet = equipSet[player.equipment.main]
  492.         end
  493.         if equipSet[AccArray[AccIndex]] then
  494.             equipSet = equipSet[AccArray[AccIndex]]
  495.         end
  496.         if buffactive["Aftermath: Lv.3"] and equipSet["AM3"] then
  497.             if Rancor == 'ON' then -- Default Rancor Toggle Is Rancorous Mantle --
  498.                 equipSet = set_combine(equipSet["AM3"],sets.TP.Rancor)
  499.             else -- Use Rancor Toggle For Atheling Mantle --
  500.                 equipSet = equipSet["AM3"]
  501.             end
  502.         end
  503.         if buffactive.Ionis and equipSet["Ionis"] then
  504.             equipSet = equipSet["Ionis"]
  505.         end
  506.         if buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
  507.             equipSet = equipSet["STP"]
  508.         end
  509.         equip(equipSet)
  510.     else
  511.         equipSet = sets.Idle
  512.         if equipSet[IdleArray[IdleIndex]] then
  513.             equipSet = equipSet[IdleArray[IdleIndex]]
  514.         end
  515.         if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
  516.             equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
  517.         end
  518.         if world.area:endswith('Adoulin') then
  519.             equipSet = set_combine(equipSet,{body="Councilor's Garb"})
  520.         end
  521.         equip(equipSet)
  522.     end
  523.     if Twilight == 'Twilight' then
  524.         equip(sets.Twilight)
  525.     end
  526. end
  527.  
  528. function buff_change(buff,gain)
  529.     buff = string.lower(buff)
  530.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  531.         if gain then
  532.             send_command('timers create "Aftermath: Lv.3" 180 down;wait 150;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 15;input /echo Aftermath: Lv.3 [WEARING OFF IN 15 SEC.];wait 5;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  533.         else
  534.             send_command('timers delete "Aftermath: Lv.3"')
  535.             add_to_chat(123,'AM3: [OFF]')
  536.         end
  537.     elseif buff == 'weakness' then -- Weakness Timer --
  538.         if gain then
  539.             send_command('timers create "Weakness" 300 up')
  540.         else
  541.             send_command('timers delete "Weakness"')
  542.         end
  543.     end
  544.     if buff == "sleep" and gain and player.hp > 200 and player.status == "Engaged" then -- Equip Berserker's Torque When You Are Asleep & Have 200+ HP --
  545.         equip({neck="Berserker's Torque"})
  546.     else
  547.         if not midaction() and not pet_midaction() then
  548.             status_change(player.status)
  549.         end
  550.     end
  551. end
  552.  
  553. function pet_midcast(spell,action)
  554.     if spell.english:startswith('Healing') then
  555.         equip(sets.Healing_Breath)
  556.     elseif spell.target.type == 'MONSTER' then
  557.         equip(sets.Elemental_Breath)
  558.     end
  559. end
  560.  
  561. function pet_aftercast(spell,action)
  562.     status_change(player.status)
  563. end
  564.  
  565. function pet_change(pet,gain)
  566.     status_change(player.status)
  567. end
  568.  
  569. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  570. function self_command(command)
  571.     if command == 'C1' then -- Accuracy Level Toggle --
  572.         AccIndex = (AccIndex % #AccArray) + 1
  573.         add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
  574.         status_change(player.status)
  575.     elseif command == 'C9' then -- Attack Toggle --
  576.         AttIndex = (AttIndex % #AttArray) + 1
  577.         add_to_chat(158,'Attack Level: '..AttArray[AttIndex])
  578.         status_change(player.status)
  579.     elseif command == 'C5' then -- Auto Update Gear Toggle --
  580.         status_change(player.status)
  581.         add_to_chat(158,'Auto Update Gear')
  582.     elseif command == 'C2' then -- Hybrid Toggle --
  583.         if Armor == 'Hybrid' then
  584.             Armor = 'None'
  585.             add_to_chat(123,'Hybrid Set: [Unlocked]')
  586.         else
  587.             Armor = 'Hybrid'
  588.             add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
  589.         end
  590.         status_change(player.status)
  591.     elseif command == 'C7' then -- PDT Toggle --
  592.         if Armor == 'PDT' then
  593.             Armor = 'None'
  594.             add_to_chat(123,'PDT Set: [Unlocked]')
  595.         else
  596.             Armor = 'PDT'
  597.             add_to_chat(158,'PDT Set: [Locked]')
  598.         end
  599.         status_change(player.status)
  600.     elseif command == 'C15' then -- MDT Toggle --
  601.         if Armor == 'MDT' then
  602.             Armor = 'None'
  603.             add_to_chat(123,'MDT Set: [Unlocked]')
  604.         else
  605.             Armor = 'MDT'
  606.             add_to_chat(158,'MDT Set: [Locked]')
  607.         end
  608.         status_change(player.status)
  609.     elseif command == 'C16' then -- Rancor Toggle --
  610.         if Rancor == 'ON' then
  611.             Rancor = 'OFF'
  612.             add_to_chat(123,'Rancor: [OFF]')
  613.         else
  614.             Rancor = 'ON'
  615.             add_to_chat(158,'Rancor: [ON]')
  616.         end
  617.         status_change(player.status)
  618.     elseif command == 'C10' then -- High Jump Enmity Toggle --
  619.         if Brais == 'ON' then
  620.             Brais = 'OFF'
  621.             add_to_chat(123,'High Jump Enmity: [OFF]')
  622.         else
  623.             Brais = 'ON'
  624.             add_to_chat(158,'High Jump Enmity: [ON]')
  625.         end
  626.         status_change(player.status)
  627.     elseif command == 'C17' then -- SAM Roll Toggle --
  628.         if Samurai_Roll == 'ON' then
  629.             Samurai_Roll = 'OFF'
  630.             add_to_chat(123,'SAM Roll: [OFF]')
  631.         else
  632.             Samurai_Roll = 'ON'
  633.             add_to_chat(158,'SAM Roll: [ON]')
  634.         end
  635.         status_change(player.status)
  636.     elseif command == 'C3' then -- Twilight Toggle --
  637.         if Twilight == 'Twilight' then
  638.             Twilight = 'None'
  639.             add_to_chat(123,'Twilight Set: [Unlocked]')
  640.         else
  641.             Twilight = 'Twilight'
  642.             add_to_chat(158,'Twilight Set: [locked]')
  643.         end
  644.         status_change(player.status)
  645.     elseif command == 'C8' then -- Distance Toggle --
  646.         if player.target.distance then
  647.             target_distance = math.floor(player.target.distance*10)/10
  648.             add_to_chat(158,'Distance: '..target_distance)
  649.         else
  650.             add_to_chat(123,'No Target Selected')
  651.         end
  652.     elseif command == 'C6' then -- Idle Toggle --
  653.         IdleIndex = (IdleIndex % #IdleArray) + 1
  654.         add_to_chat(158,'Idle Set: ' .. IdleArray[IdleIndex])
  655.         status_change(player.status)
  656.     elseif command == 'TP' then
  657.         add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
  658.     elseif command:match('^SC%d$') then
  659.         send_command('//' .. sc_map[command])
  660.     end
  661. end
  662.  
  663. function check_equip_lock() -- Lock Equipment Here --
  664.     if player.equipment.left_ring == "Warp Ring" or player.equipment.left_ring == "Capacity Ring" or player.equipment.right_ring == "Warp Ring" or player.equipment.right_ring == "Capacity Ring" then
  665.         disable('ring1','ring2')
  666.     elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
  667.         disable('back')
  668.     else
  669.         enable('ring1','ring2','back')
  670.     end
  671. end
  672.  
  673. function timer_angon()
  674.     local duration = 90
  675.     send_command('timers create "Angon" '..tostring(duration)..' down')
  676. end
  677.  
  678. function actualCost(originalCost)
  679.     if buffactive["Penury"] then
  680.         return originalCost*.5
  681.     elseif buffactive["Light Arts"] or buffactive["Addendum: White"] then
  682.         return originalCost*.9
  683.     elseif buffactive["Dark Arts"] or buffactive["Addendum: Black"] then
  684.         return originalCost*1.1
  685.     else
  686.         return originalCost
  687.     end
  688. end
  689.  
  690. function degrade_spell(spell,degrade_array)
  691.     spell_index = table.find(degrade_array,spell.name)
  692.     if spell_index > 1 then
  693.         new_spell = degrade_array[spell_index - 1]
  694.         change_spell(new_spell,spell.target.raw)
  695.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  696.     end
  697. end
  698.  
  699. function change_spell(spell_name,target)
  700.     cancel_spell()
  701.     send_command('//'..spell_name..' '..target)
  702. end
  703.  
  704. function refine_waltz(spell,action)
  705.     if spell.type ~= 'Waltz' then
  706.         return
  707.     end
  708.  
  709.     if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" or spell.name == "Divine Waltz II" then
  710.         return
  711.     end
  712.  
  713.     local newWaltz = spell.english
  714.     local waltzID
  715.  
  716.     local missingHP
  717.  
  718.     if spell.target.type == "SELF" then
  719.         missingHP = player.max_hp - player.hp
  720.     elseif spell.target.isallymember then
  721.         local target = find_player_in_alliance(spell.target.name)
  722.         local est_max_hp = target.hp / (target.hpp/100)
  723.         missingHP = math.floor(est_max_hp - target.hp)
  724.     end
  725.  
  726.     if missingHP ~= nil then
  727.         if player.sub_job == 'DNC' then
  728.             if missingHP < 40 and spell.target.name == player.name then
  729.                 add_to_chat(123,'Full HP!')
  730.                 cancel_spell()
  731.                 return
  732.             elseif missingHP < 150 then
  733.                 newWaltz = 'Curing Waltz'
  734.                 waltzID = 190
  735.             elseif missingHP < 300 then
  736.                 newWaltz = 'Curing Waltz II'
  737.                 waltzID = 191
  738.             else
  739.                 newWaltz = 'Curing Waltz III'
  740.                 waltzID = 192
  741.             end
  742.         else
  743.             return
  744.         end
  745.     end
  746.  
  747.     local waltzTPCost = {['Curing Waltz'] = 20, ['Curing Waltz II'] = 35, ['Curing Waltz III'] = 50, ['Curing Waltz IV'] = 65, ['Curing Waltz V'] = 80}
  748.     local tpCost = waltzTPCost[newWaltz]
  749.  
  750.     local downgrade
  751.  
  752.     if player.tp < tpCost and not buffactive.trance then
  753.  
  754.         if player.tp < 20 then
  755.             add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
  756.             cancel_spell()
  757.             return
  758.         elseif player.tp < 35 then
  759.             newWaltz = 'Curing Waltz'
  760.         elseif player.tp < 50 then
  761.             newWaltz = 'Curing Waltz II'
  762.         elseif player.tp < 65 then
  763.             newWaltz = 'Curing Waltz III'
  764.         elseif player.tp < 80 then
  765.             newWaltz = 'Curing Waltz IV'
  766.         end
  767.  
  768.         downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
  769.     end
  770.  
  771.     if newWaltz ~= spell.english then
  772.         send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
  773.         if downgrade then
  774.             add_to_chat(158, downgrade)
  775.         end
  776.         cancel_spell()
  777.         return
  778.     end
  779.  
  780.     if missingHP > 0 then
  781.         add_to_chat(158,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
  782.     end
  783. end
  784.  
  785. function find_player_in_alliance(name)
  786.     for i,v in ipairs(alliance) do
  787.         for k,p in ipairs(v) do
  788.             if p.name == name then
  789.                 return p
  790.             end
  791.         end
  792.     end
  793. end
  794.  
  795. function sub_job_change(newSubjob, oldSubjob)
  796.     select_default_macro_book()
  797. end
  798.  
  799. function set_macro_page(set,book)
  800.     if not tonumber(set) then
  801.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  802.         return
  803.     end
  804.     if set < 1 or set > 10 then
  805.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  806.         return
  807.     end
  808.  
  809.     if book then
  810.         if not tonumber(book) then
  811.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  812.             return
  813.         end
  814.         if book < 1 or book > 20 then
  815.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  816.             return
  817.         end
  818.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  819.     else
  820.         send_command('@input /macro set '..tostring(set))
  821.     end
  822. end
  823.  
  824. function select_default_macro_book()
  825.     -- Default macro set/book
  826.     if player.sub_job == 'SAM' then
  827.         set_macro_page(1, 5)
  828.     elseif player.sub_job == 'DNC' then
  829.         set_macro_page(5, 5)
  830.     elseif player.sub_job == 'WAR' then
  831.         set_macro_page(9, 5)
  832.     elseif player.sub_job == 'WHM' then
  833.         set_macro_page(3, 5)
  834.     elseif player.sub_job == 'NIN' then
  835.         set_macro_page(10, 5)
  836.     else
  837.         set_macro_page(1, 5)
  838.     end
  839. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement