Advertisement
Guest User

Shupyrg SMN

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