Advertisement
Guest User

Untitled

a guest
Dec 20th, 2017
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.93 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job. Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- Also, you'll need the Shortcuts addon to handle the auto-targetting of the custom pact commands.
  6.  
  7. --[[
  8. Custom commands:
  9.  
  10. gs c petweather
  11. Automatically casts the storm appropriate for the current avatar, if possible.
  12.  
  13. gs c siphon
  14. Automatically run the process to: dismiss the current avatar; cast appropriate
  15. weather; summon the appropriate spirit; Elemental Siphon; release the spirit;
  16. and re-summon the avatar.
  17.  
  18. Will not cast weather you do not have access to.
  19. Will not re-summon the avatar if one was not out in the first place.
  20. Will not release the spirit if it was out before the command was issued.
  21.  
  22. gs c pact [PactType]
  23. Attempts to use the indicated pact type for the current avatar.
  24. PactType can be one of:
  25. cure
  26. curaga
  27. buffOffense
  28. buffDefense
  29. buffSpecial
  30. debuff1
  31. debuff2
  32. sleep
  33. nuke2
  34. nuke4
  35. bp70
  36. bp75 (merits and lvl 75-80 pacts)
  37. astralflow
  38. --]]
  39.  
  40.  
  41. -- Initialization function for this job file.
  42. function get_sets()
  43. mote_include_version = 2
  44.  
  45. -- Load and initialize the include file.
  46. include('Mote-Include.lua')
  47. end
  48.  
  49. -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
  50. function job_setup()
  51. state.Buff["Avatar's Favor"] = buffactive["Avatar's Favor"] or false
  52. state.Buff["Astral Conduit"] = buffactive["Astral Conduit"] or false
  53.  
  54. spirits = S{"LightSpirit", "DarkSpirit", "FireSpirit", "EarthSpirit", "WaterSpirit", "AirSpirit", "IceSpirit", "ThunderSpirit"}
  55. avatars = S{"Carbuncle", "Fenrir", "Diabolos", "Ifrit", "Titan", "Leviathan", "Garuda", "Shiva", "Ramuh", "Odin", "Alexander", "Cait Sith"}
  56.  
  57. magicalRagePacts = S{
  58. 'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgment Bolt','Searing Light','Howling Moon','Ruinous Omen',
  59. 'Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II',
  60. 'Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV',
  61. 'Thunderspark','Burning Strike','Meteorite','Nether Blast','Flaming Crush',
  62. 'Meteor Strike','Heavenly Strike','Wind Blade','Geocrush','Grand Fall','Thunderstorm',
  63. 'Holy Mist','Lunar Bay','Night Terror','Level ? Holy'}
  64.  
  65.  
  66. pacts = {}
  67. pacts.cure = {['Carbuncle']='Healing Ruby'}
  68. pacts.curaga = {['Carbuncle']='Healing Ruby II', ['Garuda']='Whispering Wind', ['Leviathan']='Spring Water'}
  69. pacts.buffoffense = {['Carbuncle']='Glittering Ruby', ['Ifrit']='Crimson Howl', ['Garuda']='Hastega', ['Ramuh']='Rolling Thunder',
  70. ['Fenrir']='Ecliptic Growl'}
  71. pacts.buffdefense = {['Carbuncle']='Shining Ruby', ['Shiva']='Frost Armor', ['Garuda']='Aerial Armor', ['Titan']='Earthen Ward',
  72. ['Ramuh']='Lightning Armor', ['Fenrir']='Ecliptic Howl', ['Diabolos']='Noctoshield', ['Cait Sith']='Reraise II'}
  73. pacts.buffspecial = {['Ifrit']='Inferno Howl', ['Garuda']='Fleet Wind', ['Titan']='Earthen Armor', ['Diabolos']='Dream Shroud',
  74. ['Carbuncle']='Soothing Ruby', ['Fenrir']='Heavenward Howl', ['Cait Sith']='Raise II'}
  75. pacts.debuff1 = {['Shiva']='Diamond Storm', ['Ramuh']='Shock Squall', ['Leviathan']='Tidal Roar', ['Fenrir']='Lunar Cry',
  76. ['Diabolos']='Pavor Nocturnus', ['Cait Sith']='Eerie Eye'}
  77. pacts.debuff2 = {['Shiva']='Sleepga', ['Leviathan']='Slowga', ['Fenrir']='Lunar Roar', ['Diabolos']='Somnolence'}
  78. pacts.sleep = {['Shiva']='Sleepga', ['Diabolos']='Nightmare', ['Cait Sith']='Mewing Lullaby'}
  79. pacts.nuke2 = {['Ifrit']='Fire II', ['Shiva']='Blizzard II', ['Garuda']='Aero II', ['Titan']='Stone II',
  80. ['Ramuh']='Thunder II', ['Leviathan']='Water II'}
  81. pacts.nuke4 = {['Ifrit']='Fire IV', ['Shiva']='Blizzard IV', ['Garuda']='Aero IV', ['Titan']='Stone IV',
  82. ['Ramuh']='Thunder IV', ['Leviathan']='Water IV'}
  83. pacts.bp70 = {['Ifrit']='Flaming Crush', ['Shiva']='Rush', ['Garuda']='Predator Claws', ['Titan']='Mountain Buster',
  84. ['Ramuh']='Chaotic Strike', ['Leviathan']='Spinning Dive', ['Carbuncle']='Meteorite', ['Fenrir']='Eclipse Bite',
  85. ['Diabolos']='Nether Blast',['Cait Sith']='Regal Scratch'}
  86. pacts.bp75 = {['Ifrit']='Meteor Strike', ['Shiva']='Heavenly Strike', ['Garuda']='Wind Blade', ['Titan']='Geocrush',
  87. ['Ramuh']='Thunderstorm', ['Leviathan']='Grand Fall', ['Carbuncle']='Holy Mist', ['Fenrir']='Lunar Bay',
  88. ['Diabolos']='Night Terror', ['Cait Sith']='Level ? Holy'}
  89. pacts.astralflow = {['Ifrit']='Inferno', ['Shiva']='Diamond Dust', ['Garuda']='Aerial Blast', ['Titan']='Earthen Fury',
  90. ['Ramuh']='Judgment Bolt', ['Leviathan']='Tidal Wave', ['Carbuncle']='Searing Light', ['Fenrir']='Howling Moon',
  91. ['Diabolos']='Ruinous Omen', ['Cait Sith']="Altana's Favor"}
  92.  
  93. -- Wards table for creating custom timers
  94. wards = {}
  95. -- Base duration for ward pacts.
  96. wards.durations = {
  97. ['Crimson Howl'] = 60, ['Earthen Armor'] = 60, ['Inferno Howl'] = 60, ['Heavenward Howl'] = 60,
  98. ['Rolling Thunder'] = 120, ['Fleet Wind'] = 120,
  99. ['Shining Ruby'] = 180, ['Frost Armor'] = 180, ['Lightning Armor'] = 180, ['Ecliptic Growl'] = 180,
  100. ['Glittering Ruby'] = 180, ['Hastega'] = 180, ['Noctoshield'] = 180, ['Ecliptic Howl'] = 180,
  101. ['Dream Shroud'] = 180,
  102. ['Reraise II'] = 3600
  103. }
  104. -- Icons to use when creating the custom timer.
  105. wards.icons = {
  106. ['Earthen Armor'] = 'spells/00299.png', -- 00299 for Titan
  107. ['Shining Ruby'] = 'spells/00043.png', -- 00043 for Protect
  108. ['Dream Shroud'] = 'spells/00304.png', -- 00304 for Diabolos
  109. ['Noctoshield'] = 'spells/00106.png', -- 00106 for Phalanx
  110. ['Inferno Howl'] = 'spells/00298.png', -- 00298 for Ifrit
  111. ['Hastega'] = 'spells/00358.png', -- 00358 for Hastega
  112. ['Rolling Thunder'] = 'spells/00104.png', -- 00358 for Enthunder
  113. ['Frost Armor'] = 'spells/00250.png', -- 00250 for Ice Spikes
  114. ['Lightning Armor'] = 'spells/00251.png', -- 00251 for Shock Spikes
  115. ['Reraise II'] = 'spells/00135.png', -- 00135 for Reraise
  116. ['Fleet Wind'] = 'abilities/00074.png', --
  117. }
  118. -- Flags for code to get around the issue of slow skill updates.
  119. wards.flag = false
  120. wards.spell = ''
  121.  
  122. end
  123.  
  124. -------------------------------------------------------------------------------------------------------------------
  125. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  126. -------------------------------------------------------------------------------------------------------------------
  127.  
  128. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  129. function user_setup()
  130. state.OffenseMode:options('None', 'Normal', 'Acc')
  131. state.CastingMode:options('Normal', 'Resistant')
  132. state.IdleMode:options('Normal', 'PDT')
  133.  
  134. gear.perp_staff = {name=""}
  135.  
  136. select_default_macro_book()
  137. end
  138.  
  139.  
  140. -- Define sets and vars used by this job file.
  141. function init_gear_sets()
  142. --------------------------------------
  143. -- Precast Sets
  144. --------------------------------------
  145.  
  146. -- Precast sets to enhance JAs
  147. sets.precast.JA['Astral Flow'] = {head="Glyphic Horn"}
  148.  
  149. sets.precast.JA['Elemental Siphon'] = {main="Soulscourge",
  150. head="Convoker's Horn",neck="Caller's Pendant",
  151. body="Caller's Doublet +2",hands="Glyphic Bracers",ring1="Evoker's Ring",ring2="Fervor Ring",
  152. legs="Marduk's Shalwar +1",feet="Caller's Pigaches +2"}
  153.  
  154. sets.precast.JA['Mana Cede'] = {hands="Caller's Bracers +2"}
  155.  
  156. -- Pact delay reduction gear
  157. sets.precast.BloodPactWard = {
  158. main="Nirvana",
  159. sub="Elan Strap +1",
  160. ammo="Sancus Sachet +1",
  161. head="Beckoner's Horn +1",
  162. body="Apo. Dalmatica +1",
  163. hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
  164. legs="Assid. Pants +1",
  165. feet="Smn. Pigaches +2",
  166. neck="Sanctity Necklace",
  167. waist="Lucidity Sash",
  168. left_ear="Evans Earring",
  169. right_ear="Etiolation Earring",
  170. left_ring="Defending Ring",
  171. right_ring="Vocane Ring",
  172. back={ name="Conveyance Cape", augments={'Summoning magic skill +2','Pet: Enmity+14','Blood Pact ab. del. II -2',}},
  173. }
  174.  
  175. sets.precast.BloodPactRage = sets.precast.BloodPactWard
  176.  
  177. -- Fast cast sets for spells
  178.  
  179. sets.precast.FC = {
  180. head="Vanya Hood",ear2="Loquacious Earring", ear1="Etiolation Earring",
  181. body="Inyanga Jubbah",ring1="Prolix Ring", ring2="Kishar Ring",
  182. back="Campestres Cape",waist="Witful Belt",legs="Orvail Pants +1",feet="Merlinic Crackows"}
  183. sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  184.  
  185.  
  186. -- Weaponskill sets
  187. -- Default set for any weaponskill that isn't any more specifically defined
  188. sets.precast.WS = {
  189. head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  190. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
  191. back="Pahtli Cape",waist="Cascade Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
  192.  
  193. -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
  194. sets.precast.WS['Myrkr'] = {
  195. head="Nahtirah Hat",ear1="Gifted Earring",ear2="Loquacious Earring",
  196. body="Convoker's Doublet",hands="Caller's Bracers +2",ring1="Evoker's Ring",ring2="Sangoma Ring",
  197. back="Pahtli Cape",waist="Fucho-no-Obi",legs="Nares Trews",feet="Chelona Boots +1"}
  198.  
  199. sets.precast.WS['Garland of Bliss'] ={ammo="Pemphredo Tathlum",
  200. head="Merlinic Hood",neck="Sanctity Necklace",ear1="Hecate's Earring",ear2="Friomisi Earring",
  201. body="Merlinic Jubbah",hands="Amalric Gages",ring1="Shiva Ring +1",ring2="Mujin Band",
  202. back="Seshaw Cape",waist="Eschan Stone",legs="Merlinic Shalwar",feet="Merlinic Crackows"}
  203.  
  204.  
  205. --------------------------------------
  206. -- Midcast sets
  207. --------------------------------------
  208.  
  209. sets.midcast.FastRecast = {
  210. head="Nahtirah Hat",ear2="Loquacious Earring",
  211. body="Vanir Cotehardie",hands="Bokwus Gloves",ring1="Prolix Ring",
  212. back="Swith Cape +1",waist="Witful Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
  213.  
  214. sets.midcast.Cure = {main="Tamaxchi",sub="Genbu's Shield",
  215. head="Nahtirah Hat",ear2="Loquacious Earring",
  216. body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Prolix Ring",ring2="Sirona's Ring",
  217. back="Swith Cape +1",waist="Witful Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
  218.  
  219. sets.midcast.Stoneskin = {waist="Siegel Sash"}
  220.  
  221. sets.midcast['Elemental Magic'] = {main="Grioavolr",sub="Niobid Strap",ammo="Pemphredo Tathlum",
  222. head="Merlinic Hood",neck="Sanctity Necklace",ear1="Hecate's Earring",ear2="Friomisi Earring",
  223. body="Merlinic Jubbah",hands="Amalric Gages",ring1="Shiva Ring +1",ring2="Mujin Band",
  224. back="Seshaw Cape",waist="Eschan Stone",legs="Merlinic Shalwar",feet="Merlinic Crackows"}
  225.  
  226. sets.midcast['Dark Magic'] = {main="Lehbrailg +2",sub="Wizzan Grip",
  227. head="Nahtirah Hat",neck="Aesir Torque",ear1="Lifestorm Earring",ear2="Psystorm Earring",
  228. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Excelsis Ring",ring2="Sangoma Ring",
  229. waist="Fuchi-no-Obi",legs="Bokwus Slops",feet="Bokwus Boots"}
  230.  
  231.  
  232. -- Avatar pact sets. All pacts are Ability type.
  233.  
  234. sets.midcast.Pet.BloodPactWard = {main="Soulscourge",ammo="Seraphicaller",
  235. head="Beckoner's Horn +1",neck="Caller's Pendant",
  236. body="Caller's Doublet +2",hands="Glyphic Bracers",ring1="Evoker's Ring",ring2="Fervor Ring",
  237. waist="Diabolos's Rope",legs="Marduk's Shalwar +1"}
  238.  
  239. sets.midcast.Pet.DebuffBloodPactWard = {main="Soulscourge",ammo="Seraphicaller",
  240. head="Beckoner's Horn +1",neck="Caller's Pendant",
  241. body="Caller's Doublet +2",hands="Glyphic Bracers",ring1="Evoker's Ring",ring2="Fervor Ring",
  242. waist="Diabolos's Rope",legs="Marduk's Shalwar +1"}
  243.  
  244. sets.midcast.Pet.DebuffBloodPactWard.Acc = sets.midcast.Pet.DebuffBloodPactWard
  245.  
  246. sets.midcast.Pet.PhysicalBloodPactRage = {
  247. main="Nirvana",
  248. sub="Elan Strap +1",
  249. ammo="Sancus Sachet +1",
  250. head={ name="Apogee Crown +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  251. body="Apo. Dalmatica +1",
  252. hands={ name="Merlinic Dastanas", augments={'Pet: Attack+28 Pet: Rng.Atk.+28','Blood Pact Dmg.+6','Pet: INT+5','Pet: Mag. Acc.+5',}},
  253. legs="Apogee Slacks +1",
  254. feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  255. neck="Shulmanu Collar",
  256. waist="Incarnation Sash",
  257. left_ear="Gelos Earring",
  258. right_ear="Lugalbanda Earring",
  259. left_ring="Varar Ring",
  260. right_ring="Varar Ring",
  261. back="Campestres's Cape",
  262. }
  263.  
  264. sets.midcast.Pet.PhysicalBloodPactRage.Acc = sets.midcast.Pet.PhysicalBloodPactRage
  265.  
  266. sets.midcast.Pet.MagicalBloodPactRage = {
  267. main={ name="Espiritus", augments={'MP+50','Pet: "Mag.Atk.Bns."+20','Pet: Mag. Acc.+20',}},
  268. sub="Elan Strap +1",
  269. ammo="Sancus Sachet +1",
  270. head={ name="Apogee Crown +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  271. body="Apo. Dalmatica +1",
  272. hands={ name="Merlinic Dastanas", augments={'Pet: "Mag.Atk.Bns."+10','Blood Pact Dmg.+10','Pet: Mag. Acc.+15',}},
  273. legs="Enticer's Pants",
  274. feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  275. neck="Adad Amulet",
  276. waist="Regal Belt",
  277. left_ear="Gelos Earring",
  278. right_ear="Lugalbanda Earring",
  279. left_ring="Varar Ring",
  280. right_ring="Varar Ring",
  281. back="Campestres's Cape",
  282. }
  283.  
  284. sets.midcast.Pet['Flaming Crush'] = set_combine(sets.midcast.Pet.MagicalBloodPactRage,{main="Nirvana",legs="Apogee Slacks +1"})
  285. sets.midcast.Pet.MagicalBloodPactRage.Acc = sets.midcast.Pet.MagicalBloodPactRag
  286.  
  287.  
  288. -- Spirits cast magic spells, which can be identified in standard ways.
  289.  
  290. sets.midcast.Pet.WhiteMagic = {legs="Summoner's Spats"}
  291.  
  292. sets.midcast.Pet['Elemental Magic'] = set_combine(sets.midcast.Pet.BloodPactRage, {legs="Summoner's Spats"})
  293.  
  294. sets.midcast.Pet['Elemental Magic'].Resistant = {}
  295.  
  296.  
  297. --------------------------------------
  298. -- Idle/resting/defense/etc sets
  299. --------------------------------------
  300.  
  301. -- Resting sets
  302.  
  303.  
  304. -- Idle sets
  305. sets.idle = { main="Nirvana",
  306. sub="Elan Strap +1",
  307. ammo="Sancus Sachet +1",
  308. head="Beckoner's Horn +1",
  309. body="Apo. Dalmatica +1",
  310. hands="Asteria Mitts +1",
  311. legs="Assid. Pants +1",
  312. feet="Herald's Gaiters",
  313. neck="Sanctity Necklace",
  314. waist="Lucidity Sash",
  315. left_ear="Infused Earring",
  316. right_ear="Etiolation Earring",
  317. left_ring="Defending Ring",
  318. right_ring="Vocane Ring",
  319. back="Campestres's Cape",
  320. }
  321.  
  322.  
  323.  
  324.  
  325. -- perp costs:
  326. -- spirits: 7
  327. -- carby: 11 (5 with mitts)
  328. -- fenrir: 13
  329. -- others: 15
  330. -- avatar's favor: -4/tick
  331.  
  332. -- Max useful -perp gear is 1 less than the perp cost (can't be reduced below 1)
  333. -- Aim for -14 perp, and refresh in other slots.
  334.  
  335. -- -perp gear:
  336. -- Nirvana: -5
  337. -- Glyphic Horn: -4
  338. -- Caller's Doublet +2/Glyphic Doublet: -4
  339. -- Evoker's Ring: -1
  340. -- Convoker's Pigaches: -4
  341. -- total: -18
  342.  
  343. -- Can make due without either the head or the body, and use +refresh items in those slots.
  344.  
  345. sets.idle.Avatar = {
  346. main="Nirvana",
  347. sub="Elan Strap +1",
  348. ammo="Sancus Sachet +1",
  349. head="Beckoner's Horn +1",
  350. body="Apo. Dalmatica +1",
  351. hands="Asteria Mitts +1",
  352. legs="Assid. Pants +1",
  353. feet="Apogee Pumps +1",
  354. neck="Sanctity Necklace",
  355. waist="Lucidity Sash",
  356. left_ear="Evans Earring",
  357. right_ear="Etiolation Earring",
  358. left_ring="Defending Ring",
  359. right_ring="Vocane Ring",
  360. back="Campestres's Cape",
  361. }
  362.  
  363.  
  364. -- Favor uses Caller's Horn instead of Convoker's Horn for refresh
  365. sets.idle.Avatar.Favor = {head="Caller's Horn +2"}
  366. sets.idle.Avatar.Melee = {Neck="Shulmanu collar",back="Campestres's Cape",waist="Incarnation Sash"}
  367.  
  368. sets.perp = {}
  369. -- Caller's Bracer's halve the perp cost after other costs are accounted for.
  370. -- Using -10 (Gridavor, ring, Conv.feet), standard avatars would then cost 5, halved to 2.
  371. -- We can then use Hagondes Coat and end up with the same net MP cost, but significantly better defense.
  372. -- Weather is the same, but we can also use the latent on the pendant to negate the last point lost.
  373. sets.perp.Day = {body="Hagondes Coat",hands="Caller's Bracers +2"}
  374. sets.perp.Weather = {neck="Caller's Pendant",body="Hagondes Coat",hands="Caller's Bracers +2"}
  375. -- Carby: Mitts+Conv.feet = 1/tick perp. Everything else should be +refresh
  376. sets.perp.Carbuncle = {main="Bolelabunga",sub="Genbu's Shield",
  377. head="Convoker's Horn",body="Hagondes Coat",hands="Carbuncle Mitts",legs="Nares Trews",feet="Convoker's Pigaches"}
  378. -- Diabolos's Rope doesn't gain us anything at this time
  379. --sets.perp.Diabolos = {waist="Diabolos's Rope"}
  380. sets.perp.Alexander = sets.midcast.Pet.BloodPactWard
  381.  
  382. sets.perp.staff_and_grip = {main=gear.perp_staff,sub="Achaq Grip"}
  383.  
  384. -- Defense sets
  385. sets.defense.PDT = {main=gear.Staff.PDT,
  386. head="Hagondes Hat",neck="Wiglen Gorget",ear1="Gifted Earring",ear2="Loquacious Earring",
  387. body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
  388. back="Umbra Cape",waist="Fucho-no-Obi",legs="Hagondes Pants",feet="Hagondes Sabots"}
  389.  
  390. sets.defense.MDT = {
  391. head="Hagondes Hat",neck="Twilight Torque",ear1="Gifted Earring",ear2="Loquacious Earring",
  392. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Shadow Ring",
  393. back="Umbra Cape",waist="Fucho-no-Obi",legs="Bokwus Slops",feet="Hagondes Sabots"}
  394.  
  395. sets.Kiting = {feet="Herald's Gaiters"}
  396.  
  397. sets.latent_refresh = {waist="Fucho-no-obi"}
  398.  
  399.  
  400. --------------------------------------
  401. -- Engaged sets
  402. --------------------------------------
  403.  
  404. -- Normal melee group
  405. sets.engaged = {ammo="Sancus Sachet +1",
  406. head="Beckoner's Horn +1",
  407. body="Apo. Dalmatica +1",
  408. hands="Asteria Mitts +1",
  409. legs="Assid. Pants +1",
  410. feet="Apogee Pumps +1",
  411. neck="Shulmanu Collar",
  412. waist="Windbuffet Belt +1",
  413. left_ear="Dedition Earring",
  414. right_ear="Brutal Earring",
  415. left_ring="Petrov Ring",
  416. right_ring="Hetairoi Ring",
  417. back="Campestres's Cape",}
  418. end
  419.  
  420. -------------------------------------------------------------------------------------------------------------------
  421. -- Job-specific hooks for standard casting events.
  422. -------------------------------------------------------------------------------------------------------------------
  423.  
  424. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  425. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  426. function job_precast(spell, action, spellMap, eventArgs)
  427. if state.Buff['Astral Conduit'] and pet_midaction() then
  428. eventArgs.handled = true
  429. end
  430. end
  431.  
  432. function job_midcast(spell, action, spellMap, eventArgs)
  433. if state.Buff['Astral Conduit'] and pet_midaction() then
  434. eventArgs.handled = true
  435. end
  436. end
  437.  
  438. -- Runs when pet completes an action.
  439. function job_pet_aftercast(spell, action, spellMap, eventArgs)
  440. if not spell.interrupted and spell.type == 'BloodPactWard' and spellMap ~= 'DebuffBloodPactWard' then
  441. wards.flag = true
  442. wards.spell = spell.english
  443. send_command('wait 4; gs c reset_ward_flag')
  444. end
  445. end
  446.  
  447. -------------------------------------------------------------------------------------------------------------------
  448. -- Job-specific hooks for non-casting events.
  449. -------------------------------------------------------------------------------------------------------------------
  450.  
  451. -- Called when a player gains or loses a buff.
  452. -- buff == buff gained or lost
  453. -- gain == true if the buff was gained, false if it was lost.
  454. function job_buff_change(buff, gain)
  455. if state.Buff[buff] ~= nil then
  456. handle_equipping_gear(player.status)
  457. elseif storms:contains(buff) then
  458. handle_equipping_gear(player.status)
  459. end
  460. end
  461.  
  462.  
  463. -- Called when the player's pet's status changes.
  464. -- This is also called after pet_change after a pet is released. Check for pet validity.
  465. function job_pet_status_change(newStatus, oldStatus, eventArgs)
  466. if pet.isvalid and not midaction() and not pet_midaction() and (newStatus == 'Engaged' or oldStatus == 'Engaged') then
  467. handle_equipping_gear(player.status, newStatus)
  468. end
  469. end
  470.  
  471.  
  472. -- Called when a player gains or loses a pet.
  473. -- pet == pet structure
  474. -- gain == true if the pet was gained, false if it was lost.
  475. function job_pet_change(petparam, gain)
  476. classes.CustomIdleGroups:clear()
  477. if gain then
  478. if avatars:contains(pet.name) then
  479. classes.CustomIdleGroups:append('Avatar')
  480. elseif spirits:contains(pet.name) then
  481. classes.CustomIdleGroups:append('Spirit')
  482. end
  483. else
  484. select_default_macro_book('reset')
  485. end
  486. end
  487.  
  488. -------------------------------------------------------------------------------------------------------------------
  489. -- User code that supplements standard library decisions.
  490. -------------------------------------------------------------------------------------------------------------------
  491.  
  492. -- Custom spell mapping.
  493. function job_get_spell_map(spell)
  494. if spell.type == 'BloodPactRage' then
  495. if magicalRagePacts:contains(spell.english) then
  496. return 'MagicalBloodPactRage'
  497. else
  498. return 'PhysicalBloodPactRage'
  499. end
  500. elseif spell.type == 'BloodPactWard' and spell.target.type == 'MONSTER' then
  501. return 'DebuffBloodPactWard'
  502. end
  503. end
  504.  
  505. -- Modify the default idle set after it was constructed.
  506. function customize_idle_set(idleSet)
  507. if pet.isvalid then
  508. if pet.element == world.day_element then
  509. idleSet = set_combine(idleSet, sets.perp.Day)
  510. end
  511. if pet.element == world.weather_element then
  512. idleSet = set_combine(idleSet, sets.perp.Weather)
  513. end
  514. if sets.perp[pet.name] then
  515. idleSet = set_combine(idleSet, sets.perp[pet.name])
  516. end
  517. gear.perp_staff.name = elements.perpetuance_staff_of[pet.element]
  518. if gear.perp_staff.name and (player.inventory[gear.perp_staff.name] or player.wardrobe[gear.perp_staff.name]) then
  519. idleSet = set_combine(idleSet, sets.perp.staff_and_grip)
  520. end
  521. if state.Buff["Avatar's Favor"] and avatars:contains(pet.name) then
  522. idleSet = set_combine(idleSet, sets.idle.Avatar.Favor)
  523. end
  524. if pet.status == 'Engaged' then
  525. idleSet = set_combine(idleSet, sets.idle.Avatar.Melee)
  526. end
  527. end
  528.  
  529.  
  530.  
  531. return idleSet
  532. end
  533.  
  534. -- Called by the 'update' self-command, for common needs.
  535. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  536. function job_update(cmdParams, eventArgs)
  537. classes.CustomIdleGroups:clear()
  538. if pet.isvalid then
  539. if avatars:contains(pet.name) then
  540. classes.CustomIdleGroups:append('Avatar')
  541. elseif spirits:contains(pet.name) then
  542. classes.CustomIdleGroups:append('Spirit')
  543. end
  544. end
  545. end
  546.  
  547. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  548. function display_current_job_state(eventArgs)
  549.  
  550. end
  551.  
  552.  
  553. -------------------------------------------------------------------------------------------------------------------
  554. -- User self-commands.
  555. -------------------------------------------------------------------------------------------------------------------
  556.  
  557. -- Called for custom player commands.
  558. function job_self_command(cmdParams, eventArgs)
  559. if cmdParams[1]:lower() == 'petweather' then
  560. handle_petweather()
  561. eventArgs.handled = true
  562. elseif cmdParams[1]:lower() == 'siphon' then
  563. handle_siphoning()
  564. eventArgs.handled = true
  565. elseif cmdParams[1]:lower() == 'pact' then
  566. handle_pacts(cmdParams)
  567. eventArgs.handled = true
  568. elseif cmdParams[1] == 'reset_ward_flag' then
  569. wards.flag = false
  570. wards.spell = ''
  571. eventArgs.handled = true
  572. end
  573. end
  574.  
  575.  
  576. -------------------------------------------------------------------------------------------------------------------
  577. -- Utility functions specific to this job.
  578. -------------------------------------------------------------------------------------------------------------------
  579.  
  580. -- Cast the appopriate storm for the currently summoned avatar, if possible.
  581. function handle_petweather()
  582. if player.sub_job ~= 'SCH' then
  583. add_to_chat(122, "You can not cast storm spells")
  584. return
  585. end
  586.  
  587. if not pet.isvalid then
  588. add_to_chat(122, "You do not have an active avatar.")
  589. return
  590. end
  591.  
  592. local element = pet.element
  593. if element == 'Thunder' then
  594. element = 'Lightning'
  595. end
  596.  
  597. if S{'Light','Dark','Lightning'}:contains(element) then
  598. add_to_chat(122, 'You do not have access to '..elements.storm_of[element]..'.')
  599. return
  600. end
  601.  
  602. local storm = elements.storm_of[element]
  603.  
  604. if storm then
  605. send_command('@input /ma "'..elements.storm_of[element]..'" <me>')
  606. else
  607. add_to_chat(123, 'Error: Unknown element ('..tostring(element)..')')
  608. end
  609. end
  610.  
  611.  
  612. -- Custom uber-handling of Elemental Siphon
  613. function handle_siphoning()
  614. if areas.Cities:contains(world.area) then
  615. add_to_chat(122, 'Cannot use Elemental Siphon in a city area.')
  616. return
  617. end
  618.  
  619. local siphonElement
  620. local stormElementToUse
  621. local releasedAvatar
  622. local dontRelease
  623.  
  624. -- If we already have a spirit out, just use that.
  625. if pet.isvalid and spirits:contains(pet.name) then
  626. siphonElement = pet.element
  627. dontRelease = true
  628. -- If current weather doesn't match the spirit, but the spirit matches the day, try to cast the storm.
  629. if player.sub_job == 'SCH' and pet.element == world.day_element and pet.element ~= world.weather_element then
  630. if not S{'Light','Dark','Lightning'}:contains(pet.element) then
  631. stormElementToUse = pet.element
  632. end
  633. end
  634. -- If we're subbing /sch, there are some conditions where we want to make sure specific weather is up.
  635. -- If current (single) weather is opposed by the current day, we want to change the weather to match
  636. -- the current day, if possible.
  637. elseif player.sub_job == 'SCH' and world.weather_element ~= 'None' then
  638. -- We can override single-intensity weather; leave double weather alone, since even if
  639. -- it's partially countered by the day, it's not worth changing.
  640. if get_weather_intensity() == 1 then
  641. -- If current weather is weak to the current day, it cancels the benefits for
  642. -- siphon. Change it to the day's weather if possible (+0 to +20%), or any non-weak
  643. -- weather if not.
  644. -- If the current weather matches the current avatar's element (being used to reduce
  645. -- perpetuation), don't change it; just accept the penalty on Siphon.
  646. if world.weather_element == elements.weak_to[world.day_element] and
  647. (not pet.isvalid or world.weather_element ~= pet.element) then
  648. -- We can't cast lightning/dark/light weather, so use a neutral element
  649. if S{'Light','Dark','Lightning'}:contains(world.day_element) then
  650. stormElementToUse = 'Wind'
  651. else
  652. stormElementToUse = world.day_element
  653. end
  654. end
  655. end
  656. end
  657.  
  658. -- If we decided to use a storm, set that as the spirit element to cast.
  659. if stormElementToUse then
  660. siphonElement = stormElementToUse
  661. elseif world.weather_element ~= 'None' and (get_weather_intensity() == 2 or world.weather_element ~= elements.weak_to[world.day_element]) then
  662. siphonElement = world.weather_element
  663. else
  664. siphonElement = world.day_element
  665. end
  666.  
  667. local command = ''
  668. local releaseWait = 0
  669.  
  670. if pet.isvalid and avatars:contains(pet.name) then
  671. command = command..'input /pet "Release" <me>;wait 1.1;'
  672. releasedAvatar = pet.name
  673. releaseWait = 10
  674. end
  675.  
  676. if stormElementToUse then
  677. command = command..'input /ma "'..elements.storm_of[stormElementToUse]..'" <me>;wait 4;'
  678. releaseWait = releaseWait - 4
  679. end
  680.  
  681. if not (pet.isvalid and spirits:contains(pet.name)) then
  682. command = command..'input /ma "'..elements.spirit_of[siphonElement]..'" <me>;wait 4;'
  683. releaseWait = releaseWait - 4
  684. end
  685.  
  686. command = command..'input /ja "Elemental Siphon" <me>;'
  687. releaseWait = releaseWait - 1
  688. releaseWait = releaseWait + 0.1
  689.  
  690. if not dontRelease then
  691. if releaseWait > 0 then
  692. command = command..'wait '..tostring(releaseWait)..';'
  693. else
  694. command = command..'wait 1.1;'
  695. end
  696.  
  697. command = command..'input /pet "Release" <me>;'
  698. end
  699.  
  700. if releasedAvatar then
  701. command = command..'wait 1.1;input /ma "'..releasedAvatar..'" <me>'
  702. end
  703.  
  704. send_command(command)
  705. end
  706.  
  707.  
  708. -- Handles executing blood pacts in a generic, avatar-agnostic way.
  709. -- cmdParams is the split of the self-command.
  710. -- gs c [pact] [pacttype]
  711. function handle_pacts(cmdParams)
  712. if areas.Cities:contains(world.area) then
  713. add_to_chat(122, 'You cannot use pacts in town.')
  714. return
  715. end
  716.  
  717. if not pet.isvalid then
  718. add_to_chat(122,'No avatar currently available. Returning to default macro set.')
  719. select_default_macro_book('reset')
  720. return
  721. end
  722.  
  723. if spirits:contains(pet.name) then
  724. add_to_chat(122,'Cannot use pacts with spirits.')
  725. return
  726. end
  727.  
  728. if not cmdParams[2] then
  729. add_to_chat(123,'No pact type given.')
  730. return
  731. end
  732.  
  733. local pact = cmdParams[2]:lower()
  734.  
  735. if not pacts[pact] then
  736. add_to_chat(123,'Unknown pact type: '..tostring(pact))
  737. return
  738. end
  739.  
  740. if pacts[pact][pet.name] then
  741. if pact == 'astralflow' and not buffactive['astral flow'] then
  742. add_to_chat(122,'Cannot use Astral Flow pacts at this time.')
  743. return
  744. end
  745.  
  746. -- Leave out target; let Shortcuts auto-determine it.
  747. send_command('@input /pet "'..pacts[pact][pet.name]..'"')
  748. else
  749. add_to_chat(122,pet.name..' does not have a pact of type ['..pact..'].')
  750. end
  751. end
  752.  
  753.  
  754. -- Event handler for updates to player skill, since we can't rely on skill being
  755. -- correct at pet_aftercast for the creation of custom timers.
  756. windower.raw_register_event('incoming chunk',
  757. function (id)
  758. if id == 0x62 then
  759. if wards.flag then
  760. create_pact_timer(wards.spell)
  761. wards.flag = false
  762. wards.spell = ''
  763. end
  764. end
  765. end)
  766.  
  767. -- Function to create custom timers using the Timers addon. Calculates ward duration
  768. -- based on player skill and base pact duration (defined in job_setup).
  769. function create_pact_timer(spell_name)
  770. -- Create custom timers for ward pacts.
  771. if wards.durations[spell_name] then
  772. local ward_duration = wards.durations[spell_name]
  773. if ward_duration < 181 then
  774. local skill = player.skills.summoning_magic
  775. if skill > 300 then
  776. skill = skill - 300
  777. if skill > 200 then skill = 200 end
  778. ward_duration = ward_duration + skill
  779. end
  780. end
  781.  
  782. local timer_cmd = 'timers c "'..spell_name..'" '..tostring(ward_duration)..' down'
  783.  
  784. if wards.icons[spell_name] then
  785. timer_cmd = timer_cmd..' '..wards.icons[spell_name]
  786. end
  787.  
  788. send_command(timer_cmd)
  789. end
  790. end
  791.  
  792.  
  793. -- Select default macro book on initial load or subjob change.
  794. function select_default_macro_book(reset)
  795. if reset == 'reset' then
  796. -- lost pet, or tried to use pact when pet is gone
  797. end
  798.  
  799. -- Default macro set/book
  800. set_macro_page(9, 9)
  801. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement