Ballzack

COR.lua

Jun 18th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 51.18 KB | None | 0 0
  1. -- (Original: Motenten / Modified: Ballzack)
  2.  
  3. -------------------------------------------------------------------------------------------------------------------
  4. -- Keybinds
  5. -------------------------------------------------------------------------------------------------------------------
  6.  
  7. -- Modes: [ F9 ] Cycle Offense Modes
  8. -- [ CTRL+F9 ] Cycle Hybrid Modes
  9. -- [ ALT+F9 ] Cycle Ranged Modes
  10. -- [ WIN+F9 ] Cycle Weapon Skill Modes
  11. -- [ F10 ] Emergency -PDT Mode
  12. -- [ ALT+F10 ] Toggle Kiting Mode
  13. -- [ F11 ] Emergency -MDT Mode
  14. -- [ F12 ] Update Current Gear / Report Current Status
  15. -- [ CTRL+F12 ] Cycle Idle Modes
  16. -- [ ALT+F12 ] Cancel Emergency -PDT/-MDT Mode
  17. -- [ WIN+C ] Toggle Capacity Points Mode
  18. -- [ WIN+` ] Toggle use of Luzaf Ring.
  19. -- [ WIN+Q ] Quick Draw shot mode selector.
  20. --
  21. -- Abilities: [ CTRL+- ] Quick Draw primary shot element cycle forward.
  22. -- [ CTRL+= ] Quick Draw primary shot element cycle backward.
  23. -- [ ALT+- ] Quick Draw secondary shot element cycle forward.
  24. -- [ ALT+= ] Quick Draw secondary shot element cycle backward.
  25. -- [ CTRL+[ ] Quick Draw toggle target type.
  26. -- [ CTRL+] ] Quick Draw toggle use secondary shot.
  27. --
  28. -- [ CTRL+C ] Crooked Cards
  29. -- [ CTRL+` ] Double-Up
  30. -- [ CTRL+X ] Fold
  31. -- [ CTRL+S ] Snake Eye
  32. -- [ CTRL+NumLock ] Triple Shot
  33. -- [ CTRL+Numpad/ ] Berserk
  34. -- [ CTRL+Numpad* ] Warcry
  35. -- [ CTRL+Numpad- ] Aggressor
  36. --
  37. -- Spells: [ WIN+, ] Utsusemi: Ichi
  38. -- [ WIN+. ] Utsusemi: Ni
  39. --
  40. -- Weapons: [ CTRL+G ] Cycles between available ranged weapons
  41. -- [ CTRL+W ] Toggle Ranged Weapon Lock
  42. --
  43. -- WS: [ CTRL+Numpad7 ] Savage Blade
  44. -- [ CTRL+Numpad8 ] Last Stand
  45. -- [ CTRL+Numpad4 ] Leaden Salute
  46. -- [ CTRL+Numpad6 ] Wildfire
  47. -- [ CTRL+Numpad1 ] Requiescat
  48. --
  49. -- RA: [ Numpad0 ] Ranged Attack
  50. --
  51. --
  52. -- (Skillchains)
  53. -- Savage-->Last Stand-->Last Stand
  54. -- Req/Swift Blade-->Savage-->Last Stand--> Last Stand
  55. -- Hot Shot/Red Lotus-->Numbing Shot-->Savage-->Last Stand
  56. -- Numbing-->Last Stand-->Last Stand-->Last Stand
  57. -- Salute > Aeolian/Shining > Salute > Wildfire
  58. -- Leaden > Savage > CDC > Leaden > WF
  59.  
  60. -------------------------------------------------------------------------------------------------------------------
  61. -- Custom Commands (preface with /console to use these in macros)
  62. -------------------------------------------------------------------------------------------------------------------
  63.  
  64. -- gs c qd Uses the currently configured shot on the target, with either <t> or
  65. -- <stnpc> depending on setting.
  66. -- gs c qd t Uses the currently configured shot on the target, but forces use of <t>.
  67. --
  68. -- gs c cycle mainqd Cycles through the available steps to use as the primary shot when using
  69. -- one of the above commands.
  70. -- gs c cycle altqd Cycles through the available steps to use for alternating with the
  71. -- configured main shot.
  72. -- gs c toggle usealtqd Toggles whether or not to use an alternate shot.
  73. -- gs c toggle selectqdtarget Toggles whether or not to use <stnpc> (as opposed to <t>) when using a shot.
  74. --
  75. -- gs c toggle LuzafRing Toggles use of Luzaf Ring on and off
  76.  
  77.  
  78. -------------------------------------------------------------------------------------------------------------------
  79. -- Setup functions for this job. Generally should not be modified.
  80. -------------------------------------------------------------------------------------------------------------------
  81.  
  82. -- Initialization function for this job file.
  83. function get_sets()
  84. mote_include_version = 2
  85.  
  86. -- Load and initialize the include file.
  87. include('Mote-Include.lua')
  88. end
  89.  
  90. -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
  91. function job_setup()
  92. -- QuickDraw Selector
  93. state.Mainqd = M{['description']='Primary Shot', 'Fire Shot', 'Ice Shot', 'Wind Shot', 'Earth Shot', 'Thunder Shot', 'Water Shot'}
  94. state.Altqd = M{['description']='Secondary Shot', 'Fire Shot', 'Ice Shot', 'Wind Shot', 'Earth Shot', 'Thunder Shot', 'Water Shot'}
  95. state.UseAltqd = M(false, 'Use Secondary Shot')
  96. state.SelectqdTarget = M(false, 'Select Quick Draw Target')
  97. state.IgnoreTargetting = M(false, 'Ignore Targetting')
  98.  
  99. state.DualWield = M(false, 'Dual Wield III')
  100. state.QDMode = M{['description']='Quick Draw Mode', 'STP', 'Magic Enhance', 'Magic Attack'}
  101.  
  102. state.Currentqd = M{['description']='Current Quick Draw', 'Main', 'Alt'}
  103.  
  104. -- Whether to use Luzaf's Ring
  105. state.LuzafRing = M(false, "Luzaf's Ring")
  106. -- Whether a warning has been given for low ammo
  107. state.warned = M(false)
  108.  
  109. define_roll_values()
  110.  
  111. lockstyleset = 14
  112.  
  113. update_offense_mode()
  114. determine_haste_group()
  115. end
  116.  
  117. -------------------------------------------------------------------------------------------------------------------
  118. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  119. -------------------------------------------------------------------------------------------------------------------
  120.  
  121. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  122. function user_setup()
  123. state.OffenseMode:options('STP', 'Normal', 'LowAcc', 'MidAcc', 'HighAcc')
  124. state.HybridMode:options('Normal', 'DT')
  125. state.RangedMode:options('STP', 'Normal', 'Acc', 'HighAcc', 'Critical')
  126. state.WeaponskillMode:options('Normal', 'Acc')
  127. state.CastingMode:options('Normal', 'Resistant')
  128. state.IdleMode:options('Normal', 'DT', 'Refresh')
  129.  
  130. state.WeaponLock = M(false, 'Weapon Lock')
  131. state.Gun = M{['description']='Current Gun', 'Fomalhaut', 'Anarchy +2'}--, 'Armageddon', 'Death Penalty'
  132. --state.CP = M(false, "Capacity Points Mode")
  133.  
  134. gear.RAbullet = "Chrono Bullet"
  135. gear.WSbullet = "Chrono Bullet"
  136. gear.MAbullet = "Orichalc. Bullet"
  137. gear.QDbullet = "Animikii Bullet"
  138. options.ammo_warning_limit = 10
  139.  
  140. send_command('bind ^` input /ja "Double-up" <me>')
  141. send_command('bind ^c input /ja "Crooked Cards" <me>')
  142. send_command('bind ^s input /ja "Snake Eye" <me>')
  143. send_command('bind ^f input /ja "Fold" <me>')
  144. send_command('bind !` input /ja "Bolter\'s Roll" <me>')
  145. send_command ('bind @` gs c toggle LuzafRing')
  146.  
  147. send_command('bind ^- gs c cycleback mainqd')
  148. send_command('bind ^= gs c cycle mainqd')
  149. send_command('bind !- gs c cycle altqd')
  150. send_command('bind != gs c cycleback altqd')
  151. send_command('bind ^[ gs c toggle selectqdtarget')
  152. send_command('bind ^] gs c toggle usealtqd')
  153.  
  154. --send_command('bind @c gs c toggle CP')
  155. send_command('bind @q gs c cycle QDMode')
  156. send_command('bind @g gs c cycle Gun')
  157. send_command('bind @w gs c toggle WeaponLock')
  158.  
  159. send_command('bind Delete input /ws "Leaden Salute" <t>')
  160. send_command('bind Home input /ws "Savage Blade" <t>')
  161. send_command('bind End input /ws "Last Stand" <t>')
  162.  
  163. send_command('bind numpad0 input /ra <t>')
  164.  
  165. send_command('bind @home gs c warpring')
  166.  
  167. select_default_macro_book()
  168. set_lockstyle()
  169. end
  170.  
  171.  
  172. -- Called when this job file is unloaded (eg: job change)
  173. function user_unload()
  174. send_command('unbind ^`')
  175. send_command('unbind ^c')
  176. send_command('unbind ^s')
  177. send_command('unbind ^f')
  178. send_command('unbind !`')
  179. send_command('unbind @`')
  180. send_command('unbind ^-')
  181. send_command('unbind ^=')
  182. send_command('unbind !-')
  183. send_command('unbind !=')
  184. send_command('unbind ^[')
  185. send_command('unbind ^]')
  186. send_command('unbind ^,')
  187. --send_command('unbind @c')
  188. send_command('unbind @q')
  189. send_command('unbind @g')
  190. send_command('unbind @w')
  191. send_command('unbind Delete')
  192. send_command('unbind Home')
  193. send_command('unbind End')
  194. send_command('unbind numpad0')
  195. send_command('unbind @home')
  196. end
  197.  
  198. -- Define sets and vars used by this job file.
  199. function init_gear_sets()
  200. include('augmented-items.lua')
  201.  
  202. ------------------------------------------------------------------------------------------------
  203. ---------------------------------------- Precast Sets ------------------------------------------
  204. ------------------------------------------------------------------------------------------------
  205.  
  206. sets.precast.JA['Snake Eye'] = {legs="Lanun Trews +1"}
  207. sets.precast.JA['Wild Card'] = {feet="Lanun Bottes +3"}
  208. sets.precast.JA['Random Deal'] = {body="Lanun Frac +1"}
  209.  
  210. sets.precast.CorsairRoll = {
  211. head="Lanun Tricorne +1",
  212. neck="Regal Necklace",
  213. ear1="Genmei Earring",
  214. ear2="Etiolation Earring",
  215. body="Meg. Cuirie +2",
  216. hands="Chasseur's Gants +1",
  217. ring1="Gelatinous Ring +1",
  218. ring2="Defending Ring",
  219. back="Camulus's Mantle",
  220. waist="Flume Belt +1",
  221. legs="Desultor Tassets",
  222. feet="Lanun Bottes +3"}
  223.  
  224. sets.precast.CorsairRoll.Gun = set_combine(sets.precast.CorsairRoll.Engaged, {range="Compensator"})
  225. sets.precast.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="Chas. Culottes +1"})
  226. sets.precast.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="Chass. Bottes +1"})
  227. sets.precast.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="Chass. Tricorne +1"})
  228. sets.precast.CorsairRoll["Tactician's Roll"] = set_combine(sets.precast.CorsairRoll, {body="Chasseur's Frac +1"})
  229. sets.precast.CorsairRoll["Allies' Roll"] = set_combine(sets.precast.CorsairRoll, {hands="Chasseur's Gants +1"})
  230.  
  231. sets.precast.LuzafRing = set_combine(sets.precast.CorsairRoll, {ring1="Luzaf's Ring"})
  232. sets.precast.FoldDoubleBust = {hands="Lanun Gants +1"}
  233.  
  234. sets.precast.FC = {
  235. head="Carmine Mask +1",
  236. neck="Orunmila's Torque",
  237. ear1="Enchntr. Earring +1",
  238. ear2="Loquac. Earring",
  239. body=TaeonTabardFC,
  240. hands="Leyline Gloves",
  241. ring1="Prolix Ring",
  242. ring2="Kishar Ring",
  243. back="Moonlight Cape",
  244. waist="Flume Belt +1",
  245. legs=HerculeanTrousersFC,
  246. feet="Carmine Greaves +1"}
  247.  
  248. sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads",ring1="Lebeche Ring"})
  249.  
  250. -- (10% Snapshot from JP Gifts)
  251. sets.precast.RA = {
  252. ammo=gear.RAbullet,
  253. head="Taeon Chapeau",
  254. body="Oshosi Vest",
  255. hands="Carmine Fin. Ga. +1",
  256. back=CamulusSnap,
  257. waist="Yemaya Belt",
  258. legs=AdhemarKecksD,
  259. feet="Meg. Jam. +2"} --59/26
  260.  
  261. sets.precast.RA.Flurry1 = set_combine(sets.precast.RA, {
  262. body="Laksa. Frac +3"}) --47/46
  263.  
  264. sets.precast.RA.Flurry2 = set_combine(sets.precast.RA.Flurry1, {
  265. head="Chass. Tricorne +1",
  266. feet="Pursuer's Gaiters",
  267. waist="Impulse Belt"}) --30/65
  268.  
  269.  
  270. ------------------------------------------------------------------------------------------------
  271. ------------------------------------- Weapon Skill Sets ----------------------------------------
  272. ------------------------------------------------------------------------------------------------
  273.  
  274. sets.precast.WS = {
  275. ammo=gear.WSbullet,
  276. head="Meghanada Visor +2",
  277. neck="Fotia Gorget",
  278. ear1="Moonshade Earring",
  279. ear2="Ishvara Earring",
  280. body="Laksa. Frac +3",
  281. hands="Meg. Gloves +2",
  282. ring1="Regal Ring",
  283. ring2="Dingir Ring",
  284. back=CamulusStand,
  285. waist="Fotia Belt",
  286. legs=HerculeanTrousersStand,
  287. feet="Lanun Bottes +3"}
  288.  
  289. sets.precast.WS.Acc = set_combine(sets.precast.WS, {
  290. neck="Iskur Gorget",
  291. ear2="Telos Earring",
  292. ring2="Hajduk Ring +1",
  293. waist="Kwahu Kachina Belt"})
  294.  
  295. sets.precast.WS['Last Stand'] = sets.precast.WS
  296.  
  297. sets.precast.WS['Last Stand'].Acc = set_combine(sets.precast.WS['Last Stand'], {
  298. neck="Iskur Gorget",
  299. ear2="Telos Earring",
  300. ring2="Hajduk Ring +1",
  301. waist="Kwahu Kachina Belt"})
  302.  
  303. sets.precast.WS['Wildfire'] = {
  304. ammo=gear.MAbullet,
  305. head=HerculeanHelmMAB,
  306. neck="Baetyl Pendant",
  307. ear1="Crematio Earring",
  308. ear2="Friomisi Earring",
  309. body="Laksa. Frac +3", -- Relic +3
  310. hands="Carmine Fin. Ga. +1", -- Herc MAB/WSD
  311. ring1="Ilabrat Ring",
  312. ring2="Dingir Ring",
  313. back=CamulusSalute,
  314. waist="Eschan Stone",
  315. legs=HerculeanTrousersMAB,
  316. feet="Lanun Bottes +3"}
  317.  
  318. sets.precast.WS['Wildfire'].Acc = set_combine(sets.precast.WS['Wildfire'], {
  319. neck="Sanctity Necklace",
  320. ear1="Hermetic Earring"})
  321.  
  322. sets.precast.WS['Leaden Salute'] = set_combine(sets.precast.WS['Wildfire'], {
  323. head="Pixie Hairpin +1",
  324. ear1="Moonshade Earring",
  325. ring1="Archon Ring"})
  326.  
  327. sets.precast.WS['Leaden Salute'].Acc = set_combine(sets.precast.WS['Leaden Salute'], {
  328. neck="Sanctity Necklace",
  329. ear1="Hermetic Earring"})
  330.  
  331. sets.precast.WS['Leaden Salute'].FullTP = {ear1="Crematio Earring", waist="Svelt. Gouriz +1"}
  332.  
  333. sets.precast.WS['Evisceration'] = {
  334. head="Adhemar Bonnet +1",
  335. neck="Fotia Gorget",
  336. ear1="Moonshade Earring",
  337. ear2="Mache Earring +1",
  338. body="Abnoba Kaftan",
  339. hands="Mummu Wrists +2",
  340. ring1="Regal Ring",
  341. ring2="Mummu Ring",
  342. back=CamulusDA,
  343. waist="Fotia Belt",
  344. legs="Samnuha Tights",
  345. feet="Mummu Gamash. +2"}
  346.  
  347. sets.precast.WS['Evisceration'].Acc = set_combine(sets.precast.WS['Evisceration'], {
  348. head="Mummu Bonnet +2",
  349. neck="Combatant's Torque",
  350. ear2="Telos Earring",
  351. body="Mummu Jacket +2",
  352. ring1="Ramuh Ring +1",
  353. ring2="Ramuh Ring +1",
  354. waist="Grunfeld Rope"})
  355.  
  356. sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS, {
  357. head="Lilitu Headpiece",
  358. ring2="Shukuyu Ring",
  359. back=CamulusWSD,
  360. waist="Prosilio Belt +1"})
  361.  
  362. sets.precast.WS['Savage Blade'].Acc = set_combine(sets.precast.WS['Savage Blade'], {
  363. head="Meghanada Visor +2",
  364. neck="Combatant's Torque",
  365. ear2="Telos Earring",
  366. waist="Grunfeld Rope"})
  367.  
  368. sets.precast.WS['Swift Blade'] = set_combine(sets.precast.WS, {
  369. head="Adhemar Bonnet +1",
  370. ear1="Telos Earring",
  371. ear2="Brutal Earring",
  372. body="Adhemar Jacket +1",
  373. ring2="Epona's Ring",
  374. back=CamulusWSD,
  375. legs="Meg. Chausses +2",
  376. feet="Carmine Greaves +1"})
  377.  
  378. sets.precast.WS['Swift Blade'].Acc = set_combine(sets.precast.WS['Swift Blade'], {
  379. head="Meghanada Visor +2",
  380. ear2="Telos Earring",
  381. hands="Meg. Gloves +2"})
  382.  
  383. sets.precast.WS['Aeolian Edge'] = set_combine(sets.precast.WS['Wildfire'], {
  384. ear1="Moonshade Earring",
  385. ring1="Shiva Ring +1"})
  386.  
  387. ------------------------------------------------------------------------------------------------
  388. ---------------------------------------- Midcast Sets ------------------------------------------
  389. ------------------------------------------------------------------------------------------------
  390.  
  391. sets.midcast.FastRecast = sets.precast.FC
  392.  
  393. sets.midcast.SpellInterrupt = {
  394. ring1="Evanescence Ring",
  395. legs="Carmine Cuisses +1"}
  396.  
  397. sets.midcast.Cure = {
  398. neck="Incanter's Torque",
  399. ear2="Mendi. Earring",
  400. ring1="Lebeche Ring",
  401. ring2="Haoma's Ring",
  402. waist="Bishop's Sash"}
  403.  
  404. sets.midcast.Utsusemi = sets.midcast.SpellInterrupt
  405.  
  406. -- Occult Acumen Set
  407. sets.midcast['Dark Magic'] = {
  408. ammo=gear.QDbullet,
  409. head=HerculeanHelmMAB,
  410. neck="Iskur Gorget",
  411. ear1="Dedition Earring",
  412. ear2="Telos Earring",
  413. body="Mummu Jacket +2",
  414. hands=AdhemarWristbandsB,
  415. ring1="Archon Ring",
  416. ring2="Dingir Ring",
  417. back=CamulusRA,
  418. waist="Oneiros Rope",
  419. legs="Chas. Culottes +1",
  420. feet="Carmine Greaves +1"}
  421.  
  422. sets.midcast.CorsairShot = {
  423. ammo=gear.QDbullet,
  424. head=HerculeanHelmMAB,
  425. neck="Baetyl Pendant",
  426. ear1="Crematio Earring",
  427. ear2="Friomisi Earring",
  428. body="Samnuha Coat",
  429. hands="Carmine Fin. Ga. +1",
  430. legs=HerculeanTrousersMAB,
  431. ring1="Fenrir Ring +1",
  432. ring2="Dingir Ring",
  433. back=CamulusSalute,
  434. waist="Eschan Stone",
  435. feet="Lanun Bottes +3"}
  436.  
  437. sets.midcast.CorsairShot.STP = {
  438. ammo=gear.QDbullet,
  439. head="Blood Mask",
  440. neck="Iskur Gorget",
  441. ear1="Dedition Earring",
  442. ear2="Telos Earring",
  443. body="Oshosi Vest",
  444. hands="Schutzen Mittens",
  445. ring1="Ilabrat Ring",
  446. ring2="Rajas Ring",
  447. back=CamulusSTP,
  448. waist="Yemaya Belt",
  449. legs="Chas. Culottes +1",
  450. feet="Carmine Greaves +1"}
  451.  
  452. sets.midcast.CorsairShot.Resistant = set_combine(sets.midcast.CorsairShot, {
  453. head="Carmine Mask +1",
  454. neck="Sanctity Necklace",
  455. ear1="Gwati Earring",
  456. ear2="Digni. Earring",
  457. body="Mummu Jacket +2",
  458. hands="Mummu Wrists +2",
  459. ring1="Mummu Ring",
  460. ring2="Stikini Ring",
  461. waist="Kwahu Kachina Belt",
  462. legs="Mummu Kecks +2",
  463. feet="Mummu Gamash. +2"})
  464.  
  465. sets.midcast.CorsairShot['Light Shot'] = sets.midcast.CorsairShot.Resistant
  466. sets.midcast.CorsairShot['Dark Shot'] = sets.midcast.CorsairShot.Resistant
  467. sets.midcast.CorsairShot.Enhance = {head="Blood Mask", feet="Chass. Bottes +1"}
  468.  
  469. -- Ranged gear
  470. sets.midcast.RA = {
  471. ammo=gear.RAbullet,
  472. head="Meghanada Visor +2",
  473. neck="Iskur Gorget",
  474. ear1="Enervating Earring",
  475. ear2="Telos Earring",
  476. body="Mummu Jacket +2",
  477. hands=AdhemarWristbandsC,
  478. ring1="Ilabrat Ring",
  479. ring2="Dingir Ring",
  480. back=CamulusRA,
  481. waist="Yemaya Belt",
  482. legs=AdhemarKecksC,
  483. feet="Adhemar Gamashes +1"}
  484.  
  485. sets.midcast.RA.Acc = set_combine(sets.midcast.RA, {
  486. body="Laksa. Frac +3",
  487. hands="Meg. Gloves +2",
  488. ring2="Hajduk Ring +1"})
  489.  
  490. sets.midcast.RA.HighAcc = set_combine(sets.midcast.RA.Acc, {
  491. ring1="Regal Ring",
  492. waist="Kwahu Kachina Belt",
  493. legs="Laksa. Trews +3",
  494. feet="Meg. Jam. +2"})
  495.  
  496. sets.midcast.RA.Critical = set_combine(sets.midcast.RA, {
  497. head="Meghanada Visor +2",
  498. body="Meg. Cuirie +2",
  499. hands="Mummu Wrists +2",
  500. legs="Mummu Kecks +2",
  501. feet="Oshosi Leggings",
  502. ring1="Begrudging Ring",
  503. ring2="Mummu Ring",
  504. waist="Kwahu Kachina Belt"})
  505.  
  506. sets.midcast.RA.STP = set_combine(sets.midcast.RA, {
  507. body="Oshosi Vest",
  508. ear1="Dedition Earring",
  509. feet="Carmine Greaves +1"})
  510.  
  511. sets.TripleShot = {
  512. head="Oshosi Mask",
  513. body="Chasseur's Frac +1",
  514. hands="Oshosi Gloves",
  515. legs="Oshosi Trousers",
  516. feet="Oshosi Leggings"} --26
  517.  
  518.  
  519.  
  520. ------------------------------------------------------------------------------------------------
  521. ----------------------------------------- Idle Sets --------------------------------------------
  522. ------------------------------------------------------------------------------------------------
  523. sets.idle = {
  524. ammo=gear.RAbullet,
  525. head="Meghanada Visor +2",
  526. neck="Sanctity Necklace",
  527. ear1="Infused Earring",
  528. ear2="Dawn Earring",
  529. body="Meg. Cuirie +2",
  530. hands="Meg. Gloves +2",
  531. ring1="Sheltered Ring",
  532. ring2="Paguroidea Ring",
  533. back="Moonlight Cape",
  534. waist="Flume Belt +1",
  535. legs="Carmine Cuisses +1",
  536. feet="Meg. Jam. +2"}
  537.  
  538. sets.idle.DT = set_combine(sets.idle, {
  539. head="Carmine Mask +1",
  540. neck="Loricate Torque +1",
  541. ear1="Sanare Earring",
  542. ear2="Hearty Earring",
  543. body=HerculeanVestDT,
  544. hands=HerculeanGlovesPDT,
  545. ring1="Gelatinous Ring +1",
  546. ring2="Defending Ring",
  547. feet=HerculeanBootsDT})
  548.  
  549. sets.idle.Refresh = set_combine(sets.idle, {
  550. --body="Mekosu. Harness",
  551. legs="Rawhide Trousers"})
  552.  
  553. sets.idle.Town = set_combine(sets.idle, {
  554. head="Adhemar Bonnet +1",
  555. neck="Iskur Gorget",
  556. ear1="Suppanomimi",
  557. ear2="Telos Earring",
  558. body="Adhemar Jacket +1",
  559. hands=AdhemarWristbandsB,
  560. ring1="Regal Ring",
  561. ring2="Dingir Ring",
  562. back=CamulusSalute,
  563. waist="Windbuffet Belt +1",
  564. feet="Lanun Bottes +3"})
  565.  
  566.  
  567. ------------------------------------------------------------------------------------------------
  568. ---------------------------------------- Defense Sets ------------------------------------------
  569. ------------------------------------------------------------------------------------------------
  570.  
  571. sets.defense.PDT = sets.idle.DT
  572. sets.defense.MDT = sets.idle.DT
  573.  
  574. sets.Kiting = {legs="Carmine Cuisses +1"}
  575.  
  576.  
  577. ------------------------------------------------------------------------------------------------
  578. ---------------------------------------- Engaged Sets ------------------------------------------
  579. ------------------------------------------------------------------------------------------------
  580.  
  581. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  582. -- sets if more refined versions aren't defined.
  583. -- If you create a set with both offense and defense modes, the offense mode should be first.
  584. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  585.  
  586. sets.engaged = {
  587. head="Adhemar Bonnet +1",
  588. neck="Iskur Gorget",
  589. ear1="Cessance Earring",
  590. ear2="Brutal Earring",
  591. body=HerculeanVestTA,
  592. hands=AdhemarWristbandsB,
  593. ring1="Petrov Ring",
  594. ring2="Epona's Ring",
  595. back=CamulusDA,
  596. waist="Windbuffet Belt +1",
  597. legs="Samnuha Tights",
  598. feet=HerculeanBootsTA}
  599.  
  600. sets.engaged.LowAcc = set_combine(sets.engaged, {
  601. head="Dampening Tam",
  602. neck="Combatant's Torque"})
  603.  
  604. sets.engaged.MidAcc = set_combine(sets.engaged.LowAcc, {
  605. ring1="Ilabrat Ring",
  606. waist="Kentarch Belt +1"})
  607.  
  608. sets.engaged.HighAcc = set_combine(sets.engaged.MidAcc, {
  609. head="Carmine Mask +1",
  610. ear2="Telos Earring",
  611. ring2="Ramuh Ring +1",
  612. legs="Carmine Cuisses +1",
  613. waist="Olseni Belt"})
  614.  
  615. sets.engaged.STP = set_combine(sets.engaged, {
  616. ear1="Dedition Earring",
  617. ring1="Chirich Ring +1",
  618. waist="Kentarch Belt +1",
  619. feet="Carmine Cuisses +1"})
  620.  
  621. -- * DNC Subjob DW Trait: +15%
  622. -- * NIN Subjob DW Trait: +25%
  623.  
  624. -- No Magic Haste (74% DW to cap)
  625. sets.engaged.DW = {
  626. head=HerculeanHelmDW,
  627. neck="Iskur Gorget",
  628. ear1="Eabani Earring",
  629. ear2="Suppanomimi",
  630. body="Adhemar Jacket +1",
  631. hands="Floral Gauntlets",
  632. ring1="Petrov Ring",
  633. ring2="Epona's Ring",
  634. back=CamulusDA,
  635. waist="Reiki Yotai",
  636. legs="Carmine Cuisses +1",
  637. feet="Taeon Boots"} -- 52%
  638.  
  639. sets.engaged.DW.LowAcc = set_combine(sets.engaged.DW, {
  640. neck="Combatant's Torque"})
  641.  
  642. sets.engaged.DW.MidAcc = set_combine(sets.engaged.DW.LowAcc, {
  643. ring1="Ilabrat Ring"})
  644.  
  645. sets.engaged.DW.HighAcc = set_combine(sets.engaged.DW.MidAcc, {})
  646.  
  647. sets.engaged.DW.STP = set_combine(sets.engaged.DW, {
  648. ring1="Ilabrat Ring"})
  649.  
  650. -- 15% Magic Haste (67% DW to cap)
  651. sets.engaged.DW.LowHaste = {
  652. head="Adhemar Bonnet +1",
  653. neck="Iskur Gorget",
  654. ear1="Eabani Earring",
  655. ear2="Suppanomimi",
  656. body="Adhemar Jacket +1",
  657. hands="Floral Gauntlets",
  658. ring1="Petrov Ring",
  659. ring2="Epona's Ring",
  660. back=CamulusDA,
  661. waist="Reiki Yotai",
  662. legs="Carmine Cuisses +1",
  663. feet="Taeon Boots"} -- 52%
  664.  
  665. sets.engaged.DW.LowAcc.LowHaste = set_combine(sets.engaged.DW.LowHaste, {
  666. head="Dampening Tam",
  667. neck="Combatant's Torque"})
  668.  
  669. sets.engaged.DW.MidAcc.LowHaste = set_combine(sets.engaged.DW.LowAcc.LowHaste, {
  670. ring1="Ilabrat Ring"})
  671.  
  672. sets.engaged.DW.HighAcc.LowHaste = set_combine(sets.engaged.DW.MidAcc.LowHaste, {
  673. head="Carmine Mask +1"})
  674.  
  675. sets.engaged.DW.STP.LowHaste = set_combine(sets.engaged.DW.LowHaste, {
  676. ring2="Ilabrat Ring"})
  677.  
  678. -- 30% Magic Haste (56% DW to cap)
  679. sets.engaged.DW.MidHaste = {
  680. head="Adhemar Bonnet +1",
  681. neck="Iskur Gorget",
  682. ear1="Eabani Earring",
  683. ear2="Suppanomimi",
  684. body="Adhemar Jacket +1",
  685. hands=AdhemarWristbandsB,
  686. ring1="Petrov Ring",
  687. ring2="Epona's Ring",
  688. back=CamulusDA,
  689. waist="Reiki Yotai",
  690. legs="Samnuha Tights",
  691. feet="Taeon Boots"} -- 41%
  692.  
  693. sets.engaged.DW.LowAcc.MidHaste = set_combine(sets.engaged.DW.MidHaste, {
  694. head="Dampening Tam",
  695. neck="Combatant's Torque"})
  696.  
  697. sets.engaged.DW.MidAcc.MidHaste = set_combine(sets.engaged.DW.LowAcc.MidHaste, {
  698. ring1="Ilabrat Ring",
  699. legs="Meg. Chausses +2"})
  700.  
  701. sets.engaged.DW.HighAcc.MidHaste = set_combine(sets.engaged.DW.MidAcc.MidHaste, {
  702. head="Carmine Mask +1"})
  703.  
  704. sets.engaged.DW.STP.MidHaste = set_combine(sets.engaged.DW.MidHaste, {
  705. ring1="Ilabrat Ring"})
  706.  
  707. -- 35% Magic Haste (51% DW to cap)
  708. sets.engaged.DW.HighHaste = {} -- 37%
  709. sets.engaged.DW.LowAcc.HighHaste = set_combine(sets.engaged.DW.HighHaste, {})
  710. sets.engaged.DW.MidAcc.HighHaste = set_combine(sets.engaged.DW.LowAcc.HighHaste, {})
  711. sets.engaged.DW.HighAcc.HighHaste = set_combine(sets.engaged.DW.MidAcc.HighHaste, {})
  712. sets.engaged.DW.STP.HighHaste = set_combine(sets.engaged.DW.HighHaste, {})
  713.  
  714. -- 45% Magic Haste (36% DW to cap)
  715. sets.engaged.DW.MaxHaste = {
  716. head="Adhemar Bonnet +1",
  717. neck="Iskur Gorget",
  718. ear1="Telos Earring",
  719. ear2="Suppanomimi",
  720. body="Adhemar Jacket +1",
  721. hands=AdhemarWristbandsB,
  722. ring1="Petrov Ring",
  723. ring2="Epona's Ring",
  724. back=CamulusDA,
  725. waist="Windbuffet Belt +1",
  726. legs="Samnuha Tights",
  727. feet=HerculeanBootsTA} -- 21%
  728.  
  729. sets.engaged.DW.LowAcc.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, {
  730. head="Dampening Tam",
  731. neck="Combatant's Torque"})
  732.  
  733. sets.engaged.DW.MidAcc.MaxHaste = set_combine(sets.engaged.DW.LowAcc.MaxHaste, {
  734. ring1="Ilabrat Ring",
  735. waist="Kentarch Belt +1"})
  736.  
  737. sets.engaged.DW.HighAcc.MaxHaste = set_combine(sets.engaged.DW.MidAcc.MaxHaste, {
  738. head="Carmine Mask +1",
  739. ear2="Cessance Earring",
  740. ring2="Ramuh Ring +1",
  741. legs="Carmine Cuisses +1",
  742. waist="Olseni Belt"})
  743.  
  744. sets.engaged.DW.STP.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, {
  745. ear1="Dedition Earring",
  746. ring1="Chirich Ring +1",
  747. waist="Kentarch Belt +1",
  748. feet="Carmine Cuisses +1"})
  749.  
  750. sets.LessDualWield = {back=CamulusDW}
  751.  
  752. ------------------------------------------------------------------------------------------------
  753. ---------------------------------------- Hybrid Sets -------------------------------------------
  754. ------------------------------------------------------------------------------------------------
  755.  
  756. sets.engaged.Hybrid = {
  757. neck="Loricate Torque +1",
  758. hands=HerculeanGlovesPDT,
  759. ring1="Defending Ring",
  760. feet=HerculeanBootsDT}
  761.  
  762. sets.engaged.DT = set_combine(sets.engaged, sets.engaged.Hybrid)
  763. sets.engaged.LowAcc.DT = set_combine(sets.engaged.LowAcc, sets.engaged.Hybrid)
  764. sets.engaged.MidAcc.DT = set_combine(sets.engaged.MidAcc, sets.engaged.Hybrid)
  765. sets.engaged.HighAcc.DT = set_combine(sets.engaged.HighAcc, sets.engaged.Hybrid)
  766. sets.engaged.STP.DT = set_combine(sets.engaged.STP, sets.engaged.Hybrid)
  767.  
  768. sets.engaged.DW.DT = set_combine(sets.engaged.DW, sets.engaged.Hybrid)
  769. sets.engaged.DW.LowAcc.DT = set_combine(sets.engaged.DW.LowAcc, sets.engaged.Hybrid)
  770. sets.engaged.DW.MidAcc.DT = set_combine(sets.engaged.DW.MidAcc, sets.engaged.Hybrid)
  771. sets.engaged.DW.HighAcc.DT = set_combine(sets.engaged.DW.HighAcc, sets.engaged.Hybrid)
  772. sets.engaged.DW.STP.DT = set_combine(sets.engaged.DW.STP, sets.engaged.Hybrid)
  773.  
  774. sets.engaged.DW.DT.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.Hybrid)
  775. sets.engaged.DW.LowAcc.DT.LowHaste = set_combine(sets.engaged.DW.LowAcc.LowHaste, sets.engaged.Hybrid)
  776. sets.engaged.DW.MidAcc.DT.LowHaste = set_combine(sets.engaged.DW.MidAcc.LowHaste, sets.engaged.Hybrid)
  777. sets.engaged.DW.HighAcc.DT.LowHaste = set_combine(sets.engaged.DW.HighAcc.LowHaste, sets.engaged.Hybrid)
  778. sets.engaged.DW.STP.DT.LowHaste = set_combine(sets.engaged.DW.STP.LowHaste, sets.engaged.Hybrid)
  779.  
  780. sets.engaged.DW.DT.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.Hybrid)
  781. sets.engaged.DW.LowAcc.DT.MidHaste = set_combine(sets.engaged.DW.LowAcc.MidHaste, sets.engaged.Hybrid)
  782. sets.engaged.DW.MidAcc.DT.MidHaste = set_combine(sets.engaged.DW.MidAcc.MidHaste, sets.engaged.Hybrid)
  783. sets.engaged.DW.HighAcc.DT.MidHaste = set_combine(sets.engaged.DW.HighAcc.MidHaste, sets.engaged.Hybrid)
  784. sets.engaged.DW.STP.DT.MidHaste = set_combine(sets.engaged.DW.STP.MidHaste, sets.engaged.Hybrid)
  785.  
  786. sets.engaged.DW.DT.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.Hybrid)
  787. sets.engaged.DW.LowAcc.DT.HighHaste = set_combine(sets.engaged.DW.LowAcc.HighHaste, sets.engaged.Hybrid)
  788. sets.engaged.DW.MidAcc.DT.HighHaste = set_combine(sets.engaged.DW.MidAcc.HighHaste, sets.engaged.Hybrid)
  789. sets.engaged.DW.HighAcc.DT.HighHaste = set_combine(sets.engaged.DW.HighAcc.HighHaste, sets.engaged.Hybrid)
  790. sets.engaged.DW.STP.DT.HighHaste = set_combine(sets.engaged.DW.HighHaste.STP, sets.engaged.Hybrid)
  791.  
  792. sets.engaged.DW.DT.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.Hybrid)
  793. sets.engaged.DW.LowAcc.DT.MaxHaste = set_combine(sets.engaged.DW.LowAcc.MaxHaste, sets.engaged.Hybrid)
  794. sets.engaged.DW.MidAcc.DT.MaxHaste = set_combine(sets.engaged.DW.MidAcc.MaxHaste, sets.engaged.Hybrid)
  795. sets.engaged.DW.HighAcc.DT.MaxHaste = set_combine(sets.engaged.DW.HighAcc.MaxHaste, sets.engaged.Hybrid)
  796. sets.engaged.DW.STP.DT.MaxHaste = set_combine(sets.engaged.DW.STP.MaxHaste, sets.engaged.Hybrid)
  797.  
  798.  
  799. ------------------------------------------------------------------------------------------------
  800. ---------------------------------------- Special Sets ------------------------------------------
  801. ------------------------------------------------------------------------------------------------
  802.  
  803. sets.buff.Doom = {ring1="Eshmun's Ring", ring2="Eshmun's Ring", waist="Gishdubar Sash"}
  804.  
  805. sets.Obi = {waist="Hachirin-no-Obi"}
  806. --sets.CP = {back="Mecisto. Mantle"}
  807. sets.Reive = {neck="Ygnas's Resolve +1"}
  808.  
  809. end
  810.  
  811.  
  812. -------------------------------------------------------------------------------------------------------------------
  813. -- Job-specific hooks for standard casting events.
  814. -------------------------------------------------------------------------------------------------------------------
  815.  
  816. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  817. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  818. function job_precast(spell, action, spellMap, eventArgs)
  819. -- Check that proper ammo is available if we're using ranged attacks or similar.
  820. if spell.action_type == 'Ranged Attack' or spell.type == 'WeaponSkill' or spell.type == 'CorsairShot' then
  821. do_bullet_checks(spell, spellMap, eventArgs)
  822. end
  823.  
  824. -- Gear
  825. if (spell.type == 'CorsairRoll' or spell.english == "Double-Up") then
  826. if player.status ~= 'Engaged' then
  827. equip(sets.precast.CorsairRoll.Gun)
  828. end
  829. if state.LuzafRing.value then
  830. equip(sets.precast.LuzafRing)
  831. end
  832. elseif spell.type == 'CorsairShot' and state.CastingMode.value == 'Resistant' then
  833. classes.CustomClass = 'Acc'
  834. end
  835.  
  836. if spell.english == 'Fold' and buffactive['Bust'] == 2 then
  837. if sets.precast.FoldDoubleBust then
  838. equip(sets.precast.FoldDoubleBust)
  839. eventArgs.handled = true
  840. end
  841. end
  842. if spellMap == 'Utsusemi' then
  843. if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
  844. cancel_spell()
  845. add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
  846. eventArgs.handled = true
  847. return
  848. elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
  849. send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
  850. end
  851. end
  852. end
  853.  
  854. function job_post_precast(spell, action, spellMap, eventArgs)
  855. if (spell.type == 'CorsairRoll' or spell.english == "Double-Up") then
  856. if player.status ~= 'Engaged' then
  857. equip(sets.precast.CorsairRoll.Gun)
  858. end
  859. elseif spell.action_type == 'Ranged Attack' then
  860. if flurry == 2 then
  861. equip(sets.precast.RA.Flurry2)
  862. elseif flurry == 1 then
  863. equip(sets.precast.RA.Flurry1)
  864. end
  865. -- Equip obi if weather/day matches for WS.
  866. elseif spell.type == 'WeaponSkill' then
  867. if spell.english == 'Leaden Salute' then
  868. if world.weather_element == 'Dark' or world.day_element == 'Dark' then
  869. equip(sets.Obi)
  870. end
  871. if player.tp > 2500 then
  872. equip(sets.precast.WS['Leaden Salute'].FullTP)
  873. end
  874. elseif spell.english == 'Wildfire' and (world.weather_element == 'Fire' or world.day_element == 'Fire') then
  875. equip(sets.Obi)
  876. end
  877. end
  878. end
  879.  
  880. function job_post_midcast(spell, action, spellMap, eventArgs)
  881. -- Equip obi if weather/day matches for Quick Draw.
  882. if spell.type == 'CorsairShot' then
  883. if (spell.element == world.day_element or spell.element == world.weather_element) and
  884. (spell.english ~= 'Light Shot' and spell.english ~= 'Dark Shot') then
  885. equip(sets.Obi)
  886. end
  887. if state.QDMode.value == 'Magic Enhance' then
  888. equip(sets.midcast.CorsairShot.Enhance)
  889. elseif state.QDMode.value == 'STP' then
  890. equip(sets.midcast.CorsairShot.STP)
  891. end
  892. elseif spell.action_type == 'Ranged Attack' and buffactive['Triple Shot'] then
  893. equip(sets.TripleShot)
  894. end
  895. end
  896.  
  897. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  898. function job_aftercast(spell, action, spellMap, eventArgs)
  899. if spell.type == 'CorsairRoll' and not spell.interrupted then
  900. display_roll_info(spell)
  901. end
  902. if spell.english == "Light Shot" then
  903. send_command('@timers c "Light Shot ['..spell.target.name..']" 60 down abilities/00195.png')
  904. end
  905. end
  906.  
  907. function job_buff_change(buff,gain)
  908. -- If we gain or lose any haste buffs, adjust gear.
  909. if S{'haste', 'march', 'mighty guard', 'embrava', 'haste samba', 'geo-haste', 'indi-haste'}:contains(buff:lower()) then
  910. determine_haste_group()
  911. customize_melee_set()
  912. if not gain then
  913. haste = nil
  914. --add_to_chat(122, "Haste Status: Cleared")
  915. end
  916. if not midaction() then
  917. handle_equipping_gear(player.status)
  918. end
  919. end
  920.  
  921. -- If we gain or lose any flurry buffs, adjust gear.
  922. if S{'flurry'}:contains(buff:lower()) then
  923. if not gain then
  924. flurry = nil
  925. --add_to_chat(122, "Flurry status cleared.")
  926. end
  927. if not midaction() then
  928. handle_equipping_gear(player.status)
  929. end
  930. end
  931.  
  932. -- if buffactive['Reive Mark'] then
  933. -- if gain then
  934. -- equip(sets.Reive)
  935. -- disable('neck')
  936. -- else
  937. -- enable('neck')
  938. -- end
  939. -- end
  940.  
  941. if buff == "doom" then
  942. if gain then
  943. equip(sets.buff.Doom)
  944. --send_command('@input /p Doomed.')
  945. disable('ring1','ring2','waist')
  946. else
  947. enable('ring1','ring2','waist')
  948. handle_equipping_gear(player.status)
  949. end
  950. end
  951.  
  952. end
  953.  
  954. -- Handle notifications of general user state change.
  955. function job_state_change(stateField, newValue, oldValue)
  956. if state.WeaponLock.value == true then
  957. disable('ranged')
  958. else
  959. enable('ranged')
  960. end
  961. end
  962.  
  963. -------------------------------------------------------------------------------------------------------------------
  964. -- User code that supplements standard library decisions.
  965. -------------------------------------------------------------------------------------------------------------------
  966.  
  967. -- Called by the 'update' self-command, for common needs.
  968. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  969. function job_update(cmdParams, eventArgs)
  970. update_offense_mode()
  971. determine_haste_group()
  972. end
  973.  
  974. -- Modify the default idle set after it was constructed.
  975. function customize_idle_set(idleSet)
  976. if state.Gun.current == 'Fomalhaut' then
  977. equip({ranged="Fomalhaut"})
  978. elseif state.Gun.current == 'Anarchy +2' then
  979. equip({ranged="Anarchy +2"})
  980. --if state.Gun.current == 'Death Penalty' then
  981. --equip({ranged="Death Penalty"})
  982. --elseif state.Gun.current == 'Armageddon' then
  983. --equip({ranged="Armageddon"})
  984. end
  985.  
  986. --if state.CP.current == 'on' then
  987. --equip(sets.CP)
  988. --disable('back')
  989. --else
  990. --enable('back')
  991. --end
  992. return idleSet
  993. end
  994.  
  995. -- Modify the default melee set after it was constructed.
  996. function customize_melee_set(meleeSet)
  997. if state.DualWield.value == true and player.sub_job == 'DNC' then
  998. meleeSet = set_combine(meleeSet, sets.LessDualWield)
  999. end
  1000.  
  1001. return meleeSet
  1002. end
  1003.  
  1004. -- Handle auto-targetting based on local setup.
  1005. function job_auto_change_target(spell, action, spellMap, eventArgs)
  1006. if spell.type == 'CorsairShot' then
  1007. if state.IgnoreTargetting.value == true then
  1008. state.IgnoreTargetting:reset()
  1009. eventArgs.handled = true
  1010. end
  1011.  
  1012. eventArgs.SelectNPCTargets = state.SelectqdTarget.value
  1013. end
  1014. end
  1015.  
  1016. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  1017. function display_current_job_state(eventArgs)
  1018. local msg = ''
  1019.  
  1020. msg = msg .. '[ Offense/Ranged: '..state.OffenseMode.current
  1021.  
  1022. if state.HybridMode.value ~= 'Normal' then
  1023. msg = msg .. '/' .. state.HybridMode.value
  1024. end
  1025.  
  1026. msg = msg .. '/' ..state.RangedMode.current .. ' ]'
  1027.  
  1028. if state.WeaponskillMode.value ~= 'Normal' then
  1029. msg = msg .. '[ WS: '..state.WeaponskillMode.current .. ' ]'
  1030. end
  1031.  
  1032. if state.DefenseMode.value ~= 'None' then
  1033. msg = msg .. '[ Defense: ' .. state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ' ]'
  1034. end
  1035.  
  1036. if state.Kiting.value then
  1037. msg = msg .. '[ Kiting Mode: ON ]'
  1038. end
  1039.  
  1040. msg = msg .. '[ *'..state.Mainqd.current
  1041.  
  1042. if state.UseAltqd.value == true then
  1043. msg = msg .. '/'..state.Altqd.current
  1044. end
  1045.  
  1046. msg = msg .. ' ('
  1047.  
  1048. if state.QDMode.value then
  1049. msg = msg .. state.QDMode.current .. ') '
  1050. end
  1051.  
  1052. msg = msg .. ']'
  1053.  
  1054. add_to_chat(122, msg)
  1055.  
  1056. eventArgs.handled = true
  1057. end
  1058.  
  1059. -------------------------------------------------------------------------------------------------------------------
  1060. -- User self-commands.
  1061. -------------------------------------------------------------------------------------------------------------------
  1062.  
  1063. -- Called for custom player commands.
  1064. function job_self_command(cmdParams, eventArgs)
  1065. if cmdParams[1] == 'qd' then
  1066. if cmdParams[2] == 't' then
  1067. state.IgnoreTargetting:set()
  1068. end
  1069.  
  1070. local doqd = ''
  1071. if state.UseAltqd.value == true then
  1072. doqd = state[state.Currentqd.current..'qd'].current
  1073. state.Currentqd:cycle()
  1074. else
  1075. doqd = state.Mainqd.current
  1076. end
  1077. send_command('@input /ja "'..doqd..'" <t>')
  1078. end
  1079. command = cmdParams[1]:lower()
  1080. if command == 'warpring' then
  1081. equip({left_ring="Warp Ring"})
  1082. 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')
  1083. end
  1084. end
  1085.  
  1086.  
  1087. -------------------------------------------------------------------------------------------------------------------
  1088. -- Utility functions specific to this job.
  1089. -------------------------------------------------------------------------------------------------------------------
  1090.  
  1091. --Read incoming packet to differentiate between Haste/Flurry I and II
  1092. windower.register_event('action',
  1093. function(act)
  1094. --check if you are a target of spell
  1095. local actionTargets = act.targets
  1096. playerId = windower.ffxi.get_player().id
  1097. isTarget = false
  1098. for _, target in ipairs(actionTargets) do
  1099. if playerId == target.id then
  1100. isTarget = true
  1101. end
  1102. end
  1103. if isTarget == true then
  1104. if act.category == 4 then
  1105. local param = act.param
  1106. if param == 845 and flurry ~= 2 then
  1107. --add_to_chat(122, 'Flurry Status: Flurry I')
  1108. flurry = 1
  1109. elseif param == 846 then
  1110. --add_to_chat(122, 'Flurry Status: Flurry II')
  1111. flurry = 2
  1112. elseif param == 57 and haste ~=2 then
  1113. --add_to_chat(122, 'Haste Status: Haste I (Haste)')
  1114. haste = 1
  1115. elseif param == 511 then
  1116. --add_to_chat(122, 'Haste Status: Haste II (Haste II)')
  1117. haste = 2
  1118. end
  1119. elseif act.category == 5 then
  1120. if act.param == 5389 then
  1121. --add_to_chat(122, 'Haste Status: Haste II (Spy Drink)')
  1122. haste = 2
  1123. end
  1124. elseif act.category == 13 then
  1125. local param = act.param
  1126. --595 haste 1 -602 hastega 2
  1127. if param == 595 and haste ~=2 then
  1128. --add_to_chat(122, 'Haste Status: Haste I (Hastega)')
  1129. haste = 1
  1130. elseif param == 602 then
  1131. --add_to_chat(122, 'Haste Status: Haste II (Hastega2)')
  1132. haste = 2
  1133. end
  1134. end
  1135. end
  1136. end)
  1137.  
  1138. function determine_haste_group()
  1139.  
  1140. -- Assuming the following values:
  1141.  
  1142. -- Haste - 15%
  1143. -- Haste II - 30%
  1144. -- Haste Samba - 5%
  1145. -- Honor March - 15%
  1146. -- Victory March - 25%
  1147. -- Advancing March - 15%
  1148. -- Embrava - 25%
  1149. -- Mighty Guard (buffactive[604]) - 15%
  1150. -- Geo-Haste (buffactive[580]) - 30%
  1151.  
  1152. classes.CustomMeleeGroups:clear()
  1153.  
  1154. if state.CombatForm.value == 'DW' then
  1155.  
  1156. if (haste == 2 and (buffactive[580] or buffactive.march or buffactive.embrava or buffactive[604])) or
  1157. (haste == 1 and (buffactive[580] or buffactive.march == 2 or (buffactive.embrava and buffactive['haste samba']) or (buffactive.march and buffactive[604]))) or
  1158. (buffactive[580] and (buffactive.march or buffactive.embrava or buffactive[604])) or
  1159. (buffactive.march == 2 and (buffactive.embrava or buffactive[604])) or
  1160. (buffactive.march and (buffactive.embrava and buffactive['haste samba'])) then
  1161. --add_to_chat(122, 'Magic Haste Level: 43%')
  1162. classes.CustomMeleeGroups:append('MaxHaste')
  1163. state.DualWield:set()
  1164. elseif ((haste == 2 or buffactive[580] or buffactive.march == 2) and buffactive['haste samba']) or
  1165. (haste == 1 and buffactive['haste samba'] and (buffactive.march or buffactive[604])) or
  1166. (buffactive.march and buffactive['haste samba'] and buffactive[604]) then
  1167. --add_to_chat(122, 'Magic Haste Level: 35%')
  1168. classes.CustomMeleeGroups:append('HighHaste')
  1169. state.DualWield:set()
  1170. elseif (haste == 2 or buffactive[580] or buffactive.march == 2 or (buffactive.embrava and buffactive['haste samba']) or
  1171. (haste == 1 and (buffactive.march or buffactive[604])) or (buffactive.march and buffactive[604])) then
  1172. --add_to_chat(122, 'Magic Haste Level: 30%')
  1173. classes.CustomMeleeGroups:append('MidHaste')
  1174. state.DualWield:set()
  1175. elseif (haste == 1 or buffactive.march or buffactive[604] or buffactive.embrava) then
  1176. --add_to_chat(122, 'Magic Haste Level: 15%')
  1177. classes.CustomMeleeGroups:append('LowHaste')
  1178. state.DualWield:set()
  1179. else
  1180. state.DualWield:set(false)
  1181. end
  1182. end
  1183. end
  1184.  
  1185.  
  1186. function define_roll_values()
  1187. rolls = {
  1188. ["Corsair's Roll"] = {lucky=5, unlucky=9, bonus="Experience Points"},
  1189. ["Ninja Roll"] = {lucky=4, unlucky=8, bonus="Evasion"},
  1190. ["Hunter's Roll"] = {lucky=4, unlucky=8, bonus="Accuracy"},
  1191. ["Chaos Roll"] = {lucky=4, unlucky=8, bonus="Attack"},
  1192. ["Magus's Roll"] = {lucky=2, unlucky=6, bonus="Magic Defense"},
  1193. ["Healer's Roll"] = {lucky=3, unlucky=7, bonus="Cure Potency Received"},
  1194. ["Drachen Roll"] = {lucky=4, unlucky=8, bonus="Pet Magic Accuracy/Attack"},
  1195. ["Choral Roll"] = {lucky=2, unlucky=6, bonus="Spell Interruption Rate"},
  1196. ["Monk's Roll"] = {lucky=3, unlucky=7, bonus="Subtle Blow"},
  1197. ["Beast Roll"] = {lucky=4, unlucky=8, bonus="Pet Attack"},
  1198. ["Samurai Roll"] = {lucky=2, unlucky=6, bonus="Store TP"},
  1199. ["Evoker's Roll"] = {lucky=5, unlucky=9, bonus="Refresh"},
  1200. ["Rogue's Roll"] = {lucky=5, unlucky=9, bonus="Critical Hit Rate"},
  1201. ["Warlock's Roll"] = {lucky=4, unlucky=8, bonus="Magic Accuracy"},
  1202. ["Fighter's Roll"] = {lucky=5, unlucky=9, bonus="Double Attack Rate"},
  1203. ["Puppet Roll"] = {lucky=3, unlucky=7, bonus="Pet Magic Attack/Accuracy"},
  1204. ["Gallant's Roll"] = {lucky=3, unlucky=7, bonus="Defense"},
  1205. ["Wizard's Roll"] = {lucky=5, unlucky=9, bonus="Magic Attack"},
  1206. ["Dancer's Roll"] = {lucky=3, unlucky=7, bonus="Regen"},
  1207. ["Scholar's Roll"] = {lucky=2, unlucky=6, bonus="Conserve MP"},
  1208. ["Naturalist's Roll"] = {lucky=3, unlucky=7, bonus="Enh. Magic Duration"},
  1209. ["Runeist's Roll"] = {lucky=4, unlucky=8, bonus="Magic Evasion"},
  1210. ["Bolter's Roll"] = {lucky=3, unlucky=9, bonus="Movement Speed"},
  1211. ["Caster's Roll"] = {lucky=2, unlucky=7, bonus="Fast Cast"},
  1212. ["Courser's Roll"] = {lucky=3, unlucky=9, bonus="Snapshot"},
  1213. ["Blitzer's Roll"] = {lucky=4, unlucky=9, bonus="Attack Delay"},
  1214. ["Tactician's Roll"] = {lucky=5, unlucky=8, bonus="Regain"},
  1215. ["Allies' Roll"] = {lucky=3, unlucky=10, bonus="Skillchain Damage"},
  1216. ["Miser's Roll"] = {lucky=5, unlucky=7, bonus="Save TP"},
  1217. ["Companion's Roll"] = {lucky=2, unlucky=10, bonus="Pet Regain and Regen"},
  1218. ["Avenger's Roll"] = {lucky=4, unlucky=8, bonus="Counter Rate"},
  1219. }
  1220. end
  1221.  
  1222. function display_roll_info(spell)
  1223. rollinfo = rolls[spell.english]
  1224. local rollsize = (state.LuzafRing.value and 'Large') or 'Small'
  1225.  
  1226. if rollinfo then
  1227. add_to_chat(122, '[ Lucky: '..tostring(rollinfo.lucky)..' / Unlucky: '..tostring(rollinfo.unlucky)..' ] '..spell.english..': '..rollinfo.bonus..' ('..rollsize..') ')
  1228. end
  1229. end
  1230.  
  1231.  
  1232. -- Determine whether we have sufficient ammo for the action being attempted.
  1233. function do_bullet_checks(spell, spellMap, eventArgs)
  1234. local bullet_name
  1235. local bullet_min_count = 1
  1236.  
  1237. if spell.type == 'WeaponSkill' then
  1238. if spell.skill == "Marksmanship" then
  1239. if spell.english == 'Wildfire' or spell.english == 'Leaden Salute' then
  1240. -- magical weaponskills
  1241. bullet_name = gear.MAbullet
  1242. else
  1243. -- physical weaponskills
  1244. bullet_name = gear.WSbullet
  1245. end
  1246. else
  1247. -- Ignore non-ranged weaponskills
  1248. return
  1249. end
  1250. elseif spell.type == 'CorsairShot' then
  1251. bullet_name = gear.QDbullet
  1252. elseif spell.action_type == 'Ranged Attack' then
  1253. bullet_name = gear.RAbullet
  1254. if buffactive['Triple Shot'] then
  1255. bullet_min_count = 3
  1256. end
  1257. end
  1258.  
  1259. local available_bullets = player.inventory[bullet_name] or player.wardrobe[bullet_name]
  1260.  
  1261. -- If no ammo is available, give appropriate warning and end.
  1262. if not available_bullets then
  1263. if spell.type == 'CorsairShot' and player.equipment.ammo ~= 'empty' then
  1264. add_to_chat(123, 'No Quick Draw ammo left. Using what\'s currently equipped ('..player.equipment.ammo..').')
  1265. return
  1266. elseif spell.type == 'WeaponSkill' and player.equipment.ammo == gear.RAbullet then
  1267. add_to_chat(123, 'No weaponskill ammo left. Using what\'s currently equipped (standard ranged bullets: '..player.equipment.ammo..').')
  1268. return
  1269. else
  1270. add_to_chat(123, 'No ammo ('..tostring(bullet_name)..') available for that action.')
  1271. eventArgs.cancel = true
  1272. return
  1273. end
  1274. end
  1275.  
  1276. -- Don't allow shooting or weaponskilling with ammo reserved for quick draw.
  1277. if spell.type ~= 'CorsairShot' and bullet_name == gear.QDbullet and available_bullets.count <= bullet_min_count then
  1278. add_to_chat(123, 'No ammo will be left for Quick Draw. Cancelling.')
  1279. eventArgs.cancel = true
  1280. return
  1281. end
  1282.  
  1283. -- Low ammo warning.
  1284. if spell.type ~= 'CorsairShot' and state.warned.value == false
  1285. and available_bullets.count > 1 and available_bullets.count <= options.ammo_warning_limit then
  1286. local msg = '***** LOW AMMO WARNING: '..bullet_name..' *****'
  1287. --local border = string.repeat("*", #msg)
  1288. local border = ""
  1289. for i = 1, #msg do
  1290. border = border .. "*"
  1291. end
  1292.  
  1293. add_to_chat(123, border)
  1294. add_to_chat(123, msg)
  1295. add_to_chat(123, border)
  1296.  
  1297. state.warned:set()
  1298. elseif available_bullets.count > options.ammo_warning_limit and state.warned then
  1299. state.warned:reset()
  1300. end
  1301. end
  1302.  
  1303. function update_offense_mode()
  1304. if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  1305. state.CombatForm:set('DW')
  1306. else
  1307. state.CombatForm:reset()
  1308. end
  1309. end
  1310.  
  1311. -- Select default macro book on initial load or subjob change.
  1312. function select_default_macro_book()
  1313. if player.sub_job == 'NIN' then
  1314. set_macro_page(1, 11)
  1315. elseif player.sub_job == 'WAR' then
  1316. set_macro_page(2, 11)
  1317. else
  1318. set_macro_page(1, 11)
  1319. end
  1320. end
  1321.  
  1322. function set_lockstyle()
  1323. send_command('wait 2; input /lockstyleset ' .. lockstyleset)
  1324. end
Add Comment
Please, Sign In to add comment