Advertisement
Ballzack

SCH.lua

Jun 18th, 2017
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.87 KB | None | 0 0
  1. -- Original: Motenten / Modified: Ballzack
  2.  
  3. -------------------------------------------------------------------------------------------------------------------
  4. -- Keybinds
  5. -------------------------------------------------------------------------------------------------------------------
  6.  
  7. -- Modes: [ F10 ] Emergency -PDT Mode
  8. -- [ ALT+F10 ] Toggle Kiting Mode
  9. -- [ F11 ] Emergency -MDT Mode
  10. -- [ CTRL+F11 ] Cycle Casting Modes
  11. -- [ F12 ] Update Current Gear / Report Current Status
  12. -- [ CTRL+F12 ] Cycle Idle Modes
  13. -- [ ALT+F12 ] Cancel Emergency -PDT/-MDT Mode
  14. -- [ ALT+` ] Toggle Magic Burst Mode
  15. -- [ WIN+C ] Toggle Capacity Points Mode
  16. -- [ WIN+H ] Cycle Helix Mode
  17. -- [ WIN+R ] Cycle Regen Mode
  18. -- [ WIN+S ] Toggle Storm Surge
  19. --
  20. -- Abilities: [ CTRL+` ] Immanence
  21. -- [ CTRL+- ] Light Arts/Addendum: White
  22. -- [ CTRL+= ] Dark Arts/Addendum: Black
  23. -- [ CTRL+[ ] Rapture/Ebullience
  24. -- [ CTRL+] ] Altruism/Focalization
  25. -- [ CTRL+; ] Celerity/Alacrity
  26. -- [ ALT+[ ] Accesion/Manifestation
  27. -- [ ALT+] ] Perpetuance
  28. -- [ ALT+; ] Penury/Parsimony
  29. --
  30. -- Weapons: [ CTRL+W ] Toggles Weapon Lock
  31. --
  32. -- WS: [ Delete ] Myrkr
  33. --
  34. --
  35. -- (Global-Binds.lua contains additional non-job-related keybinds)
  36.  
  37.  
  38. -------------------------------------------------------------------------------------------------------------------
  39. -- Setup functions for this job. Generally should not be modified.
  40. -------------------------------------------------------------------------------------------------------------------
  41.  
  42. -- Addendum Commands:
  43. -- Shorthand versions for each strategem type that uses the version appropriate for
  44. -- the current Arts.
  45. -- Light Arts Dark Arts
  46. -- ---------- ---------
  47. -- gs c scholar light Light Arts/Addendum
  48. -- gs c scholar dark Dark Arts/Addendum
  49. -- gs c scholar cost Penury Parsimony
  50. -- gs c scholar speed Celerity Alacrity
  51. -- gs c scholar aoe Accession Manifestation
  52. -- gs c scholar power Rapture Ebullience
  53. -- gs c scholar duration Perpetuance
  54. -- gs c scholar accuracy Altruism Focalization
  55. -- gs c scholar enmity Tranquility Equanimity
  56. -- gs c scholar skillchain Immanence
  57. -- gs c scholar addendum Addendum: White Addendum: Black
  58.  
  59.  
  60. -------------------------------------------------------------------------------------------------------------------
  61. -- Setup functions for this job. Generally should not be modified.
  62. -------------------------------------------------------------------------------------------------------------------
  63.  
  64. -- Initialization function for this job file.
  65. function get_sets()
  66. mote_include_version = 2
  67.  
  68. -- Load and initialize the include file.
  69. include('Mote-Include.lua')
  70. end
  71.  
  72. -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
  73. function job_setup()
  74. info.addendumNukes = S{"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
  75. "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  76.  
  77. state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  78. state.HelixMode = M{['description']='Helix Mode', 'Lughs', 'Bookworm'}
  79. state.RegenMode = M{['description']='Regen Mode', 'Duration', 'Potency'}
  80. state.CP = M(false, "Capacity Points Mode")
  81.  
  82. update_active_strategems()
  83.  
  84. lockstyleset = 12
  85. end
  86.  
  87. -------------------------------------------------------------------------------------------------------------------
  88. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  89. -------------------------------------------------------------------------------------------------------------------
  90.  
  91. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  92. function user_setup()
  93. state.OffenseMode:options('Normal', 'Acc')
  94. state.CastingMode:options('Normal', 'Resistant')
  95. state.IdleMode:options('Normal', 'DT')
  96.  
  97. state.WeaponLock = M(false, 'Weapon Lock')
  98. state.MagicBurst = M(false, 'Magic Burst')
  99. state.StormSurge = M(false, 'Stormsurge')
  100. state.ConsMP = M(false, 'MP Coat')
  101.  
  102.  
  103. --send_command('bind ^` input /ja Immanence <me>')
  104. send_command('bind !` gs c toggle MagicBurst')
  105. --send_command('bind ^- gs c scholar light')
  106. --send_command('bind ^= gs c scholar dark')
  107. --send_command('bind ^[ gs c scholar power')
  108. --send_command('bind ^] gs c scholar accuracy')
  109. --send_command('bind ^; gs c scholar speed')
  110. --send_command('bind !w input /ma "Aspir II" <t>')
  111. --send_command('bind !o input /ma "Regen V" <stpc>')
  112. --send_command('bind ![ gs c scholar aoe')
  113. --send_command('bind !] gs c scholar duration')
  114. --send_command('bind !; gs c scholar cost')
  115. send_command('bind ^= gs c toggle ConsMP')
  116. send_command('bind @c gs c toggle CP')
  117. send_command('bind @h gs c cycle HelixMode')
  118. send_command('bind @r gs c cycle RegenMode')
  119. send_command('bind @s gs c toggle StormSurge')
  120. send_command('bind @w gs c toggle WeaponLock')
  121. send_command('bind @home gs c warpring')
  122.  
  123. send_command('bind Delete input /Myrkr')
  124.  
  125. select_default_macro_book()
  126. set_lockstyle()
  127. end
  128.  
  129. -- Called when this job file is unloaded (eg: job change)
  130. function user_unload()
  131. --send_command('unbind ^`')
  132. send_command('unbind !`')
  133. --send_command('unbind ^-')
  134. --send_command('unbind ^=')
  135. --send_command('unbind ^[')
  136. --send_command('unbind ^]')
  137. --send_command('unbind ^;')
  138. --send_command('unbind !w')
  139. --send_command('unbind !o')
  140. --send_command('unbind ![')
  141. --send_command('unbind !]')
  142. --send_command('unbind !;')
  143. --send_command('unbind ^,')
  144. --send_command('unbind !.')
  145. send_command('unbind ^=')
  146. send_command('unbind @c')
  147. send_command('unbind @h')
  148. send_command('unbind @g')
  149. send_command('unbind @s')
  150. send_command('unbind @w')
  151. send_command('unbind @home')
  152. send_command('unbind Delete')
  153.  
  154. end
  155.  
  156.  
  157.  
  158. -- Define sets and vars used by this job file.
  159. function init_gear_sets()
  160. include('augmented-items.lua')
  161. ------------------------------------------------------------------------------------------------
  162. ---------------------------------------- Precast Sets ------------------------------------------
  163. ------------------------------------------------------------------------------------------------
  164.  
  165. -- Precast sets to enhance JAs
  166. sets.precast.JA['Tabula Rasa'] = {legs="Peda. Pants +1"}
  167. sets.precast.JA['Enlightenment'] = {body="Peda. Gown +1"}
  168.  
  169. -- Fast cast sets for spells
  170. -- FC +80%, Quick Magic +5%
  171. sets.precast.FC = {
  172. ammo="Sapience Orb",--2/0
  173. head=MerlinicHoodFC,--13/0
  174. neck="Orunmila's Torque",--5/0
  175. ear1="Loquac. Earring",--2/0
  176. ear2="Enchntr. Earring +1",--2/0
  177. body="Zendik Robe",--13/0
  178. hands=MerlinicDastanasFC,--6/0
  179. ring1="Lebeche Ring",--0/2
  180. ring2="Kishar Ring",--4/0
  181. back=LughsFC,--10/0
  182. waist="Witful Belt",--3/3
  183. legs="Psycloth Lappas",--7/0
  184. feet=MerlinicCrackowsFC}-- 11/0
  185.  
  186. sets.precast.FC.Grimoire = {
  187. --head="Peda. M.Board +1",
  188. feet="Acad. Loafers +3"}
  189. sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  190. sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {ear2="Barkarole Earring"})
  191.  
  192. sets.precast.FC.Cure = set_combine(sets.precast.FC, {ear1="Mendi. Earring"})
  193.  
  194. sets.precast.FC.Curaga = sets.precast.FC.Cure
  195. sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty, body="Twilight Cloak"})
  196. sets.precast.Storm = set_combine(sets.precast.FC, {ring1="Prolix"}) -- stop quick cast
  197.  
  198.  
  199. ------------------------------------------------------------------------------------------------
  200. ------------------------------------- Weapon Skill Sets ----------------------------------------
  201. ------------------------------------------------------------------------------------------------
  202.  
  203. sets.precast.WS = {
  204. ammo="Floestone",
  205. head="Jhakri Coronal +2",
  206. neck="Fotia Gorget",
  207. ear1="Moonshade Earring",
  208. ear2="Telos Earring",
  209. body="Jhakri Robe +2",
  210. hands="Jhakri Cuffs +2",
  211. ring1="Rufescent Ring",
  212. ring2="Shukuyu Ring",
  213. back="",
  214. waist="Fotia Belt",
  215. legs="Telchine Braconi",
  216. feet="Jhakri Pigaches +2"}
  217.  
  218. sets.precast.WS['Myrkr'] = {
  219. ammo="Psilomene",
  220. head="Kaabnax Hat",
  221. neck="Dualism Collar +1",
  222. ear1="Etiolation Earring",
  223. ear2="Influx Earring",
  224. body="Weather. Robe +1",
  225. hands="Otomi Gloves",
  226. ring1="Mephitas's Ring +1",
  227. ring2="Mephitas's Ring",
  228. back=LughFC,
  229. waist="Shinjutsu-no-Obi +1",
  230. legs="Amalric Slops +1",
  231. feet="Psycloth Boots"} -- Max MP
  232.  
  233. ------------------------------------------------------------------------------------------------
  234. ---------------------------------------- Midcast Sets ------------------------------------------
  235. ------------------------------------------------------------------------------------------------
  236.  
  237. sets.midcast.FastRecast = sets.precast.FC
  238.  
  239. sets.midcast.Cure = {
  240. ammo="Hydrocera",
  241. head="Vanya Hood",
  242. neck="Incanter's Torque",
  243. ear1="Healing Earring",
  244. ear2="Beatific Earring",
  245. body="Kaykaus Bliaut",
  246. hands="Telchine Gloves",
  247. ring1="Haoma's Ring",
  248. ring2="Sirona's Ring",
  249. back="Tempered Cape +1",
  250. waist="Bishop's Sash",
  251. legs="Vanya Slops",
  252. feet="Vanya Clogs"}
  253.  
  254. sets.midcast.CureWeather = set_combine(sets.midcast.Cure, {
  255. back="Twilight Cape",
  256. waist="Hachirin-no-obi"})
  257.  
  258. sets.midcast.Curaga = set_combine(sets.midcast.Cure, {
  259. ring1="Stikini Ring",
  260. ring2="Stikini Ring",
  261. waist="Luminary Sash"})
  262.  
  263. sets.midcast.StatusRemoval = {
  264. head="Vanya Hood",
  265. neck="Incanter's Torque",
  266. ear2="Healing Earring",
  267. body="Vanya Robe",
  268. ring1="Haoma's Ring",
  269. ring2="Haoma's Ring",
  270. back="Tempered Cape +1",
  271. waist="Bishop's Sash",
  272. legs="Acad. Pants +2",
  273. feet="Vanya Clogs"}
  274.  
  275. sets.midcast.Cursna = set_combine(sets.midcast.StatusRemoval, {
  276. main="Gada",
  277. sub="Genmei Shield",
  278. ear1="Beatific Earring"})
  279.  
  280. sets.midcast['Enhancing Magic'] = {
  281. main="Gada",
  282. sub="Ammurapi Shield",
  283. ammo="Savant's Treatise",
  284. head="Befouled Crown",
  285. neck="Incanter's Torque",
  286. ear1="Andoaa Earring",
  287. ear2="Augment. Earring",
  288. body="Telchine Chas.",
  289. ring1="Stikini Ring",
  290. ring2="Stikini Ring",
  291. back="Perimede Cape",
  292. waist="Olympus Sash"}
  293.  
  294. sets.midcast.EnhancingDuration = {
  295. main="Gada",
  296. sub="Ammurapi Shield",
  297. head="Telchine Cap",
  298. body="Telchine Chas.",
  299. hands="Telchine Gloves",
  300. legs="Telchine Braconi",
  301. feet="Telchine Pigaches"}
  302.  
  303. sets.midcast.Regen = set_combine(sets.midcast.EnhancingDuration, {
  304. main="Bolelabunga",
  305. head="Arbatel Bonnet +1",
  306. back="Bookworm's Cape"})
  307.  
  308. sets.midcast.RegenDuration = set_combine(sets.midcast.EnhancingDuration, {back=LughsFC})
  309.  
  310. sets.midcast.Haste = sets.midcast.EnhancingDuration
  311.  
  312. sets.midcast.Refresh = set_combine(sets.midcast.EnhancingDuration, {
  313. head="Amalric Coif +1",
  314. waist="Gishdubar Sash"})
  315.  
  316. sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash"})
  317.  
  318. sets.midcast.Aquaveil = set_combine(sets.midcast['Enhancing Magic'], {
  319. main="Vadose Rod",
  320. head="Amalric Coif +1",
  321. waist="Emphatikos Rope"})
  322.  
  323. sets.midcast.Storm = sets.midcast.EnhancingDuration
  324.  
  325. sets.midcast.Stormsurge = set_combine(sets.midcast.Storm, {feet="Peda. Loafers +1"})
  326.  
  327. sets.midcast.Protect = set_combine(sets.midcast.EnhancingDuration, {ring2="Sheltered Ring"})
  328. sets.midcast.Protectra = sets.midcast.Protect
  329. sets.midcast.Shell = sets.midcast.Protect
  330. sets.midcast.Shellra = sets.midcast.Shell
  331.  
  332. -- Custom spell classes
  333. sets.midcast.MndEnfeebles = {
  334. ammo="Hydrocera",
  335. head=MerlinicHoodBurst,
  336. neck="Erra Pendant",
  337. ear1="Barkaro. Earring",
  338. ear2="Digni. Earring",
  339. body=MerlinicJubbahBurst,
  340. hands="Jhakri Cuffs +2",
  341. ring1="Stikini Ring",
  342. ring2="Kishar Ring",
  343. back=LughsNuke,
  344. waist="Luminary Sash",
  345. legs=MerlinicShalwarNuke,
  346. feet="Jhakri Pigaches +2"}
  347.  
  348. sets.midcast.IntEnfeebles = set_combine(sets.midcast.MndEnfeebles, {
  349. ammo="Pemphredo Tathlum"})
  350.  
  351. sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
  352.  
  353. sets.midcast['Dark Magic'] = {
  354. ammo="Pemphredo Tathlum",
  355. head=MerlinicHoodBurst,
  356. neck="Erra Pendant",
  357. ear1="Barkaro. Earring",
  358. ear2="Digni. Earring",
  359. body="Shango Robe",
  360. hands="Jhakri Cuffs +2",
  361. ring1="Stikini Ring",
  362. ring2="Evanescence Ring",
  363. back="Bookworm's Cape",
  364. waist="Luminary Sash",
  365. legs="Peda. Pants +1",
  366. feet="Jhakri Pigaches +2"}
  367.  
  368. sets.midcast.Kaustra = {
  369. ammo="Pemphredo Tathlum",
  370. head="Pixie Hairpin +1",
  371. neck="Mizu. Kubikazari",
  372. ear1="Static Earring",
  373. ear2="Barkaro. Earring",
  374. body=MerlinicJubbahBurst,
  375. hands="Amalric Gages +1",
  376. ring1="Mujin Band",
  377. ring2="Archon Ring",
  378. back=LughsNuke,
  379. waist="Refoccilation Stone",
  380. legs=MerlinicShalwarNuke,
  381. feet=MerlinicCrackowsBurst}
  382.  
  383. sets.midcast.Drain = set_combine(sets.midcast['Dark Magic'], {
  384. head="Pixie Hairpin +1",
  385. ear1="Hirudinea Earring",
  386. hands=MerlinicDastanasDrainAspir,
  387. ring1="Archon Ring",
  388. back=LughsNuke,
  389. waist="Fucho-no-Obi",
  390. legs=MerlinicShalwarNuke,
  391. feet=MerlinicCrackowsDrainAspir})
  392.  
  393. sets.midcast.Aspir = sets.midcast.Drain
  394.  
  395. sets.midcast.Stun = set_combine(sets.midcast['Dark Magic'], {
  396. back=LughsNuke,
  397. legs=MerlinicShalwarNuke})
  398.  
  399. -- Elemental Magic
  400. sets.midcast['Elemental Magic'] = {
  401. ammo="Pemphredo Tathlum",
  402. head=MerlinicHoodBurst,
  403. neck="Saevus Pendant +1",
  404. ear1="Regal Earring",
  405. ear2="Barkaro. Earring",
  406. body="Amalric Doublet +1",
  407. hands="Amalric Gages +1",
  408. ring1="Shiva Ring +1",
  409. ring2="Shiva Ring +1",
  410. back=LughsNuke,
  411. waist="Refoccilation Stone",
  412. legs="Amalric Slops +1",
  413. feet="Amalric Nails +1"}
  414.  
  415. sets.midcast['Elemental Magic'].Resistant = set_combine(sets.midcast['Elemental Magic'], {
  416. neck="Sanctity Necklace",
  417. body=MerlinicJubbahBurst,
  418. waist="Eschan Stone",
  419. legs=MerlinicShalwarNuke,
  420. feet=MerlinicCrackowsNuke})
  421.  
  422. sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {
  423. head=empty,
  424. neck="Sanctity Necklace",
  425. body="Twilight Cloak",
  426. ring1="Archon Ring",
  427. ring2="Stikini Ring",
  428. legs=MerlinicShalwarNuke,
  429. feet=MerlinicCrackowsNuke})
  430.  
  431. sets.midcast.Helix = {
  432. neck="Sanctity Necklace",
  433. back="Bookworm's Cape"}
  434.  
  435. sets.midcast.DarkHelix = set_combine(sets.midcast.Helix, {
  436. head="Pixie Hairpin +1",
  437. ring2="Archon Ring"})
  438.  
  439. --sets.midcast.LightHelix = set_combine(sets.midcast.Helix, {ring2="Weather. Ring +1"})
  440.  
  441. -- Initializes trusts at iLvl 119
  442. sets.midcast.Trust = sets.precast.FC
  443.  
  444. ------------------------------------------------------------------------------------------------
  445. ----------------------------------------- Idle Sets --------------------------------------------
  446. ------------------------------------------------------------------------------------------------
  447.  
  448. sets.idle = {
  449. main="Akademos",
  450. sub="Enki Strap",
  451. ammo="Homiliary",
  452. head="Befouled Crown",
  453. neck="Sanctity Necklace",
  454. ear1="Infused Earring",
  455. ear2="Dawn Earring",
  456. body="Jhakri Robe +2",
  457. hands=MerlinicDastanasDT,
  458. ring1="Sheltered Ring",
  459. ring2="Paguroidea Ring",
  460. back="Moonlight Cape",
  461. waist="Slipor Sash",
  462. legs="Assid. Pants +1",
  463. feet="Herald's Gaiters"}
  464.  
  465. sets.idle.DT = set_combine(sets.idle, {
  466. ammo="Staunch Tathlum +1",
  467. head=MerlinicHoodDT,
  468. neck="Loricate Torque +1",
  469. ear1="Etiolation Earring",
  470. ear2="Genmei Earring",
  471. body="Mallquis Saio +2",
  472. ring1="Defending Ring",
  473. ring2="Gelatinous Ring +1",
  474. legs=MerlinicShalwarDT})
  475.  
  476. sets.idle.Weak = sets.idle.DT
  477.  
  478. ------------------------------------------------------------------------------------------------
  479. ---------------------------------------- Defense Sets ------------------------------------------
  480. ------------------------------------------------------------------------------------------------
  481.  
  482. sets.defense.PDT = sets.idle.DT
  483. sets.defense.MDT = sets.idle.DT
  484. sets.Kiting = {feet="Herald's Gaiters"}
  485. sets.latent_refresh = {waist="Fucho-no-obi"}
  486.  
  487. ------------------------------------------------------------------------------------------------
  488. ---------------------------------------- Engaged Sets ------------------------------------------
  489. ------------------------------------------------------------------------------------------------
  490.  
  491. sets.engaged = {
  492. head="Jhakri Coronal +2",
  493. neck="Combatant's Torque",
  494. ear1="Cessance Earring",
  495. ear2="Telos Earring",
  496. body="Jhakri Robe +2",
  497. hands="Jhakri Cuffs +2",
  498. ring1="",
  499. ring2="",
  500. back="",
  501. feet="Jhakri Pigaches +2"}
  502.  
  503. ------------------------------------------------------------------------------------------------
  504. ---------------------------------------- Special Sets ------------------------------------------
  505. ------------------------------------------------------------------------------------------------
  506.  
  507. sets.magic_burst = {
  508. head=MerlinicHoodBurst,
  509. neck="Mizu. Kubikazari",
  510. body=MerlinicJubbahBurst,
  511. hands="Amalric Gages +1",
  512. ring2="Mujin Band",
  513. feet=MerlinicCrackowsBurst}
  514.  
  515. sets.magic_burst.Resistant = {}
  516.  
  517. -- sets.buff['Ebullience'] = {head="Arbatel Bonnet +1"}
  518. sets.buff['Rapture'] = {head="Arbatel Bonnet +1"}
  519. sets.buff['Perpetuance'] = {hands="Arbatel Bracers +1"}
  520. sets.buff['Immanence'] = {main="Akademos", sub="Enki Strap", hands="Arbatel Bracers +1", "Lugh's Cape"}
  521. sets.buff['Penury'] = {legs="Arbatel Pants +1"}
  522. sets.buff['Parsimony'] = {legs="Arbatel Pants +1"}
  523. sets.buff['Celerity'] = {feet="Peda. Loafers +1"}
  524. sets.buff['Alacrity'] = {feet="Peda. Loafers +1"}
  525. sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}
  526.  
  527. sets.buff.FullSublimation = {
  528. head="Acad. Mortar. +1",
  529. ear1="Savant's Earring",
  530. body="Peda. Gown +1"}
  531.  
  532. sets.buff.Doom = {ring1="Eshmun's Ring", ring2="Eshmun's Ring", waist="Gishdubar Sash"}
  533.  
  534. sets.LightArts = {legs="Acad. Pants +2", feet="Acad. Loafers +3"}
  535. sets.DarkArts = {body="Acad. Gown +2", feet="Acad. Loafers +3"}
  536.  
  537. sets.Obi = {waist="Hachirin-no-Obi"}
  538. sets.Bookworm = {back="Bookworm's Cape"}
  539. sets.CP = {back="Mecisto. Mantle"}
  540. sets.ConsMP = {body="Seidr Cotehardie"}
  541.  
  542. end
  543.  
  544. -------------------------------------------------------------------------------------------------------------------
  545. -- Job-specific hooks for standard casting events.
  546. -------------------------------------------------------------------------------------------------------------------
  547.  
  548. function job_post_precast(spell, action, spellMap, eventArgs)
  549. if (spell.type == "WhiteMagic" and (buffactive["Light Arts"] or buffactive["Addendum: White"])) or
  550. (spell.type == "BlackMagic" and (buffactive["Dark Arts"] or buffactive["Addendum: Black"])) then
  551. equip(sets.precast.FC.Grimoire)
  552. elseif spell.name == 'Impact' then
  553. equip(sets.precast.FC.Impact)
  554. end
  555. end
  556.  
  557. -- Run after the general midcast() is done.
  558. function job_post_midcast(spell, action, spellMap, eventArgs)
  559. if spell.skill == 'Elemental Magic' or spell.english == "Kaustra" then
  560. if (spell.element == world.day_element or spell.element == world.weather_element) then
  561. equip(sets.Obi)
  562. end
  563. if spellMap == "Helix" then
  564. --equip(sets.midcast['Elemental Magic'])
  565. if spell.english:startswith('Lumino') then
  566. equip(sets.midcast.LightHelix)
  567. elseif spell.english:startswith('Nocto') then
  568. equip(sets.midcast.DarkHelix)
  569. else
  570. equip(sets.midcast.Helix)
  571. end
  572. if state.HelixMode.value == 'Bookworm' then
  573. equip(sets.Bookworm)
  574. end
  575. end
  576. end
  577. if spell.action_type == 'Magic' then
  578. apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
  579. end
  580. if spell.skill == 'Enfeebling Magic' then
  581. if spell.type == "WhiteMagic" and (buffactive["Light Arts"] or buffactive["Addendum: White"]) then
  582. equip(sets.LightArts)
  583. elseif spell.type == "BlackMagic" and (buffactive["Dark Arts"] or buffactive["Addendum: Black"]) then
  584. equip(sets.DarkArts)
  585. end
  586. end
  587. if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
  588. if state.CastingMode.value == "Resistant" then
  589. equip(sets.magic_burst.Resistant)
  590. else
  591. equip(sets.magic_burst)
  592. end
  593. if spell.english == "Impact" then
  594. equip(sets.midcast.Impact)
  595. end
  596. if spell.skill == 'Elemental Magic' and state.ConsMP.value then
  597. equip(sets.ConsMP)
  598. end
  599. end
  600. if spell.skill == 'Enhancing Magic' then
  601. if classes.NoSkillSpells:contains(spell.english) then
  602. equip(sets.midcast.EnhancingDuration)
  603. if spellMap == 'Refresh' then
  604. equip(sets.midcast.Refresh)
  605. end
  606. end
  607. if spellMap == "Regen" and state.RegenMode.value == 'Duration' then
  608. equip(sets.midcast.RegenDuration)
  609. end
  610. if state.Buff.Perpetuance then
  611. equip(sets.buff['Perpetuance'])
  612. end
  613. if spellMap == "Storm" and state.StormSurge.value then
  614. equip (sets.midcast.Stormsurge)
  615. end
  616. end
  617. end
  618.  
  619. function job_aftercast(spell, action, spellMap, eventArgs)
  620. if not spell.interrupted then
  621. if spell.english == "Sleep II" then
  622. send_command('@timers c "Sleep II ['..spell.target.name..']" 90 down spells/00259.png')
  623. elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  624. send_command('@timers c "Sleep ['..spell.target.name..']" 60 down spells/00253.png')
  625. elseif spell.english == "Break" then
  626. send_command('@timers c "Break ['..spell.target.name..']" 30 down spells/00255.png')
  627. end
  628. end
  629. end
  630.  
  631.  
  632. -------------------------------------------------------------------------------------------------------------------
  633. -- Job-specific hooks for non-casting events.
  634. -------------------------------------------------------------------------------------------------------------------
  635.  
  636. -- Called when a player gains or loses a buff.
  637. -- buff == buff gained or lost
  638. -- gain == true if the buff was gained, false if it was lost.
  639. function job_buff_change(buff, gain)
  640. if buff == "Sublimation: Activated" then
  641. handle_equipping_gear(player.status)
  642. end
  643.  
  644. if buff == "doom" then
  645. if gain then
  646. equip(sets.buff.Doom)
  647. --send_command('@input /p Doomed.')
  648. disable('ring1','ring2','waist')
  649. else
  650. enable('ring1','ring2','waist')
  651. handle_equipping_gear(player.status)
  652. end
  653. end
  654.  
  655. end
  656.  
  657. -- Handle notifications of general user state change.
  658. function job_state_change(stateField, newValue, oldValue)
  659. if state.WeaponLock.value == true then
  660. disable('main','sub')
  661. else
  662. enable('main','sub')
  663. end
  664. end
  665.  
  666. -------------------------------------------------------------------------------------------------------------------
  667. -- User code that supplements standard library decisions.
  668. -------------------------------------------------------------------------------------------------------------------
  669.  
  670. -- Custom spell mapping.
  671. function job_get_spell_map(spell, default_spell_map)
  672. if spell.action_type == 'Magic' then
  673. if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
  674. if (world.weather_element == 'Light' or world.day_element == 'Light') then
  675. return 'CureWeather'
  676. end
  677. elseif spell.skill == 'Enfeebling Magic' then
  678. if spell.type == 'WhiteMagic' then
  679. return 'MndEnfeebles'
  680. else
  681. return 'IntEnfeebles'
  682. end
  683. end
  684. end
  685. end
  686.  
  687. function customize_idle_set(idleSet)
  688. if state.Buff['Sublimation: Activated'] then
  689. if state.IdleMode.value == 'Normal' then
  690. idleSet = set_combine(idleSet, sets.buff.FullSublimation)
  691. elseif state.IdleMode.value == 'PDT' then
  692. idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
  693. end
  694. end
  695. if player.mpp < 51 then
  696. idleSet = set_combine(idleSet, sets.latent_refresh)
  697. end
  698. if state.CP.current == 'on' then
  699. equip(sets.CP)
  700. disable('back')
  701. else
  702. enable('back')
  703. end
  704.  
  705. return idleSet
  706. end
  707.  
  708. -- Called by the 'update' self-command.
  709. function job_update(cmdParams, eventArgs)
  710. update_active_strategems()
  711. update_sublimation()
  712. end
  713.  
  714. -- Function to display the current relevant user state when doing an update.
  715. -- Return true if display was handled, and you don't want the default info shown.
  716. function display_current_job_state(eventArgs)
  717. eventArgs.handled = true
  718. local msg = ''
  719.  
  720. msg = msg .. 'Idle ['..state.IdleMode.value..'], Casting ['..state.CastingMode.value..']'
  721.  
  722. if state.MagicBurst.value then
  723. msg = msg .. ', MB [ON]'
  724. else
  725. msg = msg .. ', MB [OFF]'
  726. end
  727. if state.ConsMP.value then
  728. msg = msg .. ', AF Body [ON]'
  729. else
  730. msg = msg .. ', AF Body [OFF]'
  731. end
  732. if state.DefenseMode.value ~= 'None' then
  733. msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
  734. end
  735.  
  736. add_to_chat(122, msg)
  737. end
  738.  
  739. -------------------------------------------------------------------------------------------------------------------
  740. -- User code that supplements self-commands.
  741. -------------------------------------------------------------------------------------------------------------------
  742.  
  743. -- Called for direct player commands.
  744. function job_self_command(cmdParams, eventArgs)
  745. if cmdParams[1]:lower() == 'scholar' then
  746. handle_strategems(cmdParams)
  747. eventArgs.handled = true
  748. elseif cmdParams[1]:lower() == 'nuke' then
  749. handle_nuking(cmdParams)
  750. eventArgs.handled = true
  751. end
  752. command = cmdParams[1]:lower()
  753. if command == 'warpring' then
  754. equip({left_ring="Warp Ring"})
  755. send_command('gs disable left_ring;wait 10;input /item "Warp Ring" <me>;wait 1;input /item "Warp Ring" <me>;wait 1;input /item "Warp Ring" <me>;wait 10;gs enable left_ring')
  756. end
  757. end
  758.  
  759. -------------------------------------------------------------------------------------------------------------------
  760. -- Utility functions specific to this job.
  761. -------------------------------------------------------------------------------------------------------------------
  762.  
  763. -- Reset the state vars tracking strategems.
  764. function update_active_strategems()
  765. state.Buff['Ebullience'] = buffactive['Ebullience'] or false
  766. state.Buff['Rapture'] = buffactive['Rapture'] or false
  767. state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
  768. state.Buff['Immanence'] = buffactive['Immanence'] or false
  769. state.Buff['Penury'] = buffactive['Penury'] or false
  770. state.Buff['Parsimony'] = buffactive['Parsimony'] or false
  771. state.Buff['Celerity'] = buffactive['Celerity'] or false
  772. state.Buff['Alacrity'] = buffactive['Alacrity'] or false
  773.  
  774. state.Buff['Klimaform'] = buffactive['Klimaform'] or false
  775. end
  776.  
  777. function update_sublimation()
  778. state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  779. end
  780.  
  781. -- Equip sets appropriate to the active buffs, relative to the spell being cast.
  782. function apply_grimoire_bonuses(spell, action, spellMap)
  783. if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
  784. equip(sets.buff['Perpetuance'])
  785. end
  786. if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
  787. equip(sets.buff['Rapture'])
  788. end
  789. if spell.skill == 'Elemental Magic' and spellMap ~= 'ElementalEnfeeble' then
  790. if state.Buff.Ebullience and spell.english ~= 'Impact' then
  791. equip(sets.buff['Ebullience'])
  792. end
  793. if state.Buff.Immanence then
  794. equip(sets.buff['Immanence'])
  795. end
  796. if state.Buff.Klimaform and (spell.element == world.weather_element or spell.element == world.day_element) then
  797. equip(sets.buff['Klimaform'])
  798. end
  799. end
  800.  
  801. if state.Buff.Penury then equip(sets.buff['Penury']) end
  802. if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
  803. if state.Buff.Celerity then equip(sets.buff['Celerity']) end
  804. if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
  805. end
  806.  
  807.  
  808. -- General handling of strategems in an Arts-agnostic way.
  809. -- Format: gs c scholar <strategem>
  810. function handle_strategems(cmdParams)
  811. -- cmdParams[1] == 'scholar'
  812. -- cmdParams[2] == strategem to use
  813.  
  814. if not cmdParams[2] then
  815. add_to_chat(123,'Error: No strategem command given.')
  816. return
  817. end
  818. local strategem = cmdParams[2]:lower()
  819.  
  820. if strategem == 'light' then
  821. if buffactive['light arts'] then
  822. send_command('input /ja "Addendum: White" <me>')
  823. elseif buffactive['addendum: white'] then
  824. add_to_chat(122,'Error: Addendum: White is already active.')
  825. else
  826. send_command('input /ja "Light Arts" <me>')
  827. end
  828. elseif strategem == 'dark' then
  829. if buffactive['dark arts'] then
  830. send_command('input /ja "Addendum: Black" <me>')
  831. elseif buffactive['addendum: black'] then
  832. add_to_chat(122,'Error: Addendum: Black is already active.')
  833. else
  834. send_command('input /ja "Dark Arts" <me>')
  835. end
  836. elseif buffactive['light arts'] or buffactive['addendum: white'] then
  837. if strategem == 'cost' then
  838. send_command('input /ja Penury <me>')
  839. elseif strategem == 'speed' then
  840. send_command('input /ja Celerity <me>')
  841. elseif strategem == 'aoe' then
  842. send_command('input /ja Accession <me>')
  843. elseif strategem == 'power' then
  844. send_command('input /ja Rapture <me>')
  845. elseif strategem == 'duration' then
  846. send_command('input /ja Perpetuance <me>')
  847. elseif strategem == 'accuracy' then
  848. send_command('input /ja Altruism <me>')
  849. elseif strategem == 'enmity' then
  850. send_command('input /ja Tranquility <me>')
  851. elseif strategem == 'skillchain' then
  852. add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
  853. elseif strategem == 'addendum' then
  854. send_command('input /ja "Addendum: White" <me>')
  855. else
  856. add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  857. end
  858. elseif buffactive['dark arts'] or buffactive['addendum: black'] then
  859. if strategem == 'cost' then
  860. send_command('input /ja Parsimony <me>')
  861. elseif strategem == 'speed' then
  862. send_command('input /ja Alacrity <me>')
  863. elseif strategem == 'aoe' then
  864. send_command('input /ja Manifestation <me>')
  865. elseif strategem == 'power' then
  866. send_command('input /ja Ebullience <me>')
  867. elseif strategem == 'duration' then
  868. add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
  869. elseif strategem == 'accuracy' then
  870. send_command('input /ja Focalization <me>')
  871. elseif strategem == 'enmity' then
  872. send_command('input /ja Equanimity <me>')
  873. elseif strategem == 'skillchain' then
  874. send_command('input /ja Immanence <me>')
  875. elseif strategem == 'addendum' then
  876. send_command('input /ja "Addendum: Black" <me>')
  877. else
  878. add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  879. end
  880. else
  881. add_to_chat(123,'No arts has been activated yet.')
  882. end
  883. end
  884.  
  885.  
  886. -- Gets the current number of available strategems based on the recast remaining
  887. -- and the level of the sch.
  888. function get_current_strategem_count()
  889. -- returns recast in seconds.
  890. local allRecasts = windower.ffxi.get_ability_recasts()
  891. local stratsRecast = allRecasts[231]
  892.  
  893. local maxStrategems = (player.main_job_level + 10) / 20
  894.  
  895. local fullRechargeTime = 5*33
  896.  
  897. local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
  898.  
  899. return currentCharges
  900. end
  901.  
  902.  
  903. -- Select default macro book on initial load or subjob change.
  904. function select_default_macro_book()
  905. set_macro_page(1, 9)
  906. end
  907. function set_lockstyle()
  908. send_command('wait 2; input /lockstyleset ' .. lockstyleset)
  909. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement