Advertisement
Guest User

SmN gearswap

a guest
Nov 16th, 2017
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.67 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={ name="Espiritus", augments={'MP+50','Pet: "Mag.Atk.Bns."+20','Pet: Mag. Acc.+20',}},
  159. sub="Elan Strap +1",
  160. ammo="Sancus Sachet +1",
  161. head={ name="Apogee Crown +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  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="Nahtirah Hat",ear2="Loquacious Earring",
  181. body="Vanir Cotehardie",ring1="Prolix Ring",
  182. back="Swith Cape +1",waist="Witful Belt",legs="Orvail Pants +1",feet="Chelona Boots +1"}
  183.  
  184. sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  185.  
  186.  
  187. -- Weaponskill sets
  188. -- Default set for any weaponskill that isn't any more specifically defined
  189. sets.precast.WS = {
  190. head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  191. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
  192. back="Pahtli Cape",waist="Cascade Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
  193.  
  194. -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
  195. sets.precast.WS['Myrkr'] = {
  196. head="Nahtirah Hat",ear1="Gifted Earring",ear2="Loquacious Earring",
  197. body="Convoker's Doublet",hands="Caller's Bracers +2",ring1="Evoker's Ring",ring2="Sangoma Ring",
  198. back="Pahtli Cape",waist="Fucho-no-Obi",legs="Nares Trews",feet="Chelona Boots +1"}
  199.  
  200.  
  201. --------------------------------------
  202. -- Midcast sets
  203. --------------------------------------
  204.  
  205. sets.midcast.FastRecast = {
  206. head="Nahtirah Hat",ear2="Loquacious Earring",
  207. body="Vanir Cotehardie",hands="Bokwus Gloves",ring1="Prolix Ring",
  208. back="Swith Cape +1",waist="Witful Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
  209.  
  210. sets.midcast.Cure = {main="Tamaxchi",sub="Genbu's Shield",
  211. head="Nahtirah Hat",ear2="Loquacious Earring",
  212. body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Prolix Ring",ring2="Sirona's Ring",
  213. back="Swith Cape +1",waist="Witful Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
  214.  
  215. sets.midcast.Stoneskin = {waist="Siegel Sash"}
  216.  
  217. sets.midcast['Elemental Magic'] = {main="Grioavolr",sub="Niobid Strap",ammo="Pemphredo Tathlum",
  218. head="Merlinic Hood",neck="Sanctity Necklace",ear1="Hecate's Earring",ear2="Friomisi Earring",
  219. body="Merlinic Jubbah",hands="Amalric Gages",ring1="Shiva Ring +1",ring2="Mujin Band",
  220. back="Seshaw Cape",waist="Eschan Stone",legs="Merlinic Shalwar",feet="Merlinic Crackows"}
  221.  
  222. sets.midcast['Dark Magic'] = {main="Lehbrailg +2",sub="Wizzan Grip",
  223. head="Nahtirah Hat",neck="Aesir Torque",ear1="Lifestorm Earring",ear2="Psystorm Earring",
  224. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Excelsis Ring",ring2="Sangoma Ring",
  225. waist="Fuchi-no-Obi",legs="Bokwus Slops",feet="Bokwus Boots"}
  226.  
  227.  
  228. -- Avatar pact sets. All pacts are Ability type.
  229.  
  230. sets.midcast.Pet.BloodPactWard = {main="Soulscourge",ammo="Seraphicaller",
  231. head="Convoker's Horn",neck="Caller's Pendant",
  232. body="Caller's Doublet +2",hands="Glyphic Bracers",ring1="Evoker's Ring",ring2="Fervor Ring",
  233. waist="Diabolos's Rope",legs="Marduk's Shalwar +1"}
  234.  
  235. sets.midcast.Pet.DebuffBloodPactWard = {main="Soulscourge",ammo="Seraphicaller",
  236. head="Convoker's Horn",neck="Caller's Pendant",
  237. body="Caller's Doublet +2",hands="Glyphic Bracers",ring1="Evoker's Ring",ring2="Fervor Ring",
  238. waist="Diabolos's Rope",legs="Marduk's Shalwar +1"}
  239.  
  240. sets.midcast.Pet.DebuffBloodPactWard.Acc = sets.midcast.Pet.DebuffBloodPactWard
  241.  
  242. sets.midcast.Pet.PhysicalBloodPactRage = {
  243. main={ name="Gridarvor", augments={'Pet: Accuracy+70','Pet: Attack+70','Pet: "Dbl. Atk."+15',}},
  244. sub="Elan Strap +1",
  245. ammo="Sancus Sachet +1",
  246. head={ name="Apogee Crown +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  247. body="Apo. Dalmatica +1",
  248. hands={ name="Merlinic Dastanas", augments={'Pet: Accuracy+12 Pet: Rng. Acc.+12','Blood Pact Dmg.+7','Pet: DEX+1','Pet: Mag. Acc.+14',}},
  249. legs={ name="Apogee Slacks +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  250. feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  251. neck="Shulmanu Collar",
  252. waist="Incarnation Sash",
  253. left_ear="Infused Earring",
  254. right_ear="Etiolation Earring",
  255. left_ring="Varar Ring",
  256. right_ring="Varar Ring",
  257. back="Campestres's Cape",
  258. }
  259.  
  260. sets.midcast.Pet.PhysicalBloodPactRage.Acc = sets.midcast.Pet.PhysicalBloodPactRage
  261.  
  262. sets.midcast.Pet.MagicalBloodPactRage = {
  263. main={ name="Espiritus", augments={'MP+50','Pet: "Mag.Atk.Bns."+20','Pet: Mag. Acc.+20',}},
  264. sub="Elan Strap +1",
  265. ammo="Sancus Sachet +1",
  266. head={ name="Apogee Crown +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  267. body="Apo. Dalmatica +1",
  268. hands={ name="Merlinic Dastanas", augments={'Pet: Accuracy+12 Pet: Rng. Acc.+12','Blood Pact Dmg.+7','Pet: DEX+1','Pet: Mag. Acc.+14',}},
  269. legs={ name="Apogee Slacks +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  270. feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  271. neck="Adad Amulet",
  272. waist="Regal Belt",
  273. left_ear="Infused Earring",
  274. right_ear="Etiolation Earring",
  275. left_ring="Varar Ring",
  276. right_ring="Varar Ring",
  277. back="Campestres's Cape",
  278. }
  279.  
  280. sets.midcast.Pet.MagicalBloodPactRage.Acc = sets.midcast.Pet.MagicalBloodPactRage
  281.  
  282.  
  283. -- Spirits cast magic spells, which can be identified in standard ways.
  284.  
  285. sets.midcast.Pet.WhiteMagic = {legs="Summoner's Spats"}
  286.  
  287. sets.midcast.Pet['Elemental Magic'] = set_combine(sets.midcast.Pet.BloodPactRage, {legs="Summoner's Spats"})
  288.  
  289. sets.midcast.Pet['Elemental Magic'].Resistant = {}
  290.  
  291.  
  292. --------------------------------------
  293. -- Idle/resting/defense/etc sets
  294. --------------------------------------
  295.  
  296. -- Resting sets
  297.  
  298.  
  299. -- Idle sets
  300. sets.idle = {
  301. main={ name="Gridarvor", augments={'Pet: Accuracy+70','Pet: Attack+70','Pet: "Dbl. Atk."+15',}},
  302. sub="Elan Strap +1",
  303. ammo="Sancus Sachet +1",
  304. head="Beckoner's Horn +1",
  305. body="Apo. Dalmatica +1",
  306. hands={ name="Merlinic Dastanas", augments={'Pet: Accuracy+12 Pet: Rng. Acc.+12','Blood Pact Dmg.+7','Pet: DEX+1','Pet: Mag. Acc.+14',}},
  307. legs="Assid. Pants +1",
  308. feet="Herald's Gaiters",
  309. neck="Sanctity Necklace",
  310. waist="Lucidity Sash",
  311. left_ear="Infused Earring",
  312. right_ear="Etiolation Earring",
  313. left_ring="Defending Ring",
  314. right_ring="Vocane Ring",
  315. back={ name="Mecisto. Mantle", augments={'Cap. Point+34%','DEF+3',}},
  316. }
  317.  
  318. sets.idle.PDT = {main=gear.Staff.PDT,sub="Achaq Grip",ammo="Seraphicaller",
  319. head="Convoker's Horn",neck="Twilight Torque",ear1="Gifted Earring",ear2="Loquacious Earring",
  320. body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Sangoma Ring",
  321. back="Umbra Cape",waist="Fucho-no-Obi",legs="Hagondes Pants",feet="Herald's Gaiters"}
  322.  
  323. -- perp costs:
  324. -- spirits: 7
  325. -- carby: 11 (5 with mitts)
  326. -- fenrir: 13
  327. -- others: 15
  328. -- avatar's favor: -4/tick
  329.  
  330. -- Max useful -perp gear is 1 less than the perp cost (can't be reduced below 1)
  331. -- Aim for -14 perp, and refresh in other slots.
  332.  
  333. -- -perp gear:
  334. -- Gridarvor: -5
  335. -- Glyphic Horn: -4
  336. -- Caller's Doublet +2/Glyphic Doublet: -4
  337. -- Evoker's Ring: -1
  338. -- Convoker's Pigaches: -4
  339. -- total: -18
  340.  
  341. -- Can make due without either the head or the body, and use +refresh items in those slots.
  342.  
  343. sets.idle.Avatar = {
  344. main={ name="Gridarvor", augments={'Pet: Accuracy+70','Pet: Attack+70','Pet: "Dbl. Atk."+15',}},
  345. sub="Elan Strap +1",
  346. ammo="Sancus Sachet +1",
  347. head="Beckoner's Horn +1",
  348. body="Apo. Dalmatica +1",
  349. hands={ name="Merlinic Dastanas", augments={'Pet: Accuracy+12 Pet: Rng. Acc.+12','Blood Pact Dmg.+7','Pet: DEX+1','Pet: Mag. Acc.+14',}},
  350. legs="Assid. Pants +1",
  351. feet="Apogee Pumps +1",
  352. neck="Sanctity Necklace",
  353. waist="Lucidity Sash",
  354. left_ear="Evans Earring",
  355. right_ear="Etiolation Earring",
  356. left_ring="Defending Ring",
  357. right_ring="Vocane Ring",
  358. back={ name="Mecisto. Mantle", augments={'Cap. Point+34%','DEF+3',}},
  359. }
  360.  
  361.  
  362. -- Favor uses Caller's Horn instead of Convoker's Horn for refresh
  363. sets.idle.Avatar.Favor = {head="Caller's Horn +2"}
  364. sets.idle.Avatar.Melee = {Neck="Shlumanu collar",back="Campestres's Cape",waist="Incarnation Sash",legs="Convoker's Spats"}
  365.  
  366. sets.perp = {}
  367. -- Caller's Bracer's halve the perp cost after other costs are accounted for.
  368. -- Using -10 (Gridavor, ring, Conv.feet), standard avatars would then cost 5, halved to 2.
  369. -- We can then use Hagondes Coat and end up with the same net MP cost, but significantly better defense.
  370. -- Weather is the same, but we can also use the latent on the pendant to negate the last point lost.
  371. sets.perp.Day = {body="Hagondes Coat",hands="Caller's Bracers +2"}
  372. sets.perp.Weather = {neck="Caller's Pendant",body="Hagondes Coat",hands="Caller's Bracers +2"}
  373. -- Carby: Mitts+Conv.feet = 1/tick perp. Everything else should be +refresh
  374. sets.perp.Carbuncle = {main="Bolelabunga",sub="Genbu's Shield",
  375. head="Convoker's Horn",body="Hagondes Coat",hands="Carbuncle Mitts",legs="Nares Trews",feet="Convoker's Pigaches"}
  376. -- Diabolos's Rope doesn't gain us anything at this time
  377. --sets.perp.Diabolos = {waist="Diabolos's Rope"}
  378. sets.perp.Alexander = sets.midcast.Pet.BloodPactWard
  379.  
  380. sets.perp.staff_and_grip = {main=gear.perp_staff,sub="Achaq Grip"}
  381.  
  382. -- Defense sets
  383. sets.defense.PDT = {main=gear.Staff.PDT,
  384. head="Hagondes Hat",neck="Wiglen Gorget",ear1="Gifted Earring",ear2="Loquacious Earring",
  385. body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
  386. back="Umbra Cape",waist="Fucho-no-Obi",legs="Hagondes Pants",feet="Hagondes Sabots"}
  387.  
  388. sets.defense.MDT = {
  389. head="Hagondes Hat",neck="Twilight Torque",ear1="Gifted Earring",ear2="Loquacious Earring",
  390. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Shadow Ring",
  391. back="Umbra Cape",waist="Fucho-no-Obi",legs="Bokwus Slops",feet="Hagondes Sabots"}
  392.  
  393. sets.Kiting = {feet="Herald's Gaiters"}
  394.  
  395. sets.latent_refresh = {waist="Fucho-no-obi"}
  396.  
  397.  
  398. --------------------------------------
  399. -- Engaged sets
  400. --------------------------------------
  401.  
  402. -- Normal melee group
  403. sets.engaged = {ammo="Seraphicaller",
  404. head="Zelus Tiara",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  405. body="Vanir Cotehardie",hands="Bokwus Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
  406. back="Umbra Cape",waist="Goading Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
  407. end
  408.  
  409. -------------------------------------------------------------------------------------------------------------------
  410. -- Job-specific hooks for standard casting events.
  411. -------------------------------------------------------------------------------------------------------------------
  412.  
  413. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  414. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  415. function job_precast(spell, action, spellMap, eventArgs)
  416. if state.Buff['Astral Conduit'] and pet_midaction() then
  417. eventArgs.handled = true
  418. end
  419. end
  420.  
  421. function job_midcast(spell, action, spellMap, eventArgs)
  422. if state.Buff['Astral Conduit'] and pet_midaction() then
  423. eventArgs.handled = true
  424. end
  425. end
  426.  
  427. -- Runs when pet completes an action.
  428. function job_pet_aftercast(spell, action, spellMap, eventArgs)
  429. if not spell.interrupted and spell.type == 'BloodPactWard' and spellMap ~= 'DebuffBloodPactWard' then
  430. wards.flag = true
  431. wards.spell = spell.english
  432. send_command('wait 4; gs c reset_ward_flag')
  433. end
  434. end
  435.  
  436. -------------------------------------------------------------------------------------------------------------------
  437. -- Job-specific hooks for non-casting events.
  438. -------------------------------------------------------------------------------------------------------------------
  439.  
  440. -- Called when a player gains or loses a buff.
  441. -- buff == buff gained or lost
  442. -- gain == true if the buff was gained, false if it was lost.
  443. function job_buff_change(buff, gain)
  444. if state.Buff[buff] ~= nil then
  445. handle_equipping_gear(player.status)
  446. elseif storms:contains(buff) then
  447. handle_equipping_gear(player.status)
  448. end
  449. end
  450.  
  451.  
  452. -- Called when the player's pet's status changes.
  453. -- This is also called after pet_change after a pet is released. Check for pet validity.
  454. function job_pet_status_change(newStatus, oldStatus, eventArgs)
  455. if pet.isvalid and not midaction() and not pet_midaction() and (newStatus == 'Engaged' or oldStatus == 'Engaged') then
  456. handle_equipping_gear(player.status, newStatus)
  457. end
  458. end
  459.  
  460.  
  461. -- Called when a player gains or loses a pet.
  462. -- pet == pet structure
  463. -- gain == true if the pet was gained, false if it was lost.
  464. function job_pet_change(petparam, gain)
  465. classes.CustomIdleGroups:clear()
  466. if gain then
  467. if avatars:contains(pet.name) then
  468. classes.CustomIdleGroups:append('Avatar')
  469. elseif spirits:contains(pet.name) then
  470. classes.CustomIdleGroups:append('Spirit')
  471. end
  472. else
  473. select_default_macro_book('reset')
  474. end
  475. end
  476.  
  477. -------------------------------------------------------------------------------------------------------------------
  478. -- User code that supplements standard library decisions.
  479. -------------------------------------------------------------------------------------------------------------------
  480.  
  481. -- Custom spell mapping.
  482. function job_get_spell_map(spell)
  483. if spell.type == 'BloodPactRage' then
  484. if magicalRagePacts:contains(spell.english) then
  485. return 'MagicalBloodPactRage'
  486. else
  487. return 'PhysicalBloodPactRage'
  488. end
  489. elseif spell.type == 'BloodPactWard' and spell.target.type == 'MONSTER' then
  490. return 'DebuffBloodPactWard'
  491. end
  492. end
  493.  
  494. -- Modify the default idle set after it was constructed.
  495. function customize_idle_set(idleSet)
  496. if pet.isvalid then
  497. if pet.element == world.day_element then
  498. idleSet = set_combine(idleSet, sets.perp.Day)
  499. end
  500. if pet.element == world.weather_element then
  501. idleSet = set_combine(idleSet, sets.perp.Weather)
  502. end
  503. if sets.perp[pet.name] then
  504. idleSet = set_combine(idleSet, sets.perp[pet.name])
  505. end
  506. gear.perp_staff.name = elements.perpetuance_staff_of[pet.element]
  507. if gear.perp_staff.name and (player.inventory[gear.perp_staff.name] or player.wardrobe[gear.perp_staff.name]) then
  508. idleSet = set_combine(idleSet, sets.perp.staff_and_grip)
  509. end
  510. if state.Buff["Avatar's Favor"] and avatars:contains(pet.name) then
  511. idleSet = set_combine(idleSet, sets.idle.Avatar.Favor)
  512. end
  513. if pet.status == 'Engaged' then
  514. idleSet = set_combine(idleSet, sets.idle.Avatar.Melee)
  515. end
  516. end
  517.  
  518. if player.mpp < 51 then
  519. idleSet = set_combine(idleSet, sets.latent_refresh)
  520. end
  521.  
  522. return idleSet
  523. end
  524.  
  525. -- Called by the 'update' self-command, for common needs.
  526. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  527. function job_update(cmdParams, eventArgs)
  528. classes.CustomIdleGroups:clear()
  529. if pet.isvalid then
  530. if avatars:contains(pet.name) then
  531. classes.CustomIdleGroups:append('Avatar')
  532. elseif spirits:contains(pet.name) then
  533. classes.CustomIdleGroups:append('Spirit')
  534. end
  535. end
  536. end
  537.  
  538. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  539. function display_current_job_state(eventArgs)
  540.  
  541. end
  542.  
  543.  
  544. -------------------------------------------------------------------------------------------------------------------
  545. -- User self-commands.
  546. -------------------------------------------------------------------------------------------------------------------
  547.  
  548. -- Called for custom player commands.
  549. function job_self_command(cmdParams, eventArgs)
  550. if cmdParams[1]:lower() == 'petweather' then
  551. handle_petweather()
  552. eventArgs.handled = true
  553. elseif cmdParams[1]:lower() == 'siphon' then
  554. handle_siphoning()
  555. eventArgs.handled = true
  556. elseif cmdParams[1]:lower() == 'pact' then
  557. handle_pacts(cmdParams)
  558. eventArgs.handled = true
  559. elseif cmdParams[1] == 'reset_ward_flag' then
  560. wards.flag = false
  561. wards.spell = ''
  562. eventArgs.handled = true
  563. end
  564. end
  565.  
  566.  
  567. -------------------------------------------------------------------------------------------------------------------
  568. -- Utility functions specific to this job.
  569. -------------------------------------------------------------------------------------------------------------------
  570.  
  571. -- Cast the appopriate storm for the currently summoned avatar, if possible.
  572. function handle_petweather()
  573. if player.sub_job ~= 'SCH' then
  574. add_to_chat(122, "You can not cast storm spells")
  575. return
  576. end
  577.  
  578. if not pet.isvalid then
  579. add_to_chat(122, "You do not have an active avatar.")
  580. return
  581. end
  582.  
  583. local element = pet.element
  584. if element == 'Thunder' then
  585. element = 'Lightning'
  586. end
  587.  
  588. if S{'Light','Dark','Lightning'}:contains(element) then
  589. add_to_chat(122, 'You do not have access to '..elements.storm_of[element]..'.')
  590. return
  591. end
  592.  
  593. local storm = elements.storm_of[element]
  594.  
  595. if storm then
  596. send_command('@input /ma "'..elements.storm_of[element]..'" <me>')
  597. else
  598. add_to_chat(123, 'Error: Unknown element ('..tostring(element)..')')
  599. end
  600. end
  601.  
  602.  
  603. -- Custom uber-handling of Elemental Siphon
  604. function handle_siphoning()
  605. if areas.Cities:contains(world.area) then
  606. add_to_chat(122, 'Cannot use Elemental Siphon in a city area.')
  607. return
  608. end
  609.  
  610. local siphonElement
  611. local stormElementToUse
  612. local releasedAvatar
  613. local dontRelease
  614.  
  615. -- If we already have a spirit out, just use that.
  616. if pet.isvalid and spirits:contains(pet.name) then
  617. siphonElement = pet.element
  618. dontRelease = true
  619. -- If current weather doesn't match the spirit, but the spirit matches the day, try to cast the storm.
  620. if player.sub_job == 'SCH' and pet.element == world.day_element and pet.element ~= world.weather_element then
  621. if not S{'Light','Dark','Lightning'}:contains(pet.element) then
  622. stormElementToUse = pet.element
  623. end
  624. end
  625. -- If we're subbing /sch, there are some conditions where we want to make sure specific weather is up.
  626. -- If current (single) weather is opposed by the current day, we want to change the weather to match
  627. -- the current day, if possible.
  628. elseif player.sub_job == 'SCH' and world.weather_element ~= 'None' then
  629. -- We can override single-intensity weather; leave double weather alone, since even if
  630. -- it's partially countered by the day, it's not worth changing.
  631. if get_weather_intensity() == 1 then
  632. -- If current weather is weak to the current day, it cancels the benefits for
  633. -- siphon. Change it to the day's weather if possible (+0 to +20%), or any non-weak
  634. -- weather if not.
  635. -- If the current weather matches the current avatar's element (being used to reduce
  636. -- perpetuation), don't change it; just accept the penalty on Siphon.
  637. if world.weather_element == elements.weak_to[world.day_element] and
  638. (not pet.isvalid or world.weather_element ~= pet.element) then
  639. -- We can't cast lightning/dark/light weather, so use a neutral element
  640. if S{'Light','Dark','Lightning'}:contains(world.day_element) then
  641. stormElementToUse = 'Wind'
  642. else
  643. stormElementToUse = world.day_element
  644. end
  645. end
  646. end
  647. end
  648.  
  649. -- If we decided to use a storm, set that as the spirit element to cast.
  650. if stormElementToUse then
  651. siphonElement = stormElementToUse
  652. elseif world.weather_element ~= 'None' and (get_weather_intensity() == 2 or world.weather_element ~= elements.weak_to[world.day_element]) then
  653. siphonElement = world.weather_element
  654. else
  655. siphonElement = world.day_element
  656. end
  657.  
  658. local command = ''
  659. local releaseWait = 0
  660.  
  661. if pet.isvalid and avatars:contains(pet.name) then
  662. command = command..'input /pet "Release" <me>;wait 1.1;'
  663. releasedAvatar = pet.name
  664. releaseWait = 10
  665. end
  666.  
  667. if stormElementToUse then
  668. command = command..'input /ma "'..elements.storm_of[stormElementToUse]..'" <me>;wait 4;'
  669. releaseWait = releaseWait - 4
  670. end
  671.  
  672. if not (pet.isvalid and spirits:contains(pet.name)) then
  673. command = command..'input /ma "'..elements.spirit_of[siphonElement]..'" <me>;wait 4;'
  674. releaseWait = releaseWait - 4
  675. end
  676.  
  677. command = command..'input /ja "Elemental Siphon" <me>;'
  678. releaseWait = releaseWait - 1
  679. releaseWait = releaseWait + 0.1
  680.  
  681. if not dontRelease then
  682. if releaseWait > 0 then
  683. command = command..'wait '..tostring(releaseWait)..';'
  684. else
  685. command = command..'wait 1.1;'
  686. end
  687.  
  688. command = command..'input /pet "Release" <me>;'
  689. end
  690.  
  691. if releasedAvatar then
  692. command = command..'wait 1.1;input /ma "'..releasedAvatar..'" <me>'
  693. end
  694.  
  695. send_command(command)
  696. end
  697.  
  698.  
  699. -- Handles executing blood pacts in a generic, avatar-agnostic way.
  700. -- cmdParams is the split of the self-command.
  701. -- gs c [pact] [pacttype]
  702. function handle_pacts(cmdParams)
  703. if areas.Cities:contains(world.area) then
  704. add_to_chat(122, 'You cannot use pacts in town.')
  705. return
  706. end
  707.  
  708. if not pet.isvalid then
  709. add_to_chat(122,'No avatar currently available. Returning to default macro set.')
  710. select_default_macro_book('reset')
  711. return
  712. end
  713.  
  714. if spirits:contains(pet.name) then
  715. add_to_chat(122,'Cannot use pacts with spirits.')
  716. return
  717. end
  718.  
  719. if not cmdParams[2] then
  720. add_to_chat(123,'No pact type given.')
  721. return
  722. end
  723.  
  724. local pact = cmdParams[2]:lower()
  725.  
  726. if not pacts[pact] then
  727. add_to_chat(123,'Unknown pact type: '..tostring(pact))
  728. return
  729. end
  730.  
  731. if pacts[pact][pet.name] then
  732. if pact == 'astralflow' and not buffactive['astral flow'] then
  733. add_to_chat(122,'Cannot use Astral Flow pacts at this time.')
  734. return
  735. end
  736.  
  737. -- Leave out target; let Shortcuts auto-determine it.
  738. send_command('@input /pet "'..pacts[pact][pet.name]..'"')
  739. else
  740. add_to_chat(122,pet.name..' does not have a pact of type ['..pact..'].')
  741. end
  742. end
  743.  
  744.  
  745. -- Event handler for updates to player skill, since we can't rely on skill being
  746. -- correct at pet_aftercast for the creation of custom timers.
  747. windower.raw_register_event('incoming chunk',
  748. function (id)
  749. if id == 0x62 then
  750. if wards.flag then
  751. create_pact_timer(wards.spell)
  752. wards.flag = false
  753. wards.spell = ''
  754. end
  755. end
  756. end)
  757.  
  758. -- Function to create custom timers using the Timers addon. Calculates ward duration
  759. -- based on player skill and base pact duration (defined in job_setup).
  760. function create_pact_timer(spell_name)
  761. -- Create custom timers for ward pacts.
  762. if wards.durations[spell_name] then
  763. local ward_duration = wards.durations[spell_name]
  764. if ward_duration < 181 then
  765. local skill = player.skills.summoning_magic
  766. if skill > 300 then
  767. skill = skill - 300
  768. if skill > 200 then skill = 200 end
  769. ward_duration = ward_duration + skill
  770. end
  771. end
  772.  
  773. local timer_cmd = 'timers c "'..spell_name..'" '..tostring(ward_duration)..' down'
  774.  
  775. if wards.icons[spell_name] then
  776. timer_cmd = timer_cmd..' '..wards.icons[spell_name]
  777. end
  778.  
  779. send_command(timer_cmd)
  780. end
  781. end
  782.  
  783.  
  784. -- Select default macro book on initial load or subjob change.
  785. function select_default_macro_book(reset)
  786. if reset == 'reset' then
  787. -- lost pet, or tried to use pact when pet is gone
  788. end
  789.  
  790. -- Default macro set/book
  791. set_macro_page(9, 1)
  792. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement