Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.75 KB | None | 0 0
  1. --[[
  2.  
  3. Common Macros needed:
  4.  
  5. Geo AutoAction (ON/OFF)
  6. /con send {Player} gs c auto_action
  7.  
  8.  
  9. Modes:
  10. - Fury = iFury / G.Frailty
  11. - Haste = iHaste / G.Frailty
  12. - Attunement = iAttunement / G.Vex
  13. - Acumen = iAcumen / G.Malaise
  14. - Precision = iPrecision / G.Torpor
  15. - Focus = iFocus / G.Languor
  16.  
  17. Macro:
  18. /con send {Player} gs c geo_mode
  19.  
  20.  
  21. Entrust (This goes always to <p1>)
  22. /con send {Player} gs c entrust_acc
  23. /con send {Player} gs c entrust_focus
  24. /con send {Player} gs c entrust_fury
  25. /con send {Player} gs c entrust_haste
  26.  
  27.  
  28. Geo BoG: (BoG the current Geo Bubble set as mode)
  29. /con send {Player} gs c blaze
  30.  
  31.  
  32. Assist (To get on the hate list on new mobs)
  33. /con send {Player} /assist <p1> // oder {DD}
  34. /wait 1
  35. /con send {Player} /ma "Dia II" <t>
  36.  
  37. ]]--
  38.  
  39. -------------------------------------------------------------------------------------------------------------------
  40. -- Setup functions for this job. Generally should not be modified.
  41. -------------------------------------------------------------------------------------------------------------------
  42.  
  43. -- Initialization function for this job file.
  44. function get_sets()
  45. mote_include_version = 2
  46.  
  47. -- Load and initialize the include file.
  48. -- include('Mote-Include.lua')
  49. -- include('organizer-lib')
  50.  
  51. -- VARIABLES --
  52. auto_action = 'Off'
  53. geo_mode = 'Fury'
  54. blaze = 'Off'
  55.  
  56. windower.register_event('tp change', function(new, old)
  57. if new > 349
  58. and auto_action == 'On' then
  59. relaxed_play_mode()
  60. end
  61. end)
  62.  
  63. windower.register_event('time change', function(time)
  64. if auto_action == 'On' then
  65. relaxed_play_mode()
  66. end
  67. end)
  68.  
  69.  
  70. --------------------------------------
  71. -- Precast sets
  72. --------------------------------------
  73.  
  74. -- Precast sets to enhance JAs
  75. sets.precast = {}
  76. sets.precast.JA = {}
  77. sets.precast.JA.Bolster = {body="Bagua Tunic"}
  78. sets.precast.JA['Life cycle'] = {body="Geo. Tunic +1",back="Nantosuelta's Cape"}
  79. sets.precast.JA['Full cycle'] = {head="Azimuth Hood"}
  80. sets.precast.JA['Radial Arcana'] = {feet="Bagua sandals"}
  81. sets.precast.JA['Primeval Zeal'] = {head="Bagua Galero"}
  82. sets.precast.JA['Cardinal Chant'] = {head="Geomancy Galero"}
  83. sets.precast.JA['Curative Recantation'] = {hands="Bagua Mitaines"}
  84. sets.precast.JA['Mending Halation'] = {legs="Bagua Pants +1"}
  85.  
  86. merl_head_FC="Merlinic Hood"
  87. merl_feet_FC={name="Merlinic Crackows", augments={'INT+8'}}
  88. merl_feet_idle={name="Merlinic Crackows", augments={'CHR+1'}}
  89. solstice="Solstice"
  90. merl_legs_MAB="Merlinic Shalwar"
  91.  
  92.  
  93. -- Fast cast sets for spells
  94.  
  95. sets.precast.FastCast = {
  96. main="Sucellus",sub="Genbu's Shield",range="Dunna",
  97. head=merl_head_FC,neck="Voltsurge Torque",
  98. body="Merlinic Jubbah",hands="Merlinic Dastanas",ring1="Prolix Ring",
  99. back="Swith Cape",waist="Channeler's Stone",legs="Telchine Braconi",feet=merl_feet_FC
  100. }
  101.  
  102. --sets.precast.FC.Cure = set_combine(sets.precast.FC, {main="Tamaxchi",sub="Sors Shield",back="Pahtli Cape"})
  103.  
  104. --sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {hands="Bagua mitaines"})
  105.  
  106.  
  107. -- Weaponskill sets
  108. -- Default set for any weaponskill that isn't any more specifically defined
  109. sets.precast.WS = {}
  110.  
  111. -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
  112. sets.precast.WS['Flash Nova'] = {}
  113.  
  114. sets.precast.WS['Starlight'] = {ear2="Moonshade Earring"}
  115.  
  116. sets.precast.WS['Moonlight'] = {ear2="Moonshade Earring"}
  117.  
  118.  
  119. --------------------------------------
  120. -- Midcast sets
  121. --------------------------------------
  122.  
  123. -- Base fast recast for spells
  124. sets.midcast = {}
  125. sets.midcast.FastRecast = {range="Dunna",ammo=empty,back="Lifestream Cape"}
  126.  
  127. sets.midcast.Geomancy = {
  128. main=solstice,sub="Genbu's Shield",range="Dunna",
  129. head="Azimuth Hood",neck="Deceiver's Torque",
  130. body="Bagua Tunic",hands="Geomancy Mitaines",back="Nantosuelta's Cape",waist="Channeler's Stone"
  131. }
  132.  
  133. sets.midcast.Geomancy.Indi = set_combine(sets.midcast.Geomancy, {back=geo_PET,legs="Bagua Pants +1",feet="Azimuth Gaiters"})
  134.  
  135. sets.midcast.Cure = sets.midcast.FastRecast
  136.  
  137. sets.midcast.Curaga = sets.midcast.Cure
  138.  
  139. sets.midcast.Protectra = {ring1="Sheltered Ring"}
  140.  
  141. sets.midcast.Shellra = {ring1="Sheltered Ring"}
  142.  
  143. sets.midcast['Enhancing Magic'] = {main="Gada",sub="Ammurapi Shield",head=telc_head_ENH,body=telc_body_ENH,hands=telc_hands_ENH,legs=telc_legs_ENH,feet=telc_feet_ENH}
  144.  
  145. sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {ear1="Earthcry Earring",waist="Siegel Sash"})
  146. sets.midcast.Cursna = {waist="Gishdubar Sash",ring1="Haoma's Ring",ring2="Ephedra Ring"}
  147. sets.midcast.Refresh = set_combine(sets.midcast['Enhancing Magic'], {waist="Gishdubar Sash",feet="Inspirited Boots"})
  148. sets.midcast.Warp = set_combine(sets.midcast.FastRecast, {})
  149.  
  150.  
  151. sets.midcast['Enfeebling Magic'] = {main=grio_ENF,sub="Enki Strap",ammo="Hydrocera",
  152. head=merl_head_MAB,neck="Incanter's Torque",ear1="Barkarole Earring",ear2="Dignitary's Earring",
  153. body=merl_body_MB,hands="Lurid Mitts",ring1="Metamorph Ring +1",ring2="Kishar Ring",
  154. back=geo_MAB,waist="Luminary Sash",legs=merl_legs_MAB,feet="Skaoi Boots"}
  155.  
  156. sets.midcast['Elemental Magic'] = {main=solstice,sub="Genbu's Shield",
  157. head="Merlinic Hood",neck="Quanpur Necklace",ear1="Friomisi Earring",ear2="Strophadic Earring",
  158. body="Merlinic Jubbah",hands="Amalric Gages",ring1="Mujin Band",ring2="Acumen Ring",
  159. back="Nantosuelta's Cape",waist="Channeler's Stone",legs=merl_legs_MAB,feet=merl_feet_FC}
  160.  
  161.  
  162. sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})
  163.  
  164. sets.midcast['Dark Magic'] = {main="Rubicundity",sub="Ammurapi Shield",ammo="Pemphredo Tathlum",
  165. head=merl_head_MAB,neck="Incanter's Torque",ear1="Barkarole Earring",ear2="Dignitary's Earring",
  166. body="Shango Robe",hands=merl_hands_AS,ring1="Evanescence Ring",ring2="Kishar Ring",
  167. back="Swith Cape +1",waist="Witful Belt",legs="Psycloth Lappas",feet="Skaoi Boots"}
  168.  
  169. sets.midcast.Drain = set_combine(sets.midcast['Dark Magic'], {main="Rubicundity",sub="Ammurapi Shield",
  170. head="Pixie Hairpin +1",neck="Incanter's Torque",ear1="Hirudinea Earring",
  171. hands=merl_hands_AS,back=geo_MAB,waist="Fucho-no-obi"})
  172. sets.midcast.Aspir = set_combine(sets.midcast.Drain, {})
  173.  
  174.  
  175.  
  176. sets.magic_burst = sets.midcast['Elemental Magic']
  177. sets.midcast.Elemental = sets.midcast['Elemental Magic']
  178.  
  179.  
  180.  
  181. sets.obi = {}
  182.  
  183. --------------------------------------
  184. -- Idle/resting/defense/etc sets
  185. --------------------------------------
  186.  
  187. -- Resting sets
  188. sets.resting = {}
  189.  
  190. -- Idle sets
  191.  
  192. sets.idle = {
  193. main=solstice,
  194. sub="Genmei Shield",
  195. range="Dunna",
  196. head="Befouled Crown",
  197. neck="Loricate Torque +1",
  198. ear1="Hearty Earring",
  199. ear2="Moonshade Earring",
  200. body="Jhakri Robe +1",
  201. hands=merl_hands_DT,
  202. ring1="Shneddick Ring",
  203. ring2="Warp Ring",
  204. back="Lifestream Cape",
  205. waist="Gishdubar Sash",
  206. legs="Assiduity Pants +1",
  207. feet=merl_feet_idle}
  208.  
  209. sets.idle.PDT = sets.idle
  210.  
  211. -- .Pet sets are for when Luopan is present.
  212. sets.idle.Pet = sets.idle
  213.  
  214. sets.idle.PDT.Pet = sets.idle.Pet
  215.  
  216. -- .Indi sets are for when an Indi-spell is active.
  217. --sets.idle.Indi = set_combine(sets.idle, {legs="Bagua Pants"})
  218. --sets.idle.Pet.Indi = set_combine(sets.idle.Pet, {legs="Bagua Pants"})
  219. --sets.idle.PDT.Indi = set_combine(sets.idle.PDT, {legs="Bagua Pants"})
  220. --sets.idle.PDT.Pet.Indi = set_combine(sets.idle.PDT.Pet, {legs="Bagua Pants"})
  221.  
  222. sets.Kiting = {feet="Geomancy Sandals"}
  223.  
  224. sets.latent_refresh = {waist="Fucho-no-obi"}
  225.  
  226.  
  227. --------------------------------------
  228. -- Engaged sets
  229. --------------------------------------
  230.  
  231. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  232. -- sets if more refined versions aren't defined.
  233. -- If you create a set with both offense and defense modes, the offense mode should be first.
  234. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  235.  
  236. -- Normal melee group
  237. sets.engaged = {}
  238.  
  239.  
  240. end
  241.  
  242. do
  243. --[[ Author: Arcon
  244. The three next "do" sections are used to aid in checking recast
  245. times, can check multiple recast times at once ]]
  246. local cache = {}
  247.  
  248. function j(str)
  249. if not cache[str] then
  250. cache[str] = gearswap.res.job_abilities:with('name', str)
  251. end
  252.  
  253. return cache[str]
  254. end
  255. end
  256.  
  257. do
  258. local cache = {}
  259.  
  260. function s(str)
  261. if not cache[str] then
  262. cache[str] = gearswap.res.spells:with('name', str)
  263. end
  264.  
  265. return cache[str]
  266. end
  267. end
  268.  
  269. do
  270. local ja_types = S(gearswap.res.job_abilities:map(table.get-{'type'}))
  271.  
  272. function check_recasts(...)
  273. local spells = S{...}
  274.  
  275. for spell in spells:it() do
  276. local fn = 'get_' .. (ja_types:contains(spell.type)
  277. and 'ability'
  278. or 'spell') ..'_recasts'
  279. if windower.ffxi[fn]()[spell.recast_id] > 0 then
  280. return false
  281. end
  282. end
  283.  
  284. return true
  285. end
  286. end
  287.  
  288. -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
  289. function job_setup()
  290. indi_timer = ''
  291. indi_duration = 180
  292.  
  293.  
  294. -- VARIABLES --
  295. auto_action = 'Off'
  296. geo_mode = 'Fury'
  297. blaze = 'Off'
  298.  
  299. windower.register_event('tp change', function(new, old)
  300. if new > 349
  301. and auto_action == 'On' then
  302. relaxed_play_mode()
  303. end
  304. end)
  305.  
  306. windower.register_event('time change', function(time)
  307. if auto_action == 'On' then
  308. relaxed_play_mode()
  309. end
  310. end)
  311.  
  312.  
  313. end
  314.  
  315. -------------------------------------------------------------------------------------------------------------------
  316. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  317. -------------------------------------------------------------------------------------------------------------------
  318.  
  319. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  320. function user_setup()
  321. state.OffenseMode:options('None', 'Normal')
  322. state.CastingMode:options('Normal', 'Resistant')
  323. state.IdleMode:options('Normal', 'PDT')
  324.  
  325. state.MagicBurst = M(true, 'Magic Burst')
  326.  
  327. -- Additional local binds
  328. send_command('bind ^` gs c toggle MagicBurst')
  329. end
  330.  
  331. function self_command(str)
  332. -- Use an in game macro "/con gs c auto_action" to toggle bot Off and On
  333. --macro: "/con send Anukk gs c auto_action"
  334. if str == 'auto_action' then
  335. if auto_action == 'Off' then
  336. auto_action = 'On'
  337. else
  338. auto_action = 'Off'
  339. end
  340. windower.add_to_chat(8,'Auto fire event set to: '..auto_action)
  341. windower.send_command('input /echo Auto_action: '..auto_action)
  342.  
  343. elseif str == 'geo_mode' then
  344. if geo_mode == 'Fury' then
  345. geo_mode = 'Haste'
  346. elseif geo_mode == 'Haste' then
  347. geo_mode = 'Attunement'
  348. elseif geo_mode == 'Attunement' then
  349. geo_mode = 'Acumen'
  350. elseif geo_mode == 'Acumen' then
  351. geo_mode = 'Precision'
  352. elseif geo_mode == 'Precision' then
  353. geo_mode = 'Focus'
  354. elseif geo_mode == 'Focus' then
  355. geo_mode = 'Fury'
  356. end
  357. windower.add_to_chat(8,'Geo set mode: '..geo_mode)
  358. windower.send_command('input /echo Geo_mode: '..geo_mode)
  359.  
  360. elseif str == 'entrust_acc' then
  361. if not check_buffs('silence', 'mute')
  362. and check_recasts(s('Indi-Precision'))
  363. and check_recasts(s('Entrust')) then
  364. windower.send_command('Entrust <me>;wait 1;Indi-Precision <p1>')
  365. end
  366.  
  367. elseif str == 'entrust_focus' then
  368. if not check_buffs('silence', 'mute')
  369. and check_recasts(s('Indi-Focus'))
  370. and check_recasts(s('Entrust')) then
  371. windower.send_command('Entrust <me>;wait 1;Indi-Focus <p1>')
  372. end
  373.  
  374. elseif str == 'entrust_fury' then
  375. if not check_buffs('silence', 'mute')
  376. and check_recasts(s('Indi-Fury'))
  377. and check_recasts(s('Entrust')) then
  378. windower.send_command('Entrust <me>;wait 1;Indi-Fury <p1>')
  379. end
  380.  
  381. elseif str == 'entrust_refresh' then
  382. if not check_buffs('silence', 'mute')
  383. and check_recasts(s('Indi-Refresh'))
  384. and check_recasts(s('Entrust')) then
  385. windower.send_command('Entrust <me>;wait 1;Indi-Refresh <p1>')
  386. end
  387.  
  388. elseif str == 'entrust_haste' then
  389. if not check_buffs('silence', 'mute')
  390. and check_recasts(s('Indi-Haste'))
  391. and check_recasts(s('Entrust')) then
  392. windower.send_command('Entrust <me>;wait 1;Indi-Haste <p1>')
  393. end
  394.  
  395. elseif str == 'blaze' then
  396. if not check_buffs('silence', 'mute')
  397. and player.mp > 379
  398. and check_recasts(s('Radial Arcana'))
  399. and check_recasts(s('Blaze of Glory'))
  400. and check_recasts(s('Dematerialize')) then
  401. blaze = 'On'
  402. end
  403.  
  404. end
  405. end
  406.  
  407. function relaxed_play_mode()
  408. -- This can be used as a mini bot to automate actions
  409. if not midaction() then
  410. if player.hpp < 70
  411. and not check_buffs('silence', 'mute')
  412. and check_recasts(s('cure4')) then
  413. windower.send_command('cure4 <me>')
  414.  
  415. elseif player.hpp > 90
  416. and player.mpp < 10
  417. and check_recasts(s('Convert')) then
  418. windower.send_command('Convert;wait 1;cure4 <me>')
  419.  
  420. elseif not check_buffs('Refresh')
  421. and not check_buffs('silence', 'mute')
  422. and check_recasts(s('Refresh')) then
  423. windower.send_command('Refresh <me>')
  424.  
  425. --Indi
  426. elseif not check_buffs('Attack Boost')
  427. and not check_buffs('silence', 'mute')
  428. and geo_mode == 'Fury'
  429. and check_recasts(s('Indi-Fury')) then
  430. windower.send_command('Indi-Fury')
  431.  
  432. elseif not buffactive[580]
  433. --buffactive[581]
  434. --check_buffs('Haste')
  435. and not check_buffs('silence', 'mute')
  436. and geo_mode == 'Haste'
  437. and check_recasts(s('Indi-Haste')) then
  438. windower.send_command('Indi-Haste')
  439.  
  440. elseif not check_buffs('Magic Evasion Boost')
  441. and not check_buffs('silence', 'mute')
  442. and geo_mode == 'Attunement'
  443. and check_recasts(s('Indi-Attunement')) then
  444. windower.send_command('Indi-Attunement')
  445.  
  446. elseif not check_buffs('Magic Atk. Boost')
  447. and not check_buffs('silence', 'mute')
  448. and geo_mode == 'Acumen'
  449. and check_recasts(s('Indi-Acumen')) then
  450. windower.send_command('Indi-Acumen')
  451.  
  452. elseif not check_buffs('Accuracy Boost')
  453. and not check_buffs('silence', 'mute')
  454. and geo_mode == 'Precision'
  455. and check_recasts(s('Indi-Precision')) then
  456. windower.send_command('Indi-Precision')
  457.  
  458. elseif not check_buffs('Magic Accuracy Boost')
  459. and not check_buffs('silence', 'mute')
  460. and geo_mode == 'Focus'
  461. and check_recasts(s('Indi-Focus')) then
  462. windower.send_command('Indi-Focus')
  463.  
  464. --blaze of glory
  465. elseif blaze == 'On'
  466. and not check_buffs('silence', 'mute')
  467. and check_recasts(s('Geo-Frailty'))
  468. and player.mp > 379
  469. and check_recasts(s('Radial Arcana'))
  470. and check_recasts(s('Blaze of Glory'))
  471. and check_recasts(s('Dematerialize')) then
  472. if geo_mode == 'Fury' then
  473. windower.send_command('Radial Arcana <me>;wait 1;Blaze of Glory <me>;wait 2;Geo-Frailty <bt>;wait 6;Dematerialize <me>;wait 1;Life Cycle <me>;wait 1;Lasting Emanation <me>;wait 1;Dia2 <bt>')
  474. elseif geo_mode == 'Haste' then
  475. windower.send_command('Radial Arcana <me>;wait 1;Blaze of Glory <me>;wait 2;Geo-Frailty <bt>;wait 6;Dematerialize <me>;wait 1;Life Cycle <me>;wait 1;Lasting Emanation <me>;wait 1;Dia2 <bt>')
  476. elseif geo_mode == 'Attunement' then
  477. windower.send_command('Radial Arcana <me>;wait 1;Blaze of Glory <me>;wait 2;Geo-Vex <bt>;wait 6;Dematerialize <me>;wait 1;Life Cycle <me>;wait 1;Lasting Emanation <me>;wait 1;Dia2 <bt>')
  478. elseif geo_mode == 'Acumen' then
  479. windower.send_command('Radial Arcana <me>;wait 1;Blaze of Glory <me>;wait 2;Geo-Malaise <bt>;wait 6;Dematerialize <me>;wait 1;Life Cycle <me>;wait 1;Lasting Emanation <me>;wait 1;Dia2 <bt>')
  480. elseif geo_mode == 'Precision' then
  481. windower.send_command('Radial Arcana <me>;wait 1;Blaze of Glory <me>;wait 2;Geo-Torpor <bt>;wait 6;Dematerialize <me>;wait 1;Life Cycle <me>;wait 1;Lasting Emanation <me>;wait 1;Dia2 <bt>')
  482. elseif geo_mode == 'Focus' then
  483. windower.send_command('Radial Arcana <me>;wait 1;Blaze of Glory <me>;wait 2;Geo-Languor <bt>;wait 6;Dematerialize <me>;wait 1;Life Cycle <me>;wait 1;Lasting Emanation <me>;wait 1;Dia2 <bt>')
  484. end
  485. blaze = 'Off'
  486.  
  487. --Geo
  488. elseif not pet.isvalid
  489. and not check_buffs('silence', 'mute')
  490. and check_recasts(s('Geo-Frailty'))
  491. and check_recasts(s('Geo-Vex'))
  492. and check_recasts(s('Geo-Malaise'))
  493. and check_recasts(s('Geo-Torpor')) then
  494. if player.mp > 305 and geo_mode == 'Fury' then
  495. windower.send_command('wait 1;Geo-Frailty <bt>;wait 7;Dia2 <bt>;wait 3;Distract <bt>')
  496. elseif player.mp > 302 and geo_mode == 'Haste' then
  497. windower.send_command('wait 1;Geo-Frailty <bt>;wait 7;Dia2 <bt>;wait 3;Distract <bt>')
  498. elseif player.mp > 302 and geo_mode == 'Attunement' then
  499. windower.send_command('wait 1;Geo-Vex <bt>;wait 7;Dia2 <bt>;wait 3;Distract <bt>')
  500. elseif player.mp > 379 and geo_mode == 'Acumen' then
  501. windower.send_command('wait 1;Geo-Malaise <bt>;wait 7;Frazzle <bt>')
  502. elseif player.mp > 203 and geo_mode == 'Precision' then
  503. windower.send_command('wait 1;Geo-Torpor <bt>;wait 7;Dia2 <bt>;wait 3;Distract <bt>')
  504. elseif player.mp > 249 and geo_mode == 'Focus' then
  505. windower.send_command('wait 1;Geo-Languor <bt>;wait 7;Dia2 <bt>;wait 3;Frazzle <bt>')
  506. end
  507.  
  508. end
  509. end
  510.  
  511. if not midaction() then
  512. --[[
  513. if not check_buffs('Stoneskin')
  514. and not check_buffs('silence', 'mute')
  515. and check_recasts(s('Stoneskin')) then
  516. windower.send_command('Stoneskin')
  517. end]]--
  518. --if not check_buffs('Phalanx')
  519. -- and not check_buffs('silence', 'mute')
  520. -- and check_recasts(s('Phalanx')) then
  521. -- windower.send_command('Phalanx')
  522. --end
  523. end
  524.  
  525. end
  526.  
  527. function relaxed_play_mode2()
  528. -- Skillup Elemental/Enfeebling/Dark
  529. if not midaction() then
  530. if player.hpp < 70
  531. and not check_buffs('silence', 'mute')
  532. and check_recasts(s('cure4')) then
  533. windower.send_command('cure4 <me>')
  534.  
  535. elseif player.hpp > 90
  536. and player.mpp < 10
  537. and check_recasts(s('Convert')) then
  538. windower.send_command('Convert;wait 1;cure4 <me>')
  539.  
  540. elseif not check_buffs('Regen')
  541. and not check_buffs('silence', 'mute')
  542. and check_recasts(s('Indi-Regen')) then
  543. windower.send_command('Indi-Regen')
  544.  
  545. elseif not pet.isvalid
  546. and not check_buffs('silence', 'mute')
  547. and check_recasts(s('Geo-Refresh')) then
  548. windower.send_command('Geo-Refresh <me>')
  549.  
  550. elseif not check_buffs('silence', 'mute') then
  551. windower.send_command('dia <bt>')
  552.  
  553. end
  554. end
  555. end
  556.  
  557.  
  558. -- Define sets and vars used by this job file.
  559. -------------------------------------------------------------------------------------------------------------------
  560. -- User code that supplements standard library decisions.
  561. -------------------------------------------------------------------------------------------------------------------
  562.  
  563. function job_get_spell_map(spell, default_spell_map)
  564. if spell.action_type == 'Magic' then
  565. if spell.skill == 'Enfeebling Magic' then
  566. if spell.type == 'WhiteMagic' then
  567. return 'MndEnfeebles'
  568. else
  569. return 'IntEnfeebles'
  570. end
  571. elseif spell.skill == 'Geomancy' then
  572. if spell.english:startswith('Indi') then
  573. return 'Indi'
  574. end
  575. end
  576. end
  577. end
  578.  
  579.  
  580. function customize_idle_set(idleSet)
  581. if player.mpp < 51 then
  582. idleSet = set_combine(idleSet, sets.latent_refresh)
  583. end
  584. return idleSet
  585. end
  586.  
  587. -- Called by the 'update' self-command.
  588. function job_update(cmdParams, eventArgs)
  589. classes.CustomIdleGroups:clear()
  590. if player.indi then
  591. classes.CustomIdleGroups:append('Indi')
  592. end
  593. end
  594.  
  595. -- Function to display the current relevant user state when doing an update.
  596. function display_current_job_state(eventArgs)
  597. local msg = 'Offense'
  598. msg = msg .. ': [' .. state.OffenseMode.value .. '], '
  599. msg = msg .. 'Casting'
  600. msg = msg .. ': [' .. state.CastingMode.value .. '], '
  601. msg = msg .. 'Idle'
  602. msg = msg .. ': [' .. state.IdleMode.value .. '], '
  603.  
  604. if state.MagicBurst.value == true then
  605. msg = msg .. 'Magic Burst: [On]'
  606. elseif state.MagicBurst.value == false then
  607. msg = msg .. 'Magic Burst: [Off]'
  608. end
  609.  
  610. add_to_chat(122, msg)
  611.  
  612. eventArgs.handled = true
  613. end
  614.  
  615. function job_post_midcast(spell, action, spellMap, eventArgs)
  616. if spell.action_type == "Magic" then
  617. if spell.element == world.weather_element or spell.element == world.day_element then
  618. equip(sets.obi[spell.element])
  619. end
  620. end
  621. if spell.skill == 'Elemental Magic' then
  622. --and state.MagicBurst.value then
  623. equip(sets.magic_burst)
  624. end
  625. end
  626.  
  627. function check_buffs(...)
  628. --[[ Function Author: Arcon
  629. Simple check before attempting to auto activate Job Abilities that
  630. check active buffs and debuffs ]]
  631. return table.any({...}, table.get+{buffactive})
  632. end
  633.  
  634. function check_set_spells(...)
  635.  
  636. --[[ Function Author: Arcon
  637. Used to pull list of currently set spells, this is useful for
  638. determining traits such as Dual Wield IV
  639. Also used to determine the Cure spell set, when used with a
  640. self_command ]]
  641. set_spells = set_spells
  642. or gearswap.res.spells:type('BlueMagic'):rekey('name')
  643. return table.all({...}, function(name)
  644. return S(windower.ffxi.get_mjob_data().spells)
  645. :contains(set_spells[name].id)
  646. end)
  647. end
  648.  
  649. function gear_modes()
  650. -- User created bridge for aftercast and status_change functions
  651. -- Sequential gear sets used to easily allow for changing player needs
  652. --slot_disabling()
  653.  
  654. local attack_preference = 'null'
  655.  
  656. if player.status == 'Engaged' then
  657. equip(sets.engaged)
  658. elseif player.status == 'Idle' then
  659. equip(sets.idle)
  660. if dt_mode == 'None' then
  661. --print(party.count)
  662. if party.count > 1 then
  663. equip(sets.idle.SphereRefresh)
  664. end
  665. if player.mpp < 50 then
  666. equip(sets.idle.under_50mpp)
  667. end
  668. if check_buffs('Reive Mark') then
  669. equip(sets.misc.Reive)
  670. end
  671. end
  672. end
  673.  
  674. -- Will inform you if no weapon is equiped and re-equip once able
  675. if player.equipment.main == 'empty' then
  676. equip(sets.weapon[weapon_combo])
  677. windower.add_to_chat(8,'No Weapon, trying to re-equip: '..weapon_combo)
  678. end
  679. end
  680.  
  681. function precast(spell,arg)
  682. gear_change_ok = false
  683. slot_disabling()
  684.  
  685.  
  686. --[[ Generic equip command for Job Abilities and Weaponskills that have
  687. a gear set listed in get_sets()
  688. If Idle and a weaponskill macro is pressed you will change to
  689. current Idle/DT set, useful as a fast way to equip proper gear
  690. For then in game macros the quotations("") and <t> aren't needed
  691. EX: /ws Expiacion ]]
  692. if sets.precast.JA[spell.name] then
  693. equip(sets.precast.JA[spell.name])
  694. elseif sets.precast.WS[spell.name] then
  695. if player.status == 'Engaged' then
  696. equip(sets.precast.WS[spell.name])
  697. if check_buffs('Reive Mark') then
  698. equip(sets.misc.Reive)
  699. end
  700. else
  701. cancel_spell()
  702. gear_modes()
  703. return
  704. end
  705. end
  706.  
  707. -- Magic spell gear handling(Precast)
  708. if spell.prefix == '/magic'
  709. or spell.prefix == '/ninjutsu'
  710. or spell.prefix == '/song' then
  711. if spell.type == 'BlueMagic' then
  712. equip(sets.precast.FastCast.BlueMagic)
  713. else
  714. equip(sets.precast.FastCast)
  715. end
  716. if spell.name == 'Utsusemi: Ichi'
  717. and check_recasts(spell)
  718. and shadow_type == 'Ni' then
  719. if check_buffs(
  720. 'Copy Image',
  721. 'Copy Image (2)',
  722. 'Copy Image (3)') then
  723. windower.send_command('cancel copy image;'
  724. ..'cancel copy image (2); cancel copy image (3)')
  725. end
  726. elseif (spell.name == 'Monomi: Ichi' or spell.name == 'Sneak')
  727. and check_buffs('Sneak')
  728. and check_recasts(spell)
  729. and spell.target.type == 'SELF' then
  730. windower.send_command('cancel sneak')
  731. elseif (spell.name == 'Diamondhide'
  732. or spell.name == 'Metallic body'
  733. or spell.name == 'Stoneskin')
  734. and check_buffs('Stoneskin')
  735. and check_recasts(spell) then
  736. windower.send_command('cancel stoneskin')
  737. end
  738. end
  739.  
  740. -- Dancer Sub Job
  741. if spell.name == 'Spectral Jig'
  742. and check_buffs('Sneak')
  743. and check_recasts(spell) then
  744. windower.send_command('cancel sneak')
  745. cast_delay(0.3)
  746. elseif windower.wc_match(spell.name,'*Step') then
  747. equip(sets.TP['Accuracy High'])
  748. end
  749. end
  750.  
  751.  
  752. function midcast(spell,arg)
  753. -- Special handling for Spell Mappings outlined in get_maps()
  754. local stat
  755.  
  756. if spell.english:startswith('Indi') or spell.english:startswith('Geo') then
  757. equip(sets.midcast.Geomancy)
  758. end
  759. if spell.skill == 'Healing Magic' or spell.skill == 'Enhancing Magic'
  760. or spell.type == 'Trust' then
  761. equip(sets.midcast.FastRecast)
  762. if spell.name:startswith('Cure') then
  763. equip(sets.midcast.Cure)
  764. if spell.target.type == 'SELF' then
  765. equip(sets.midcast.Cure)
  766. end
  767. end
  768. end
  769. if spell.skill == 'Elemental Magic' then
  770. equip(sets.midcast.Elemental)
  771. end
  772.  
  773. end
  774.  
  775.  
  776. function aftercast(spell,arg)
  777. gear_change_ok = true
  778. gear_modes()
  779.  
  780. -- Gear info, useful if using DressUp or BlinkMeNot
  781.  
  782. if not spell.interrupted then
  783. -- Changes shadow type variable to allow cancel Copy Image
  784. -- if last cast was Utsusemi: Ni
  785. if spell.name == 'Utsusemi: Ni' then
  786. shadow_type = 'Ni'
  787. elseif spell.name == 'Utsusemi: Ichi' then
  788. shadow_type = 'Ichi'
  789. end
  790.  
  791. -- If you have spells under a different macro set in game this will let
  792. -- you change to that set quickly and then change back once finished
  793. if spell.name:startswith('Unbridled') then
  794. windower.send_command('input /macro set 3')
  795. end
  796.  
  797. -- TIMERS PLUGIN: Dream Flower
  798. if spell.name == 'Dream Flower' then
  799. windower.add_to_chat(8,'NOTE: 1:30 general timer set, '
  800. ..'max sleep can last 2:00')
  801. windower.send_command('timers c "Dream Flower" 90 down'
  802. ..'spells/00521.png')
  803. end
  804.  
  805. -- TIMERS PLUGIN: Since Aftermath: Lv.1 can overwrite itself this
  806. -- will delete and re-create this specific timer
  807. if spell.name == 'Expiacion' and player.equipment.main == 'Tizona'
  808. and check_buffs('Aftermath: Lv.1') then
  809. windower.send_command('timers d "Aftermath: Lv.1"; wait 0.3;'
  810. ..'timers c "Aftermath: Lv.1" 90 down abilities/00027.png')
  811. end
  812. end
  813. end
  814.  
  815. function slot_disabling()
  816. -- Disable slots for items you don't want removed when performing actions
  817. if player.equipment.head == 'Reraise Hairpin' then
  818. disable('head')
  819. windower.add_to_chat(8,'Reraise Hairpin equiped on head')
  820. else
  821. enable('head')
  822. end
  823.  
  824. if player.equipment.left_ear == 'Reraise Earring' then
  825. disable('left_ear')
  826. windower.add_to_chat(8,'Reraise Earring equiped on left ear')
  827. else
  828. enable('left_ear')
  829. end
  830.  
  831. if player.equipment.right_ear == 'Reraise Earring' then
  832. disable('right_ear')
  833. windower.add_to_chat(8,'Reraise Earring equiped on right ear')
  834. else
  835. enable('right_ear')
  836. end
  837. end
  838.  
  839.  
  840. function status_change(new,old)
  841. if T{'Idle','Engaged'}:contains(new) and gear_change_ok then
  842. gear_modes()
  843. end
  844. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement