Advertisement
Guest User

NiteAnjel's SCH.Lua

a guest
Sep 26th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.67 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job. Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. --[[
  6. Custom commands:
  7.  
  8. Shorthand versions for each strategem type that uses the version appropriate for
  9. the current Arts.
  10.  
  11. Light Arts Dark Arts
  12.  
  13. gs c scholar light Light Arts/Addendum
  14. gs c scholar dark Dark Arts/Addendum
  15. gs c scholar cost Penury Parsimony
  16. gs c scholar speed Celerity Alacrity
  17. gs c scholar aoe Accession Manifestation
  18. gs c scholar power Rapture Ebullience
  19. gs c scholar duration Perpetuance
  20. gs c scholar accuracy Altruism Focalization
  21. gs c scholar enmity Tranquility Equanimity
  22. gs c scholar skillchain Immanence
  23. gs c scholar addendum Addendum: White Addendum: Black
  24. --]]
  25.  
  26.  
  27.  
  28. -- Initialization function for this job file.
  29. function get_sets()
  30. mote_include_version = 2
  31.  
  32. -- Load and initialize the include file.
  33. include('Mote-Include.lua')
  34. end
  35.  
  36. -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
  37. function job_setup()
  38. info.addendumNukes = S{"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
  39. "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  40.  
  41. state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  42. update_active_strategems()
  43. end
  44.  
  45. -------------------------------------------------------------------------------------------------------------------
  46. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  47. -------------------------------------------------------------------------------------------------------------------
  48.  
  49. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  50. function user_setup()
  51. state.OffenseMode:options('None', 'Normal')
  52. state.CastingMode:options('Normal', 'Resistant')
  53. state.IdleMode:options('Normal', 'PDT')
  54.  
  55.  
  56. info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder"}
  57. info.mid_nukes = S{"Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II",
  58. "Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
  59. "Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",}
  60. info.high_nukes = S{"Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  61.  
  62. gear.macc_hagondes = {name="Hagondes Cuffs", augments={'Phys. dmg. taken -3%','Mag. Acc.+29'}}
  63.  
  64. send_command('bind ^` input /ma Stun <t>')
  65.  
  66. select_default_macro_book()
  67. end
  68.  
  69. function user_unload()
  70. send_command('unbind ^`')
  71. end
  72.  
  73.  
  74. -- Define sets and vars used by this job file.
  75. function init_gear_sets()
  76. --------------------------------------
  77. -- Start defining the sets
  78. --------------------------------------
  79.  
  80. -- Precast Sets
  81.  
  82. -- Precast sets to enhance JAs
  83.  
  84. sets.precast.JA['Tabula Rasa'] = {legs="Pedagogy Pants"}
  85.  
  86.  
  87. -- Fast cast sets for spells
  88.  
  89. sets.precast.FC = {ammo="Impatiens", main="Marin staff", sub="Vivid Strap",
  90. head="Nahtirah Hat",ear1="Loquacious Earring",
  91. body="Vanir Cotehardie",hands="Telchine gloves",ring1="Prolix Ring",
  92. back="Swith Cape +1",waist="Witful Belt",legs="Artsieq hose",feet="Academic's Loafers"}
  93.  
  94. sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  95.  
  96. sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="Stoicheion Medal"})
  97.  
  98. sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
  99.  
  100.  
  101. -- Midcast Sets
  102.  
  103. sets.midcast.FastRecast = {ammo="Impatiens", main="Marin staff", sub="Vivid Strap",
  104. head="Nahtirah Hat",ear1="Loquacious Earring",
  105. body="Vanir Cotehardie",hands="Telchine gloves",ring1="Prolix Ring",
  106. back="Swith Cape +1",waist="Witful Belt",legs="Artsieq hose",feet="Academic's Loafers"}
  107.  
  108. sets.midcast.Cure = {main="Tamaxchi",sub="Sors Shield",ammo="Leisure musk +1",
  109. head="Pedagogy Mortarboard",neck="Savant's chain",ear1="Lifestorm Earring",ear2="Psystorm Earring",
  110. body="Pedagogy Gown",hands="Telchine Gloves",ring1="Sangoma Ring",ring2="Globidonta Ring",
  111. back="Refraction Cape",waist="Ovate rope",legs="Academic's pants",feet="Regal pumps"}
  112.  
  113. sets.midcast.CureWithLightWeather = {main="Tamaxchi",sub="Sors Shield",ammo="Leisure musk +1",
  114. head="Pedagogy Mortarboard",neck="Savant's chain",ear1="Lifestorm Earring",ear2="Psystorm Earring",
  115. body="Pedagogy Gown",hands="Telchine Gloves",ring1="Sangoma Ring",ring2="Globidonta Ring",
  116. back="Twilight Cape",waist="Hachirin-no-obi",legs="Academic's pants",feet="Regal pumps"}
  117.  
  118. sets.midcast.Curaga = sets.midcast.CureWithLightWeather
  119.  
  120. sets.midcast.Regen = {main="Bolelabunga",head="Arbatel Bonnet"}
  121.  
  122. sets.midcast.Cursna = {
  123. neck="Malison Medallion",
  124. hands="Hieros Mittens",ring1="Ephedra Ring",
  125. feet="Gendewitha Galoshes"}
  126.  
  127. sets.midcast['Enhancing Magic'] = {ammo="Leisure musk +1",
  128. head="Arbatel Bonnet",neck="Enhancing Torque",
  129. body="Pedagogy Gown",hands="Arbatel Bracers",
  130. legs="Academic's pants",feet="Regal pumps"}
  131.  
  132. sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash"})
  133.  
  134. sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {feet="Pedagogy Loafers"})
  135.  
  136.  
  137. -- Custom spell classes
  138. sets.midcast.MndEnfeebles = {main="Marin Staff",sub="Mephitis Grip",ammo="Leisure musk +1",
  139. head="Nahtirah Hat",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  140. body="Arbatel Gown",hands="Argute bracers +2",ring1="Sangoma Ring",ring2="Globidonta Ring",
  141. back="Refraction Cape",waist="Ovate rope",legs="Arbatel pants",feet="Academic's Loafers"}
  142.  
  143. sets.midcast.IntEnfeebles = {main="Marin Staff",sub="Mephitis Grip",ammo="Leisure musk +1",
  144. head="Nahtirah Hat",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  145. body="Arbatel Gown",hands="Argute bracers +2",ring1="Sangoma Ring",ring2="Globidonta Ring",
  146. back="Refraction Cape",waist="Ovate rope",legs="Arbatel pants",feet="Academic's Loafers"}
  147.  
  148. sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
  149.  
  150. sets.midcast['Dark Magic'] = {main="Marin Staff",sub="Mephitis Grip",ammo="Witchstone",
  151. head="Nahtirah Hat",neck="Dark Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  152. body="Arbatel Gown",hands="Yaoyotl Gloves",ring1="Sangoma Ring",ring2="Icesoul Ring",
  153. back="Bookworm's Cape",waist="Oneiros sash",legs="Artsieq hose",feet="Umbani Boots"}
  154.  
  155. sets.midcast.Kaustra = {main="Keraunos",sub="Zuuxowu Grip",ammo="Witchstone",
  156. head="Buremte Hat",neck="Stoicheion Medal",ear1="Crematio Earring",ear2="Hecate's Earring",
  157. body="Artsieq jubbah",hands="Yaoyotl Gloves",ring1="Icesoul Ring",ring2="Acumen Ring",
  158. back="Bookworm's cape",waist="Oneiros sash",legs="Artsieq hose",feet="Umbani Boots"}
  159.  
  160. sets.midcast.Drain = {main="Marin Staff",sub="Mephitis Grip",ammo="Witchstone",
  161. head="Nahtirah Hat",neck="Dark Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  162. body="Arbatel Gown",hands="Yaoyotl Gloves",ring1="Sangoma Ring",ring2="Icesoul Ring",
  163. back="Bookworm's Cape",waist="Fucho-no-obi",legs="Artsieq hose",feet="Academic's Loafers"}
  164.  
  165. sets.midcast.Aspir = sets.midcast.Drain
  166.  
  167. sets.midcast.Stun = set_combine(sets.midcast.FastRecast)
  168.  
  169. sets.midcast.Stun.Resistant = set_combine(sets.midcast.Stun, {main="Marin Staff"})
  170.  
  171.  
  172. -- Elemental Magic sets are default for handling low-tier nukes.
  173. sets.midcast['Elemental Magic'] = {main="Keraunos",sub="Zuuxowu Grip",ammo="Witchstone",
  174. head="Buremte Hat",neck="Stoicheion Medal",ear1="Crematio Earring",ear2="Hecate's Earring",
  175. body="Artsieq jubbah",hands="Yaoyotl Gloves",ring1="Icesoul Ring",ring2="Acumen Ring",
  176. back="Bookworm's cape",waist="Oneiros sash",legs="Artsieq hose",feet="Umbani Boots"}
  177.  
  178. sets.midcast['Elemental Magic'].Resistant = {main="Keraunos",sub="Zuuxowu Grip",ammo="Witchstone",
  179. head="Buremte Hat",neck="Stoicheion Medal",ear1="Crematio Earring",ear2="Hecate's Earring",
  180. body="Artsieq jubbah",hands="Yaoyotl Gloves",ring1="Icesoul Ring",ring2="Acumen Ring",
  181. back="Bookworm's cape",waist="Oneiros sash",legs="Artsieq hose",feet="Umbani Boots"}
  182.  
  183. -- Custom refinements for certain nuke tiers
  184. sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'], {sub="Zuuxowu Grip"})
  185.  
  186. sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'].Resistant, {sub="Zuuxowu Grip"})
  187.  
  188. sets.midcast.Impact = {main="Keraunos",sub="Zuuxowu Grip",ammo="Witchstone",
  189. neck="Stoicheion Medal",ear1="Crematio Earring",ear2="Hecate's Earring",
  190. body="Twilight Cloak",hands="Yaoyotl Gloves",ring1="Icesoul Ring",ring2="Acumen Ring",
  191. back="Bookworm's cape",waist="Oneiros sash",legs="Artsieq hose",feet="Umbani Boots"}
  192.  
  193.  
  194. -- Sets to return to when not performing an action.
  195.  
  196. -- Resting sets
  197. sets.resting = {main="Chatoyant Staff",sub="Mephitis Grip",
  198. head="Nefer Khat +1",neck="Wiglen Gorget",
  199. body="Heka's Kalasiris",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
  200. waist="Austerity Belt",legs="Nares Trews",feet="Serpentes Sabots"}
  201.  
  202.  
  203. -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  204.  
  205. sets.idle.Town = {main="Keraunos",sub="Zuuxowu",ammo="Witchstone",
  206. head="Pedagogy Mortarboard",neck="Savant's Chain",ear1="Savant's earring",ear2="Moonshade Earring",
  207. body="Pedagogy gown",hands="Arbatel Bracers",
  208. back="Bookworm's Cape",waist="Hachirin-no-obi",legs="Arbatel Pants",feet="Academic's Loafers"}
  209.  
  210. sets.idle.Field = {main="Bolelabunga",sub="Sors Shield",ammo="Impatiens",
  211. head="Pedagogy Mortarboard",neck="Savant's Chain",ear1="Savant's earring",ear2="Moonshade Earring",
  212. body="Arbatel gown",hands="Serpentes cuffs",
  213. back="Bookworm's Cape",waist="Hachirin-no-obi",legs="Assiduity pants",feet="Serpentes Sabots"}
  214.  
  215. sets.idle.Field.PDT = {main=gear.Staff.PDT,sub="Achaq Grip",ammo="Incantor Stone",
  216. head="Nahtirah Hat",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  217. body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Paguroidea Ring",
  218. back="Umbra Cape",waist="Hierarch Belt",legs="Nares Trews",feet="Herald's Gaiters"}
  219.  
  220. sets.idle.Field.Stun = {main="Apamajas II",sub="Mephitis Grip",ammo="Incantor Stone",
  221. head="Nahtirah Hat",neck="Aesir Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  222. body="Vanir Cotehardie",hands="Gendewitha Gages",ring1="Prolix Ring",ring2="Sangoma Ring",
  223. back="Swith Cape +1",waist="Goading Belt",legs="Bokwus Slops",feet="Academic's Loafers"}
  224.  
  225. sets.idle.Weak = {main="Bolelabunga",sub="Genbu's Shield",ammo="Incantor Stone",
  226. head="Nahtirah Hat",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  227. body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Sheltered Ring",ring2="Meridian Ring",
  228. back="Umbra Cape",waist="Hierarch Belt",legs="Nares Trews",feet="Herald's Gaiters"}
  229.  
  230. -- Defense sets
  231.  
  232. sets.defense.PDT = {main=gear.Staff.PDT,sub="Achaq Grip",ammo="Incantor Stone",
  233. head="Nahtirah Hat",neck="Twilight Torque",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  234. body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
  235. back="Umbra Cape",waist="Hierarch Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
  236.  
  237. sets.defense.MDT = {main=gear.Staff.PDT,sub="Achaq Grip",ammo="Incantor Stone",
  238. head="Nahtirah Hat",neck="Twilight Torque",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  239. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Shadow Ring",
  240. back="Tuilha Cape",waist="Hierarch Belt",legs="Bokwus Slops",feet="Hagondes Sabots"}
  241.  
  242. sets.Kiting = {feet="Herald's Gaiters"}
  243.  
  244. sets.latent_refresh = {waist="Fucho-no-obi"}
  245.  
  246. -- Engaged sets
  247.  
  248. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  249. -- sets if more refined versions aren't defined.
  250. -- If you create a set with both offense and defense modes, the offense mode should be first.
  251. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  252.  
  253. -- Normal melee group
  254. sets.engaged = {
  255. head="Zelus Tiara",
  256. body="Vanir Cotehardie",hands="Bokwus Gloves",ring1="Rajas Ring",
  257. waist="Goading Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
  258.  
  259.  
  260.  
  261. -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  262. sets.buff['Ebullience'] = {head="Arbatel bonnet"}
  263. sets.buff['Rapture'] = {head="Arbatel bonnet"}
  264. sets.buff['Perpetuance'] = {hands="Arbatel bracers"}
  265. sets.buff['Immanence'] = {hands="Arbatel bracers"}
  266. sets.buff['Penury'] = {legs="Arbatel Pants"}
  267. sets.buff['Parsimony'] = {legs="Arbatel Pants"}
  268. sets.buff['Celerity'] = {feet="Pedagogy Loafers"}
  269. sets.buff['Alacrity'] = {feet="Pedagogy Loafers"}
  270.  
  271. sets.buff['Klimaform'] = {feet="Arbatel Loafers"}
  272.  
  273. sets.buff.FullSublimation = {head="Academic's Mortarboard",ear1="Savant's Earring",body="Pedagogy Gown"}
  274. sets.buff.PDTSublimation = {head="Academic's Mortarboard",ear1="Savant's Earring"}
  275.  
  276. --sets.buff['Sandstorm'] = {feet="Desert Boots"}
  277. end
  278.  
  279. -------------------------------------------------------------------------------------------------------------------
  280. -- Job-specific hooks for standard casting events.
  281. -------------------------------------------------------------------------------------------------------------------
  282.  
  283. -- Run after the general midcast() is done.
  284. function job_post_midcast(spell, action, spellMap, eventArgs)
  285. if spell.action_type == 'Magic' then
  286. apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
  287. end
  288. end
  289.  
  290. -------------------------------------------------------------------------------------------------------------------
  291. -- Job-specific hooks for non-casting events.
  292. -------------------------------------------------------------------------------------------------------------------
  293.  
  294. -- Called when a player gains or loses a buff.
  295. -- buff == buff gained or lost
  296. -- gain == true if the buff was gained, false if it was lost.
  297. function job_buff_change(buff, gain)
  298. if buff == "Sublimation: Activated" then
  299. handle_equipping_gear(player.status)
  300. end
  301. end
  302.  
  303. -- Handle notifications of general user state change.
  304. function job_state_change(stateField, newValue, oldValue)
  305. if stateField == 'Offense Mode' then
  306. if newValue == 'Normal' then
  307. disable('main','sub','range')
  308. else
  309. enable('main','sub','range')
  310. end
  311. end
  312. end
  313.  
  314. -------------------------------------------------------------------------------------------------------------------
  315. -- User code that supplements standard library decisions.
  316. -------------------------------------------------------------------------------------------------------------------
  317.  
  318. -- Custom spell mapping.
  319. function job_get_spell_map(spell, default_spell_map)
  320. if spell.action_type == 'Magic' then
  321. if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
  322. if world.weather_element == 'Light' then
  323. return 'CureWithLightWeather'
  324. end
  325. elseif spell.skill == 'Enfeebling Magic' then
  326. if spell.type == 'WhiteMagic' then
  327. return 'MndEnfeebles'
  328. else
  329. return 'IntEnfeebles'
  330. end
  331. elseif spell.skill == 'Elemental Magic' then
  332. if info.low_nukes:contains(spell.english) then
  333. return 'LowTierNuke'
  334. elseif info.mid_nukes:contains(spell.english) then
  335. return 'MidTierNuke'
  336. elseif info.high_nukes:contains(spell.english) then
  337. return 'HighTierNuke'
  338. end
  339. end
  340. end
  341. end
  342.  
  343. function customize_idle_set(idleSet)
  344. if state.Buff['Sublimation: Activated'] then
  345. if state.IdleMode.value == 'Normal' then
  346. idleSet = set_combine(idleSet, sets.buff.FullSublimation)
  347. elseif state.IdleMode.value == 'PDT' then
  348. idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
  349. end
  350. end
  351.  
  352. if player.mpp < 51 then
  353. idleSet = set_combine(idleSet, sets.latent_refresh)
  354. end
  355.  
  356. return idleSet
  357. end
  358.  
  359. -- Called by the 'update' self-command.
  360. function job_update(cmdParams, eventArgs)
  361. if cmdParams[1] == 'user' and not (buffactive['light arts'] or buffactive['dark arts'] or
  362. buffactive['addendum: white'] or buffactive['addendum: black']) then
  363. if state.IdleMode.value == 'Stun' then
  364. send_command('@input /ja "Dark Arts" <me>')
  365. else
  366. send_command('@input /ja "Light Arts" <me>')
  367. end
  368. end
  369.  
  370. update_active_strategems()
  371. update_sublimation()
  372. end
  373.  
  374. -- Function to display the current relevant user state when doing an update.
  375. -- Return true if display was handled, and you don't want the default info shown.
  376. function display_current_job_state(eventArgs)
  377. display_current_caster_state()
  378. eventArgs.handled = true
  379. end
  380.  
  381. -------------------------------------------------------------------------------------------------------------------
  382. -- User code that supplements self-commands.
  383. -------------------------------------------------------------------------------------------------------------------
  384.  
  385. -- Called for direct player commands.
  386. function job_self_command(cmdParams, eventArgs)
  387. if cmdParams[1]:lower() == 'scholar' then
  388. handle_strategems(cmdParams)
  389. eventArgs.handled = true
  390. end
  391. end
  392.  
  393. -------------------------------------------------------------------------------------------------------------------
  394. -- Utility functions specific to this job.
  395. -------------------------------------------------------------------------------------------------------------------
  396.  
  397. -- Reset the state vars tracking strategems.
  398. function update_active_strategems()
  399. state.Buff['Ebullience'] = buffactive['Ebullience'] or false
  400. state.Buff['Rapture'] = buffactive['Rapture'] or false
  401. state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
  402. state.Buff['Immanence'] = buffactive['Immanence'] or false
  403. state.Buff['Penury'] = buffactive['Penury'] or false
  404. state.Buff['Parsimony'] = buffactive['Parsimony'] or false
  405. state.Buff['Celerity'] = buffactive['Celerity'] or false
  406. state.Buff['Alacrity'] = buffactive['Alacrity'] or false
  407.  
  408. state.Buff['Klimaform'] = buffactive['Klimaform'] or false
  409. end
  410.  
  411. function update_sublimation()
  412. state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  413. end
  414.  
  415. -- Equip sets appropriate to the active buffs, relative to the spell being cast.
  416. function apply_grimoire_bonuses(spell, action, spellMap)
  417. if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
  418. equip(sets.buff['Perpetuance'])
  419. end
  420. if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
  421. equip(sets.buff['Rapture'])
  422. end
  423. if spell.skill == 'Elemental Magic' and spellMap ~= 'ElementalEnfeeble' then
  424. if state.Buff.Ebullience and spell.english ~= 'Impact' then
  425. equip(sets.buff['Ebullience'])
  426. end
  427. if state.Buff.Immanence then
  428. equip(sets.buff['Immanence'])
  429. end
  430. if state.Buff.Klimaform and spell.element == world.weather_element then
  431. equip(sets.buff['Klimaform'])
  432. end
  433. end
  434.  
  435. if state.Buff.Penury then equip(sets.buff['Penury']) end
  436. if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
  437. if state.Buff.Celerity then equip(sets.buff['Celerity']) end
  438. if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
  439. end
  440.  
  441.  
  442. -- General handling of strategems in an Arts-agnostic way.
  443. -- Format: gs c scholar <strategem>
  444. function handle_strategems(cmdParams)
  445. -- cmdParams[1] == 'scholar'
  446. -- cmdParams[2] == strategem to use
  447.  
  448. if not cmdParams[2] then
  449. add_to_chat(123,'Error: No strategem command given.')
  450. return
  451. end
  452. local strategem = cmdParams[2]:lower()
  453.  
  454. if strategem == 'light' then
  455. if buffactive['light arts'] then
  456. send_command('input /ja "Addendum: White" <me>')
  457. elseif buffactive['addendum: white'] then
  458. add_to_chat(122,'Error: Addendum: White is already active.')
  459. else
  460. send_command('input /ja "Light Arts" <me>')
  461. end
  462. elseif strategem == 'dark' then
  463. if buffactive['dark arts'] then
  464. send_command('input /ja "Addendum: Black" <me>')
  465. elseif buffactive['addendum: black'] then
  466. add_to_chat(122,'Error: Addendum: Black is already active.')
  467. else
  468. send_command('input /ja "Dark Arts" <me>')
  469. end
  470. elseif buffactive['light arts'] or buffactive['addendum: white'] then
  471. if strategem == 'cost' then
  472. send_command('input /ja Penury <me>')
  473. elseif strategem == 'speed' then
  474. send_command('input /ja Celerity <me>')
  475. elseif strategem == 'aoe' then
  476. send_command('input /ja Accession <me>')
  477. elseif strategem == 'power' then
  478. send_command('input /ja Rapture <me>')
  479. elseif strategem == 'duration' then
  480. send_command('input /ja Perpetuance <me>')
  481. elseif strategem == 'accuracy' then
  482. send_command('input /ja Altruism <me>')
  483. elseif strategem == 'enmity' then
  484. send_command('input /ja Tranquility <me>')
  485. elseif strategem == 'skillchain' then
  486. add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
  487. elseif strategem == 'addendum' then
  488. send_command('input /ja "Addendum: White" <me>')
  489. else
  490. add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  491. end
  492. elseif buffactive['dark arts'] or buffactive['addendum: black'] then
  493. if strategem == 'cost' then
  494. send_command('input /ja Parsimony <me>')
  495. elseif strategem == 'speed' then
  496. send_command('input /ja Alacrity <me>')
  497. elseif strategem == 'aoe' then
  498. send_command('input /ja Manifestation <me>')
  499. elseif strategem == 'power' then
  500. send_command('input /ja Ebullience <me>')
  501. elseif strategem == 'duration' then
  502. add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
  503. elseif strategem == 'accuracy' then
  504. send_command('input /ja Focalization <me>')
  505. elseif strategem == 'enmity' then
  506. send_command('input /ja Equanimity <me>')
  507. elseif strategem == 'skillchain' then
  508. send_command('input /ja Immanence <me>')
  509. elseif strategem == 'addendum' then
  510. send_command('input /ja "Addendum: Black" <me>')
  511. else
  512. add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  513. end
  514. else
  515. add_to_chat(123,'No arts has been activated yet.')
  516. end
  517. end
  518.  
  519.  
  520. -- Gets the current number of available strategems based on the recast remaining
  521. -- and the level of the sch.
  522. function get_current_strategem_count()
  523. -- returns recast in seconds.
  524. local allRecasts = windower.ffxi.get_ability_recasts()
  525. local stratsRecast = allRecasts[231]
  526.  
  527. local maxStrategems = (player.main_job_level + 10) / 20
  528.  
  529. local fullRechargeTime = 4*60
  530.  
  531. local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
  532.  
  533. return currentCharges
  534. end
  535.  
  536.  
  537. -- Select default macro book on initial load or subjob change.
  538. function select_default_macro_book()
  539. set_macro_page(1, 17)
  540. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement