Bokura

Bokura_SMN

Jan 28th, 2014
2,287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 24.94 KB | None | 0 0
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Some of Motenten's Functions ** --
  3.  
  4. function get_sets()
  5.     AccIndex = 1
  6.     AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP & Physical/Magical BloodPactRage. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  7.     IdleIndex = 1
  8.     IdleArray = {"Movement","Refresh"} -- Default Idle Set Is Movement --
  9.     Armor = 'None'
  10.     Lock_Main = 'OFF' -- Set Default Lock Main Weapon ON or OFF Here --
  11.     message = 'ON' -- Set Default BloodPact Debuff/Buff Messages ON or OFF Here --
  12.     Kiting = 'OFF' -- Set Default Avatar/Sublimation Kiting Set ON or OFF Here --
  13.     Elemental_Staff = 'OFF' -- Set Default Precast Elemental Staff ON or OFF Here --
  14.     target_distance = 5 -- Set Default Distance Here --
  15.     select_default_macro_book() -- Change Default Macro Book At The End --
  16.  
  17.     Cities = S{
  18.             "Ru'lude Gardens","Upper Jeuno","Lower Jeuno","Port Jeuno",
  19.             "Port Windurst","Windurst Waters","Windurst Woods","Windurst Walls","Heavens Tower",
  20.             "Port San d'Oria","Northern San d'Oria","Southern San d'Oria",
  21.             "Port Bastok","Bastok Markets","Bastok Mines","Metalworks",
  22.             "Aht Urhgan Whitegate","Nashmau","Tavanazian Safehold",
  23.             "Selbina","Mhaura","Norg","Eastern Adoulin","Western Adoulin","Kazham"}
  24.  
  25.     -- Avatar Spells --
  26.     Avatars = S{
  27.             "Ramuh","Garuda","Alexander","Fenrir","Titan","Shiva","Ifrit","Diabolos",
  28.             "Leviathan","Carbuncle","Odin","Cait Sith","Atomos"}
  29.  
  30.     -- To Trigger Auto Elemental Siphon: Use The Following Spirit Spells Again --
  31.     Spirits = S{
  32.             "Fire Spirit","Ice Spirit","Air Spirit","Earth Spirit","Thunder Spirit",
  33.             "Water Spirit","Light Spirit","Dark Spirit"}
  34.  
  35.     -- Spirit Pacts --
  36.     SpiritPacts = S{
  37.             "FireSpirit","IceSpirit","AirSpirit","EarthSpirit","ThunderSpirit",
  38.             "WaterSpirit","LightSpirit","DarkSpirit"}
  39.  
  40.     -- Magical BloodPactRage --
  41.     Magical_RagePacts = S{
  42.             'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgement Bolt',
  43.             'Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II',
  44.             'Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV',
  45.             'Burning Strike','Nether Blast','Flaming Crush','Searing Light',
  46.             'Howling Moon','Ruinous Omen','Level ? Holy','Conflag Strike','Impact'}
  47.  
  48.     -- Magical BloodPactRage Affected By TP --
  49.     Magical_TP_RagePacts = S{
  50.             'Heavenly Strike','Wind Blade','Holy Mist','Night Terror','Thunderstorm','Geocrush',
  51.             'Meteorite','Meteor Strike','Grand Fall','Lunar Bay','Thunderspark'}
  52.  
  53.     -- To Trigger The Following BPs: Use The Appropriate Avatar Spells Again --
  54.     -- Can Replace Whatever BPs You Like For Each Listed Avatars --
  55.     BloodPactWard = {
  56.             Garuda = "Fleet Wind", Ifrit = "Inferno Howl", Fenrir = "Ecliptic Growl",
  57.             Titan = "Earthen Armor", Leviathan = "Spring Water", Carbuncle = "Soothing Ruby",
  58.             Diabolos = "Noctoshield"}
  59.  
  60.     -- Debuff BloodPactWard --
  61.     DebuffBloodPactWard = S{
  62.             'Diamond Storm','Sleepga','Slowga','Tidal Roar','Nightmare','Pavor Nocturnus',
  63.             'Ultimate Terror','Somnolence','Lunar Cry','Lunar Roar','Mewing Lullaby','Eerie Eye'}
  64.  
  65.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  66.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  67.     sc_map = {SC1 = "Garuda", SC2 = "Ramuh", SC3 = "Fenrir"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  68.  
  69.     sets.Idle = {}
  70.     -- Idle Sets --
  71.     sets.Idle.Refresh = {}
  72.     sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  73.             feet="Herald's Gaiters"})
  74.     sets.Resting = {}
  75.  
  76.     -- PDT Set --
  77.     sets.PDT = {}
  78.  
  79.     -- Kiting Set --
  80.     sets.Kiting = {feet="Herald's Gaiters"}
  81.  
  82.     -- Sublimation Set --
  83.     sets.Sublimation = {}
  84.  
  85.     sets.Precast = {}
  86.     -- Fastcast Set (empty = To Fix Club/Staff Issue) --
  87.     sets.Precast.FastCast = {
  88.             sub=empty}
  89.  
  90.     -- Precast BloodPact --
  91.     sets.Precast.BloodPact = {main="Nirvana"}
  92.  
  93.     -- Elemental Staves --
  94.     sets.Precast.Lightning = {main='Apamajas I'}
  95.     sets.Precast.Water = {main='Haoma I'}
  96.     sets.Precast.Fire = {main='Atar I'}
  97.     sets.Precast.Ice = {main='Vourukasha I'}
  98.     sets.Precast.Wind = {main='Vayuvata I'}
  99.     sets.Precast.Earth = {main='Vishrava I'}
  100.     sets.Precast.Light = {main='Arka I'}
  101.     sets.Precast.Dark = {main='Xsaeta I'}
  102.  
  103.     sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  104.  
  105.     -- Precast Cure Set --
  106.     sets.Precast.Cure = {
  107.             sub=empty}
  108.  
  109.     -- Midcast Base Set --
  110.     sets.Midcast = {}
  111.  
  112.     -- Haste Set --
  113.     sets.Midcast.Haste = {}
  114.  
  115.     -- Cure Set --
  116.     sets.Midcast.Cure = {}
  117.  
  118.     -- Curaga Set --
  119.     sets.Midcast.Curaga = {}
  120.  
  121.     -- Enhancing Magic Set --
  122.     sets.Midcast['Enhancing Magic'] = {}
  123.  
  124.     -- Stoneskin Set --
  125.     sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{})
  126.  
  127.     -- Avatars Sets
  128.     sets.Avatars = {
  129.             main="Nirvana",
  130.             sub="Oneiros Grip",
  131.             ammo="Seraphicaller"}
  132.     sets.Avatars['Carbuncle'] = set_combine(sets.Avatars,{hands="Carbuncle Mitts"})
  133.     sets.Avatars['Diabolos'] = set_combine(sets.Avatars,{waist="Diabolos's Rope"})
  134.  
  135.     -- Avatar's Favor Set --
  136.     sets.Favor = set_combine(sets.Avatars,{})
  137.  
  138.     -- Spirits Set --
  139.     sets.Spirits = set_combine(sets.Avatars,{})
  140.  
  141.     sets.Midcast.Pet = {}
  142.     -- BloodPactWard/PD Set --
  143.     sets.Midcast.Pet.BloodPactWard = {
  144.             main="Nirvana",
  145.             ammo="Seraphicaller"}
  146.  
  147.     -- Magic Accuracy For The Listed Debuff BloodPactWard --
  148.     sets.Midcast.Pet.DebuffBloodPactWard = set_combine(sets.Midcast.Pet.BloodPactWard,{})
  149.  
  150.     sets.Midcast.Pet.Physical_RagePacts = {}
  151.     -- Physical BloodPactRage Sets --
  152.     sets.Midcast.Pet.Physical_RagePacts.LowACC = {}
  153.     sets.Midcast.Pet.Physical_RagePacts.MidACC = set_combine(sets.Midcast.Pet.Physical_RagePacts.LowACC,{})
  154.     sets.Midcast.Pet.Physical_RagePacts.HighACC = set_combine(sets.Midcast.Pet.Physical_RagePacts.MidACC,{})
  155.  
  156.     sets.Midcast.Pet.Magical_RagePacts = {}
  157.     -- Magical BloodPactRage Sets --
  158.     sets.Midcast.Pet.Magical_RagePacts.LowACC = {}
  159.     sets.Midcast.Pet.Magical_RagePacts.MidACC = set_combine(sets.Midcast.Pet.Magical_RagePacts.LowACC,{})
  160.     sets.Midcast.Pet.Magical_RagePacts.HighACC = set_combine(sets.Midcast.Pet.Magical_RagePacts.MidACC,{})
  161.  
  162.     sets.Midcast.Pet.Magical_TP_RagePacts = {}
  163.     -- Magical BloodPactRage Affected By TP --
  164.     sets.Midcast.Pet.Magical_TP_RagePacts.LowACC = {}
  165.     sets.Midcast.Pet.Magical_TP_RagePacts.MidACC = set_combine(sets.Midcast.Pet.Magical_TP_RagePacts.LowACC,{})
  166.     sets.Midcast.Pet.Magical_TP_RagePacts.HighACC = set_combine(sets.Midcast.Pet.Magical_TP_RagePacts.MidACC,{})
  167.  
  168.     -- Shock Squall Set --
  169.     sets.Midcast.Pet['Shock Squall'] = {}
  170.  
  171.     sets.JA = {}
  172.     -- JA Sets --
  173.     sets.JA['Mana Cede'] = {hands="Beck. Bracers +1"}
  174.     sets.JA['Elemental Siphon'] = set_combine(sets.Midcast.Pet.BloodPactWard,{feet="Beck. Pigaches +1"})
  175.     sets.JA['Astral Flow'] = {head="Glyphic Horn +1"}
  176.  
  177.     -- Melee Set --
  178.     sets.Melee = set_combine(sets.Midcast.Haste,{})
  179.  
  180.     -- WS Base Set --
  181.     sets.WS = {}
  182.  
  183.     sets.WS.Shattersoul = {}
  184.     sets.WS.Myrkr = {}
  185.     sets.WS["Garland of Bliss"] = {}
  186.  
  187.     -- Idle Reive Set --
  188.     sets.Reive = {neck="Arciela's Grace +1"}
  189. end
  190.  
  191. function pretarget(spell,action)
  192.     if midaction() or pet_midaction() then
  193.         cancel_spell()
  194.         return
  195.     elseif spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  196.         cancel_spell()
  197.         send_command('input /item "Echo Drops" <me>')
  198.     elseif spell.type == 'WeaponSkill' and player.status == 'Engaged' then
  199.         if not spell.english == 'Myrkr' and spell.target.distance > target_distance then -- Cancel WS If You Are Out Of Range --
  200.             cancel_spell()
  201.             add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  202.             return
  203.         end
  204.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  205.         degrade_spell(spell,Cure_Spells)
  206.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  207.         degrade_spell(spell,Curaga_Spells)
  208.     elseif spell.english == 'Shiva' and pet.isvalid then -- Change Shiva Spell To Sleepga When Shiva Is Present --
  209.         cancel_spell()
  210.         send_command('input /pet "Sleepga" <t>')
  211.     elseif spell.english == 'Ramuh' and pet.isvalid then -- Change Ramuh Spell To Shock Squall When Ramuh Is Present --
  212.         cancel_spell()
  213.         send_command('input /pet "Shock Squall" <t>')
  214.     elseif Avatars:contains(spell.english) and pet.isvalid then
  215.         cancel_spell()
  216.         send_command('input /pet "'..BloodPactWard[pet.name]..'" <me>;wait 5;Release')
  217.     elseif Spirits:contains(spell.english) and pet.isvalid then
  218.         cancel_spell()
  219.         send_command('ElementalSiphon;wait 1;Release')
  220.     elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  221.         if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  222.             cancel_spell()
  223.             send_command('input /ja Addendum: White <me>')
  224.         elseif spell.english == "Manifestation" then
  225.             cancel_spell()
  226.             send_command('input /ja Accession <me>')
  227.         elseif spell.english == "Alacrity" then
  228.             cancel_spell()
  229.             send_command('input /ja Celerity <me>')
  230.         elseif spell.english == "Parsimony" then
  231.             cancel_spell()
  232.             send_command('input /ja Penury <me>')
  233.         end
  234.     elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  235.         if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  236.             cancel_spell()
  237.             send_command('input /ja Addendum: Black <me>')
  238.         elseif spell.english == "Accession" then
  239.             cancel_spell()
  240.             send_command('input /ja Manifestation <me>')
  241.         elseif spell.english == "Celerity" then
  242.             cancel_spell()
  243.             send_command('input /ja Alacrity <me>')
  244.         elseif spell.english == "Penury" then
  245.             cancel_spell()
  246.             send_command('input /ja Parsimony <me>')
  247.         end
  248.     end
  249. end
  250.  
  251. function precast(spell,action)
  252.     if midaction() or pet_midaction() then
  253.         cancel_spell()
  254.         return
  255.     elseif spell.action_type == 'Magic' then
  256.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  257.             cancel_spell()
  258.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  259.             return
  260.         else
  261.             if spell.type == "SummonerPact" then
  262.                 if Avatars:contains(spell.english) or Spirits:contains(spell.english) then
  263.                     if Cities:contains(world.area) then
  264.                         cancel_spell()
  265.                         add_to_chat(123,'Unable To Summon Pacts In Town')
  266.                         return
  267.                     else
  268.                         equip(sets.Precast.FastCast)
  269.                     end
  270.                 end
  271.             elseif spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  272.                 equip(sets.Precast.Cure)
  273.             elseif spell.english == 'Utsusemi: Ni' then
  274.                 if buffactive['Copy Image (3)'] then
  275.                     cancel_spell()
  276.                     add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  277.                     return
  278.                 else
  279.                     equip(sets.Precast.FastCast)
  280.                 end
  281.             elseif sets.Precast[spell.skill] then
  282.                 equip(sets.Precast[spell.skill])
  283.             else
  284.                 equip(sets.Precast.FastCast)
  285.             end
  286.         end
  287.     elseif spell.type == "WeaponSkill" then
  288.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  289.             cancel_spell()
  290.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  291.             return
  292.         else
  293.             if sets.WS[spell.english] then
  294.                 equip(sets.WS[spell.english])
  295.             end
  296.         end
  297.     elseif spell.type == "JobAbility" then
  298.         if sets.JA[spell.english] then
  299.             equip(sets.JA[spell.english])
  300.         end
  301.     elseif spell.type:startswith('BloodPact') then
  302.         equip(sets.Precast.BloodPact)
  303.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  304.         cast_delay(0.2)
  305.         send_command('cancel Sneak')
  306.     end
  307.     if sets.Precast[spell.element] and Elemental_Staff == 'ON' then
  308.         equip(sets.Precast[spell.element])
  309.     end
  310. end
  311.  
  312. function midcast(spell,action)
  313.     equipSet = {}
  314.     if pet_midaction() then
  315.         return
  316.     elseif spell.action_type == 'Magic' then
  317.         equipSet = sets.Midcast
  318.         if equipSet[spell.english] then
  319.             equipSet = equipSet[spell.english]
  320.         elseif spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  321.             if spell.english:startswith('Cure') then
  322.                 equipSet = equipSet.Cure
  323.             elseif spell.english:startswith('Cura') then
  324.                 equipSet = equipSet.Curaga
  325.             end
  326.             if world.day_element == spell.element or world.weather_element == spell.element then
  327.                 equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Hachirin-no-Obi"})
  328.             end
  329.         elseif spell.english == "Stoneskin" then
  330.             if buffactive.Stoneskin then
  331.                 send_command('@wait 2.8;cancel stoneskin')
  332.             end
  333.             equipSet = equipSet.Stoneskin
  334.         elseif spell.english == "Sneak" then
  335.             if spell.target.name == player.name and buffactive['Sneak'] then
  336.                 send_command('cancel sneak')
  337.             end
  338.             equipSet = equipSet.Haste
  339.         elseif spell.english:startswith('Utsusemi') then
  340.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  341.                 send_command('@wait 1.7;cancel Copy Image*')
  342.             end
  343.             equipSet = equipSet.Haste
  344.         elseif spell.english == 'Monomi: Ichi' then
  345.             if buffactive['Sneak'] then
  346.                 send_command('@wait 1.7;cancel sneak')
  347.             end
  348.             equipSet = equipSet.Haste
  349.         elseif equipSet[spell.skill] then
  350.             equipSet = equipSet[spell.skill]
  351.         end
  352.     elseif equipSet[spell.english] then
  353.         equipSet = equipSet[spell.english]
  354.     end
  355.     equip(equipSet)
  356. end
  357.  
  358. function aftercast(spell,action)
  359.     if pet_midaction() then
  360.         return
  361.     elseif not spell.type:startswith('BloodPact') then
  362.         status_change(player.status)
  363.     end
  364. end
  365.  
  366. function status_change(new,old)
  367.     check_equip_lock()
  368.     if Armor == 'PDT' then
  369.         equip(sets.PDT)
  370.     elseif pet.isvalid then
  371.         if SpiritPacts:contains(pet.name) then
  372.             equip(sets.Spirits)
  373.         elseif buffactive["Avatar's Favor"] then
  374.             equip(sets.Favor)
  375.         else
  376.             equip(sets.Avatars)
  377.             if sets.Avatars[pet.name] then
  378.                 equip(sets.Avatars[pet.name])
  379.             end
  380.         end
  381.         if Kiting == 'ON' then
  382.             equip(sets.Kiting)
  383.         end
  384.     elseif buffactive["Sublimation: Activated"] then
  385.         equip(sets.Sublimation)
  386.         if Kiting == 'ON' then
  387.             equip(sets.Kiting)
  388.         end
  389.     elseif new == 'Engaged' then
  390.         equip(sets.Melee)
  391.     elseif new == 'Idle' then
  392.         equipSet = sets.Idle
  393.         if equipSet[IdleArray[IdleIndex]] then
  394.             equipSet = equipSet[IdleArray[IdleIndex]]
  395.         end
  396.         if buffactive['Reive Mark'] then -- Equip Arciela's Grace +1 During Reive --
  397.             equipSet = set_combine(equipSet,sets.Reive)
  398.         end
  399.         equip(equipSet)
  400.     elseif new == 'Resting' then
  401.         equip(sets.Resting)
  402.     end
  403. end
  404.  
  405. function buff_change(buff,gain)
  406.     buff = string.lower(buff)
  407.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  408.         if gain then
  409.             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.]')
  410.         else
  411.             send_command('timers delete "Aftermath: Lv.3"')
  412.             add_to_chat(123,'AM3: [OFF]')
  413.         end
  414.     elseif buff == 'weakness' then -- Weakness Timer --
  415.         if gain then
  416.             send_command('timers create "Weakness" 300 up')
  417.         else
  418.             send_command('timers delete "Weakness"')
  419.         end
  420.     end
  421.     if not midaction() and not pet_midaction() then
  422.         status_change(player.status)
  423.     end
  424. end
  425.  
  426. function pet_midcast(spell)
  427.     if spell.english == 'Perfect Defense' then
  428.         equip(sets.Midcast.Pet.BloodPactWard)
  429.     elseif spell.type == 'BloodPactWard' then
  430.         if DebuffBloodPactWard:contains(spell.english) then
  431.             equip(sets.Midcast.Pet.DebuffBloodPactWard)
  432.         elseif sets.Midcast.Pet[spell.english] then
  433.             equip(sets.Midcast.Pet[spell.english])
  434.         else
  435.             equip(sets.Midcast.Pet.BloodPactWard)
  436.         end
  437.     elseif spell.type == 'BloodPactRage' then
  438.         if Magical_RagePacts:contains(spell.english) then
  439.             equip(sets.Midcast.Pet.Magical_RagePacts[AccArray[AccIndex]])
  440.         elseif Magical_TP_RagePacts:contains(spell.english) then
  441.             equip(sets.Midcast.Pet.Magical_TP_RagePacts[AccArray[AccIndex]])
  442.         else
  443.             equip(sets.Midcast.Pet.Physical_RagePacts[AccArray[AccIndex]])
  444.         end
  445.     end
  446. end
  447.  
  448. function pet_aftercast(spell)
  449.     if not spell.interrupted and message == 'ON' then
  450.         if spell.english == "Ecliptic Howl" then
  451.             if world.moon_pct > 89 then
  452.                 send_command('input /p [Ecliptic Howl] ACC +25 | EVA +1')
  453.             elseif world.moon_pct > 74 then
  454.                 send_command('input /p [Ecliptic Howl] ACC +21 | EVA +5')
  455.             elseif world.moon_pct > 59 then
  456.                 send_command('input /p [Ecliptic Howl] ACC +17 | EVA +9')
  457.             elseif world.moon_pct > 39 then
  458.                 send_command('input /p [Ecliptic Howl] ACC +13 | EVA +13')
  459.             elseif world.moon_pct > 24 then
  460.                 send_command('input /p [Ecliptic Howl] ACC +9 | EVA +17')
  461.             elseif world.moon_pct > 9 then
  462.                 send_command('input /p [Ecliptic Howl] ACC +5 | EVA +21')
  463.             else
  464.                 send_command('input /p [Ecliptic Howl] ACC +1 | EVA +25')
  465.             end
  466.         elseif spell.english == "Ecliptic Growl" then
  467.             if world.moon_pct > 89 then
  468.                 send_command('input /p [Ecliptic Growl] STR/DEX/VIT 7 | INT/MND/CHR/AGI 1')
  469.             elseif world.moon_pct > 74 then
  470.                 send_command('input /p [Ecliptic Growl] STR/DEX/VIT 6 | INT/MND/CHR/AGI 2')
  471.             elseif world.moon_pct > 59 then
  472.                 send_command('input /p [Ecliptic Growl] STR/DEX/VIT 5 | INT/MND/CHR/AGI 3')
  473.             elseif world.moon_pct > 39 then
  474.                 send_command('input /p [Ecliptic Growl] STR/DEX/VIT 4 | INT/MND/CHR/AGI 4')
  475.             elseif world.moon_pct > 24 then
  476.                 send_command('input /p [Ecliptic Growl] STR/DEX/VIT 3 | INT/MND/CHR/AGI 5')
  477.             elseif world.moon_pct > 9 then
  478.                 send_command('input /p [Ecliptic Growl] STR/DEX/VIT 2 | INT/MND/CHR/AGI 6')
  479.             else
  480.                 send_command('input /p [Ecliptic Growl] STR/DEX/VIT 1 | INT/MND/CHR/AGI 7')
  481.             end  
  482.         elseif spell.english == "Lunar Cry" then
  483.             if world.moon_pct > 89 then
  484.                 send_command('input /p [Lunar Cry] Enemy ACC -31 | Enemy EVA -1')
  485.             elseif world.moon_pct > 74 then
  486.                 send_command('input /p [Lunar Cry] Enemy ACC -26 | Enemy EVA -6')
  487.             elseif world.moon_pct > 59 then
  488.                 send_command('input /p [Lunar Cry] Enemy ACC -21 | Enemy EVA -11')
  489.             elseif world.moon_pct > 39 then
  490.                 send_command('input /p [Lunar Cry] Enemy ACC -16 | Enemy EVA -16')
  491.             elseif world.moon_pct > 24 then
  492.                 send_command('input /p [Lunar Cry] Enemy ACC -11 | Enemy EVA -21')
  493.             elseif world.moon_pct > 9 then
  494.                 send_command('input /p [Lunar Cry] Enemy ACC -6 | Enemy EVA -26')
  495.             else
  496.                 send_command('input /p [Lunar Cry] Enemy ACC -1 | Enemy EVA -31')
  497.             end
  498.         elseif spell.english == "Dream Shroud" then
  499.             if world.time <= (0*60) or world.time >= (1*60) then
  500.                 send_command('input /p [Dream Shroud] MAB +13 | MDB +1')
  501.             elseif (world.time <= (1*60) or world.time >= (2*60)) or (world.time <= (23*60) or world.time >= (0*60)) then
  502.                 send_command('input /p [Dream Shroud] MAB +12 | MDB +2')
  503.             elseif (world.time <= (2*60) or world.time >= (3*60)) or (world.time <= (22*60) or world.time >= (23*60)) then
  504.                 send_command('input /p [Dream Shroud] MAB +11 | MDB +3')
  505.             elseif (world.time <= (3*60) or world.time >= (4*60)) or (world.time <= (21*60) or world.time >= (22*60)) then
  506.                 send_command('input /p [Dream Shroud] MAB +10 | MDB +4')
  507.             elseif (world.time <= (4*60) or world.time >= (5*60)) or (world.time <= (20*60) or world.time >= (21*60)) then
  508.                 send_command('input /p [Dream Shroud] MAB +9 | MDB +5')
  509.             elseif (world.time <= (5*60) or world.time >= (6*60)) or (world.time <= (19*60) or world.time >= (20*60)) then
  510.                 send_command('input /p [Dream Shroud] MAB +8 | MDB +6')
  511.             elseif (world.time <= (6*60) or world.time >= (7*60)) or (world.time <= (18*60) or world.time >= (19*60)) then
  512.                 send_command('input /p [Dream Shroud] MAB +7 | MDB +7')
  513.             elseif (world.time <= (7*60) or world.time >= (8*60)) or (world.time <= (17*60) or world.time >= (18*60)) then
  514.                 send_command('input /p [Dream Shroud] MAB +6 | MDB +8')
  515.             elseif (world.time <= (8*60) or world.time >= (9*60)) or (world.time <= (16*60) or world.time >= (17*60)) then
  516.                 send_command('input /p [Dream Shroud] MAB +5 | MDB +9')
  517.             elseif (world.time <= (9*60) or world.time >= (10*60)) or (world.time <= (15*60) or world.time >= (16*60)) then
  518.                 send_command('input /p [Dream Shroud] MAB +4 | MDB +10')
  519.             elseif (world.time <= (10*60) or world.time >= (11*60)) or (world.time <= (14*60) or world.time >= (15*60)) then
  520.                 send_command('input /p [Dream Shroud] MAB +3 | MDB +11')
  521.             elseif (world.time <= (11*60) or world.time >= (12*60)) or (world.time <= (13*60) or world.time >= (14*60)) then
  522.                 send_command('input /p [Dream Shroud] MAB +2 | MDB +12')
  523.             elseif world.time <= (12*60) or world.time >= (13*60) then
  524.                 send_command('input /p [Dream Shroud] MAB +1 | MDB +13')
  525.             end
  526.         elseif spell.english == "Sleepga" then
  527.             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.]')
  528.         end
  529.     end
  530.     status_change(player.status)
  531. end
  532.  
  533. function pet_change(pet,gain)
  534.     status_change(player.status)
  535. end
  536.  
  537. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  538. function self_command(command)
  539.     if command == 'C1' then -- BloodPact Accuracy Toggle --
  540.         AccIndex = (AccIndex % #AccArray) + 1
  541.         add_to_chat(158,'BloodPact Accuracy Level: '..AccArray[AccIndex])
  542.         status_change(player.status)
  543.     elseif command == 'C2' then -- Kiting Toggle --
  544.         if Kiting == 'ON' then
  545.             Kiting = 'OFF'
  546.             add_to_chat(123,'Kiting Set: [Unlocked]')
  547.         else
  548.             Kiting = 'ON'
  549.             add_to_chat(158,'Kiting Set: [Locked]')
  550.         end
  551.         status_change(player.status)
  552.     elseif command == 'C5' then -- Auto Update Gear Toggle --
  553.         status_change(player.status)
  554.         add_to_chat(158,'Auto Update Gear')
  555.     elseif command == 'C7' then
  556.         if Armor == 'PDT' then -- PDT Toggle --
  557.             Armor = 'None'
  558.             add_to_chat(123,'PDT Set: [Unlocked]')
  559.         else
  560.             Armor = 'PDT'
  561.             add_to_chat(158,'PDT Set: [Locked]')
  562.         end
  563.         status_change(player.status)
  564.     elseif command == 'C17' then -- Lock Main Weapon Toggle --
  565.         if Lock_Main == 'ON' then
  566.             Lock_Main = 'OFF'
  567.             add_to_chat(123,'Main Weapon: [Unlocked]')
  568.         else
  569.             Lock_Main = 'ON'
  570.             add_to_chat(158,'Main Weapon: [Locked]')
  571.         end
  572.         status_change(player.status)
  573.     elseif command == 'C9' then -- Message Toggle --
  574.         if message == 'ON' then
  575.             message = 'OFF'
  576.             add_to_chat(123,'Message: [OFF]')
  577.         else
  578.             message = 'ON'
  579.             add_to_chat(158,'Message: [ON]')
  580.         end
  581.         status_change(player.status)
  582.     elseif command == 'C8' then -- Distance Toggle --
  583.         if player.target.distance then
  584.             target_distance = math.floor(player.target.distance*10)/10
  585.             add_to_chat(158,'Distance: '..target_distance)
  586.         else
  587.             add_to_chat(123,'No Target Selected')
  588.         end
  589.     elseif command == 'C6' then -- Idle Toggle --
  590.         IdleIndex = (IdleIndex % #IdleArray) + 1
  591.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  592.         status_change(player.status)
  593.     elseif command:match('^SC%d$') then
  594.         send_command('//' .. sc_map[command])
  595.     end
  596. end
  597.  
  598. function check_equip_lock() -- Lock Equipment Here --
  599.     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
  600.         disable('ring1','ring2')
  601.     elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
  602.         disable('back')
  603.     elseif Lock_Main == 'ON' then
  604.         disable('main','sub')
  605.     else
  606.         enable('main','sub','ring1','ring2','back')
  607.     end
  608. end
  609.  
  610. function actualCost(originalCost)
  611.     if buffactive["Penury"] then
  612.         return originalCost*.5
  613.     elseif buffactive["Light Arts"] then
  614.         return originalCost*.9
  615.     else
  616.         return originalCost
  617.     end
  618. end
  619.  
  620. function degrade_spell(spell,degrade_array)
  621.     spell_index = table.find(degrade_array,spell.name)
  622.     if spell_index > 1 then
  623.         new_spell = degrade_array[spell_index - 1]
  624.         change_spell(new_spell,spell.target.raw)
  625.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  626.     end
  627. end
  628.  
  629. function change_spell(spell_name,target)
  630.     cancel_spell()
  631.     send_command('//'..spell_name..' '..target)
  632. end
  633.  
  634. function sub_job_change(newSubjob, oldSubjob)
  635.     select_default_macro_book()
  636. end
  637.  
  638. function set_macro_page(set,book)
  639.     if not tonumber(set) then
  640.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  641.         return
  642.     end
  643.     if set < 1 or set > 10 then
  644.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  645.         return
  646.     end
  647.  
  648.     if book then
  649.         if not tonumber(book) then
  650.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  651.             return
  652.         end
  653.         if book < 1 or book > 20 then
  654.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  655.             return
  656.         end
  657.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  658.     else
  659.         send_command('@input /macro set '..tostring(set))
  660.     end
  661. end
  662.  
  663. function select_default_macro_book()
  664.     -- Default macro set/book
  665.     if player.sub_job == 'WHM' then
  666.         set_macro_page(1, 15)
  667.     elseif player.sub_job == 'RDM' then
  668.         set_macro_page(2, 15)
  669.     elseif player.sub_job == 'SCH' then
  670.         set_macro_page(3, 15)
  671.     else
  672.         set_macro_page(1, 15)
  673.     end
  674. end
Advertisement
Add Comment
Please, Sign In to add comment