Advertisement
raffytaffy62

SMN

Apr 12th, 2017
766
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.70 KB | None | 0 0
  1.  
  2. function set_macros(sheet,book)
  3. if book then
  4. send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(sheet))
  5. return
  6. end
  7. send_command('@input /macro set '..tostring(sheet))
  8. end
  9.  
  10. function set_style(sheet)
  11. send_command('@input /lockstyleset '..sheet)
  12. end
  13.  
  14. bp_physical=S{'Punch','Rock Throw','Barracuda Dive','Claw','Axe Kick','Shock Strike','Camisado','Regal Scratch',
  15. 'Poison Nails','Moonlit Charge','Crescent Fang','Rock Buster','Tail Whip','Double Punch',
  16. 'Megalith Throw','Double Slap','Eclipse Bite','Mountain Buster','Spinning Dive','Predator Claws',
  17. 'Rush','Chaotic Strike','Crag Throw','Volt Strike'}
  18.  
  19. bp_hybrid=S{'Burning Strike','Flaming Crush'}
  20.  
  21. bp_magical=S{'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgment Bolt','Searing Light',
  22. 'Howling Moon','Ruinous Omen','Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II','Thunderspark',
  23. 'Somnolence','Meteorite','Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV','Nether Blast',
  24. 'Meteor Strike','Geocrush','Grand Fall','Wind Blade','Heavenly Strike','Thunderstorm','Level ? Holy','Holy Mist',
  25. 'Lunar Bay','Night Terror','Conflag Strike'}
  26.  
  27. bp_debuff=S{'Lunar Cry','Mewing Lullaby','Nightmare','Lunar Roar','Slowga','Ultimate Terror','Sleepga','Eerie Eye',
  28. 'Tidal Roar','Diamond Storm','Shock Squall','Pavor Nocturnus'}
  29.  
  30. bp_buff=S{'Shining Ruby','Frost Armor','Rolling Thunder','Crimson Howl','Lightning Armor','Ecliptic Growl','Hastega',
  31. 'Noctoshield','Ecliptic Howl','Dream Shroud','Earthen Armor','Fleet Wind','Inferno Howl','Soothing Ruby',
  32. 'Heavenward Howl','Soothing Current','Hastega II','Crystal Blessing'}
  33.  
  34. bp_other=S{'Healing Ruby','Raise II','Aerial Armor','Reraise II','Whispering Wind','Glittering Ruby','Earthen Ward',
  35. 'Spring Water','Healing Ruby II'}
  36.  
  37. AvatarList=S{'Shiva','Ramuh','Garuda','Leviathan','Diabolos','Titan','Fenrir','Ifrit','Carbuncle','Fire Spirit',
  38. 'Air Spirit','Ice Spirit','Thunder Spirit','Light Spirit','Dark Spirit','Earth Spirit','Water Spirit','Cait Sith',
  39. 'Alexander','Odin','Atomos'}
  40.  
  41. spirit_element={Fire='Fire Spirit',Earth='Earth Spirit',Water='Water Spirit',Wind='Air Spirit',Ice='Ice Spirit',
  42. Lightning='Thunder Spirit',Light='Light Spirit',Dark='Dark Spirit'}spirit_conflict={Fire='Ice',Earth='Lightning',
  43. Water='Fire',Wind='Earth',Ice='Wind',Lightning='Water',Light='Dark',Dark='Light'}
  44.  
  45.  
  46. include('mote-globals.lua') -- Just a collection of functions that I use in all my GearSwaps. See below (after this code block)
  47.  
  48. --set_macros(4,1) -- Sheet, Book
  49.  
  50. function get_sets()
  51.  
  52. -- My formatting is very easy to follow. All sets that pertain to my character doing things are under 'me'.
  53. -- All sets that are equipped to faciliate my avatar's behaviour or abilities are under 'avatar', eg, Perpetuation, Blood Pacts, etc
  54.  
  55. sets.me = {}
  56. sets.avatar = {}
  57.  
  58. -- Your idle set when you DON'T have an avatar out
  59. sets.me.idle = {
  60. main="Nirvana",
  61. sub="Achaq Grip",
  62. ammo="Sancus Sachet",
  63. head="Beckoner's Horn +1",
  64. neck="Twilight Torque",
  65. lear="Gelos Earring",
  66. rear="Lugalbanda Earring",
  67. body="Shomonjijoe +1",
  68. hands="Serpentes Cuffs",
  69. lring="Shadow Ring",
  70. rring="Sheltered Ring",
  71. back="Solemnity Cape",
  72. waist="Witful Belt",
  73. legs="Assid. Pants +1",
  74. feet="Serpentes Sabots"
  75. }
  76.  
  77. -- Your MP Recovered Whilst Resting Set
  78. sets.me.resting = {
  79. main="Chatoyant Staff",
  80. head="Goliard Chapeau",
  81. body="Chelona Blazer",
  82. hands="Oracle's Gloves",
  83. legs="Yigit Seraweels",
  84. feet="Chelona Boots +1",
  85. legs="Goliard Clogs",
  86. waist="Cleric's Belt",
  87. neck="Grandiose Chain",
  88. back="Vita Cape",
  89. left_ear="Relaxing Earring"
  90. }
  91.  
  92. -----------------------
  93. -- Perpetuation Related
  94. -----------------------
  95.  
  96. -- Avatar's Out --
  97. -- This is the base for all perpetuation scenarios, as seen below
  98. sets.avatar.perp = {
  99. main="Nirvana",
  100. sub="Vox Grip",
  101. ranged="",
  102. ammo="Sancus Sachet",
  103. head="Beckoner's Horn +1",
  104. neck="Caller's Pendant",
  105. lear="Gifted Earring",
  106. rear="Evans Earring",
  107. body="Apogee Dalmatica",
  108. hands="Glyphic Bracers +1",
  109. lring="Evoker's Ring",
  110. rring="Speaker's Ring",
  111. back="Astute Cape",
  112. waist="Incarnation Sash",
  113. legs="Assid. Pants +1",
  114. feet="Apogee Pumps",
  115. }
  116.  
  117. -- The following sets base off of perpetuation, so you can consider them idle sets.
  118. -- Set the relevant gear, bearing in mind it will overwrite the perpetuation item for that slot!
  119.  
  120. -- When we want our avatar to stay alive
  121. sets.avatar.tank = set_combine(sets.avatar.perp,{
  122. main="Espiritus",
  123. sub="Vox Grip",
  124. ranged="",
  125. ammo="Sancus Sachet",
  126. head="",
  127. neck="Caller's Pendant",
  128. lear="Handler's Earring",
  129. rear="Evans Earring",
  130. body="Shomonjijoe +1",
  131. hands="Artsieq Cuffs",
  132. lring="Evoker's Ring",
  133. rring="Serket Ring",
  134. back="Astute Cape",
  135. waist="Isa Belt",
  136. legs="",
  137. feet="Beck. Pigaches"
  138. })
  139.  
  140. -- When we want our avatar to shred
  141. sets.avatar.melee = set_combine(sets.avatar.perp,{
  142. main="",
  143. sub="",
  144. ranged="",
  145. ammo="",
  146. head="",
  147. neck="",
  148. lear="",
  149. rear="",
  150. body="",
  151. hands="",
  152. lring="",
  153. rring="",
  154. back="",
  155. waist="",
  156. legs="",
  157. feet=""
  158. })
  159.  
  160. -- When we want our avatar to hit
  161. sets.avatar.acc = set_combine(sets.avatar.perp,{
  162. main="",
  163. sub="",
  164. ranged="",
  165. ammo="",
  166. head="",
  167. neck="",
  168. lear="",
  169. rear="",
  170. body="",
  171. hands="",
  172. lring="",
  173. rring="",
  174. back="",
  175. waist="",
  176. legs="",
  177. feet=""
  178. })
  179.  
  180. -- When Avatar's Favor is active
  181. sets.avatar.favor = set_combine(sets.avatar.perp,{
  182. main="Espiritus",
  183. sub="Vox Grip",
  184. ranged="",
  185. ammo="Sancus Sachet",
  186. head="Beckoner's Horn +1",
  187. neck="Caller's Pendant",
  188. lear="Gifted Earring",
  189. rear="Evans Earring",
  190. body="Beck. Doublet +1",
  191. hands="Helios Gloves",
  192. lring="Evoker's Ring",
  193. rring="Serket Ring",
  194. back="Astute Cape",
  195. waist="Incarnation Sash",
  196. legs="Assid. Pants +1",
  197. feet="Helios Boots"
  198. })
  199.  
  200. ----------------------------
  201. -- Summoning Skill Related
  202. -- Including all blood pacts
  203. ----------------------------
  204.  
  205. -- + Summoning Magic. This is a base set for max skill and blood pacts and we'll overwrite later as and when we need to
  206. sets.avatar.skill = {
  207. main="Espiritus",
  208. sub="Vox Grip",
  209. ranged="",
  210. ammo="Sancus Sachet",
  211. head="Beckoner's Horn +1",
  212. neck="Caller's Pendant",
  213. lear="",
  214. rear="Smn. Earring",
  215. body="Beck. Doublet +1",
  216. hands="Glyphic Bracers +1",
  217. lring="Evoker's Ring",
  218. rring="",
  219. back="Astute Cape",
  220. waist="Lucidity Sash",
  221. legs="",
  222. legs="",
  223. feet=""
  224. }
  225.  
  226. -------------------------
  227. -- Individual Blood Pacts
  228. -------------------------
  229.  
  230. -- Physical damage
  231. sets.avatar.atk = set_combine(sets.avatar.skill,{
  232. main="Keraunos",
  233. sub="Elan Strap",
  234. ammo="Sancus Sachet",
  235. head={ name="Apogee Crown", augments={'MP+60','Pet: Attack+30','Blood Pact Dmg.+7',}},
  236. neck="Shulmanu Collar",
  237. lear="Gelos Earring",
  238. rear="Lugalbanda Earring",
  239. body="Beck. Doublet +1",
  240. hands="Apogee Mitts",
  241. legs="Beck. Spats +1",
  242. feet="Glyph. Pigaches +1",
  243. lring="Varar Ring",
  244. back="Campestres's Cape",
  245. waist="Incarnation Sash",
  246. rring="Varar Ring",
  247. })
  248.  
  249. -- Magic Attack
  250. sets.avatar.mab = set_combine(sets.avatar.skill,{
  251. main="Nirvana",
  252. sub="Elan Strap",
  253. ammo="Sancus Sachet",
  254. head={ name="Apogee Crown", augments={'MP+60','Pet: "Mag.Atk.Bns."+30','Blood Pact Dmg.+7',}},
  255. neck="Adad Amulet",
  256. body="Apogee Doublet",
  257. hands="Merlinic Dastanas",
  258. legs="Beck. Spats +1",
  259. feet="Apogee Pumps",
  260. lring="Varar Ring",
  261. lear="Gelos Earring",
  262. rear="Lugalbanda Earring",
  263. back="Campestres's Cape",
  264. waist="Incarnation Sash",
  265. rring="Varar Ring",
  266. })
  267.  
  268. -- Hybrid
  269. sets.avatar.hybrid = set_combine(sets.avatar.skill,{
  270. main="",
  271. sub="",
  272. ranged="",
  273. ammo="",
  274. head="",
  275. neck="",
  276. lear="",
  277. rear="",
  278. body="",
  279. hands="",
  280. lring="",
  281. rring="",
  282. back="",
  283. waist="",
  284. legs="",
  285. feet=""
  286. })
  287.  
  288. -- Magic Accuracy
  289. sets.avatar.macc = set_combine(sets.avatar.skill,{
  290. main="",
  291. sub="",
  292. ranged="",
  293. ammo="",
  294. head="",
  295. neck="",
  296. lear="",
  297. rear="",
  298. body="",
  299. hands="",
  300. lring="",
  301. rring="",
  302. back="",
  303. waist="",
  304. legs="",
  305. feet=""
  306. })
  307.  
  308. -- Buffs - Summoning Magic --
  309. sets.avatar.buff = set_combine(sets.avatar.skill,{
  310. main="Nirvana",
  311. sub="Vox Grip",
  312. ranged="",
  313. ammo="",
  314. head="Beckoner's Horn +1",
  315. body="Beck. Doublet +1",
  316. neck="Caller's Pendant",
  317. lear="Summoning Earring",
  318. rear="Gelos Earring",
  319. hands="Glyphic Bracers +1",
  320. lring="Evoker's Ring",
  321. rring="Stikini Ring",
  322. back="Astute Cape",
  323. waist="Lucidity Sash",
  324. legs="Beck. Spats +1",
  325. feet="Apogee Pumps"
  326. })
  327.  
  328.  
  329. -- Combat Related Sets
  330.  
  331. -- Melee
  332. -- The melee set combines with perpetuation, because we don't want to be losing all our MP whilst we swing our Staff
  333. -- Anything you equip here will overwrite the perpetuation/refresh in that slot.
  334. sets.me.melee = set_combine(sets.avatar.perp,{
  335. main="",
  336. sub="",
  337. ranged="",
  338. ammo="",
  339. head="",
  340. neck="",
  341. lear="",
  342. rear="",
  343. body="",
  344. hands="",
  345. lring="",
  346. rring="",
  347. back="",
  348. waist="",
  349. legs="",
  350. feet=""
  351. })
  352.  
  353. -- Shattersoul. Weapon Skills do not work off perpetuation as it only stays equipped for a moment
  354. sets.me["Shattersoul"] = {
  355. main="",
  356. sub="",
  357. ranged="",
  358. ammo="",
  359. head="",
  360. neck="",
  361. lear="",
  362. rear="",
  363. body="",
  364. hands="",
  365. lring="",
  366. rring="",
  367. back="",
  368. waist="",
  369. legs="",
  370. feet=""
  371. }
  372.  
  373. -- Feel free to add new weapon skills, make sure you spell it the same as in game. These are the only two I ever use though
  374.  
  375. ---------------
  376. -- Casting Sets
  377. ---------------
  378.  
  379. sets.precast = {}
  380. sets.midcast = {}
  381. sets.aftercast = {}
  382.  
  383. ----------
  384. -- Precast
  385. ----------
  386.  
  387. -- Generic Casting Set that all others take off of. Here you should add all your fast cast
  388. sets.precast.casting = {
  389. main="Marin Staff",
  390. sub="",
  391. ammo="",
  392. head="Nahtirah Hat",
  393. body="Inyan",
  394. hands="Gende. Gages +1",
  395. legs="Artsieq Hose",
  396. feet="Regal Pumps +1",
  397. neck="",
  398. waist="Witful Belt",
  399. left_ear="Enchntr. Earring +1",
  400. right_ear="Loquac. Earring",
  401. left_ring="Prolix Ring",
  402. right_ring="Kishar Ring",
  403. back="Veela Cape"
  404. }
  405.  
  406. -- Summoning Magic Cast time - gear
  407. sets.precast.summoning = set_combine(sets.precast.casting,{
  408. main="",
  409. sub="",
  410. ranged="",
  411. ammo="Sancus Sachet",
  412. head="Beckoner's Horn +1",
  413. neck="Caller's Pendant",
  414. lear="Smn. Earring",
  415. rear="",
  416. body="Apogee Dalmatica",
  417. hands="Glyphic Bracers +1",
  418. lring="Evoker's Ring",
  419. rring="Stikini Ring",
  420. back="Astute Cape",
  421. waist="Lucidity Sash",
  422. legs="Beck. Spats +1",
  423. feet="Apogee Pumps"
  424. })
  425.  
  426. -- Stoneskin casting time -, works off of enhancing -
  427. sets.precast.stoneskin = set_combine(sets.precast.enhancing,{
  428. main="",
  429. sub="",
  430. head="Umuthi Hat",
  431. body="",
  432. hands="",
  433. legs="",
  434. feet="",
  435. neck="",
  436. left_ear="",
  437. right_ear="",
  438. left_ring="",
  439. right_ring="",
  440. waist="Siegel Sash",
  441. back="",
  442. })
  443.  
  444. -- Curing Precast, Cure Spell Casting time -
  445. sets.precast.cure = set_combine(sets.precast.casting,{
  446. main={ name="Serenity", augments={'MP+10','"Cure" spellcasting time -9%',}},
  447. sub="Achaq Grip",
  448. ammo="",
  449. head="",
  450. body="Heka's Kalasiris",
  451. hands="",
  452. legs="",
  453. feet="Vanya Clogs",
  454. neck="",
  455. waist="Witful Belt",
  456. left_ear="",
  457. right_ear="Loquacious Earring",
  458. left_ring="",
  459. right_ring="",
  460. back="Veela Cape"
  461. })
  462.  
  463. ---------------------
  464. -- Ability Precasting
  465. ---------------------
  466.  
  467. -- Blood Pact Ability Delay
  468. sets.precast.bp = {
  469. head="Glyphic Horn +1",
  470. body="Glyphic Doublet +1",
  471. hands="Glyphic Bracers +1",
  472. feet="Glyph. Pigaches +1"
  473. }
  474.  
  475. -- Mana Cede
  476. sets.precast["Mana Cede"] = {
  477. main="",
  478. sub="",
  479. ranged="",
  480. ammo="",
  481. head="",
  482. neck="",
  483. lear="",
  484. rear="",
  485. body="",
  486. hands="",
  487. lring="",
  488. rring="",
  489. back="",
  490. waist="",
  491. legs="",
  492. feet=""
  493. }
  494.  
  495. -- Astral Flow
  496. sets.precast["Astral Flow"] = {
  497. main="Espiritus",
  498. sub="Vox Grip",
  499. ranged="",
  500. ammo="",
  501. head="Beckoner's Horn +1",
  502. neck="Caller's Pendant",
  503. lear="Summoning Earring",
  504. rear="Andoaa Earring",
  505. body="Beck. Doublet +1",
  506. hands="Glyphic Bracers +1",
  507. lring="Evoker's Ring",
  508. rring="",
  509. back="Astute Cape",
  510. waist="Lucidity Sash",
  511. legs="",
  512. feet=""
  513. }
  514.  
  515. -- Elemental Siphon, eg, Tatsumaki Thingies, Esper Stone, etc
  516. sets.precast.siphon = set_combine(sets.avatar.skill,{
  517. main="",
  518. main="Espiritus",
  519. sub="Vox Grip",
  520. ranged="",
  521. ammo="",
  522. head="Beckoner's Horn +1",
  523. neck="Caller's Pendant",
  524. lear="Summoning Earring",
  525. rear="Andoaa Earring",
  526. body="Beck. Doublet +1",
  527. hands="Glyphic Bracers +1",
  528. lring="Evoker's Ring",
  529. rring="Andoaa Earring",
  530. back="Astute Cape",
  531. waist="Lucidity Sash",
  532. legs="",
  533. feet=""
  534. })
  535.  
  536. ----------
  537. -- Midcast
  538. ----------
  539.  
  540. -- We handle the damage and etc. in Pet Midcast later
  541.  
  542. -- Whatever you want to equip mid-cast as a catch all for all spells, and we'll overwrite later for individual spells
  543. sets.midcast.casting = {
  544. main="",
  545. sub="",
  546. ranged="",
  547. ammo="",
  548. head="",
  549. neck="",
  550. lear="",
  551. rear="",
  552. body="",
  553. hands="",
  554. lring="",
  555. rring="",
  556. back="",
  557. waist="",
  558. legs="",
  559. feet=""
  560. }
  561.  
  562. -- Enhancing
  563. sets.midcast.enhancing = set_combine(sets.midcast.casting,{
  564. main="",
  565. sub="",
  566. ammo="",
  567. head="Befouled Crown",
  568. body="Anhur Robe",
  569. hands="Augur's Gloves",
  570. legs="Shedir Seraweels",
  571. feet="Rubeus Boots",
  572. neck="Colossus's Torque",
  573. waist="Olympus Sash",
  574. left_ear="Andoaa Earring",
  575. right_ear="Beatific Earring",
  576. left_ring="",
  577. right_ring="",
  578. back="",
  579. })
  580.  
  581. -- Stoneskin
  582. sets.midcast.stoneskin = set_combine(sets.midcast.enhancing,{
  583. main="Mythic Wand +1",
  584. sub="Muse Tariqah",
  585. head="Apogee Crown",
  586. body="Shomonjijoe +1",
  587. hands="Telchine Gloves",
  588. legs="Shedir Seraweels",
  589. feet="Wayfarer Clogs",
  590. neck="Morgana's Choker",
  591. left_ear="",
  592. right_ear="",
  593. left_ring="Aqua Ring",
  594. right_ring="Sirona's Ring",
  595. waist="Siegel Sash",
  596. back="Aslan Cape"
  597. })
  598.  
  599. -- Cure Potency
  600. sets.midcast.cure = set_combine(sets.midcast.casting,{
  601. main={ name="Serenity", augments={'MP+5','"Cure" potency +1%',}},
  602. sub="Achaq Grip",
  603. ammo="Oreiad's Tathlum",
  604. head="",
  605. body="Heka's Kalasiris",
  606. hands="Telchine Gloves",
  607. legs="Nares Trews",
  608. feet="Vanya Clogs",
  609. neck="Colossus's Torque",
  610. waist="Bishop's Sash",
  611. left_ear="Beatific Earring",
  612. right_ear="",
  613. left_ring="Sirona's Ring",
  614. right_ring="Janniston Ring",
  615. back="Tempered Cape +1"
  616. })
  617.  
  618. ------------
  619. -- Aftercast
  620. ------------
  621.  
  622. -- I don't use aftercast sets, as we handle what to equip later depending on conditions using a function, eg, do we have an avatar out?
  623.  
  624. end
  625.  
  626. function precast(spell)
  627.  
  628. -- Don't swap if we're in the middle of something or our pet's doing something
  629. -- Stops macro spam from interfering with an action GS is already handling
  630. if midaction() or pet_midaction() then
  631. return
  632. end
  633.  
  634. -- If we're doing a blood pact, equip our delay set IF Apogee or Astral Conduit are not active
  635. if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') and not (buffactive['Astral Conduit'] or buffactive['Apogee']) then
  636.  
  637. equip(sets.precast.bp)
  638.  
  639. elseif spell.type == 'SummonerPact' then
  640.  
  641. -- This chunk of code handles Elemental Siphon. It will look at the current day and weather and cancel the spell to summon
  642. -- the right elemental. Your elemental siphon macro should summon a Dark Spirit to trigger this check
  643.  
  644. -- These use the included lists in global.lua to determine the right spirit to summon
  645.  
  646. if spell.name == 'Dark Spirit' then
  647. if world.weather_element == 'Dark' then
  648.  
  649. -- Dark Weather is active, lets the spell go ahead and equips summoning precast
  650. equip(sets.precast.summoning)
  651.  
  652. elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then
  653.  
  654. -- It's not dark weather but there is some weather up, cancels dark and summons the right spirit
  655. cancel_spell()
  656. send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element]))
  657. equip(sets.precast.summoning)
  658.  
  659. elseif world.day_element == 'Dark' then
  660.  
  661. -- It's darksday so allow the dark spirit to go ahead and equip summoning
  662. equip(sets.precast.summoning)
  663.  
  664. else
  665.  
  666. -- There is no weather up and it's not darksday, so summon the current day's spirit
  667. cancel_spell()
  668. send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
  669. equip(sets.precast.summoning)
  670.  
  671. end
  672. else
  673.  
  674. -- We're not summoning Dark Spirit, so we don't want to Siphon, which means we're summoning an avatar
  675. equip(sets.precast.summoning)
  676.  
  677. end
  678.  
  679. -- Moving on to other types of magic
  680. elseif spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' then
  681.  
  682. -- Stoneskin Precast
  683. if spell.name == 'Stoneskin' then
  684.  
  685. windower.ffxi.cancel_buff(37)--[[Cancels stoneskin, not delayed incase you get a Quick Cast]]
  686. equip(sets.precast.stoneskin)
  687.  
  688. -- Cure Precast
  689. elseif spell.name:match('Cure') or spell.name:match('Cura') then
  690.  
  691. equip(sets.precast.cure)
  692.  
  693. -- Enhancing Magic
  694. elseif spell.skill == 'Enhancing Magic' then
  695.  
  696. equip(sets.precast.enhancing)
  697.  
  698. if spell.name == 'Sneak' then
  699. windower.ffxi.cancel_buff(71)--[[Cancels Sneak]]
  700. end
  701. else
  702.  
  703. -- For everything else we go with max fastcast
  704. equip(sets.precast.casting)
  705.  
  706. end
  707.  
  708. -- Summoner Abilities
  709. -- We use a catch all here, if the set exists for an ability, use it
  710. -- This way we don't need to write a load of different code for different abilities, just make a set
  711.  
  712. elseif sets.precast[spell.name] then
  713. equip(sets.precast[spell.name])
  714. end
  715.  
  716. end
  717.  
  718. function midcast(spell)
  719.  
  720. -- If our pet is doing something, prevents us swapping equipment too early
  721. if pet_midaction() then
  722. return
  723. end
  724.  
  725. -- No need to annotate all this, it's fairly logical. Just equips the relevant sets for the relevant magic
  726. if spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' then
  727. if spell.name == 'Stoneskin' then
  728. equip(sets.midcast.stoneskin)
  729. elseif spell.name:match('Cure') or spell.name:match('Cura') then
  730. equip(sets.midcast.cure)
  731. elseif spell.skill == 'Enhancing Magic' then
  732. equip(sets.midcast.enhancing)
  733. if spell.name:match('Protect') or spell.name:match('Shell') then
  734. equip({rring="Sheltered Ring"})
  735. end
  736. else
  737. equip(sets.midcast.casting)
  738. end
  739. elseif spell.name == 'Elemental Siphon' then
  740.  
  741. -- Siphon Set
  742. equip(sets.precast.siphon)
  743.  
  744. -- Checks if pet matches weather
  745. if pet.element == world.weather_element then
  746. equip(sets.precast.siphon,{main="Chatoyant Staff"--[[Take advantage of the weather boost]]})
  747. end
  748.  
  749. -- And our catch all, if a set exists for this spell use it
  750. elseif sets.midcast[spell.name] then
  751. equip(sets.midcast[spell.name])
  752.  
  753. -- Remember those WS Sets we defined? :)
  754. elseif sets.me[spell.name] then
  755. equip(sets.me[spell.name])
  756. end
  757. end
  758.  
  759. function aftercast(spell)
  760.  
  761. -- If our pet's doing something, Stop!
  762. if pet_midaction() then
  763. return
  764. end
  765.  
  766. -- If not a blood pact or summon
  767. if spell and (not spell.type or not string.find(spell.type,'BloodPact') and not AvatarList:contains(spell.name) or spell.interrupted) then
  768.  
  769. -- Then initiate idle function to check which set should be equipped
  770. idle(pet)
  771.  
  772. end
  773. end
  774.  
  775. function pet_midcast(spell)
  776.  
  777. -- Our pet is doing something
  778. if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') then
  779.  
  780. -- We're going to check the lists in global.lua for matches and equip the relevant sets
  781.  
  782. if bp_physical:contains(spell.name) then
  783.  
  784. equip(sets.avatar.atk)
  785.  
  786. elseif bp_hybrid:contains(spell.name) then
  787.  
  788. equip(sets.avatar.hybrid)
  789. if pet.name == 'Ifrit' then
  790. equip({rring="Fervor Ring"})--[[Change rring to lring if you put Evoker's on your right hand]]
  791. end
  792.  
  793. elseif bp_magical:contains(spell.name) then
  794.  
  795. equip(sets.avatar.mab)
  796. if pet.name == 'Ifrit' then
  797. equip({rring="Fervor Ring"})--[[Change rring to lring if you put Evoker's on your right hand]]
  798. end
  799.  
  800. elseif bp_debuff:contains(spell.name) then
  801.  
  802. equip(sets.avatar.macc)
  803.  
  804. elseif bp_buff:contains(spell.name) then
  805.  
  806. equip(sets.avatar.buff)
  807.  
  808. elseif bp_other:contains(spell.name) then
  809.  
  810. equip(sets.avatar.other)
  811.  
  812. elseif spell.name == 'Perfect Defense' then
  813.  
  814. equip(sets.avatar.skill)
  815.  
  816. else
  817.  
  818. equip(sets.avatar.skill)
  819.  
  820. end
  821. end
  822. end
  823.  
  824. function pet_aftercast(spell)
  825.  
  826. -- Pet aftercast is simply a check for whether Conduit and Apogee are up, and then a call to our aftercast function
  827. -- We have a variable called autobp that we set to true or false with commands to auto repeat BPs for us
  828. if (buffactive['Apogee'] or buffactive['Astral Conduit']) and autobp then
  829. send_command('input /pet "%s" <t>':format(spell.name))
  830. return
  831. end
  832.  
  833. idle(pet)
  834.  
  835. end
  836.  
  837. function idle(pet)
  838.  
  839. -- This function is called after every action, and handles which set to equip depending on what we're doing
  840. -- We check if we're meleeing because we don't want to idle in melee gear when we're only engaged for trusts
  841.  
  842. if favor then
  843.  
  844. -- Avatar's favor takes priority!
  845. equip(sets.avatar.favor)
  846.  
  847. elseif meleeing and player.status=='Engaged' then
  848.  
  849. -- We're both engaged and meleeing
  850. equip(sets.me.melee)
  851.  
  852. elseif pet.isvalid then
  853.  
  854. -- We have a pet out but we're not meleeing, set the right idle set
  855. equip(sets.avatar[mode])
  856.  
  857. else
  858.  
  859. -- We're not meleeing and we have no pet out
  860. equip(sets.me.idle)
  861.  
  862. end
  863. end
  864.  
  865. function status_change(new,old)
  866. if new == 'Engaged' then
  867.  
  868. -- If we engage check our meleeing status
  869. idle(pet)
  870.  
  871. elseif new=='Resting' then
  872.  
  873. -- We're resting
  874. equip(sets.me.resting)
  875. else
  876. idle(pet)
  877. end
  878.  
  879. end
  880.  
  881. function pet_change(pet,gain)
  882.  
  883. -- When we summon or release an avatar
  884. idle(pet)
  885.  
  886. end
  887.  
  888.  
  889. function self_command(command)
  890.  
  891. local commandArgs = command
  892.  
  893. -- This command takes //gs c avatar mode, where mode is what you want, eg, tank, acc, melee, etc
  894. if #commandArgs:split(' ') >= 2 then
  895. commandArgs = T(commandArgs:split(' '))
  896. if commandArgs[1] == 'avatar' then
  897. if commandArgs[2] then
  898. mode = tostring(commandArgs[2])
  899. equip(sets.avatar[mode])
  900. windower.add_to_chat(8,'----- Avatar set to '..mode..' mode! -----')
  901. end
  902. elseif commandArgs[1] == 'toggle' then
  903. if commandArgs[2] == 'auto' then
  904.  
  905. -- //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
  906. -- And by repeat I mean repeat. If Conduit is up, it will SPAM the BP until Conduit is down
  907. if autobp then
  908. autobp = false
  909. windower.add_to_chat(8,'----- Auto BP mode Disabled -----')
  910. else
  911. autobp = true
  912. windower.add_to_chat(8,'----- Auto BP mode Enabled -----')
  913. end
  914. elseif commandArgs[2] == 'melee' then
  915.  
  916. -- //gs c toggle melee will toggle melee mode on and off.
  917. -- This basically locks the slots that will cause you to lose TP if changing them,
  918. -- As well as equip your melee set if you're engaged
  919.  
  920. if meleeing then
  921. meleeing = false
  922. enable('main','sub','ranged')
  923. windower.add_to_chat(8,'----- Weapons Unlocked, WILL LOSE TP -----')
  924. idle(pet)
  925. else
  926. meleeing=true
  927. disable('main','sub','ranged')
  928. windower.add_to_chat(8,'----- Weapons Locked, WILL NOT LOSE TP -----')
  929. idle(pet)
  930. end
  931.  
  932. elseif commandArgs[2] == 'favor' then
  933.  
  934. -- //gs c toggle favor will toggle Favor mode on and off.
  935. -- It won't automatically toggle, as some people like having favor active without the gear swaps for maximum effectiveness
  936. -- You need to toggle prioritisation yourself
  937. if favor then
  938. favor = false
  939. windower.add_to_chat(8,"----- Avatar's Favor Mode OFF -----")
  940. else
  941. favor = true
  942. windower.add_to_chat(8,"----- Avatar's Favor Mode ON -----")
  943. end
  944.  
  945. end
  946. end
  947. end
  948. end
  949.  
  950. -- Required variables and their initial value
  951. meleeing = false
  952. autobp = false
  953. favor = false
  954. mode = "perp"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement