Arnan

GEO (mule) Lua January 2018

Jan 3rd, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.02 KB | None | 0 0
  1.  
  2. function get_sets()
  3.     AccIndex = 1
  4.     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 --
  5.     IdleIndex = 1
  6.     IdleArray = {"Full","DT","Warp"} -- Default Idle Set Is Movement --
  7.     Armor = 'None'
  8.     StunIndex = 0
  9.     Lock_Main = 'OFF' -- Set Default Lock Main Weapon ON or OFF Here --
  10.     Obi = 'ON' -- Set Default Obi ON or OFF Here --
  11.     Elemental_Staff = 'ON' -- Set Default Precast Elemental Staff ON or OFF Here --
  12.     LowNuke = 'ON' -- Set Default Low Tier Nuke ON or OFF Here --
  13.     MB = 'ON' -- Set Default MB ON or OFF Here --
  14.     target_distance = 5 -- Set Default Distance Here --
  15.     define_geomancy_values()
  16.     send_command('input /macro book 1;wait .1;input /macro set 1') -- Change Default Macro Book Here --
  17.  
  18.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  19.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  20.  
  21.     -- Add or Remove Low Tier Spells Here --
  22.     Low_Tier_Spells = S{
  23.             'Fire','Aero','Water','Blizzard','Stone','Thunder','Fire II','Aero II','Water II',
  24.             'Blizzard II','Stone II','Thunder II'}
  25.  
  26.     Non_Obi_Spells = S{
  27.             'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  28.             'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  29.  
  30.     Cities = S{
  31.             "Ru'lude Gardens","Upper Jeuno","Lower Jeuno","Port Jeuno",
  32.             "Port Windurst","Windurst Waters","Windurst Woods","Windurst Walls","Heavens Tower",
  33.             "Port San d'Oria","Northern San d'Oria","Southern San d'Oria",
  34.             "Port Bastok","Bastok Markets","Bastok Mines","Metalworks",
  35.             "Aht Urhgan Whitegate","Nashmau","Tavanazian Safehold",
  36.             "Selbina","Mhaura","Norg","Eastern Adoulin","Western Adoulin","Kazham"}
  37.  
  38.     -- Augments --
  39.     Solstice={}
  40.     Solstice.MACC={ name="Solstice", augments={'Mag. Acc.+20','Pet: Damage taken -4%','"Fast Cast"+5',}}
  41.     Solstice.MAB={ name="Solstice", augments={'INT+15','"Mag.Atk.Bns."+10','"Refresh"+1',}}
  42.    
  43.     MABCape={ name="Nantosuelta's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+3','"Mag.Atk.Bns."+10',}}
  44.     PetCape={ name="Nantosuelta's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Pet: "Regen"+10',}}
  45.            
  46.     sets.Idle = {
  47.         main="Bolelabunga",
  48.         sub="Genmei Shield",
  49.         range="Dunna",
  50.         head="Merlinic Hood",
  51.         neck="Loricate Torque +1",
  52.         ear1="Etiolation Earring",
  53.         ear2="Moonshade Earring",
  54.         body="Jhakri Robe +2",
  55.         hands="Bagua Mitaines +1",
  56.         ring1="Defending Ring",
  57.         ring2="Vocane Ring",
  58.         back="Moonbeam Cape",
  59.         waist="Isa Belt",
  60.         legs="Assid. Pants +1",
  61.         feet="Geo. Sandals +3"}
  62.     sets.Idle.Full = set_combine(sets.Idle,{})
  63.     sets.Idle.DT = set_combine(sets.Idle,{})
  64.     sets.Idle.Warp = set_combine(sets.Idle,{
  65.             ring2="Warp Ring"})
  66.  
  67.     -- Luopan Set (Automaticly switches from Idle set when a GEO luopan is active) --
  68.     sets.Luopan =  {
  69.         main="Sucellus",
  70.         sub="Genmei Shield",
  71.         range="Dunna",
  72.         head="Telchine Cap",
  73.         neck="Loricate Torque +1",
  74.         ear1="Etiolation Earring",
  75.         ear2="Odnowa Earring +1",
  76.         body="Telchine Chas.",
  77.         hands="Geo. Mitaines +2",
  78.         ring1="Defending Ring",
  79.         ring2="Vocane Ring",
  80.         back=PetCape,
  81.         waist="Isa Belt",
  82.         legs="Telchine Braconi",
  83.         feet="Telchine Pigaches"}
  84.            
  85.     sets.Resting = set_combine(sets.Idle.Movement,{})
  86.  
  87.     -- PDT Set --
  88.     sets.PDT = {
  89.         sub="Genmei Shield",
  90.         head="Telchine Cap",
  91.         neck="Loricate Torque +1",
  92.         ear1="Etiolation Earring",
  93.         ear2="Odnowa Earring +1",
  94.         body="Mallquis Saio +2",
  95.         hands="Geo. Mitaines +2",
  96.         ring1="Defending Ring",
  97.         ring2="Vocane Ring",
  98.         back="Moonbeam Cape",
  99.         waist="Isa Belt",
  100.         legs="Telchine Braconi",
  101.         feet="Mallquis Clogs +1"}
  102.  
  103.     -- Sublimation Set --
  104.     sets.Sublimation = {}
  105.  
  106.     sets.Precast = {
  107.         main=Solstice.MACC,
  108.         sub="Genmei Shield",
  109.         head="Amalric Coif",
  110.         neck="Loricate Torque +1",
  111.         ear1="Etiolation Earring",
  112.         ear2="Loquac. Earring",
  113.         body="Shango Robe",
  114.         hands="Geo. Mitaines +2",
  115.         ring1="Defending Ring",
  116.         ring2="Prolix Ring",
  117.         back="Lifestream Cape",
  118.         waist="Witful Belt",
  119.         legs="Geomancy Pants +2",
  120.         feet="Amalric Nails"}
  121.    
  122.     -- FastCast Set --
  123.     sets.Precast.FastCast = set_combine(sets.Precast,{})
  124.  
  125.     -- Geomancy Precast --
  126.     sets.Precast.GeoCast = set_combine(sets.Precast,{})
  127.  
  128.     -- Elemental Staves --
  129.     sets.Precast.Lightning = {}
  130.     sets.Precast.Water = {}
  131.     sets.Precast.Fire = {}
  132.     sets.Precast.Ice = {}
  133.     sets.Precast.Wind = {}
  134.     sets.Precast.Earth = {}
  135.     sets.Precast.Light = {}
  136.     sets.Precast.Dark = {}
  137.  
  138.     -- Precast Enhancing Magic --
  139.     sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{})
  140.  
  141.     -- Precast Elemental Magic --
  142.     sets.Precast['Elemental Magic'] = set_combine(sets.Precast.FastCast,{
  143.         ear2="Barkaro. Earring",
  144.         body="Mallquis Saio +2",
  145.         hands="Bagua Mitaines +1",
  146.         feet="Mallquis Clogs +1"})
  147.  
  148.     -- Precast Cure Set --
  149.     sets.Precast.Cure = {}
  150.  
  151.     -- Midcast Base Set --
  152.     sets.Midcast = {
  153.         main=Solstice.MACC,
  154.         sub="Genmei Shield",
  155.         head="Vanya Hood",
  156.         neck="Loricate Torque +1",
  157.         ear1="Mendi. Earring",
  158.         ear2="Gifted Earring",
  159.         body="Vanya Robe",
  160.         hands="Vanya Cuffs",
  161.         ring1="Defending Ring",
  162.         ring2="Vocane Ring",
  163.         back="Thauma. Cape",
  164.         waist="Austerity Belt",
  165.         legs="Vanya Slops",
  166.         feet="Amalric Nails"}
  167.  
  168.     -- Midcast Geocolure Set --
  169.     sets.Midcast.Geocolure = set_combine(sets.Midcast,{
  170.         neck="Incanter's Torque",
  171.         ring2="Stikini Ring"})
  172.  
  173.     -- Midcast Indicolure Set --
  174.     sets.Midcast.Indicolure = set_combine(sets.Midcast,{
  175.         neck="Incanter's Torque",
  176.         ring2="Stikini Ring",
  177.         back="Nantosuelta's Cape",
  178.         legs="Bagua Pants +1",
  179.         feet="Azimuth Gaiters"})
  180.  
  181.     -- Cure Set --
  182.     sets.Midcast.Cure = set_combine(sets.Midcast,{
  183.         head="Vanya Hood",
  184.         neck="Incanter's Torque",
  185.         ear1="Mendi. Earring",
  186.         hands="Bokwus Gloves",
  187.         ring1="Stikini Ring",
  188.         ring2="Stikini Ring",
  189.         back="Solemnity Cape"})
  190.  
  191.     -- Curaga Set --
  192.     sets.Midcast.Curaga = set_combine(sets.Midcast,{
  193.         head="Vanya Hood",
  194.         neck="Incanter's Torque",
  195.         ear1="Mendi. Earring",
  196.         hands="Bokwus Gloves",
  197.         ring1="Stikini Ring",
  198.         ring2="Stikini Ring",
  199.         back="Solemnity Cape"})
  200.  
  201.     -- Haste Set --
  202.     sets.Midcast.Haste = set_combine(sets.Midcast,{})
  203.  
  204.     -- Enhancing Set --
  205.     sets.Midcast['Enhancing Magic'] = set_combine(sets.Midcast,{
  206.         head="Befouled Crown",
  207.         neck="Incanter's Torque",
  208.         body="Telchine Chas.",
  209.         ring1="Stikini Ring",
  210.         ring2="Stikini Ring"})
  211.  
  212.     -- Stoneskin Set --
  213.     sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{})
  214.  
  215.     -- Cursna Set --
  216.     sets.Midcast.Cursna = set_combine(sets.Midcast,{})
  217.  
  218.     -- Stun Sets --
  219.     sets.Midcast.Stun = {
  220.         main=Solstice.MACC,
  221.         head="Geo. Galero +2",
  222.         neck="Incanter's Torque",
  223.         ear1="Barkaro. Earring",
  224.         ear2="Gwati Earring",
  225.         body="Geomancy Tunic +2",
  226.         hands="Geo. Mitaines +2",
  227.         ring1="Stikini Ring",
  228.         ring2="Stikini Ring",
  229.         back=MABCape,
  230.         waist="Othila Sash",
  231.         legs="Geomancy Pants +2",
  232.         feet="Geo. Sandals +3"}
  233.     sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  234.     sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  235.  
  236.     -- Dark Magic Sets --
  237.     sets.Midcast['Dark Magic'] = {
  238.         main=Solstice.MACC,
  239.         head="Geo. Galero +2",
  240.         neck="Incanter's Torque",
  241.         ear1="Barkaro. Earring",
  242.         ear2="Gwati Earring",
  243.         body="Geomancy Tunic +2",
  244.         hands="Geo. Mitaines +2",
  245.         ring1="Stikini Ring",
  246.         ring2="Stikini Ring",
  247.         back=MABCape,
  248.         waist="Othila Sash",
  249.         legs="Geomancy Pants +2",
  250.         feet="Geo. Sandals +3"}
  251.     sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
  252.     sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
  253.  
  254.     -- Aspir Set --
  255.     sets.Midcast.Aspir = {
  256.         main=Solstice.MACC,
  257.         head="Bagua Galero +1",
  258.         neck="Incanter's Torque",
  259.         ear1="Barkaro. Earring",
  260.         ear2="Gwati Earring",
  261.         body="Geomancy Tunic +2",
  262.         hands="Geo. Mitaines +2",
  263.         ring1="Stikini Ring",
  264.         ring2="Evanescence Ring",
  265.         back=MABCape,
  266.         waist="Othila Sash",
  267.         legs="Geomancy Pants +2",
  268.         feet="Geo. Sandals +3"}
  269.  
  270.     -- Drain Set --
  271.     sets.Midcast.Drain = {
  272.         main=Solstice.MACC,
  273.         head="Bagua Galero +1",
  274.         neck="Incanter's Torque",
  275.         ear1="Barkaro. Earring",
  276.         ear2="Gwati Earring",
  277.         body="Geomancy Tunic +2",
  278.         hands="Geo. Mitaines +2",
  279.         ring1="Stikini Ring",
  280.         ring2="Evanescence Ring",
  281.         back=MABCape,
  282.         waist="Othila Sash",
  283.         legs="Geomancy Pants +2",
  284.         feet="Geo. Sandals +3"}
  285.  
  286.     -- Low Tier Set --
  287.     sets.LowNuke = {
  288.         main=Solstice.MAB,
  289.         head="Mallquis Chapeau +1",
  290.         neck="Sanctity Necklace",
  291.         ear1="Barkaro. Earring",
  292.         ear2="Friomisi Earring",
  293.         body="Mallquis Saio +2",
  294.         hands="Mallquis Cuffs +1",
  295.         ring1="Acumen Ring",
  296.         ring2="Mallquis Ring",
  297.         back=MABCape,
  298.         waist="Othila Sash",
  299.         legs="Mallquis Trews +1",
  300.         feet="Mallquis Clogs +1"}
  301.  
  302.     -- MB Set --
  303.     sets.MB = {
  304.         main=Solstice.MAB,
  305.         head="Ea Hat",
  306.         neck="Mizu. Kubikazari",
  307.         ear1="Barkaro. Earring",
  308.         ear2="Friomisi Earring",
  309.         body="Ea Houppelande",
  310.         hands="Ea Cuffs",
  311.         ring1="Acumen Ring",
  312.         ring2="Mujin Band",
  313.         back=MABCape,
  314.         waist="Othila Sash",
  315.         legs="Ea Slops",
  316.         feet="Ea Pigaches"}
  317.  
  318.     -- Elemental Sets --
  319.     sets.Midcast['Elemental Magic'] = {
  320.         main=Solstice.MAB,
  321.         head="Jhakri Coronal +1",
  322.         neck="Sanctity Necklace",
  323.         ear1="Barkaro. Earring",
  324.         ear2="Friomisi Earring",
  325.         body="Jhakri Robe +2",
  326.         hands="Jhakri Cuffs +1",
  327.         ring1="Acumen Ring",
  328.         ring2="Shiva Ring",
  329.         back=MABCape,
  330.         waist="Othila Sash",
  331.         legs="Jhakri Slops +1",
  332.         feet="Jhakri Pigaches +1"}
  333.     sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{})
  334.     sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{})
  335.  
  336.     -- Enfeebling Sets --
  337.     sets.Midcast['Enfeebling Magic'] = {
  338.         main=Solstice.MACC,
  339.         head="Geo. Galero +2",
  340.         neck="Incanter's Torque",
  341.         ear1="Barkaro. Earring",
  342.         ear2="Gwati Earring",
  343.         body="Geomancy Tunic +2",
  344.         hands="Geo. Mitaines +2",
  345.         ring1="Stikini Ring",
  346.         ring2="Stikini Ring",
  347.         back=MABCape,
  348.         waist="Othila Sash",
  349.         legs="Geomancy Pants +2",
  350.         feet="Geo. Sandals +3"}
  351.     sets.Midcast['Enfeebling Magic'].MidACC =  set_combine(sets.Midcast['Enfeebling Magic'],{})
  352.     sets.Midcast['Enfeebling Magic'].HighACC = set_combine(sets.Midcast['Enfeebling Magic'].MidACC,{})
  353.  
  354.     -- Impact Set --
  355.     sets.Midcast.Impact = {}
  356.    
  357.     -- Refresh --
  358.     sets.Midcast.Refresh = set_combine(sets.Midcast,{
  359.                         head="Amalric Coif",
  360.                         feet="Inspirited Boots"})
  361.  
  362.     -- Elemental Obi --
  363.     sets.Obi = {waist="Hachirin-no-Obi"}
  364.     sets.Obi.Lightning = {waist="Hachirin-no-Obi"}
  365.     sets.Obi.Water = {waist="Hachirin-no-Obi"}
  366.     sets.Obi.Fire = {waist="Hachirin-no-Obi"}
  367.     sets.Obi.Ice = {waist="Hachirin-no-Obi"}
  368.     sets.Obi.Wind = {waist="Hachirin-no-Obi"}
  369.     sets.Obi.Earth = {waist="Hachirin-no-Obi"}
  370.     sets.Obi.Light = {waist="Hachirin-no-Obi"}
  371.     sets.Obi.Dark = {waist="Hachirin-no-Obi"}
  372.  
  373.     -- JA Sets --
  374.     sets.JA = {}
  375.     sets.JA['Life Cycle'] = {body="Geomancy Tunic +2",back="Nantosuelta's Cape"}
  376.     sets.JA.Bolster = {body="Bagua Tunic +1"}
  377.     sets.JA['Radial Arcana'] = {feet="Bagua Sandals +1"}
  378.     sets.JA['Mending Halation'] = {feet="Bagua Pants +1"}
  379.     sets.JA['Full Circle'] = {head="Azimuth Hood +1"}
  380.  
  381.     -- Melee Set --
  382.     sets.Melee = {}
  383.  
  384.     -- WS Base Set --
  385.     sets.WS = {}
  386.  
  387.     sets.WS.Exudation = {}
  388.     sets.WS["Hexa Strike"] = {}
  389.     sets.WS.Realmrazer = {}
  390.     sets.WS.Shattersoul = {}
  391.  
  392.     -- Idle Reive Set --
  393.     sets.Reive = {neck="Arciela's Grace +1"}
  394. end
  395.  
  396. function pretarget(spell,action)
  397.     if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  398.         cancel_spell()
  399.         send_command('input /item "Echo Drops" <me>')
  400.     elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  401.         cancel_spell()
  402.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  403.         return
  404.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  405.         degrade_spell(spell,Cure_Spells)
  406.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  407.         degrade_spell(spell,Curaga_Spells)
  408.     elseif spell.english:startswith('Geo') and pet.isvalid then -- Change Any Geo Spells To Full Circle If You Have A Luopan Active --
  409.         cancel_spell()
  410.         send_command('input /ja "Full Circle" <me>')
  411.     elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  412.         if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  413.             cancel_spell()
  414.             send_command('input /ja Addendum: White <me>')
  415.         elseif spell.english == "Manifestation" then
  416.             cancel_spell()
  417.             send_command('input /ja Accession <me>')
  418.         elseif spell.english == "Alacrity" then
  419.             cancel_spell()
  420.             send_command('input /ja Celerity <me>')
  421.         elseif spell.english == "Parsimony" then
  422.             cancel_spell()
  423.             send_command('input /ja Penury <me>')
  424.         end
  425.     elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  426.         if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  427.             cancel_spell()
  428.             send_command('input /ja Addendum: Black <me>')
  429.         elseif spell.english == "Accession" then
  430.             cancel_spell()
  431.             send_command('input /ja Manifestation <me>')
  432.         elseif spell.english == "Celerity" then
  433.             cancel_spell()
  434.             send_command('input /ja Alacrity <me>')
  435.         elseif spell.english == "Penury" then
  436.             cancel_spell()
  437.             send_command('input /ja Parsimony <me>')
  438.         end
  439.     end
  440. end
  441.  
  442. function precast(spell,action)
  443.     if spell.action_type == 'Magic' then
  444.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  445.             cancel_spell()
  446.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  447.             return
  448.         else
  449.             if spell.type == "Geomancy" then
  450.                 if Cities:contains(world.area) then
  451.                     cancel_spell()
  452.                     add_to_chat(123,'Unable To Use Geomancy In Town')
  453.                     return
  454.                 else
  455.                     display_geomancy_info(spell)
  456.                     equip(sets.Precast.GeoCast)
  457.                 end
  458.             elseif spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  459.                 equip(sets.Precast.Cure)
  460.             elseif spell.english == "Impact" then
  461.                 equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  462.             elseif spell.english == 'Utsusemi: Ni' then
  463.                 if buffactive['Copy Image (3)'] then
  464.                     cancel_spell()
  465.                     add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  466.                     return
  467.                 else
  468.                     equip(sets.Precast.FastCast)
  469.                 end
  470.             elseif sets.Precast[spell.skill] then
  471.                 equip(sets.Precast[spell.skill])
  472.             else
  473.                 equip(sets.Precast.FastCast)
  474.             end
  475.         end
  476.     elseif spell.type == "WeaponSkill" then
  477.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  478.             cancel_spell()
  479.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  480.             return
  481.         else
  482.             if sets.WS[spell.english] then
  483.                 equip(sets.WS[spell.english])
  484.             end
  485.         end
  486.     elseif spell.type == "JobAbility" then
  487.         if sets.JA[spell.english] then
  488.             equip(sets.JA[spell.english])
  489.         end
  490.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  491.         cast_delay(0.2)
  492.         send_command('cancel Sneak')
  493.     end
  494.     if sets.Precast[spell.element] and Elemental_Staff == 'ON' then
  495.         equip(sets.Precast[spell.element])
  496.     end
  497.     if StunIndex == 1 then
  498.         equip(sets.Midcast.Stun)
  499.     end
  500. end
  501.  
  502. function midcast(spell,action)
  503.     equipSet = {}
  504.     if spell.action_type == 'Magic' then
  505.         equipSet = sets.Midcast
  506.         if spell.type == "Geomancy" then
  507.             if spell.english:startswith('Indi') then
  508.                 equipSet = equipSet.Indicolure
  509.             else
  510.                 equipSet = equipSet.Geocolure
  511.             end
  512.         elseif spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  513.             if spell.english:startswith('Cure') then
  514.                 equipSet = equipSet.Cure
  515.             elseif spell.english:startswith('Cura') then
  516.                 equipSet = equipSet.Curaga
  517.             end
  518.             if world.day_element == spell.element or world.weather_element == spell.element then
  519.                 equipSet = set_combine(equipSet,{})
  520.             end
  521.         elseif spell.english:startswith('Banish') then
  522.             equipSet = set_combine(equipSet.Haste,{})
  523.         elseif spell.english == "Stoneskin" then
  524.             if buffactive.Stoneskin then
  525.                 send_command('@wait 2.8;cancel stoneskin')
  526.             end
  527.             equipSet = equipSet.Stoneskin
  528.         elseif spell.english == "Sneak" then
  529.             if spell.target.name == player.name and buffactive['Sneak'] then
  530.                 send_command('cancel sneak')
  531.             end
  532.             equipSet = equipSet.Haste
  533.         elseif spell.english:startswith('Aspir') then
  534.             equipSet = equipSet.Aspir
  535.         elseif spell.english == "Drain" then
  536.             equipSet = equipSet.Drain
  537.         elseif spell.english:startswith('Utsusemi') then
  538.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  539.                 send_command('@wait 1.7;cancel Copy Image*')
  540.             end
  541.             equipSet = equipSet.Haste
  542.         elseif spell.english == 'Monomi: Ichi' then
  543.             if buffactive['Sneak'] then
  544.                 send_command('@wait 1.7;cancel sneak')
  545.             end
  546.             equipSet = equipSet.Haste
  547.         elseif Low_Tier_Spells:contains(spell.english) and LowNuke == 'ON' then
  548.             equipSet = set_combine(equipSet,sets.LowNuke)
  549.         elseif spell.skill == 'Elemental Magic' and MB == 'ON' then
  550.             equipSet = set_combine(equipSet,sets.MB)
  551.         else
  552.             if equipSet[spell.english] then
  553.                 equipSet = equipSet[spell.english]
  554.             end
  555.             if equipSet[spell.skill] then
  556.                 equipSet = equipSet[spell.skill]
  557.             end
  558.             if equipSet[AccArray[AccIndex]] then
  559.                 equipSet = equipSet[AccArray[AccIndex]]
  560.             end
  561.             if equipSet[spell.type] then
  562.                 equipSet = equipSet[spell.type]
  563.             end
  564.             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 --
  565.                 equipSet = set_combine(equipSet,sets.Obi[spell.element])
  566.             end
  567.         end
  568.     elseif equipSet[spell.english] then
  569.         equipSet = equipSet[spell.english]
  570.     end
  571.     equip(equipSet)
  572.     if StunIndex == 1 then
  573.         equip(sets.Midcast.Stun)
  574.     end
  575. end
  576.  
  577. function aftercast(spell,action)
  578.     if not spell.interrupted then
  579.         if spell.english == "Sleep II" then-- Sleep II Countdown --
  580.             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.]')
  581.         elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  582.             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.]')
  583.         elseif spell.english == "Banish II" then -- Banish II Countdown --
  584.             send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  585.         end
  586.     end
  587.     status_change(player.status)
  588. end
  589.  
  590. function status_change(new,old)
  591.     if Armor == 'PDT' then
  592.         equip(sets.PDT)
  593.     elseif pet.isvalid then -- Equip Luopan Set when a GEO Luopan is active --
  594.         equip(sets.Luopan)
  595.     elseif buffactive["Sublimation: Activated"] then
  596.         equip(sets.Sublimation)
  597.     elseif new == 'Engaged' then
  598.         equip(sets.Melee)
  599.     elseif new == 'Idle' then
  600.         equipSet = sets.Idle
  601.         if equipSet[IdleArray[IdleIndex]] then
  602.             equipSet = equipSet[IdleArray[IdleIndex]]
  603.         end
  604.         if buffactive['Reive Mark'] then -- Equip Arciela's Grace +1 During Reive --
  605.             equipSet = set_combine(equipSet,sets.Reive)
  606.         end
  607.         if world.area:endswith('Adoulin') then
  608.             equipSet = set_combine(equipSet,{})
  609.         end
  610.         equip(equipSet)
  611.     elseif new == 'Resting' then
  612.         equip(sets.Resting)
  613.     end
  614.     if StunIndex == 1 then
  615.         equip(sets.Midcast.Stun)
  616.     end
  617. end
  618.  
  619. function buff_change(buff,gain,buff_table)
  620.         buff = string.lower(buff)
  621.     if buff == 'weakness' then -- Weakness Timer --
  622.         if gain then
  623.             send_command('timers create "Weakness" 300 up')
  624.         else
  625.             send_command('timers delete "Weakness"')
  626.         end
  627.     elseif buff_table['id'] == 612 then -- Indi Spell --
  628.         if not gain then
  629.             send_command('input /tell Arnan >>>>>>>>>> Your Indi Spell wore off. <<<<<<<<<<')
  630.         end
  631.         end
  632.     if not midaction() then
  633.         status_change(player.status)
  634.     end
  635. end
  636.  
  637. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  638. function self_command(command)
  639.     if command == 'acc' then -- Magic Accuracy Toggle --
  640.         AccIndex = (AccIndex % #AccArray) + 1
  641.         add_to_chat(155,'Magic Accuracy Level: ' .. AccArray[AccIndex])
  642.         status_change(player.status)
  643.     elseif command == 'stun' then -- Stun Toggle --
  644.         if StunIndex == 1 then
  645.             StunIndex = 0
  646.             add_to_chat(123,'Stun Set: [Unlocked]')
  647.         else
  648.             StunIndex = 1
  649.             add_to_chat(158,'Stun Set: [Locked]')
  650.         end
  651.         status_change(player.status)
  652.     elseif command == 'update' then -- Auto Update Gear Toggle --
  653.         status_change(player.status)
  654.         add_to_chat(155,'Auto Update Gear')
  655.     elseif command == 'C3' then -- Obi Toggle --
  656.         if Obi == 'ON' then
  657.             Obi = 'OFF'
  658.             add_to_chat(123,'Obi: [OFF]')
  659.         else
  660.             Obi = 'ON'
  661.             add_to_chat(158,'Obi: [ON]')
  662.         end
  663.         status_change(player.status)
  664.     elseif command == 'pdt' then -- PDT Toggle --
  665.         if Armor == 'PDT' then
  666.             Armor = 'None'
  667.             add_to_chat(123,'PDT Set: [Unlocked]')
  668.         else
  669.             Armor = 'PDT'
  670.             add_to_chat(158,'PDT Set: [Locked]')
  671.         end
  672.         status_change(player.status)
  673.     elseif command == 'idris' then -- Idris Toggle --
  674.         if Idris == 'ON' then
  675.             Idris = 'OFF'
  676.             add_to_chat(123,'Idris: [OFF]')
  677.         else
  678.             Idris = 'ON'
  679.             add_to_chat(158,'Idris: [ON]')
  680.         end
  681.         status_change(player.status)
  682.     elseif command == 'lownuke' then -- LowNuke Toggle --
  683.         if LowNuke == 'ON' then
  684.             LowNuke = 'OFF'
  685.             add_to_chat(123,'Low Nuke: [OFF]')
  686.         else
  687.             LowNuke = 'ON'
  688.             add_to_chat(158,'Low Nuke: [ON]')
  689.         end
  690.         status_change(player.status)
  691.     elseif command == 'mb' then -- MB Toggle --
  692.         if MB == 'ON' then
  693.             MB = 'OFF'
  694.             add_to_chat(123,'MB: [OFF]')
  695.         else
  696.             MB = 'ON'
  697.             add_to_chat(158,'MB: [ON]')
  698.         end
  699.         status_change(player.status)
  700.     elseif command == 'mainlock' then -- Lock Main Weapon Toggle --
  701.         if Lock_Main == 'ON' then
  702.             Lock_Main = 'OFF'
  703.             add_to_chat(123,'Main Weapon: [Unlocked]')
  704.         else
  705.             Lock_Main = 'ON'
  706.             add_to_chat(158,'Main Weapon: [Locked]')
  707.         end
  708.         status_change(player.status)
  709.     elseif command == 'distance' then -- Distance Toggle --
  710.         if player.target.distance then
  711.             target_distance = math.floor(player.target.distance*10)/10
  712.             add_to_chat(155,'Distance: '..target_distance)
  713.         else
  714.             add_to_chat(123,'No Target Selected')
  715.         end
  716.     elseif command == 'idle' then -- Idle Toggle --
  717.         IdleIndex = (IdleIndex % #IdleArray) + 1
  718.         add_to_chat(155,'Idle Set: '..IdleArray[IdleIndex])
  719.         status_change(player.status)
  720.     elseif command:match('^SC%d$') then
  721.         send_command('//' .. sc_map[command])
  722.     end
  723. end
  724.  
  725. function actualCost(originalCost)
  726.     if buffactive["Penury"] then
  727.         return originalCost*.5
  728.     elseif buffactive["Light Arts"] then
  729.         return originalCost*.9
  730.     else
  731.         return originalCost
  732.     end
  733. end
  734.  
  735. function degrade_spell(spell,degrade_array)
  736.     spell_index = table.find(degrade_array,spell.name)
  737.     if spell_index > 1 then
  738.         new_spell = degrade_array[spell_index - 1]
  739.         change_spell(new_spell,spell.target.raw)
  740.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  741.     end
  742. end
  743.  
  744. function change_spell(spell_name,target)
  745.     cancel_spell()
  746.     send_command('//'..spell_name..' '..target)
  747. end
  748.  
  749. function define_geomancy_values()
  750.     geomancy = {
  751.         Frailty = {bonus="Defense Down"},
  752.         Torpor = {bonus="Evasion Down"},
  753.         Languor = {bonus="Magic Evasion Down"},
  754.         Focus = {bonus="Magic Accuracy"},
  755.         Malaise = {bonus="Magic Defense Down"},
  756.         Precision = {bonus="Accuracy"},
  757.         Refresh = {bonus="Refresh"},
  758.         Fade = {bonus="Magic Attack Down"},
  759.         Wilt = {bonus="Attack Down"},
  760.         Vex = {bonus="Magic Accuracy Down"},
  761.         Slip = {bonus="Accuracy Down"},
  762.         Acumen = {bonus="Magic Attack"},
  763.         Fend = {bonus="Magic Defense"},
  764.         Fury = {bonus="Attack"},
  765.         Attunement = {bonus="Magic Evasion"},
  766.         Voidance = {bonus="Evasion"},
  767.         Barrier = {bonus="Defense"},
  768.         Haste = {bonus="Haste"}
  769.         }
  770. end
  771.  
  772. function display_geomancy_info(spell)
  773.     geoType=nil
  774.     string.gsub(spell.english.."-","-(.-)-",function(geo) geoType=geo end)
  775.     geoInfo = geomancy[geoType]
  776.     if geoInfo then
  777.         add_to_chat(155, spell.english..' = '..tostring(geoInfo.bonus))
  778.     end
  779. end
  780.  
  781. --- Luopan Notifier ---
  782. function pet_change(pet,gain_or_loss)
  783. status_change(player.status)
  784. if not gain_or_loss then
  785. add_to_chat(123,'Your luopan has vanished.')
  786. send_command('input /tell Arnan >>>>>>>>>> Your Luopan has vanished. <<<<<<<<<<')
  787. end
  788. end
  789.  
  790. function job_aftercast(spell, action, spellMap, eventArgs)
  791.     if not spell.interrupted then
  792.         if spell.english:startswith('Indi') then
  793.             if spell.target.type == 'SELF' then
  794.                 last_indi = spell.name
  795.             end
  796.         elseif spell.english:startswith('Geo') then
  797.             last_geo = spell.name
  798.         end
  799.     end
  800. end
Advertisement
Add Comment
Please, Sign In to add comment