Advertisement
Falkirk

SMN.lua

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