Bokura

Bokura_GEO

Jan 29th, 2014
1,836
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 21.57 KB | None | 0 0
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Motenten's Macro Book Function ** --
  3.  
  4. function get_sets()
  5.     AccIndex = 1
  6.     AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For Magic. Default ACC Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  7.     IdleIndex = 1
  8.     IdleArray = {"Movement","Refresh","Luopan"} -- Default Idle Set Is Movement --
  9.     Armor = 'None'
  10.     StunIndex = 0
  11.     Lock_Main = 'OFF' -- Set Default Lock Main Weapon ON or OFF Here --
  12.     Obi = 'ON' -- Set Default Obi ON or OFF Here --
  13.     Elemental_Staff = 'ON' -- Set Default Precast Elemental Staff ON or OFF Here --
  14.     LowNuke = 'ON' -- Set Default Low Tier Nuke ON or OFF Here --
  15.     MB = 'OFF' -- Set Default MB ON or OFF Here --
  16.     target_distance = 5 -- Set Default Distance Here --
  17.     define_geomancy_values()
  18.     select_default_macro_book() -- Change Default Macro Book At The End --
  19.  
  20.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  21.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  22.     sc_map = {SC1 = "GeoTorpor", SC2 = "GeoLanguor", SC3 = "IndiFocus"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  23.  
  24.     -- Add or Remove Low Tier Spells Here --
  25.     Low_Tier_Spells = S{
  26.             'Fire','Aero','Water','Blizzard','Stone','Thunder','Fire II','Aero II','Water II',
  27.             'Blizzard II','Stone II','Thunder II'}
  28.  
  29.     Non_Obi_Spells = S{
  30.             'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  31.             'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  32.  
  33.     Cities = S{
  34.             "Ru'lude Gardens","Upper Jeuno","Lower Jeuno","Port Jeuno",
  35.             "Port Windurst","Windurst Waters","Windurst Woods","Windurst Walls","Heavens Tower",
  36.             "Port San d'Oria","Northern San d'Oria","Southern San d'Oria",
  37.             "Port Bastok","Bastok Markets","Bastok Mines","Metalworks",
  38.             "Aht Urhgan Whitegate","Nashmau","Tavanazian Safehold",
  39.             "Selbina","Mhaura","Norg","Eastern Adoulin","Western Adoulin","Kazham"}
  40.  
  41.     sets.Idle = {}
  42.  
  43.     -- Idle Sets --
  44.     sets.Idle.Refresh = {}
  45.     sets.Idle.Movement =  set_combine(sets.Idle.Refresh,{
  46.             feet="Geo. Sandals +1"})
  47.  
  48.     -- Luopan Idle Set --
  49.     sets.Idle.Luopan =  set_combine(sets.Idle.Refresh,{
  50.             main="Idris",
  51.             sub="Genbu's Shield",
  52.             neck="Twilight Torque",
  53.             hands="Geo. Mitaines +1",
  54.             ring1="Defending Ring",
  55.             ring2="Dark Ring",
  56.             back="Lifestream Cape",
  57.             feet="Bagua Sandals +1"})
  58.            
  59.     sets.Resting = set_combine(sets.Idle.Movement,{})
  60.  
  61.     -- PDT Set --
  62.     sets.PDT = {}
  63.  
  64.     -- Sublimation Set --
  65.     sets.Sublimation = {}
  66.  
  67.     sets.Precast = {}
  68.     -- FastCast Set --
  69.     sets.Precast.FastCast = {
  70.             sub=empty}
  71.  
  72.     -- Geomancy Precast (empty = To Fix Club/Staff Issue) --
  73.     sets.Precast.GeoCast = {
  74.             sub=empty,
  75.             range=empty,
  76.             ammo="Impatiens",
  77.             hands="Geo. Mitaines +1",
  78.             back="Lifestream Cape",
  79.             legs="Geo. Pants +1"}
  80.  
  81.     -- Elemental Staves --
  82.     sets.Precast.Lightning = {main='Apamajas I'}
  83.     sets.Precast.Water = {main='Haoma I'}
  84.     sets.Precast.Fire = {main='Atar I'}
  85.     sets.Precast.Ice = {main='Vourukasha I'}
  86.     sets.Precast.Wind = {main='Vayuvata I'}
  87.     sets.Precast.Earth = {main='Vishrava I'}
  88.     sets.Precast.Light = {main='Arka I'}
  89.     sets.Precast.Dark = {main='Xsaeta I'}
  90.  
  91.     -- Precast Enhancing Magic --
  92.     sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  93.  
  94.     -- Precast Elemental Magic --
  95.     sets.Precast['Elemental Magic'] = set_combine(sets.Precast.FastCast,{hands="Bagua Mitaines +1"})
  96.  
  97.     -- Precast Cure Set --
  98.     sets.Precast.Cure = {
  99.             sub=empty}
  100.  
  101.     -- Midcast Base Set --
  102.     sets.Midcast = {}
  103.  
  104.     -- Midcast Geocolure Set --
  105.     sets.Midcast.Geocolure = {
  106.             main="Idris",
  107.             sub="Genbu's Shield",
  108.             range="Dunna",
  109.             ammo=empty,
  110.             body="Bagua Tunic +1",
  111.             hands="Geo. Mitaines +1",
  112.             back="Lifestream Cape"}
  113.  
  114.     -- Midcast Indicolure Set --
  115.     sets.Midcast.Indicolure = set_combine(sets.Midcast.Geocolure,{
  116.             legs="Bagua Pants +1",
  117.             feet="Azimuth Gaiters +1"})
  118.  
  119.     -- Cure Set --
  120.     sets.Midcast.Cure = {}
  121.  
  122.     -- Curaga Set --
  123.     sets.Midcast.Curaga = {}
  124.  
  125.     -- Haste Set --
  126.     sets.Midcast.Haste = {}
  127.  
  128.     -- Enhancing Set --
  129.     sets.Midcast['Enhancing Magic'] = {}
  130.  
  131.     -- Stoneskin Set --
  132.     sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{})
  133.  
  134.     -- Cursna Set --
  135.     sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{})
  136.  
  137.     -- Stun Sets --
  138.     sets.Midcast.Stun = {}
  139.     sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  140.     sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  141.  
  142.     -- Dark Magic Sets --
  143.     sets.Midcast['Dark Magic'] = {}
  144.     sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
  145.     sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
  146.  
  147.     -- Aspir Set --
  148.     sets.Midcast.Aspir = {}
  149.  
  150.     -- Drain Set --
  151.     sets.Midcast.Drain = {}
  152.  
  153.     -- Low Tier Set --
  154.     sets.LowNuke = {}
  155.  
  156.     -- MB Set --
  157.     sets.MB = {}
  158.  
  159.     -- Elemental Sets --
  160.     sets.Midcast['Elemental Magic'] = {}
  161.     sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{})
  162.     sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{})
  163.  
  164.     -- Enfeebling Sets --
  165.     sets.Midcast['Enfeebling Magic'] = {}
  166.     sets.Midcast['Enfeebling Magic'].MidACC =  set_combine(sets.Midcast['Enfeebling Magic'],{})
  167.     sets.Midcast['Enfeebling Magic'].HighACC = set_combine(sets.Midcast['Enfeebling Magic'].MidACC,{})
  168.  
  169.     -- Impact Set --
  170.     sets.Midcast.Impact = {
  171.             body="Twilight Cloak"}
  172.  
  173.     -- Elemental Obi/Twilight Cape --
  174.     sets.Obi = {}
  175.     sets.Obi.Lightning = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  176.     sets.Obi.Water = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  177.     sets.Obi.Fire = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  178.     sets.Obi.Ice = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  179.     sets.Obi.Wind = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  180.     sets.Obi.Earth = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  181.     sets.Obi.Light = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  182.     sets.Obi.Dark = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  183.  
  184.     -- JA Sets --
  185.     sets.JA = {}
  186.     sets.JA['Life Cycle'] = {body="Geo. Tunic +1"}
  187.     sets.JA.Bolster = {body="Bagua Tunic +1"}
  188.     sets.JA['Radial Arcana'] = {feet="Bagua Sandals +1"}
  189.     sets.JA['Mending Halation'] = {feet="Bagua Pants +1"}
  190.  
  191.     -- Melee Set --
  192.     sets.Melee = set_combine(sets.Midcast.Haste,{})
  193.  
  194.     -- WS Base Set --
  195.     sets.WS = {}
  196.  
  197.     sets.WS.Exudation = {}
  198.     sets.WS["Hexa Strike"] = {}
  199.     sets.WS.Realmrazer = {}
  200.     sets.WS.Shattersoul = {}
  201.  
  202.     -- Idle Reive Set --
  203.     sets.Reive = {neck="Arciela's Grace +1"}
  204. end
  205.  
  206. function pretarget(spell,action)
  207.     if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  208.         cancel_spell()
  209.         send_command('input /item "Echo Drops" <me>')
  210.     elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  211.         cancel_spell()
  212.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  213.         return
  214.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  215.         degrade_spell(spell,Cure_Spells)
  216.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  217.         degrade_spell(spell,Curaga_Spells)
  218.     elseif spell.english:startswith('Geo') and pet.isvalid then -- Change Any Geo Spells To Full Circle If You Have A Luopan Active --
  219.         cancel_spell()
  220.         send_command('input /ja "Full Circle" <me>')
  221.     elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  222.         if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  223.             cancel_spell()
  224.             send_command('input /ja Addendum: White <me>')
  225.         elseif spell.english == "Manifestation" then
  226.             cancel_spell()
  227.             send_command('input /ja Accession <me>')
  228.         elseif spell.english == "Alacrity" then
  229.             cancel_spell()
  230.             send_command('input /ja Celerity <me>')
  231.         elseif spell.english == "Parsimony" then
  232.             cancel_spell()
  233.             send_command('input /ja Penury <me>')
  234.         end
  235.     elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  236.         if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  237.             cancel_spell()
  238.             send_command('input /ja Addendum: Black <me>')
  239.         elseif spell.english == "Accession" then
  240.             cancel_spell()
  241.             send_command('input /ja Manifestation <me>')
  242.         elseif spell.english == "Celerity" then
  243.             cancel_spell()
  244.             send_command('input /ja Alacrity <me>')
  245.         elseif spell.english == "Penury" then
  246.             cancel_spell()
  247.             send_command('input /ja Parsimony <me>')
  248.         end
  249.     end
  250. end
  251.  
  252. function precast(spell,action)
  253.     if spell.action_type == 'Magic' then
  254.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  255.             cancel_spell()
  256.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  257.             return
  258.         else
  259.             if spell.type == "Geomancy" then
  260.                 if Cities:contains(world.area) then
  261.                     cancel_spell()
  262.                     add_to_chat(123,'Unable To Use Geomancy In Town')
  263.                     return
  264.                 else
  265.                     display_geomancy_info(spell)
  266.                     equip(sets.Precast.GeoCast)
  267.                 end
  268.             elseif spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  269.                 equip(sets.Precast.Cure)
  270.             elseif spell.english == "Impact" then
  271.                 equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  272.             elseif spell.english == 'Utsusemi: Ni' then
  273.                 if buffactive['Copy Image (3)'] then
  274.                     cancel_spell()
  275.                     add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  276.                     return
  277.                 else
  278.                     equip(sets.Precast.FastCast)
  279.                 end
  280.             elseif sets.Precast[spell.skill] then
  281.                 equip(sets.Precast[spell.skill])
  282.             else
  283.                 equip(sets.Precast.FastCast)
  284.             end
  285.         end
  286.     elseif spell.type == "WeaponSkill" then
  287.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  288.             cancel_spell()
  289.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  290.             return
  291.         else
  292.             if sets.WS[spell.english] then
  293.                 equip(sets.WS[spell.english])
  294.             end
  295.         end
  296.     elseif spell.type == "JobAbility" then
  297.         if sets.JA[spell.english] then
  298.             equip(sets.JA[spell.english])
  299.         end
  300.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  301.         cast_delay(0.2)
  302.         send_command('cancel Sneak')
  303.     end
  304.     if sets.Precast[spell.element] and Elemental_Staff == 'ON' then
  305.         equip(sets.Precast[spell.element])
  306.     end
  307.     if StunIndex == 1 then
  308.         equip(sets.Midcast.Stun)
  309.     end
  310. end
  311.  
  312. function midcast(spell,action)
  313.     equipSet = {}
  314.     if spell.action_type == 'Magic' then
  315.         equipSet = sets.Midcast
  316.         if spell.type == "Geomancy" then
  317.             if spell.english:startswith('Indi') then
  318.                 equipSet = equipSet.Indicolure
  319.             else
  320.                 equipSet = equipSet.Geocolure
  321.             end
  322.         elseif spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  323.             if spell.english:startswith('Cure') then
  324.                 equipSet = equipSet.Cure
  325.             elseif spell.english:startswith('Cura') then
  326.                 equipSet = equipSet.Curaga
  327.             end
  328.             if world.day_element == spell.element or world.weather_element == spell.element then
  329.                 equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Hachirin-no-Obi"})
  330.             end
  331.         elseif spell.english:startswith('Banish') then
  332.             equipSet = set_combine(equipSet.Haste,{ring1="Fenian Ring"})
  333.         elseif spell.english == "Stoneskin" then
  334.             if buffactive.Stoneskin then
  335.                 send_command('@wait 2.8;cancel stoneskin')
  336.             end
  337.             equipSet = equipSet.Stoneskin
  338.         elseif spell.english == "Sneak" then
  339.             if spell.target.name == player.name and buffactive['Sneak'] then
  340.                 send_command('cancel sneak')
  341.             end
  342.             equipSet = equipSet.Haste
  343.         elseif spell.english:startswith('Aspir') then
  344.             equipSet = equipSet.Aspir
  345.         elseif spell.english == "Drain" then
  346.             equipSet = equipSet.Drain
  347.         elseif spell.english:startswith('Utsusemi') then
  348.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  349.                 send_command('@wait 1.7;cancel Copy Image*')
  350.             end
  351.             equipSet = equipSet.Haste
  352.         elseif spell.english == 'Monomi: Ichi' then
  353.             if buffactive['Sneak'] then
  354.                 send_command('@wait 1.7;cancel sneak')
  355.             end
  356.             equipSet = equipSet.Haste
  357.         elseif Low_Tier_Spells:contains(spell.english) and LowNuke == 'ON' then
  358.             equipSet = set_combine(equipSet,sets.LowNuke)
  359.         elseif spell.skill == 'Elemental Magic' and MB == 'ON' then
  360.             equipSet = set_combine(equipSet,sets.MB)
  361.         else
  362.             if equipSet[spell.english] then
  363.                 equipSet = equipSet[spell.english]
  364.             end
  365.             if equipSet[spell.skill] then
  366.                 equipSet = equipSet[spell.skill]
  367.             end
  368.             if equipSet[AccArray[AccIndex]] then
  369.                 equipSet = equipSet[AccArray[AccIndex]]
  370.             end
  371.             if equipSet[spell.type] then
  372.                 equipSet = equipSet[spell.type]
  373.             end
  374.             if (spell.skill == 'Elemental Magic' or spell.english:startswith('Cur') or spell.english:startswith('Bio') or spell.english:startswith('Dia') or spell.english == 'Aspir' or spell.english == 'Drain') and not Non_Obi_Spells:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' and spell.english ~= "Cursna" then -- Use Obi Toggle To Equip Normal Waist Gear --
  375.                 equipSet = set_combine(equipSet,sets.Obi[spell.element])
  376.             end
  377.         end
  378.     elseif equipSet[spell.english] then
  379.         equipSet = equipSet[spell.english]
  380.     end
  381.     equip(equipSet)
  382.     if StunIndex == 1 then
  383.         equip(sets.Midcast.Stun)
  384.     end
  385. end
  386.  
  387. function aftercast(spell,action)
  388.     if not spell.interrupted then
  389.         if spell.english == "Sleep II" then-- Sleep II Countdown --
  390.             send_command('wait 60;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  391.         elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  392.             send_command('wait 30;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  393.         elseif spell.english == "Banish II" then -- Banish II Countdown --
  394.             send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  395.         end
  396.     end
  397.     status_change(player.status)
  398. end
  399.  
  400. function status_change(new,old)
  401.     check_equip_lock()
  402.     if Armor == 'PDT' then
  403.         equip(sets.PDT)
  404.     elseif buffactive["Sublimation: Activated"] then
  405.         equip(sets.Sublimation)
  406.     elseif new == 'Engaged' then
  407.         equip(sets.Melee)
  408.     elseif new == 'Idle' then
  409.         equipSet = sets.Idle
  410.         if equipSet[IdleArray[IdleIndex]] then
  411.             equipSet = equipSet[IdleArray[IdleIndex]]
  412.         end
  413.         if buffactive['Reive Mark'] then -- Equip Arciela's Grace +1 During Reive --
  414.             equipSet = set_combine(equipSet,sets.Reive)
  415.         end
  416.         if world.area:endswith('Adoulin') then
  417.             equipSet = set_combine(equipSet,{body="Councilor's Garb"})
  418.         end
  419.         equip(equipSet)
  420.     elseif new == 'Resting' then
  421.         equip(sets.Resting)
  422.     end
  423.     if StunIndex == 1 then
  424.         equip(sets.Midcast.Stun)
  425.     end
  426. end
  427.  
  428. function buff_change(buff,gain)
  429.     buff = string.lower(buff)
  430.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  431.         if gain then
  432.             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.]')
  433.         else
  434.             send_command('timers delete "Aftermath: Lv.3"')
  435.             add_to_chat(123,'AM3: [OFF]')
  436.         end
  437.     elseif buff == 'weakness' then -- Weakness Timer --
  438.         if gain then
  439.             send_command('timers create "Weakness" 300 up')
  440.         else
  441.             send_command('timers delete "Weakness"')
  442.         end
  443.     end
  444.     if not midaction() then
  445.         status_change(player.status)
  446.     end
  447. end
  448.  
  449. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  450. function self_command(command)
  451.     if command == 'C1' then -- Magic Accuracy Toggle --
  452.         AccIndex = (AccIndex % #AccArray) + 1
  453.         add_to_chat(158,'Magic Accuracy Level: ' .. AccArray[AccIndex])
  454.         status_change(player.status)
  455.     elseif command == 'C2' then -- Stun Toggle --
  456.         if StunIndex == 1 then
  457.             StunIndex = 0
  458.             add_to_chat(123,'Stun Set: [Unlocked]')
  459.         else
  460.             StunIndex = 1
  461.             add_to_chat(158,'Stun Set: [Locked]')
  462.         end
  463.         status_change(player.status)
  464.     elseif command == 'C5' then -- Auto Update Gear Toggle --
  465.         status_change(player.status)
  466.         add_to_chat(158,'Auto Update Gear')
  467.     elseif command == 'C3' then -- Obi Toggle --
  468.         if Obi == 'ON' then
  469.             Obi = 'OFF'
  470.             add_to_chat(123,'Obi: [OFF]')
  471.         else
  472.             Obi = 'ON'
  473.             add_to_chat(158,'Obi: [ON]')
  474.         end
  475.         status_change(player.status)
  476.     elseif command == 'C7' then -- PDT Toggle --
  477.         if Armor == 'PDT' then
  478.             Armor = 'None'
  479.             add_to_chat(123,'PDT Set: [Unlocked]')
  480.         else
  481.             Armor = 'PDT'
  482.             add_to_chat(158,'PDT Set: [Locked]')
  483.         end
  484.         status_change(player.status)
  485.     elseif command == 'C10' then -- Idris Toggle --
  486.         if Idris == 'ON' then
  487.             Idris = 'OFF'
  488.             add_to_chat(123,'Idris: [OFF]')
  489.         else
  490.             Idris = 'ON'
  491.             add_to_chat(158,'Idris: [ON]')
  492.         end
  493.         status_change(player.status)
  494.     elseif command == 'C15' then -- LowNuke Toggle --
  495.         if LowNuke == 'ON' then
  496.             LowNuke = 'OFF'
  497.             add_to_chat(123,'Low Nuke: [OFF]')
  498.         else
  499.             LowNuke = 'ON'
  500.             add_to_chat(158,'Low Nuke: [ON]')
  501.         end
  502.         status_change(player.status)
  503.     elseif command == 'C9' then -- MB Toggle --
  504.         if MB == 'ON' then
  505.             MB = 'OFF'
  506.             add_to_chat(123,'MB: [OFF]')
  507.         else
  508.             MB = 'ON'
  509.             add_to_chat(158,'MB: [ON]')
  510.         end
  511.         status_change(player.status)
  512.     elseif command == 'C17' then -- Lock Main Weapon Toggle --
  513.         if Lock_Main == 'ON' then
  514.             Lock_Main = 'OFF'
  515.             add_to_chat(123,'Main Weapon: [Unlocked]')
  516.         else
  517.             Lock_Main = 'ON'
  518.             add_to_chat(158,'Main Weapon: [Locked]')
  519.         end
  520.         status_change(player.status)
  521.     elseif command == 'C8' then -- Distance Toggle --
  522.         if player.target.distance then
  523.             target_distance = math.floor(player.target.distance*10)/10
  524.             add_to_chat(158,'Distance: '..target_distance)
  525.         else
  526.             add_to_chat(123,'No Target Selected')
  527.         end
  528.     elseif command == 'C6' then -- Idle Toggle --
  529.         IdleIndex = (IdleIndex % #IdleArray) + 1
  530.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  531.         status_change(player.status)
  532.     elseif command:match('^SC%d$') then
  533.         send_command('//' .. sc_map[command])
  534.     end
  535. end
  536.  
  537. function check_equip_lock() -- Lock Equipment Here --
  538.     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
  539.         disable('ring1','ring2')
  540.     elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
  541.         disable('back')
  542.     elseif Lock_Main == 'ON' then
  543.         disable('main','sub')
  544.     else
  545.         enable('main','sub','ring1','ring2','back')
  546.     end
  547. end
  548.  
  549. function actualCost(originalCost)
  550.     if buffactive["Penury"] then
  551.         return originalCost*.5
  552.     elseif buffactive["Light Arts"] then
  553.         return originalCost*.9
  554.     else
  555.         return originalCost
  556.     end
  557. end
  558.  
  559. function degrade_spell(spell,degrade_array)
  560.     spell_index = table.find(degrade_array,spell.name)
  561.     if spell_index > 1 then
  562.         new_spell = degrade_array[spell_index - 1]
  563.         change_spell(new_spell,spell.target.raw)
  564.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  565.     end
  566. end
  567.  
  568. function change_spell(spell_name,target)
  569.     cancel_spell()
  570.     send_command('//'..spell_name..' '..target)
  571. end
  572.  
  573. function define_geomancy_values()
  574.     geomancy = {
  575.         Frailty = {bonus="Defense Down"},
  576.         Torpor = {bonus="Evasion Down"},
  577.         Languor = {bonus="Magic Evasion Down"},
  578.         Focus = {bonus="Magic Accuracy"},
  579.         Malaise = {bonus="Magic Defense Down"},
  580.         Precision = {bonus="Accuracy"},
  581.         Refresh = {bonus="Refresh"},
  582.         Fade = {bonus="Magic Attack Down"},
  583.         Wilt = {bonus="Attack Down"},
  584.         Vex = {bonus="Magic Accuracy Down"},
  585.         Slip = {bonus="Accuracy Down"},
  586.         Acumen = {bonus="Magic Attack"},
  587.         Fend = {bonus="Magic Defense"},
  588.         Fury = {bonus="Attack"},
  589.         Attunement = {bonus="Magic Evasion"},
  590.         Voidance = {bonus="Evasion"},
  591.         Barrier = {bonus="Defense"},
  592.         Haste = {bonus="Haste"}
  593.         }
  594. end
  595.  
  596. function display_geomancy_info(spell)
  597.     geoType=nil
  598.     string.gsub(spell.english.."-","-(.-)-",function(geo) geoType=geo end)
  599.     geoInfo = geomancy[geoType]
  600.     if geoInfo then
  601.         add_to_chat(158, spell.english..' = '..tostring(geoInfo.bonus))
  602.     end
  603. end
  604.  
  605. function sub_job_change(newSubjob, oldSubjob)
  606.     select_default_macro_book()
  607. end
  608.  
  609. function set_macro_page(set,book)
  610.     if not tonumber(set) then
  611.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  612.         return
  613.     end
  614.     if set < 1 or set > 10 then
  615.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  616.         return
  617.     end
  618.  
  619.     if book then
  620.         if not tonumber(book) then
  621.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  622.             return
  623.         end
  624.         if book < 1 or book > 20 then
  625.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  626.             return
  627.         end
  628.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  629.     else
  630.         send_command('@input /macro set '..tostring(set))
  631.     end
  632. end
  633.  
  634. function select_default_macro_book()
  635.     -- Default macro set/book
  636.     if player.sub_job == 'RDM' then
  637.         set_macro_page(1, 7)
  638.     elseif player.sub_job == 'BLM' then
  639.         set_macro_page(2, 7)
  640.     elseif player.sub_job == 'WHM' then
  641.         set_macro_page(3, 7)
  642.     else
  643.         set_macro_page(1, 7)
  644.     end
  645. end
Advertisement
Add Comment
Please, Sign In to add comment