midash

Wonderousgoat_COR

Mar 5th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.76 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Initialization function that defines sets and variables to be used.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- IMPORTANT: Make sure to also get the Mote-Include.lua file to go with this.
  6.  
  7. --[[
  8. gs c toggle luzaf -- Toggles use of Luzaf Ring on and off
  9.  
  10. Offense mode is melee or ranged. Used ranged offense mode if you are engaged
  11. for ranged weaponskills, but not actually meleeing.
  12. Acc on offense mode (which is intended for melee) will currently use .Acc weaponskill
  13. mode for both melee and ranged weaponskills. Need to fix that in core.
  14. --]]
  15.  
  16.  
  17. -- Initialization function for this job file.
  18. function get_sets()
  19. -- Load and initialize the include file.
  20. mote_include_version = 2
  21. include('Mote-Include.lua')
  22. include('organizer-lib')
  23. end
  24.  
  25. -- Setup vars that are user-independent.
  26. function job_setup()
  27. -- Whether to use Luzaf's Ring
  28. state.LuzafRing = M(false, "Luzaf's Ring")
  29. state.warned = M(false)
  30. state.CapacityMode = M(false, 'Capacity Point Mantle')
  31.  
  32. define_roll_values()
  33. end
  34.  
  35.  
  36. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  37. function user_setup()
  38. state.OffenseMode:options('Normal', 'Melee', 'Acc')
  39. state.RangedMode:options('Normal', 'Acc')
  40. state.WeaponskillMode:options('Normal', 'Acc')
  41. state.PhysicalDefenseMode:options('PDT')
  42.  
  43. gear.RAbullet = "Decimating Bullet"
  44. gear.WSbullet = "Decimating Bullet"
  45. gear.MAbullet = "Decimating Bullet"
  46. gear.QDbullet = "Animikii Bullet"
  47. --gear.QDbullet = "Adlivun Bullet"
  48. options.ammo_warning_limit = 15
  49.  
  50. state.AutoRA = M{['description']='Auto RA', 'Normal', 'Shoot', 'WS' }
  51.  
  52. cor_sub_weapons = S{"Fettering Blade", "Vanir Knife", "Sabebus", "Aphotic Kukri", "Atoyac", "Surcouf's Jambiya"}
  53. auto_gun_ws = "Wildfire"
  54.  
  55. get_combat_form()
  56. -- Additional local binds
  57. -- Cor doesn't use hybrid Defense mode; using that for ranged mode adjustments.
  58. send_command('bind ^` input /ja "Double-up" <me>')
  59. send_command('bind !` input /ja "Bolter\'s Roll" <me>')
  60. send_command('bind != gs c toggle CapacityMode')
  61.  
  62. send_command('bind ^- gs c cycle AutoRA')
  63. select_default_macro_book()
  64. end
  65.  
  66.  
  67. -- Called when this job file is unloaded (eg: job change)
  68. function job_file_unload()
  69. send_command('unbind ^`')
  70. send_command('unbind !=')
  71. send_command('unbind !`')
  72. send_command('unbind ^-')
  73. end
  74.  
  75. -- Define sets and vars used by this job file.
  76. function init_gear_sets()
  77. --------------------------------------
  78. -- Start defining the sets
  79. --------------------------------------
  80.  
  81. -- Precast Sets
  82.  
  83. -- Precast sets to enhance JAs
  84.  
  85. sets.precast.JA['Triple Shot'] = {body="Navarch's Frac +2"}
  86. sets.precast.JA['Snake Eye'] = {legs="Commodore Culottes +1"}
  87. sets.precast.JA['Wild Card'] = {feet="Lanun Bottes"}
  88. sets.precast.JA['Random Deal'] = {body="Commodore Frac"}
  89. sets.precast.JA['Fold'] = {hands="Commodore Gants +2"}
  90. sets.CapacityMantle = {back="Mecistopins Mantle"}
  91.  
  92. sets.precast.CorsairRoll = {
  93. head="Commodore Tricorne",
  94. hands="Navarch's Gants +2",
  95. body="Commodore Frac",
  96. ring1="Merirosvo Ring",
  97. back="Gunslinger's Cape"
  98. }
  99.  
  100.  
  101. sets.precast.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="Navarch's Culottes +2"})
  102. sets.precast.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="Navarch's Bottes +2"})
  103. sets.precast.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="Navarch's Tricorne +2"})
  104. sets.precast.CorsairRoll["Tactician's Roll"] = set_combine(sets.precast.CorsairRoll, {body="Navarch's Frac +2"})
  105. sets.precast.CorsairRoll["Allies' Roll"] = set_combine(sets.precast.CorsairRoll, {hands="Navarch's Gants +2"})
  106.  
  107. sets.precast.LuzafRing = {ring2="Luzaf's Ring"}
  108. --sets.precast.FoldDoubleBust = {hands="Lanun Gants"}
  109.  
  110. sets.precast.CorsairShot = {}
  111.  
  112.  
  113. -- Waltz set (chr and vit)
  114. sets.precast.Waltz = {
  115. head="Whirlpool Mask",
  116. hands="Iuitl Wristbands +1",
  117. legs="Adhemar Kecks",
  118. }
  119.  
  120. sets.Organizer = {
  121. main="Fettering Blade",
  122. sub="Demersal Degan +1",
  123. range="Holliday",
  124. hands="Compensator",
  125. ammo="Legion Scutum"
  126. }
  127.  
  128. -- Don't need any special gear for Healing Waltz.
  129. sets.precast.Waltz['Healing Waltz'] = {}
  130.  
  131. -- Fast cast sets for spells
  132.  
  133. sets.precast.FC = {
  134. --ammo="Impatiens",
  135. head="Taeon Chapeau",ear2="Loquacious Earring",ring1="Prolix Ring",ring2="Weather. Ring",
  136. hands="Leyline Gloves"
  137. }
  138.  
  139. sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})
  140.  
  141. sets.precast.RA = {
  142. ammo=gear.RAbullet,
  143. hands="Iuitl Wristbands +1",
  144. back="Navarch's Mantle",
  145. body="Pursuer's Doublet",
  146. waist="Impulse Belt",
  147. legs="Adhemar Kecks",
  148. feet="Wurrukatte Boots"
  149.  
  150. }
  151.  
  152. -- Weaponskill sets
  153. -- Default set for any weaponskill that isn't any more specifically defined
  154. sets.precast.WS = {
  155. head="Lanun Tricorne +1",
  156. neck="Fotia Gorget",
  157. ear1="Flame Pearl",
  158. ear2="Flame Pearl",
  159. body="Pursuer's Doublet",
  160. hands="Pursuer's Cuffs",
  161. ring1="Karieyh Ring",
  162. ring2="Ifrit Ring",
  163. back="Buquwik Cape",
  164. waist="Fotia Belt",
  165. legs="Adhemar Kecks",
  166. feet="Lanun Bottes"
  167. }
  168.  
  169.  
  170. -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
  171. sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS, { ear2="Moonshade Earring"})
  172.  
  173. sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {legs="Samnuha Tights"})
  174.  
  175. sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {ear2="Moonshade Earring", legs="Samnuha Tights"})
  176.  
  177. sets.precast.WS['Last Stand'] = set_combine(sets.precast.WS, {
  178. ammo=gear.WSbullet,
  179. ear1="Flame Pearl",
  180. ear2="Moonshade Earring",
  181. })
  182. sets.precast.WS['Last Stand'].Acc = set_combine(sets.precast.WS['Last Stand'], {
  183. ammo=gear.WSbullet,
  184. ear1="Enervating Earring",
  185. ear2="Moonshade Earring",
  186. back="Buquwik Cape",
  187. ring1="Karieyh Ring",
  188. ring2="Garuda Ring"
  189. })
  190.  
  191. sets.precast.WS['Wildfire'] = {
  192. ammo=gear.MAbullet,
  193. head="Lanun Tricorne +1",
  194. neck="Stoicheion Medal",
  195. ear1="Crematio Earring",
  196. ear2="Friomisi Earring",
  197. body="Samnuha Coat",
  198. hands="Leyline Gloves",
  199. ring1="Karieyh Ring",
  200. ring2="Garuda Ring",
  201. back="Gunslinger's Cape",
  202. waist="Aquiline Belt",
  203. legs="Shneddick Tights +1",
  204. feet="Lanun Bottes"
  205. }
  206.  
  207. sets.precast.WS['Leaden Salute'] = set_combine(sets.precast.WS['Wildfire'], { ear2="Moonshade Earring"})
  208.  
  209. -- Midcast Sets
  210. sets.midcast.FastRecast = {
  211. head="Uk'uxkaj Cap",
  212. neck="Stoicheion Medal",
  213. hands="Iuitl Wristbands +1",
  214. ear1="Psystorm Earring",
  215. ear2="Lifestorm Earring",
  216. body="Pursuer's Doublet",
  217. back="Gunslinger's Cape",
  218. ring1="Globidonta Ring",
  219. ring2="Sangoma Ring",
  220. legs="Adhemar Kecks",
  221. waist="Aquiline Belt",
  222. }
  223.  
  224. -- Specific spells
  225. sets.midcast.Utsusemi = sets.midcast.FastRecast
  226.  
  227. sets.midcast.CorsairShot = {
  228. ammo=gear.QDbullet,
  229. head="Umbani Cap",
  230. neck="Stoicheion Medal",
  231. ear1="Friomisi Earring",
  232. ear2="Crematio Earring",
  233. body="Samnhua Coat",
  234. hands="Leyline Gloves",
  235. ring1="Acumen Ring",
  236. ring2="Garuda Ring",
  237. back="Gunslinger's Cape",
  238. waist="Aquiline Belt",
  239. legs="Shneddick Tights +1",
  240. feet="Lanun Bottes"
  241. }
  242.  
  243. sets.midcast.CorsairShot.Acc = set_combine(sets.midcast.CorsairShot, {
  244. body="Mekosuchinae Harness",
  245. ear1="Lifestorm Earring",
  246. ear2="Psystorm Earring",
  247. ring1="Weather. Ring",
  248. ring2="Sangoma Ring",
  249. feet="Navarch's Bottes +2"
  250. })
  251.  
  252. sets.midcast.CorsairShot['Light Shot'] = sets.midcast.CorsairShot.Acc
  253. sets.midcast.CorsairShot['Dark Shot'] = sets.midcast.CorsairShot['Light Shot']
  254.  
  255. -- Ranged gear
  256. sets.midcast.RA = {
  257. ammo=gear.RAbullet,
  258. head="Umbani Cap",
  259. neck="Iqabi Necklace",
  260. ear1="Enervating Earring",
  261. ear2="Volley Earring",
  262. body="Pursuer's Doublet",
  263. hands="Alruna's Gloves +1",
  264. ring1="Rajas Ring",
  265. ring2="Hajduk Ring",
  266. back="Gunslinger's Cape",
  267. waist="Elanid Belt",
  268. legs="Adhemar Kecks",
  269. feet="Scopuli Nails +1"
  270. }
  271.  
  272. sets.midcast.RA.Acc = set_combine(sets.midcast.RA, {
  273. body="Pursuer's Doublet",
  274. ring1="Paqichikaji Ring",
  275. hands="Floral Gauntlets",
  276. waist="Elanid Belt"
  277. })
  278.  
  279. -- Sets to return to when not performing an action.
  280.  
  281. -- Resting sets
  282. sets.resting = {ring2="Paguroidea Ring"}
  283.  
  284. -- Idle sets
  285. sets.idle = {
  286. ammo=gear.RAbullet,
  287. head="Herculean Helm",
  288. neck="Loricate Torque +1",
  289. back="Solemnity Cape",
  290. ear1="Genmei Earring",
  291. ear2="Crematio Earring",
  292. body="Emet Harness +1",
  293. hands="Herculean Gloves",
  294. ring1="Defending Ring",
  295. ring2="Dark Ring",
  296. waist="Lieutenant's Sash",
  297. legs="Carmine Cuisses +1",
  298. feet="Carmine Greaves +1"
  299. }
  300. sets.idle.Regen = set_combine(sets.idle, {
  301. head="Ocelomeh Headpiece +1",
  302. body="Kheper jacket",
  303. })
  304.  
  305. sets.idle.Town = {
  306. ammo=gear.RAbullet,
  307. head="Lanun Tricorne +1",
  308. neck="Loricate Torque +1",
  309. ear1="Enervating Earring",
  310. ear2="Crematio Earring",
  311. body="Pursuer's Doublet",
  312. hands="Alruna's Gloves +1",
  313. ring1="Ifrit Ring",
  314. ring2="Karieyh Ring",
  315. back="Gunslinger's Cape",
  316. waist="Flume Belt",
  317. legs="Adhemar Kecks",
  318. feet="Skadi's Jambeaux +1"
  319. }
  320.  
  321. -- Defense sets
  322. sets.defense.PDT = set_combine(sets.idle, {
  323. head="Lithelimb Cap",
  324. neck="Loricate Torque +1",
  325. hands="Iuitl Wristbands +1",
  326. body="Emet Harness +1",
  327. ring1="Patricius Ring",
  328. ring2="Dark Ring",
  329. back="Solemnity Cape",
  330. waist="Flume Belt",
  331. legs="Iuitl Tights +1",
  332. feet="Lanun Bottes"
  333. })
  334.  
  335. sets.defense.MDT = sets.defense.PDT
  336.  
  337. sets.Kiting = {feet="Skadi's Jambeaux +1"}
  338.  
  339. -- Engaged sets
  340.  
  341. -- Variations for TP weapon and (optional) offense/Defense modes. Code will fall back on previous
  342. -- sets if more refined versions aren't defined.
  343. -- If you create a set with both offense and Defense modes, the offense mode should be first.
  344. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  345.  
  346. sets.engaged = {
  347. ammo=gear.RAbullet,
  348. head="Dampening Tam",
  349. neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  350. body={ name="Herculean Vest", augments={'Accuracy+20 Attack+20','"Triple Atk."+3','AGI+8','Accuracy+14','Attack+11',}},
  351. hands={ name="Herculean Gloves", augments={'"Triple Atk."+4','DEX+4',}},
  352. ring1="Hetairoi Ring",ring2="Epona's Ring",
  353. back="Atheling Mantle",waist="Windbuffet Belt +1",
  354. legs="Samnuha Tights",
  355. feet="Taeon Boots"}
  356.  
  357. -- Normal melee group
  358. sets.engaged.Melee = {
  359. ammo=gear.RAbullet,
  360. head="Dampening Tam",
  361. neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
  362. body={ name="Herculean Vest", augments={'Accuracy+20 Attack+20','"Triple Atk."+3','AGI+8','Accuracy+14','Attack+11',}},
  363. hands={ name="Herculean Gloves", augments={'"Triple Atk."+4','DEX+4',}},
  364. ring1="Hetairoi Ring",ring2="Epona's Ring",
  365. back="Atheling Mantle",waist="Windbuffet Belt +1",
  366. legs="Samnuha Tights",
  367. feet="Taeon Boots"}
  368.  
  369. sets.engaged.DW = set_combine(sets.engaged.Melee, {
  370. head="Dampening Tam",
  371. neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
  372. body={ name="Herculean Vest", augments={'Accuracy+20 Attack+20','"Triple Atk."+3','AGI+8','Accuracy+14','Attack+11',}},
  373. hands={ name="Herculean Gloves", augments={'"Triple Atk."+4','DEX+4',}},
  374. ring1="Hetairoi Ring",ring2="Epona's Ring",
  375. back="Atheling Mantle",waist="Windbuffet Belt +1",
  376. legs="Samnuha Tights",
  377. feet="Taeon Boots"
  378. })
  379.  
  380. sets.engaged.Acc = set_combine(sets.engaged.Melee, {
  381. ring1="Mars's Ring",
  382. ear1="Zennaroi Earring",
  383. neck="Iqabi Necklace",
  384. hands="Floral Gauntlets",
  385. waist="Reiki Yotai",
  386. })
  387.  
  388. sets.engaged.Acc.DW = set_combine(sets.engaged.Melee.DW, {
  389. ring1="Mars's Ring",
  390. waist="Reiki Yotai",
  391. })
  392. end
  393.  
  394. -------------------------------------------------------------------------------------------------------------------
  395. -- Job-specific hooks that are called to process player actions at specific points in time.
  396. -------------------------------------------------------------------------------------------------------------------
  397. function job_pretarget(spell, action, spellMap, eventArgs)
  398. -- If autora enabled, use WS automatically at 100+ TP
  399. if spell.action_type == 'Ranged Attack' then
  400. if player.tp >= 1000 and state.AutoRA.value == 'WS' and not buffactive.amnesia then
  401. cancel_spell()
  402. use_weaponskill()
  403. end
  404. end
  405. end
  406.  
  407. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  408. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  409. function job_precast(spell, action, spellMap, eventArgs)
  410. -- Check that proper ammo is available if we're using ranged attacks or similar.
  411. if spell.action_type == 'Ranged Attack' or spell.type == 'WeaponSkill' or spell.type == 'CorsairShot' then
  412. do_bullet_checks(spell, spellMap, eventArgs)
  413. end
  414.  
  415. -- gear sets
  416. if (spell.type == 'CorsairRoll' or spell.english == "Double-Up") and state.LuzafRing.value then
  417. equip(sets.precast.LuzafRing)
  418. elseif spell.type == 'CorsairShot' and state.CastingMode.value == 'Resistant' then
  419. classes.CustomClass = 'Acc'
  420. elseif spell.english == 'Fold' and buffactive['Bust'] == 2 then
  421. if sets.precast.FoldDoubleBust then
  422. equip(sets.precast.FoldDoubleBust)
  423. eventArgs.handled = true
  424. end
  425. end
  426. end
  427.  
  428. function job_post_precast(spell, action, spellMap, eventArgs)
  429. if spell.type == 'WeaponSkill' then
  430. if state.CapacityMode.value then
  431. equip(sets.CapacityMantle)
  432. end
  433. end
  434. end
  435.  
  436. function job_midcast(spell, action, spellMap, eventArgs)
  437. if spell.type == 'CorsairShot' or spell.action_type == 'Ranged Attack' then
  438. if state.CapacityMode.value then
  439. equip(sets.CapacityMantle)
  440. end
  441. end
  442. end
  443. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  444. function job_aftercast(spell, action, spellMap, eventArgs)
  445. if spell.type == 'CorsairRoll' and not spell.interrupted then
  446. display_roll_info(spell)
  447. end
  448. if state.AutoRA.value ~= 'Normal' then
  449. use_ra(spell)
  450. end
  451. end
  452.  
  453.  
  454. -------------------------------------------------------------------------------------------------------------------
  455. -- Customization hooks for idle and melee sets, after they've been automatically constructed.
  456. -------------------------------------------------------------------------------------------------------------------
  457.  
  458. -- Return a customized weaponskill mode to use for weaponskill sets.
  459. -- Don't return anything if you're not overriding the default value.
  460. function get_custom_wsmode(spell, action, default_wsmode)
  461. --if buffactive['Transcendancy'] then
  462. -- return 'Brew'
  463. --end
  464. end
  465. function customize_idle_set(idleSet)
  466. if player.hpp < 90 then
  467. idleSet = set_combine(idleSet, sets.idle.Regen)
  468. end
  469. return idleSet
  470. end
  471. function customize_melee_set(meleeSet)
  472. if state.CapacityMode.value then
  473. meleeSet = set_combine(meleeSet, sets.CapacityMantle)
  474. end
  475. return meleeSet
  476. end
  477.  
  478. -------------------------------------------------------------------------------------------------------------------
  479. -- General hooks for other events.
  480. -------------------------------------------------------------------------------------------------------------------
  481.  
  482. -- Called when the player's status changes.
  483. function job_status_change(newStatus, oldStatus, eventArgs)
  484. end
  485.  
  486. -- Called when a player gains or loses a buff.
  487. -- buff == buff gained or lost
  488. -- gain == true if the buff was gained, false if it was lost.
  489. function job_buff_change(buff, gain)
  490.  
  491. end
  492.  
  493.  
  494. -------------------------------------------------------------------------------------------------------------------
  495. -- User code that supplements self-commands.
  496. -------------------------------------------------------------------------------------------------------------------
  497.  
  498. -- Called by the 'update' self-command, for common needs.
  499. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  500. function job_update(cmdParams, eventArgs)
  501. get_combat_form()
  502. end
  503.  
  504. -- Job-specific toggles.
  505. function job_toggle_state(field)
  506. if field:lower() == 'luzaf' then
  507. state.LuzafRing:toggle()
  508. return "Use of Luzaf Ring", state.LuzafRing.value
  509. end
  510. end
  511.  
  512. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  513. function display_current_job_state(eventArgs)
  514. local msg = ''
  515. msg = msg .. 'Off.: '..state.OffenseMode.current
  516. msg = msg .. ', Rng.: '..state.RangedMode.current
  517. msg = msg .. ', WS.: '..state.WeaponskillMode.current
  518. msg = msg .. ', QD.: '..state.CastingMode.current
  519.  
  520. if state.AutoRA.value ~= 'Normal' then
  521. msg = '[Auto RA: ON]['..state.AutoRA.value..']'
  522. else
  523. msg = msg .. '[Auto RA: OFF]'
  524. end
  525. if state.DefenseMode.value ~= 'None' then
  526. local defMode = state[state.DefenseMode.value ..'DefenseMode'].current
  527. msg = msg .. ', Defense: '..state.DefenseMode.value..' '..defMode
  528. end
  529. if state.Kiting.value then
  530. msg = msg .. ', Kiting'
  531. end
  532. if state.PCTargetMode.value ~= 'default' then
  533. msg = msg .. ', Target PC: '..state.PCTargetMode.value
  534. end
  535. if state.SelectNPCTargets.value then
  536. msg = msg .. ', Target NPCs'
  537. end
  538.  
  539. msg = msg .. ', Roll Size: ' .. ((state.LuzafRing.value and 'Large') or 'Small')
  540. add_to_chat(122, msg)
  541. eventArgs.handled = true
  542. end
  543.  
  544. -------------------------------------------------------------------------------------------------------------------
  545. -- Utility functions specific to this job.
  546. -------------------------------------------------------------------------------------------------------------------
  547. function get_combat_form()
  548. if cor_sub_weapons:contains(player.equipment.main) then
  549. --if player.equipment.main == gear.Stave then
  550. if S{'NIN', 'DNC'}:contains(player.sub_job) and cor_sub_weapons:contains(player.equipment.sub) then
  551. state.CombatForm:set("DW")
  552. else
  553. state.CombatForm:reset()
  554. end
  555. else
  556. state.CombatForm:set('Stave')
  557. end
  558. end
  559.  
  560. function define_roll_values()
  561. rolls = {
  562. ["Corsair's Roll"] = {lucky=5, unlucky=9, bonus="Experience Points"},
  563. ["Ninja Roll"] = {lucky=4, unlucky=8, bonus="Evasion"},
  564. ["Hunter's Roll"] = {lucky=4, unlucky=8, bonus="Accuracy"},
  565. ["Chaos Roll"] = {lucky=4, unlucky=8, bonus="Attack"},
  566. ["Magus's Roll"] = {lucky=2, unlucky=6, bonus="Magic Defense"},
  567. ["Healer's Roll"] = {lucky=3, unlucky=7, bonus="Cure Potency Received"},
  568. ["Puppet Roll"] = {lucky=4, unlucky=8, bonus="Pet Magic Accuracy/Attack"},
  569. ["Choral Roll"] = {lucky=2, unlucky=6, bonus="Spell Interruption Rate"},
  570. ["Monk's Roll"] = {lucky=3, unlucky=7, bonus="Subtle Blow"},
  571. ["Beast Roll"] = {lucky=4, unlucky=8, bonus="Pet Attack"},
  572. ["Samurai Roll"] = {lucky=2, unlucky=6, bonus="Store TP"},
  573. ["Evoker's Roll"] = {lucky=5, unlucky=9, bonus="Refresh"},
  574. ["Rogue's Roll"] = {lucky=5, unlucky=9, bonus="Critical Hit Rate"},
  575. ["Warlock's Roll"] = {lucky=4, unlucky=8, bonus="Magic Accuracy"},
  576. ["Fighter's Roll"] = {lucky=5, unlucky=9, bonus="Double Attack Rate"},
  577. ["Drachen Roll"] = {lucky=3, unlucky=7, bonus="Pet Accuracy"},
  578. ["Gallant's Roll"] = {lucky=3, unlucky=7, bonus="Defense"},
  579. ["Wizard's Roll"] = {lucky=5, unlucky=9, bonus="Magic Attack"},
  580. ["Dancer's Roll"] = {lucky=3, unlucky=7, bonus="Regen"},
  581. ["Scholar's Roll"] = {lucky=2, unlucky=6, bonus="Conserve MP"},
  582. ["Bolter's Roll"] = {lucky=3, unlucky=9, bonus="Movement Speed"},
  583. ["Caster's Roll"] = {lucky=2, unlucky=7, bonus="Fast Cast"},
  584. ["Courser's Roll"] = {lucky=3, unlucky=9, bonus="Snapshot"},
  585. ["Blitzer's Roll"] = {lucky=4, unlucky=9, bonus="Attack Delay"},
  586. ["Tactician's Roll"] = {lucky=5, unlucky=8, bonus="Regain"},
  587. ["Allies's Roll"] = {lucky=3, unlucky=10, bonus="Skillchain Damage"},
  588. ["Miser's Roll"] = {lucky=5, unlucky=7, bonus="Save TP"},
  589. ["Companion's Roll"] = {lucky=2, unlucky=10, bonus="Pet Regain and Regen"},
  590. ["Avenger's Roll"] = {lucky=4, unlucky=8, bonus="Counter Rate"},
  591. }
  592. end
  593.  
  594. function display_roll_info(spell)
  595. rollinfo = rolls[spell.english]
  596. local rollsize = 'Small'
  597. if state.LuzafRing then
  598. rollsize = 'Large'
  599. end
  600. if rollinfo then
  601. add_to_chat(104, spell.english..' provides a bonus to '..rollinfo.bonus..'. Roll size: '..rollsize)
  602. add_to_chat(104, 'Lucky roll is '..tostring(rollinfo.lucky)..', Unlucky roll is '..tostring(rollinfo.unlucky)..'.')
  603. end
  604. end
  605.  
  606. -- Determine whether we have sufficient ammo for the action being attempted.
  607. function do_bullet_checks(spell, spellMap, eventArgs)
  608. local bullet_name
  609. local bullet_min_count = 1
  610.  
  611. if spell.type == 'WeaponSkill' then
  612. if spell.skill == "Marksmanship" then
  613. if spell.element == 'None' then
  614. -- physical weaponskills
  615. bullet_name = gear.WSbullet
  616. else
  617. -- magical weaponskills
  618. bullet_name = gear.MAbullet
  619. end
  620. else
  621. -- Ignore non-ranged weaponskills
  622. return
  623. end
  624. elseif spell.type == 'CorsairShot' then
  625. bullet_name = gear.QDbullet
  626. elseif spell.action_type == 'Ranged Attack' then
  627. bullet_name = gear.RAbullet
  628. if buffactive['Triple Shot'] then
  629. bullet_min_count = 3
  630. end
  631. end
  632.  
  633. local available_bullets = player.inventory[bullet_name] or player.wardrobe[bullet_name]
  634.  
  635. -- If no ammo is available, give appropriate warning and end.
  636. if not available_bullets then
  637. if spell.type == 'CorsairShot' and player.equipment.ammo ~= 'empty' then
  638. add_to_chat(104, 'No Quick Draw ammo left. Using what\'s currently equipped ('..player.equipment.ammo..').')
  639. return
  640. elseif spell.type == 'WeaponSkill' and player.equipment.ammo == gear.RAbullet then
  641. add_to_chat(104, 'No weaponskill ammo left. Using what\'s currently equipped (standard ranged bullets: '..player.equipment.ammo..').')
  642. return
  643. else
  644. add_to_chat(104, 'No ammo ('..tostring(bullet_name)..') available for that action.')
  645. eventArgs.cancel = true
  646. return
  647. end
  648. end
  649.  
  650. -- Don't allow shooting or weaponskilling with ammo reserved for quick draw.
  651. if spell.type ~= 'CorsairShot' and bullet_name == gear.QDbullet and available_bullets.count <= bullet_min_count then
  652. add_to_chat(104, 'No ammo will be left for Quick Draw. Cancelling.')
  653. eventArgs.cancel = true
  654. return
  655. end
  656.  
  657. -- Low ammo warning.
  658. if spell.type ~= 'CorsairShot' and not state.warned
  659. and available_bullets.count > 1 and available_bullets.count <= options.ammo_warning_limit then
  660. local msg = '**** LOW AMMO WARNING: '..bullet_name..' ****'
  661. local border = ""
  662. for i = 1, #msg do
  663. border = border .. "*"
  664. end
  665.  
  666. add_to_chat(104, border)
  667. add_to_chat(104, msg)
  668. add_to_chat(104, border)
  669. state.warned = true
  670. elseif available_bullets.count > options.ammo_warning_limit and state.warned then
  671. state.warned = false
  672. end
  673. end
  674.  
  675. function use_weaponskill()
  676. send_command('input /ws "'..auto_gun_ws..'" <t>')
  677. end
  678.  
  679. function job_state_change(stateField, newValue, oldValue)
  680. if stateField == 'Auto RA' then
  681. if newValue ~= 'Normal' then
  682. send_command('@wait 2.5; input /ra <t>')
  683. end
  684. end
  685. end
  686.  
  687. function use_ra(spell)
  688.  
  689. local delay = '2.2'
  690. -- GUN
  691. if spell.type:lower() == 'weaponskill' then
  692. delay = '2.25'
  693. else
  694. if buffactive["Courser's Roll"] then
  695. delay = '0.7' -- MAKE ADJUSTMENT HERE
  696. elseif buffactive['Flurry II'] then
  697. delay = '0.5'
  698. else
  699. delay = '1.05' -- MAKE ADJUSTMENT HERE
  700. end
  701. end
  702. send_command('@wait '..delay..'; input /ra <t>')
  703. end
  704.  
  705. function select_default_macro_book()
  706. set_macro_page(1, 16)
  707. end
Add Comment
Please, Sign In to add comment