Advertisement
Vamperica

SMN Base Code

Aug 10th, 2019
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.51 KB | None | 0 0
  1.  include('SMN_Gearsets.lua')
  2.  
  3.  -- Blood Pacts Groupings: 
  4. --[[
  5.      Put: /console gs c pact [PactType] as your macro
  6.      
  7.         PactType can be one of:
  8.             cure
  9.             curaga
  10.             buffOffense
  11.             buffDefense
  12.             buffSpecial
  13.             debuff1
  14.             debuff2
  15.             sleep
  16.             nuke2
  17.             nuke4
  18.             bp70
  19.             bp75 (merits and lvl 75-80 pacts)
  20.             bp99
  21.             astralflow
  22. --]]
  23.  
  24.     pacts = {}
  25.     pacts.cure = {['Carbuncle']='Healing Ruby'}
  26.     pacts.curaga = {['Carbuncle']='Healing Ruby II', ['Garuda']='Whispering Wind', ['Leviathan']='Spring Water'}
  27.     pacts.buffoffense = {['Carbuncle']='Glittering Ruby', ['Ifrit']='Crimson Howl', ['Garuda']='Hastega II', ['Ramuh']='Rolling Thunder',
  28.         ['Fenrir']='Ecliptic Growl', ['Shiva']='Crystal Blessing'}
  29.     pacts.buffdefense = {['Carbuncle']='Shining Ruby', ['Shiva']='Frost Armor', ['Garuda']='Aerial Armor', ['Titan']='Earthen Ward',
  30.         ['Ramuh']='Lightning Armor', ['Fenrir']='Ecliptic Howl', ['Diabolos']='Noctoshield', ['Cait Sith']='Reraise II'}
  31.     pacts.buffspecial = {['Ifrit']=' <staff_and_grip Howl', ['Garuda']='Fleet Wind', ['Titan']='Earthen Armor', ['Diabolos']='Dream Shroud',
  32.         ['Carbuncle']='Soothing Ruby', ['Fenrir']='Heavenward Howl', ['Cait Sith']='Raise II'}
  33.     pacts.debuff1 = {['Shiva']='Diamond Storm', ['Ramuh']='Shock Squall', ['Leviathan']='Tidal Roar', ['Fenrir']='Lunar Cry',
  34.         ['Diabolos']='Pavor Nocturnus', ['Cait Sith']='Eerie Eye'}
  35.     pacts.debuff2 = {['Shiva']='Sleepga', ['Leviathan']='Slowga', ['Fenrir']='Lunar Roar', ['Diabolos']='Somnolence', ['Ramuh']='Thunderspark'}
  36.     pacts.sleep = {['Shiva']='Sleepga', ['Diabolos']='Nightmare', ['Cait Sith']='Mewing Lullaby'}
  37.     pacts.nuke2 = {['Ifrit']='Fire II', ['Shiva']='Blizzard II', ['Garuda']='Aero II', ['Titan']='Stone II',
  38.         ['Ramuh']='Thunder II', ['Leviathan']='Water II'}
  39.     pacts.nuke4 = {['Ifrit']='Fire IV', ['Shiva']='Blizzard IV', ['Garuda']='Aero IV', ['Titan']='Stone IV',
  40.         ['Ramuh']='Thunder IV', ['Leviathan']='Water IV'}
  41.     pacts.bp70 = {['Ifrit']='Flaming Crush', ['Shiva']='Rush', ['Garuda']='Predator Claws', ['Titan']='Mountain Buster',
  42.         ['Ramuh']='Chaotic Strike', ['Leviathan']='Spinning Dive', ['Carbuncle']='Meteorite', ['Fenrir']='Eclipse Bite',
  43.         ['Diabolos']='Nether Blast',['Cait Sith']='Regal Gash'}
  44.     pacts.bp75 = {['Ifrit']='Meteor Strike', ['Shiva']='Heavenly Strike', ['Garuda']='Wind Blade', ['Titan']='Geocrush',
  45.         ['Ramuh']='Thunderstorm', ['Leviathan']='Grand Fall', ['Carbuncle']='Holy Mist', ['Fenrir']='Lunar Bay',
  46.         ['Diabolos']='Night Terror', ['Cait Sith']='Level ? Holy'}
  47.     pacts.bp99 = {['Ifrit']='Conflag Strike', ['Ramuh']='Volt Strike', ['Titan']='Crag Throw', ['Fenrir']='Impact', ['Diabolos']='Blindside'}
  48.     pacts.astralflow = {['Ifrit']='Inferno', ['Shiva']='Diamond Dust', ['Garuda']='Aerial Blast', ['Titan']='Earthen Fury',
  49.         ['Ramuh']='Judgment Bolt', ['Leviathan']='Tidal Wave', ['Carbuncle']='Searing Light', ['Fenrir']='Howling Moon',
  50.         ['Diabolos']='Ruinous Omen', ['Cait Sith']="Altana's Favor"}
  51.     pacts.exatt = {['Ramuh']='Volt Strike', ['Titan']='Crag Throw', ['Fenrir']='Impact', ['Diabolos']='Blindside', ['Ifrit']='Flaming Crush',
  52.         ['Shiva']='Rush', ['Garuda']='Predator Claws', ['Leviathan']='Spinning Dive', ['Fenrir']='Eclipse Bite', ['Cait Sith']='Regal Gash'}
  53.    
  54.  
  55. --     
  56.        
  57. bp_physical=S{  'Punch','Rock Throw','Barracuda Dive','Claw','Axe Kick','Shock Strike','Camisado','Regal Scratch','Poison Nails',
  58.                 'Moonlit Charge','Crescent Fang','Rock Buster','Tail Whip','Double Punch','Megalith Throw','Double Slap','Eclipse Bite',
  59.                 'Mountain Buster','Spinning Dive','Predator Claws','Rush','Chaotic Strike','Crag Throw','Volt Strike'}
  60.  
  61. bp_hybrid=S{    'Burning Strike','Flaming Crush'}
  62.  
  63. bp_magical=S{   'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgment Bolt','Searing Light','Howling Moon',
  64.                 'Ruinous Omen','Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II','Thunderspark','Somnolence',
  65.                 'Meteorite','Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV','Nether Blast','Meteor Strike',
  66.                 'Geocrush','Grand Fall','Wind Blade','Heavenly Strike','Thunderstorm','Level ? Holy','Holy Mist','Lunar Bay',
  67.                 'Night Terror','Conflagration Strike', 'Zantetsuken'}
  68.                
  69. bp_debuff=S{    'Lunar Cry','Mewing Lullaby','Nightmare','Lunar Roar','Slowga','Ultimate Terror','Sleepga','Eerie Eye','Tidal Roar',
  70.                 'Diamond Storm','Shock Squall','Pavor Nocturnus'}
  71.                
  72. bp_buff=S{      'Shining Ruby','Frost Armor','Rolling Thunder','Crimson Howl','Lightning Armor','Ecliptic Growl','Hastega','Noctoshield',
  73.                 'Ecliptic Howl','Dream Shroud','Earthen Armor','Fleet Wind','Inferno Howl','Soothing Ruby','Heavenward Howl',
  74.                 'Soothing Current','Hastega II','Crystal Blessing'}
  75.  
  76. bp_other=S{     'Healing Ruby','Raise II','Aerial Armor','Reraise II','Whispering Wind','Glittering Ruby','Earthen Ward','Spring Water','Healing Ruby II'}
  77.  
  78. AvatarList=S{   'Shiva','Ramuh','Garuda','Leviathan','Diabolos','Titan','Fenrir','Ifrit','Carbuncle','Fire Spirit','Air Spirit','Ice Spirit',
  79.                 'Thunder Spirit','Light Spirit','Dark Spirit','Earth Spirit','Water Spirit','Cait Sith','Alexander','Odin','Atomos'}
  80.                
  81. spirit_element={Fire='Fire Spirit',Earth='Earth Spirit',Water='Water Spirit',Wind='Air Spirit',Ice='Ice Spirit',Lightning='Thunder Spirit',
  82.                 Light='Light Spirit',Dark='Dark Spirit'}spirit_conflict={Fire='Ice',Earth='Lightning',Water='Fire',Wind='Earth',Ice='Wind',
  83.                 Lightning='Water',Light='Dark',Dark='Light'}
  84.                
  85. -- Set Macros for your SMN's macro page, book.
  86. function set_macros(sheet,book)
  87.     if book then
  88.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(sheet))
  89.         return
  90.     end
  91.     send_command('@input /macro set '..tostring(sheet))
  92. end
  93. set_macros(5,5) -- Sheet, Book
  94.  
  95. function set_style(sheet)
  96.     send_command('@input /lockstyleset '..sheet)
  97. end
  98. set_style(3)
  99.  
  100. -- Required variables and  their initial value
  101. meleeing = false
  102. autobp = false
  103. favor = true
  104. mBurst = false
  105. macc = false
  106. mode = "perp"
  107. savedMode = "perp"
  108.  
  109.  
  110.  function precast(spell)
  111.  
  112.     -- Don't swap if we're in the middle of something or our pet's doing something
  113.     -- Stops macro spam from interfering with an action GS is already handling
  114.     if midaction() or pet_midaction() then
  115.         return
  116.     end
  117.     if buffactive['Astral Conduit'] then
  118.         return
  119.     end
  120.  
  121.     -- If we're doing a blood pact, equip our delay set IF Apogee or Astral Conduit are not active
  122.     if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') and not (buffactive['Astral Conduit'] or buffactive['Apogee']) then
  123.      
  124.         equip(sets.precast.bp)
  125.          
  126.     elseif spell.type == 'SummonerPact' then
  127.      
  128.         -- This chunk of code handles Elemental Siphon. It will look at the current day and weather and cancel the spell to summon
  129.         -- the right elemental. Your elemental siphon macro should summon a Dark Spirit to trigger this check
  130.          
  131.         -- These use the included lists in global.lua to determine the right spirit to summon
  132.              
  133.         if spell.name == 'Dark Spirit' then
  134.            
  135.             cancel_spell()
  136.            
  137.             if world.weather_element ~= 'None' then
  138.                 send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element]))
  139.                 equip(sets.precast.summoning)
  140.                
  141.                 else
  142.                     send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
  143.                     equip(sets.precast.summoning)          
  144.                  
  145.             end
  146.         else
  147.          
  148.             -- summoning an avatar
  149.             equip(sets.precast.summoning)
  150.              
  151.         end
  152.          
  153.     -- Moving on to other types of magic
  154.     elseif spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' or spell.name == AvatarList:contains(spell.name) then
  155.      
  156.         -- Stoneskin Precast
  157.         if spell.name == 'Stoneskin' then
  158.          
  159.             windower.ffxi.cancel_buff(37)--[[Cancels stoneskin, not delayed incase you get a Quick Cast]]
  160.             equip(sets.precast.stoneskin)
  161.              
  162.         -- Cure Precast
  163.         elseif spell.name:match('Cure') or spell.name:match('Cura') then
  164.          
  165.             equip(sets.precast.cure)
  166.              
  167.         -- Enhancing Magic
  168.         elseif spell.skill == 'Magic' then
  169.          
  170.             equip(sets.precast.enhancing)
  171.              
  172.             if spell.name == 'Sneak' then
  173.                 windower.ffxi.cancel_buff(71)--[[Cancels Sneak]]
  174.             end
  175.         else
  176.          
  177.             -- For everything else we go with max fastcast
  178.             equip(sets.precast.casting)
  179.              
  180.         end
  181.          
  182.     -- Summoner Abilities
  183.     -- We use a catch all here, if the set exists for an ability, use it
  184.     -- This way we don't need to write a load of different code for different abilities, just make a set
  185.      
  186.     elseif sets.precast[spell.name] then
  187.         equip(sets.precast[spell.name])
  188.     end
  189.      
  190. end
  191.  
  192. function midcast(spell)
  193.      
  194.     -- No need to annotate all this, it's fairly logical. Just equips the relevant sets for the relevant magic
  195.     if spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' then
  196.         if spell.name == 'Stoneskin' then
  197.             equip(sets.midcast.stoneskin)
  198.         elseif spell.name:match('Cure') or spell.name:match('Cura') or spell.name:match('Regen')then
  199.             equip(sets.midcast.cure)
  200.         elseif spell.skill == 'Enhancing Magic' then
  201.             equip(sets.midcast.enhancing)
  202.             if spell.name:match('Protect') or spell.name:match('Shell') then
  203.                 equip({rring="Sheltered Ring"})
  204.             end
  205.         else
  206.             equip(sets.midcast.casting)
  207.         end
  208.     elseif spell.name == 'Elemental Siphon' then
  209.      
  210.         -- Siphon Set
  211.         equip(sets.midcast.siphon)
  212.          
  213.         -- Checks if pet matches weather
  214.         --if pet.element == world.weather_element then
  215.         --    equip(sets.midcast.siphon,{main="Chatoyant Staff"--[[Take advantage of the weather boost]]})
  216.         --end
  217.          
  218.     -- And our catch all, if a set exists for this spell use it
  219.     elseif sets.midcast[spell.name] then
  220.         equip(sets.midcast[spell.name])
  221.          
  222.     -- Remember those WS Sets we defined? :)
  223.     elseif sets.me[spell.name] then
  224.         equip(sets.me[spell.name])
  225.     end
  226. end
  227.  
  228. function aftercast(spell)
  229.  
  230.     -- If our pet is doing something, prevents us swapping equipment too early
  231.     if midaction() or pet_midaction() then
  232.         return
  233.     end
  234.     if buffactive['Astral Conduit'] then
  235.         return
  236.     end
  237.      
  238.     -- If not a blood pact or summon
  239.     if spell and (not spell.type or not string.find(spell.type,'BloodPact') and not AvatarList:contains(spell.name) or spell.interrupted) then
  240.      
  241.         -- Then initiate idle function to check which set should be equipped
  242.         idle(pet)
  243.          
  244.     end
  245. end
  246.  
  247. function pet_midcast(spell)
  248.  
  249.     -- Our pet is doing something
  250.     if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') then
  251.      
  252.         -- We're going to check the lists in global.lua for matches and equip the relevant sets
  253.          
  254.         if bp_physical:contains(spell.name) then
  255.             if mode == 'acc' then
  256.                 equip(sets.avatar.pacc)    
  257.             else
  258.                 equip(sets.avatar.atk)
  259.             end
  260.         elseif bp_hybrid:contains(spell.name) then
  261.          
  262.             equip(sets.avatar.hybrid)
  263.  
  264.         elseif bp_magical:contains(spell.name) then
  265.          
  266.             if mode == 'acc' then
  267.                 equip(sets.avatar.macc)
  268.             elseif mBurst then
  269.                 equip(sets.avatar.mb)          
  270.             else
  271.                 equip(sets.avatar.mab)
  272.             end
  273.  
  274.         elseif bp_debuff:contains(spell.name) then
  275.          
  276.             equip(sets.avatar.macc)
  277.              
  278.         elseif bp_buff:contains(spell.name) then
  279.          
  280.             equip(sets.avatar.buff)
  281.              
  282.         elseif bp_other:contains(spell.name) then
  283.          
  284.             equip(sets.avatar.other)
  285.              
  286.         elseif spell.name == 'Perfect Defense' then
  287.          
  288.             equip(sets.avatar.skill)
  289.              
  290.         else
  291.          
  292.             equip(sets.avatar.skill)
  293.              
  294.         end
  295.         if pet.name == 'Carbuncle' or pet.name == 'Cait Sith' then
  296.             equip(sets.avatar[pet.name])
  297.         end
  298.     end
  299. end
  300.  
  301. function pet_aftercast(spell)
  302.      
  303.     -- Pet aftercast is simply a check for whether Conduit and Apogee are up, and then a call to our aftercast function
  304.     -- We have a variable called autobp that we set to true or false with commands to auto repeat BPs for us
  305.     if (buffactive['Apogee'] or buffactive['Astral Conduit']) and autobp then
  306.         send_command('input /pet "%s" <t>':format(spell.name))
  307.         return
  308.     end
  309.    
  310.     idle(pet)
  311.     -- Add to Chat rules for buffs with variable values.
  312.     buffs_to_chat(spell)
  313.     if (spell.english=="Heavenward Howl") then
  314.         if (world.moon_pct>89) then
  315.                 add_to_chat(104,"[Heavenward Howl] Moon Phase Full moon - Endrain 15%")
  316.         elseif (world.moon_pct>73) then
  317.                 add_to_chat(104,"[Heavenward Howl] Moon phase 74~90% {Endrain 12%")
  318.         elseif (world.moon_pct>56) then
  319.                 add_to_chat(104,"[Heavenward Howl] Moon phase 57~73% {Endrain 8%}")
  320.         elseif (world.moon_pct>39) then
  321.                 add_to_chat(104,"[Heavenward Howl] Moon phase 40~56% {First Quarter Moon - Endrain 5% | Last Quarter - moon Enaspir 1%}" )
  322.         elseif (world.moon_pct>24) then
  323.                 add_to_chat(104,"[Heavenward Howl] Moon phase 25~39% {Enaspir 2%}")
  324.         elseif (world.moon_pct>9) then
  325.                 add_to_chat(104,"[Heavenward Howl] Moon phase 10~24% {Enaspir 4%}")
  326.         else
  327.                 add_to_chat(104,"[Heavenward Howl] Moon Phase New Moon - Enaspir 5%")
  328.         end    
  329.     end
  330. end
  331.  
  332. function buffs_to_chat(spell)
  333.     -- Add to Chat rules for buffs with variable values
  334.     -- table of tables: spell = T{ "stat_a", "stat_b", step}
  335.     buff_chat_values = {
  336.         ['Ecliptic Howl'] = T{"Accuracy","Evasion",4},
  337.         ['Ecliptic Growl'] = T{"STR/DEX/VIT","INT/MND/CHR/AGI",1},
  338.         ['Lunar Cry'] = T{"Enemy Acc Down","Enemy Eva Down",1},
  339.     }
  340.     if buff_chat_values[spell.english] then
  341.         -- calc value of stat_a: 1 + (the moon phase value * step value)
  342.         local val_a = 1 + (Moon() * buff_chat_values[spell.english][3])
  343.         -- calc value of stat_b: (2 - (6 * step value)) - val_a
  344.         local val_b = (2 + (6 * buff_chat_values[spell.english][3])) - val_a
  345.         -- concatenate all that together
  346.         add_to_chat(104,"["..spell.english.."] "..buff_chat_values[spell.english][1].." "..tostring(val_a).." - "..buff_chat_values[spell.english][2].." "..tostring(val_b))
  347.     -- Dream Shroud is based on time not moon phase
  348.     elseif (spell.english=="Dream Shroud") then
  349.         -- get the hour in 24h format
  350.         local hour24 = math.floor(world.time/60)
  351.         if hour24 < 13 then
  352.             add_to_chat(104,"[Dream Shroud] MAB "..tostring(13-hour24).." - MDB "..tostring(hour24+1))
  353.         else
  354.             add_to_chat(104,"[Dream Shroud] MAB "..tostring(1+(hour24-12)).." - MDB "..tostring(13-(hour24-12)))
  355.         end
  356.     end
  357. end
  358.  
  359. function Moon()
  360.     -- Assume bonus to effects is symmetrical around New Moon or Full Moon
  361.     -- Actually Phase 0/11 in 12 phase Full Cycle
  362.     -- Originally written for Artemis' Medal
  363.     -- See http://www.ffxiah.com/screenshots/51600
  364.     if world.moon == "New Moon" then
  365.         return 0
  366.     -- Check for Waxing Moon
  367.     elseif world.moon == "Waxing Crescent" then
  368.         -- If %MOONPCT < 24% we know it's Early, rather than Late
  369.         if world.moon_pct < 24 then
  370.             return 1
  371.         else
  372.             return 2
  373.         end
  374.     elseif world.moon == "First Quarter Moon" then
  375.         return 3
  376.     elseif world.moon == "Waxing Gibbous" then
  377.         -- If %MOONPCT < 74% we know it's Early, rather than Late
  378.         if world.moon_pct < 74 then
  379.             return 4
  380.         else
  381.             return 5
  382.         end
  383.     elseif world.moon == "Full Moon" then
  384.         return 6
  385.     -- Check for Waning Moon
  386.     elseif world.moon == "Waning Gibbous" then
  387.         -- If %MOONPCT > 76% we know it's Early, rather than Late
  388.         if world.moon_pct > 76 then
  389.             -- Actually Phase 7 in Full Cycle
  390.             return 5
  391.         else
  392.             -- Actually Phase 8 in Full Cycle
  393.             return 4
  394.         end
  395.     elseif world.moon == "Last Quarter Moon" then
  396.         -- Actually Phase 9 in Full Cycle
  397.         return 3
  398.     elseif world.moon == "Waning Crescent" then
  399.         -- If %MOONPCT > 26% we know it's Early, rather than Late
  400.         if world.moon_pct > 26 then
  401.             -- Actually Phase 10 in Full Cycle
  402.             return 2
  403.         else
  404.             -- Actually Phase 11 in Full Cycle
  405.             return 1
  406.         end
  407.     end
  408. end
  409.  
  410. function idle(pet)
  411.  
  412.     -- This function is called after every action, and handles which set to equip depending on what we're doing
  413.     -- We check if we're meleeing because we don't want to idle in melee gear when we're only engaged for trusts
  414.      
  415.     if meleeing and player.status=='Engaged' then  
  416.         -- We're both engaged and meleeing, meleeing priority over all.
  417.         equip(sets.me.melee)    
  418.     elseif pet.isvalid then
  419.         if pet.name == 'Alexander' then      
  420.             -- We have Alexander so we want idle in max skill instead.
  421.             equip(sets.avatar.skill)   
  422.         else
  423.             -- We have a non-Alexander pet out but we're not meleeing, set the right idle set
  424.             equip(sets.avatar[mode])
  425.         end
  426.         if pet.name == 'Carbuncle' or pet.name == 'Cait Sith' then
  427.             -- If we have cait or carbie  we switch hands to those things.
  428.             equip(sets.avatar[pet.name])       
  429.         end
  430.         if favor then
  431.             -- Avatar's favor set just, or should just swap to beckoner's horn +1 for head.
  432.             --[[
  433.                 Assuming your favor set is this:
  434.                 sets.avatar.favor = {
  435.                     head="Beckoner's Horn +1",
  436.                 }
  437.             --]]
  438.             equip(sets.avatar.favor)
  439.         end
  440.     else
  441.         -- We're not meleeing and we have no pet out
  442.         equip(sets.me.idle)    
  443.     end
  444. end
  445.  
  446. function status_change(new,old)
  447.     if new == 'Engaged' then
  448.      
  449.         -- If we engage check our meleeing status
  450.         idle(pet)
  451.          
  452.     elseif new=='Resting' then
  453.      
  454.         -- We're resting
  455.         equip(sets.me.resting)
  456.     else
  457.         idle(pet)
  458.     end
  459. end
  460.  
  461. function pet_change(pet,gain)
  462.  
  463.     -- When we summon or release an avatar
  464.     idle(pet)
  465.     windower.add_to_chat(8,'----- Avatar set to '..mode..' mode! -----')
  466. end
  467.  
  468.  
  469. function self_command(command)
  470.  
  471.     local commandArgs = command
  472.      
  473.     -- This command takes //gs c avatar mode, where mode is what you want, eg, tank, acc, melee, etc
  474.     if #commandArgs:split(' ') >= 2 then
  475.         commandArgs = T(commandArgs:split(' '))
  476.         if commandArgs[1] == 'avatar' and pet.isvalid then
  477.             if commandArgs[2] then
  478.                 mode = tostring(commandArgs[2])
  479.                 if mode == 'mode' then
  480.                     if savedMode == 'perp' then
  481.                        mode = 'tank'
  482.                     elseif savedMode == 'tank' then
  483.                        mode = 'melee'
  484.                     elseif savedMode == 'melee' then
  485.                        mode = 'acc'
  486.                     elseif savedMode == 'acc' then
  487.                        mode = 'perp'
  488.                     end
  489.                     savedMode = mode
  490.                 end    
  491.                 equip(sets.avatar[mode])
  492.                 windower.add_to_chat(8,'----- Avatar set to '..mode..' mode! -----')
  493.             end
  494.         elseif commandArgs[1] == 'toggle' then
  495.             if commandArgs[2] == 'auto' then
  496.              
  497.                 -- //gs c toggle auto will toggle auto blood pacts on and off. Auto blood pact will make your GS repeat BPs under Apogee or Conduit
  498.                 -- And by repeat I mean repeat. If Conduit is up, it will SPAM the BP until Conduit is down
  499.                 if autobp then
  500.                     autobp = false
  501.                     windower.add_to_chat(8,'----- Auto BP mode Disabled -----')
  502.                 else
  503.                     autobp = true
  504.                     windower.add_to_chat(8,'----- Auto BP mode Enabled -----')
  505.                 end
  506.             elseif commandArgs[2] == 'melee' then
  507.              
  508.                 -- //gs c toggle melee will toggle melee mode on and off.
  509.                 -- This basically locks the slots that will cause you to lose TP if changing them,
  510.                 -- As well as equip your melee set if you're engaged
  511.  
  512.                 if meleeing then
  513.                     meleeing = false
  514.                     enable('main','sub','ranged')
  515.                     windower.add_to_chat(8,'----- Weapons Unlocked, WILL LOSE TP -----')
  516.                     idle(pet)
  517.                 else
  518.                     meleeing=true
  519.                     disable('main','sub','ranged')
  520.                     windower.add_to_chat(8,'----- Weapons Locked, WILL NOT LOSE TP -----')
  521.                     idle(pet)
  522.                 end
  523.                  
  524.             elseif commandArgs[2] == 'favor' then
  525.                      
  526.                 -- //gs c toggle favor will toggle Favor mode on and off.
  527.                 -- It won't automatically toggle, as some people like having favor active without the gear swaps for maximum effectiveness
  528.                 -- You need to toggle prioritisation yourself
  529.                 if favor then
  530.                     favor = false
  531.                     windower.add_to_chat(8,"----- Avatar's Favor Mode OFF -----")
  532.                 else
  533.                     favor = true
  534.                     windower.add_to_chat(8,"----- Avatar's Favor Mode ON -----")
  535.                 end
  536.             elseif commandArgs[2] == 'mb' then
  537.                      
  538.                 -- //gs c toggle mb will toggle mb mode on and off.
  539.                 -- You need to toggle prioritisation yourself
  540.                 if mBurst then
  541.                     mBurst = false
  542.                     windower.add_to_chat(8,"----- Avatar's MB Mode OFF -----")
  543.                 else
  544.                     mBurst = true
  545.                     windower.add_to_chat(8,"----- Avatar's MB Mode ON -----")
  546.                 end
  547.             end
  548.         -- Handles executing blood pacts in a generic, avatar-agnostic way.
  549.         -- //gs c pact [pacttype]
  550.         elseif commandArgs[1]:lower() == 'pact' then
  551.             if not pet.isvalid then
  552.                     windower.add_to_chat(122,'No avatar currently available. Returning to default macro set.')
  553.                     set_macros(5,5)
  554.                 return
  555.             end
  556.          
  557.             if not commandArgs[2] then
  558.                 windower.add_to_chat(123,'No pact type given.')
  559.                 return
  560.             end
  561.          
  562.             local pact = commandArgs[2]:lower()
  563.          
  564.             if not pacts[pact] then
  565.                 windower.add_to_chat(123,'Unknown pact type: '..tostring(pact))
  566.                 return
  567.             end
  568.          
  569.             if pacts[pact][pet.name] then
  570.                 if pact == 'astralflow' and not buffactive['astral flow'] then
  571.                     windower.add_to_chat(122,'Cannot use Astral Flow pacts at this time.')
  572.                     return
  573.                 end
  574.          
  575.                 -- Leave out target; let Shortcuts auto-determine it.
  576.                 send_command('@input /pet "'..pacts[pact][pet.name]..'"')
  577.             else
  578.                 windower.add_to_chat(122,pet.name..' does not have a pact of type ['..pact..'].')
  579.             end
  580.         end
  581.     end
  582. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement