Advertisement
Guest User

His Inc lua

a guest
Mar 23rd, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.40 KB | None | 0 0
  1. --------------------------------------------------------------------------------------------------
  2. -- FILE: inc.lua
  3. -- DESC: General utility functions that can be used by any job files.
  4. --------------------------------------------------------------------------------------------------
  5. -- Offense/Defense --
  6. local off = 'atk'
  7. local def = 'none'
  8. local am = 'atk'
  9. local sub = 'sub'
  10. local swap = true
  11.  
  12. -- Special Spell Groups --
  13. local spell_groups =
  14. {
  15. -- Cure --
  16. ['Cure'] = 'Cure',
  17. ['Cure II'] = 'Cure',
  18. ['Cure III'] = 'Cure',
  19. ['Cure IV'] = 'Cure',
  20. ['Cure V'] = 'Cure',
  21. ['Cure VI'] = 'Cure',
  22. ['Cura'] = 'Cure',
  23. ['Cura II'] = 'Cure',
  24. ['Cura III'] = 'Cure',
  25. ['Curaga'] = 'Curaga',
  26. ['Curaga II'] = 'Curaga',
  27. ['Curaga III'] = 'Curaga',
  28. ['Curaga IV'] = 'Curaga',
  29. ['Curaga V'] = 'Curaga',
  30.  
  31.  
  32. -- Status Removal --
  33. ['Poisona'] = 'StatusRemoval',
  34. ['Paralyna'] = 'StatusRemoval',
  35. ['Silena'] = 'StatusRemoval',
  36. ['Blindna'] = 'StatusRemoval',
  37. ['Cursna'] = 'StatusRemoval',
  38. ['Stona'] = 'StatusRemoval',
  39. ['Viruna'] = 'StatusRemoval',
  40. ['Erase'] = 'StatusRemoval',
  41.  
  42. -- Barspell --
  43. ['Barfire'] = 'BarElement',
  44. ['Barstone'] = 'BarElement',
  45. ['Barwater'] = 'BarElement',
  46. ['Baraero'] = 'BarElement',
  47. ['Barblizzard'] = 'BarElement',
  48. ['Barthunder'] = 'BarElement',
  49. ['Barfira'] = 'BarElement',
  50. ['Barstonra'] = 'BarElement',
  51. ['Barwatera'] = 'BarElement',
  52. ['Baraera'] = 'BarElement',
  53. ['Barblizzara'] = 'BarElement',
  54. ['Barthundra'] = 'BarElement',
  55.  
  56. -- Raise --
  57. ['Raise'] = 'Raise',
  58. ['Raise II'] = 'Raise',
  59. ['Raise III'] = 'Raise',
  60. ['Arise'] = 'Raise',
  61. ['Reraise'] = 'Raise',
  62. ['Reraise II'] = 'Raise',
  63. ['Reraise III'] = 'Raise',
  64.  
  65. -- Protect --
  66. ['Protect'] = 'Protect',
  67. ['Protect II'] = 'Protect',
  68. ['Protect III'] = 'Protect',
  69. ['Protect IV'] = 'Protect',
  70. ['Protect V'] = 'Protect',
  71. ['Protectra'] = 'Protect',
  72. ['Protectra II'] = 'Protect',
  73. ['Protectra III'] = 'Protect',
  74. ['Protectra IV'] = 'Protect',
  75. ['Protectra V'] = 'Protect',
  76.  
  77. -- Shell --
  78. ['Shell'] = 'Shell',
  79. ['Shell II'] = 'Shell',
  80. ['Shell III'] = 'Shell',
  81. ['Shell IV'] = 'Shell',
  82. ['Shell V'] = 'Shell',
  83. ['Shellra'] = 'Shell',
  84. ['Shellra II'] = 'Shell',
  85. ['Shellra III'] = 'Shell',
  86. ['Shellra IV'] = 'Shell',
  87. ['Shellra V'] = 'Shell',
  88.  
  89. -- Regen --
  90. ['Regen'] = 'Regen',
  91. ['Regen II'] = 'Regen',
  92. ['Regen III'] = 'Regen',
  93. ['Regen IV'] = 'Regen',
  94. ['Regen V'] = 'Regen',
  95.  
  96. -- Refresh --
  97. ['Refresh'] = 'Refresh',
  98. ['Refresh II'] = 'Refresh',
  99.  
  100. -- Teleports --
  101. ['Teleport-Holla'] = 'Teleport',
  102. ['Teleport-Dem'] = 'Teleport',
  103. ['Teleport-Mea'] = 'Teleport',
  104. ['Teleport-Altep'] = 'Teleport',
  105. ['Teleport-Yhoat'] = 'Teleport',
  106. ['Teleport-Vahzl'] = 'Teleport',
  107. ['Recall-Pashh'] = 'Teleport',
  108. ['Recall-Meriph'] = 'Teleport',
  109. ['Recall-Jugner'] = 'Teleport',
  110.  
  111. -- Bard Songs --
  112. ['Valor Minuet'] = 'Minuet',
  113. ['Valor Minuet II'] = 'Minuet',
  114. ['Valor Minuet III'] = 'Minuet',
  115. ['Valor Minuet IV'] = 'Minuet',
  116. ['Valor Minuet V'] = 'Minuet',
  117. ["Knight's Minne"] = 'Minne',
  118. ["Knight's Minne II"] = 'Minne',
  119. ["Knight's Minne III"] = 'Minne',
  120. ["Knight's Minne IV"] = 'Minne',
  121. ["Knight's Minne V"] = 'Minne',
  122. ['Advancing March'] = 'March',
  123. ['Victory March'] = 'March',
  124. ['Sword Madrigal'] = 'Madrigal',
  125. ['Blade Madrigal'] = 'Madrigal',
  126. ["Hunter's Prelude"] = 'Prelude',
  127. ["Archer's Prelude"] = 'Prelude',
  128. ['Sheepfoe Mambo'] = 'Mambo',
  129. ['Dragonfoe Mambo'] = 'Mambo',
  130. ['Raptor Mazurka'] = 'Mazurka',
  131. ['Chocobo Mazurka'] = 'Mazurka',
  132. ["Mage's Ballad"] = 'Ballad',
  133. ["Mage's Ballad II"] = 'Ballad',
  134. ["Mage's Ballad III"] = 'Ballad',
  135. ["Army's Paeon"] = 'Paeon',
  136. ["Army's Paeon II"] = 'Paeon',
  137. ["Army's Paeon III"] = 'Paeon',
  138. ["Army's Paeon IV"] = 'Paeon',
  139. ["Army's Paeon V"] = 'Paeon',
  140. ["Army's Paeon VI"] = 'Paeon',
  141. ['Fire Carol'] = 'Carol',
  142. ['Ice Carol'] = 'Carol',
  143. ['Wind Carol'] = 'Carol',
  144. ['Earth Carol'] = 'Carol',
  145. ['Lightning Carol'] = 'Carol',
  146. ['Water Carol'] = 'Carol',
  147. ['Light Carol'] = 'Carol',
  148. ['Dark Carol'] = 'Carol',
  149. ['Fire Carol II'] = 'Carol',
  150. ['Ice Carol II'] = 'Carol',
  151. ['Wind Carol II'] = 'Carol',
  152. ['Earth Carol II'] = 'Carol',
  153. ['Lightning Carol II'] = 'Carol',
  154. ['Water Carol II'] = 'Carol',
  155. ['Light Carol II'] = 'Carol',
  156. ['Dark Carol II'] = 'Carol',
  157. ['Foe Lullaby'] = 'Lullaby',
  158. ['Foe Lullaby II'] = 'Lullaby',
  159. ['Horde Lullaby'] = 'Lullaby',
  160. ['Horde Lullaby II'] = 'Lullaby',
  161. ['Fire Threnody'] = 'Threnody',
  162. ['Ice Threnody'] = 'Threnody',
  163. ['Wind Threnody'] = 'Threnody',
  164. ['Earth Threnody'] = 'Threnody',
  165. ['Lightning Threnody'] = 'Threnody',
  166. ['Water Threnody'] = 'Threnody',
  167. ['Light Threnody'] = 'Threnody',
  168. ['Dark Threnody'] = 'Threnody',
  169. ['Battlefield Elegy'] = 'Elegy',
  170. ['Carnage Elegy'] = 'Elegy',
  171. ['Foe Requiem'] = 'Requiem',
  172. ['Foe Requiem II'] = 'Requiem',
  173. ['Foe Requiem III'] = 'Requiem',
  174. ['Foe Requiem IV'] = 'Requiem',
  175. ['Foe Requiem V'] = 'Requiem',
  176. ['Foe Requiem VI'] = 'Requiem',
  177. ['Foe Requiem VII'] = 'Requiem',
  178.  
  179. ['Sinewy Etude'] = 'Etude',
  180. ['Dextrous Etude'] = 'Etude',
  181. ['Vivacious Etude'] = 'Etude',
  182. ['Quick Etude'] = 'Etude',
  183. ['Learned Etude'] = 'Etude',
  184. ['Spirited Etude'] = 'Etude',
  185. ['Enchanting Etude'] = 'Etude',
  186. ['Herculean Etude'] = 'Etude',
  187. ['Uncanny Etude'] = 'Etude',
  188. ['Vital Etude'] = 'Etude',
  189. ['Swift Etude'] = 'Etude',
  190. ['Sage Etude'] = 'Etude',
  191. ['Logical Etude'] = 'Etude',
  192. ['Bewitching Etude'] = 'Etude',
  193.  
  194. ['Utsusemi: Ichi'] = 'Utsusemi',
  195. ['Utsusemi: Ni'] = 'Utsusemi',
  196.  
  197. ['Banish'] = 'Banish',
  198. ['Banish II'] = 'Banish',
  199. ['Banish III'] = 'Banish',
  200. ['Banishga'] = 'Banish',
  201. ['Banishga II'] = 'Banish',
  202.  
  203. ['Slow'] = 'Enfeeble-MND',
  204. ['Slow II'] = 'Enfeeble-MND',
  205. ['Paralyze'] = 'Enfeeble-MND',
  206. ['Paralyze II'] = 'Enfeeble-MND',
  207.  
  208. ['Holy'] = 'Holy',
  209. ['Holy II'] = 'Holy',
  210.  
  211. ['Drain'] = 'Drain',
  212. ['Drain II'] = 'Drain',
  213. ['Aspir'] = 'Aspir',
  214. ['Aspir II'] = 'Aspir',
  215.  
  216. ['Absorb-Str'] = 'Absorb',
  217. ['Absorb-Dex'] = 'Absorb',
  218. ['Absorb-Vit'] = 'Absorb',
  219. ['Absorb-Agi'] = 'Absorb',
  220. ['Absorb-Int'] = 'Absorb',
  221. ['Absorb-Mnd'] = 'Absorb',
  222. ['Absorb-Chr'] = 'Absorb',
  223. ['Absorb-Acc'] = 'Absorb',
  224. ['Absorb-TP'] = 'Absorb',
  225. ['Absorb-Attri'] = 'Absorb',
  226.  
  227. ['Burn'] = 'Enfeeble-Ele',
  228. ['Frost'] = 'Enfeeble-Ele',
  229. ['Choke'] = 'Enfeeble-Ele',
  230. ['Rasp'] = 'Enfeeble-Ele',
  231. ['Shock'] = 'Enfeeble-Ele',
  232. ['Drown'] = 'Enfeeble-Ele',
  233.  
  234. ['Pyrohelix'] = 'Helix',
  235. ['Cryohelix'] = 'Helix',
  236. ['Anemohelix'] = 'Helix',
  237. ['Geohelix'] = 'Helix',
  238. ['Ionohelix'] = 'Helix',
  239. ['Hydrohelix'] = 'Helix',
  240. ['Luminohelix'] = 'Helix',
  241. ['Noctohelix'] = 'Helix',
  242.  
  243. ['Firestorm'] = 'Storm',
  244. ['Hailstorm'] = 'Storm',
  245. ['Windstorm'] = 'Storm',
  246. ['Sandstorm'] = 'Storm',
  247. ['Thunderstorm'] = 'Storm',
  248. ['Rainstorm'] = 'Storm',
  249. ['Aurorastorm'] = 'Storm',
  250. ['Voidstorm'] = 'Storm',
  251.  
  252. ['Fire Maneuver'] = 'Maneuver',
  253. ['Ice Maneuver'] = 'Maneuver',
  254. ['Wind Maneuver'] = 'Maneuver',
  255. ['Earth Maneuver'] = 'Maneuver',
  256. ['Thunder Maneuver'] = 'Maneuver',
  257. ['Water Maneuver'] = 'Maneuver',
  258. ['Light Maneuver'] = 'Maneuver',
  259. ['Dark Maneuver'] = 'Maneuver',
  260.  
  261. ['Haste'] = 'EnhancingD',
  262. ['Haste II'] = 'EnhancingD',
  263. ['Flurry'] = 'EnhancingD',
  264. ['Flurry II'] = 'EnhancingD',
  265. ['Refresh'] = 'EnhancingD',
  266. ['Refresh II'] = 'EnhancingD',
  267. ['Firestorm'] = 'EnhancingD',
  268. ['Hailstorm'] = 'EnhancingD',
  269. ['Windstorm'] = 'EnhancingD',
  270. ['Sandstorm'] = 'EnhancingD',
  271. ['Thunderstorm'] = 'EnhancingD',
  272. ['Rainstorm'] = 'EnhancingD',
  273. ['Aurorastorm'] = 'EnhancingD',
  274. ['Voidstorm'] = 'EnhancingD',
  275.  
  276. ['Blizzard'] = 'Blizz',
  277. ['Blizzard II'] = 'Blizz',
  278. ['Blizzard III'] = 'Blizz',
  279. ['Blizzard IV'] = 'Blizz',
  280. ['Blizzard V'] = 'Blizz',
  281. ['Freeze'] = 'Blizz',
  282.  
  283.  
  284. --Dnc Groups--
  285.  
  286.  
  287.  
  288. ['Drain Samba'] = 'Samba',
  289. ['Drain Samba II'] = 'Samba',
  290. ['Aspir Samba'] = 'Samba',
  291. ['Aspir Samba II'] = 'Samba',
  292. ['Haste Samba'] = 'Samba',
  293.  
  294. ['Quickstep'] = 'Step',
  295. ['Box Step'] = 'Step',
  296. ['Stutter Step'] = 'Step',
  297.  
  298. ['Violent Flourish'] = 'Flourish',
  299. ['Animated Flourish'] = 'Flourish',
  300. ['Desperate Flourish'] = 'Flourish',
  301.  
  302. ['Spectral Jig'] = 'Jig',
  303. ['Chocobo Jig'] = 'Jig',
  304. ['Chocobo Jig II'] = 'Jig',
  305.  
  306.  
  307. --Blu Groups--
  308.  
  309. --STR--
  310. ['Vertical cleave'] = 'BluSTR',
  311. ['Death Scissors'] = 'BluSTR',
  312. ['Empty thrash'] = 'BluSTR',
  313. ['Dimensional Death'] = 'BluSTR',
  314. ['Quadrastrike'] = 'BluSTR',
  315. ['Bloodrake'] = 'BluSTR',
  316. ['Heavy strike'] = 'BluSTR',
  317.  
  318. --STRDEX--
  319. ['Disseverment']= 'BluSTRDEX',
  320. ['Hysteric Barrage']= 'BluSTRDEX',
  321. ['Frenetic Rip']= 'BluSTRDEX',
  322. ['Seedspray']= 'BluSTRDEX',
  323. ['Vanity Dive']= 'BluSTRDEX',
  324. ['Goblin rush']= 'BluSTRDEX',
  325. ['Paralyzing Triad']= 'BluSTRDEX',
  326. ['Thrashing Assault']= 'BluSTRDEX',
  327. ['Sinkerdrill']= 'BluSTRDEX',
  328.  
  329.  
  330. --STRVIT--
  331. ['Quad. Continuum']= 'BluSTRVIT',
  332. ['Delta Thrust']= 'BluSTRVIT',
  333. ['Cannonball']= 'BluSTRVIT',
  334. ['Glutinous Dart']= 'BluSTRVIT',
  335.  
  336. --STRMND--
  337. ['Whirl of Rage']= 'BluSTRMND',
  338.  
  339. --AGI--
  340. ['Benthic Typhoon']= 'BluAGI',
  341. ['Final Sting']= 'BluAGI',
  342. ['Spiral Spin']= 'BluAGI',
  343.  
  344. --INT--
  345. ['Gates of Hades']= 'BluINT',
  346. ['Leafstorm']= 'BluINT',
  347. ['Firespit']= 'BluINT',
  348. ['Acrid stream']= 'BluINT',
  349. ['Regurgitation']= 'BluINT',
  350. ['Corrosive Ooze']= 'BluINT',
  351. ['Thermal Pulse']= 'BluINT',
  352. ['Magic Hammer']= 'BluINT',
  353. ['Everyone. Grudge']= 'BluINT',
  354. ['Water Bomb']= 'BluINT',
  355. ['Dark Orb']= 'BluINT',
  356. ['Thunderbolt']= 'BluINT',
  357. ['Tem. Upheaval']= 'BluINT',
  358. ['Embalming Earth']= 'BluINT',
  359. ['Foul Waters']= 'BluINT',
  360. ['Rending Deluge']= 'BluINT',
  361. ['Droning Whirlwind']= 'BluINT',
  362. ['Subduction']= 'BluINT',
  363. ['Railcannon']='BluINT',
  364. ['PolarRoar']='BluINT',
  365.  
  366. --Bluecures
  367. ['Magic Fruit']= 'BluCure',
  368. ['Plenilune Embrace']= 'BluCure',
  369. ['Wild Carrot']= 'BluCure',
  370. ['Pollen']= 'BluCure',
  371. ['Restoral']= 'BluCure',
  372.  
  373. --BlueAcc
  374. ['Sheep Song']= 'BluAcc',
  375. ['Mortal Ray']= 'BluAcc',
  376. ['Chaotic Eye']= 'BluAcc',
  377. ['Sound Blast']= 'BluAcc',
  378. ['Lowing']= 'BluAcc',
  379. ['Infrasonics']= 'BluAcc',
  380. ['Feather Tickle']= 'BluAcc',
  381. ['Voracious Trunk']= 'BluAcc',
  382. ['Auroral Drape']= 'BluAcc',
  383. ['Filamented Hold']= 'BluAcc',
  384. ['Cimicine Discharge']= 'BluAcc',
  385. ['Awful Eye']= 'BluAcc',
  386. ['Demoralizing Roar']= 'BluAcc',
  387. ['Blank Gaze']= 'BluAcc',
  388. ['Light of Penance']= 'BluAcc',
  389. ['Actinic Burst']= 'BluAcc',
  390. ['Blood Drain']= 'BluAcc',
  391. ['Soporific']= 'BluAcc',
  392. ['Digest']= 'BluAcc',
  393. ['MP Drainkiss']= 'BluAcc',
  394. ['Geist Wall']= 'BluAcc',
  395. ['Jettatura']= 'BluAcc',
  396. ['Sandspray']= 'BluAcc',
  397. ['Enervation']= 'BluAcc',
  398. ['Dream Flower']= 'BluAcc',
  399.  
  400.  
  401. }
  402.  
  403.  
  404. local spell_ignore_skill =
  405. S{
  406. 'Teleport'
  407. }
  408.  
  409. -- ToAU Zone List --
  410. toau_zones =
  411. S{
  412. "Leujaoam Sanctum",
  413. "Mamool Ja Training Grounds",
  414. "Lebros Cavern","Periqia",
  415. "Ilrusi Atoll",
  416. "Nyzul Isle",
  417. "Bhaflau Remnants",
  418. "Arrapago Remnants",
  419. "Silver Sea Remnants",
  420. "Zhayolm Remnants"
  421. }
  422.  
  423. --------------------------------------------------------------------------------------------------
  424. -- NAME: Init.
  425. --------------------------------------------------------------------------------------------------
  426. function inc_init()
  427. -- Base Sets --
  428. sets.offense = {}
  429. sets.defense = {}
  430. sets.aftermath = {}
  431. sets.fc = {}
  432. sets.ja = {}
  433. sets.ws = {}
  434. sets.pet = {}
  435. sets.midcast = {}
  436. sets.sub = {}
  437.  
  438. -- send_command('clearbinds')
  439.  
  440. -- Configure Keybinds --
  441. send_command('wait 0.2; bind %numpad0 gs c numpad0')
  442. send_command('wait 0.2; bind %numpad1 gs c numpad1')
  443. send_command('wait 0.2; bind %numpad2 gs c numpad2')
  444. send_command('wait 0.2; bind %numpad3 gs c numpad3')
  445. send_command('wait 0.2; bind %numpad4 gs c numpad4')
  446. send_command('wait 0.2; bind %numpad5 gs c numpad5')
  447. send_command('wait 0.2; bind %numpad6 gs c numpad6')
  448. send_command('wait 0.2; bind %numpad7 gs c numpad7')
  449. send_command('wait 0.2; bind %numpad8 gs c numpad8')
  450. send_command('wait 0.2; bind %numpad9 gs c numpad9')
  451.  
  452. send_command('wait 0.2; bind %1 gs c std1')
  453. send_command('wait 0.2; bind %2 gs c std2')
  454. send_command('wait 0.2; bind %3 gs c std3')
  455. send_command('wait 0.2; bind %4 gs c std4')
  456. send_command('wait 0.2; bind %5 gs c std5')
  457. send_command('wait 0.2; bind %6 gs c std6')
  458. send_command('wait 0.2; bind %7 gs c std7')
  459. send_command('wait 0.2; bind %8 gs c std8')
  460. send_command('wait 0.2; bind %9 gs c std9')
  461. send_command('wait 0.2; bind %0 gs c std0')
  462. send_command('wait 0.2; bind %- gs c std-')
  463. send_command('wait 0.2; bind %= gs c std=')
  464.  
  465. send_command('wait 0.2; bind %^1 gs c ctl1')
  466. send_command('wait 0.2; bind %^2 gs c ctl2')
  467. send_command('wait 0.2; bind %^3 gs c ctl3')
  468. send_command('wait 0.2; bind %^4 gs c ctl4')
  469. send_command('wait 0.2; bind %^5 gs c ctl5')
  470. send_command('wait 0.2; bind %^6 gs c ctl6')
  471. send_command('wait 0.2; bind %^7 gs c ctl7')
  472. send_command('wait 0.2; bind %^8 gs c ctl8')
  473. send_command('wait 0.2; bind %^9 gs c ctl9')
  474. send_command('wait 0.2; bind %^0 gs c ctl0')
  475. send_command('wait 0.2; bind %^- gs c ctl-')
  476. send_command('wait 0.2; bind %^= gs c ctl=')
  477.  
  478. send_command('wait 0.2; bind %!1 gs c alt1')
  479. send_command('wait 0.2; bind %!2 gs c alt2')
  480. send_command('wait 0.2; bind %!3 gs c alt3')
  481. send_command('wait 0.2; bind %!4 gs c alt4')
  482. send_command('wait 0.2; bind %!5 gs c alt5')
  483. send_command('wait 0.2; bind %!6 gs c alt6')
  484. send_command('wait 0.2; bind %!7 gs c alt7')
  485. send_command('wait 0.2; bind %!8 gs c alt8')
  486. send_command('wait 0.2; bind %!9 gs c alt9')
  487. send_command('wait 0.2; bind %!0 gs c alt0')
  488. send_command('wait 0.2; bind %!- gs c alt-')
  489. send_command('wait 0.2; bind %!= gs c alt=')
  490.  
  491. send_command('wait 0.2; bind ` input /target <bt>')
  492. end
  493.  
  494. --------------------------------------------------------------------------------------------------
  495. -- NAME: File Unload.
  496. --------------------------------------------------------------------------------------------------
  497. function file_unload()
  498. -- Clear Keybinds --
  499. -- send_command('clearbinds')
  500. end
  501.  
  502. --------------------------------------------------------------------------------------------------
  503. -- NAME: Cancel Buffs.
  504. -- DESC: Function to cancel buffs if they'd conflict with using the spell you're attempting.
  505. --------------------------------------------------------------------------------------------------
  506. function cancel_buffs(spell)
  507. if(spell.action_type == 'Ability') then
  508. local abil_recasts = windower.ffxi.get_ability_recasts()
  509. if(abil_recasts[spell.index] and (abil_recasts[spell.index] > 0)) then
  510. add_to_chat(123,'Cancel '..spell.english..': Ability waiting on recast.')
  511. cancel_spell()
  512. return true
  513. end
  514. elseif(spell.action_type == 'Magic') then
  515. local spell_recasts = windower.ffxi.get_spell_recasts()
  516. if(spell_recasts[spell.index] and (spell_recasts[spell.index] > 0)) then
  517. add_to_chat(123,'Cancel '..spell.english..': Spell waiting on recast.')
  518. cancel_spell()
  519. return true
  520. end
  521. end
  522.  
  523. -- Cancel Sneak --
  524. if(buffactive.sneak) then
  525. if(spell.english == 'Spectral Jig') then
  526. cast_delay(0.2)
  527. send_command('cancel sneak')
  528. elseif((spell.english == 'Sneak') and (spell.target.type == 'SELF')) then
  529. send_command('cancel sneak')
  530. elseif spell.english:startswith('Monomi') then
  531. send_command('cancel sneak')
  532. end
  533. end
  534.  
  535. -- Cancel Shadows --
  536. -- if(spell.english == 'Utsusemi: Ichi') then
  537. -- send_command('cancel copy image*')
  538. -- end
  539.  
  540. -- Cancel Stoneskin --
  541. if(spell.english == 'Stoneskin') then
  542. send_command('cancel stoneskin')
  543. end
  544.  
  545. return false
  546. end
  547.  
  548. --------------------------------------------------------------------------------------------------
  549. -- NAME: Toggle Offense
  550. --------------------------------------------------------------------------------------------------
  551. function toggle_offense()
  552. if(off == 'atk') then
  553. off = 'acc'
  554. add_to_chat(104, '-- Offense: acc --')
  555. elseif(off == 'acc') then
  556. off = 'mp'
  557. add_to_chat(104, '-- Offense: refresh/th --')
  558. else
  559. off = 'atk'
  560. add_to_chat(104, '-- Offense: atk --')
  561. end
  562.  
  563. eq_default()
  564. end
  565.  
  566. --------------------------------------------------------------------------------------------------
  567. -- NAME: Toggle Aftermath
  568. --------------------------------------------------------------------------------------------------
  569. function toggle_aftermath()
  570. if(am == 'none') then
  571. am = 'atk'
  572. add_to_chat(104, '-- Aftermath: atk --')
  573. elseif(am == 'atk') then
  574. am = 'acc'
  575. add_to_chat(104, '-- Aftermath: acc --')
  576. else
  577. am = 'none'
  578. add_to_chat(104, '-- Aftermath: none --')
  579. end
  580.  
  581. eq_default()
  582. end
  583.  
  584.  
  585.  
  586.  
  587. --------------------------------------------------------------------------------------------------
  588. -- NAME: Toggle Swap
  589. ------------------------------------------------------------------------------
  590.  
  591. function toggle_swap()
  592. if(swap) then
  593. swap = false
  594. add_to_chat(104,'Swap: Off')
  595. else
  596. swap = true
  597. add_to_chat(104,'Swap: On')
  598. end
  599. end
  600. --------------------------------------------------------------------------------------------------
  601. -- NAME: Toggle Defense
  602. --------------------------------------------------------------------------------------------------
  603. function toggle_defense()
  604. -- None/MDT/PDT Toggle --
  605. if(def == 'none') then
  606. def = 'mdt'
  607. add_to_chat(104, '-- Defense: MDT --')
  608. elseif(def == 'mdt') then
  609. def = 'pdt'
  610. add_to_chat(104, '-- Defense: PDT --')
  611. else
  612. def = 'none'
  613. add_to_chat(104, '-- Defense: None --')
  614. end
  615.  
  616. eq_default()
  617. end
  618.  
  619. --------------------------------------------------------------------------------------------------
  620. -- NAME: Get Offense.
  621. --------------------------------------------------------------------------------------------------
  622. function get_offense()
  623. return off
  624. end
  625.  
  626. --------------------------------------------------------------------------------------------------
  627. -- NAME: Get Defense.
  628. --------------------------------------------------------------------------------------------------
  629. function get_defense()
  630. return def
  631. end
  632.  
  633. --------------------------------------------------------------------------------------------------
  634. -- NAME: Get Aftermath.
  635. --------------------------------------------------------------------------------------------------
  636. function get_aftermath()
  637. return am
  638. end
  639.  
  640. --------------------------------------------------------------------------------------------------
  641. -- NAME: Get Spell Group.
  642. --------------------------------------------------------------------------------------------------
  643. function get_group(spell)
  644. return spell_groups[spell.english]
  645. end
  646.  
  647. --------------------------------------------------------------------------------------------------
  648. -- NAME: Change Spell
  649. -- DESC: Cancel the previous spell and replace it with the specified spell
  650. --------------------------------------------------------------------------------------------------
  651. function change_spell(spell)
  652. cancel_spell()
  653. send_command(spell)
  654. end
  655.  
  656. --------------------------------------------------------------------------------------------------
  657. -- Is Target PC?
  658. --------------------------------------------------------------------------------------------------
  659. function is_target_pc()
  660. if(player.target.type == 'NONE') then return true end
  661. if(player.target.type == 'SELF') then return true end
  662. if(player.target.type == 'PLAYER') then return true end
  663.  
  664. return false
  665. end
  666.  
  667. --------------------------------------------------------------------------------------------------
  668. -- Is Target Enemy?
  669. --------------------------------------------------------------------------------------------------
  670. function is_target_enemy()
  671. return player.target.type == 'MONSTER'
  672. end
  673.  
  674. --------------------------------------------------------------------------------------------------
  675. -- NAME: Equip Defense Gear.
  676. --------------------------------------------------------------------------------------------------
  677. function eq_defense()
  678. -- Apply Defense --
  679. if(sets.defense[def]) then
  680. equip(sets.defense[def])
  681. end
  682. end
  683.  
  684. --------------------------------------------------------------------------------------------------
  685. -- NAME: Equip Default Gear
  686. --------------------------------------------------------------------------------------------------
  687. function eq_default()
  688. -- Save TP --
  689. if(swap) then
  690. enable('Main', 'Sub', 'Range')
  691. else
  692. disable('Main', 'Sub', 'Range')
  693. end
  694.  
  695. if(player.status == 'Engaged') then
  696. if(sets.offense[off]) then
  697. equip(sets.offense[off])
  698. end
  699. if(buffactive.Aftermath and sets.aftermath[am]) then
  700. equip(sets.aftermath[am])
  701. end
  702. end
  703.  
  704. -- Idle Set --
  705. if(player.status == 'Idle') then
  706. equip(sets.idle)
  707. end
  708.  
  709. if(buffactive == "Sublimation: Activated" and player.status == 'Idle') then
  710. equip(sets.sub)
  711. end
  712.  
  713.  
  714. -- Apply Defense --
  715. eq_defense()
  716.  
  717. if(player.status == 'Resting') then
  718. equip(sets.rest)
  719. end
  720.  
  721. end
  722.  
  723. --------------------------------------------------------------------------------------------------
  724. -- NAME: Equip Default Precast Gear
  725. --------------------------------------------------------------------------------------------------
  726. function eq_default_precast(spell)
  727. -- Cancel Overwritten Buffs --
  728. cancel_buffs(spell)
  729.  
  730. -- Magic PreCast --
  731. if(spell.action_type == 'Magic') then
  732. -- Generic Fast Cast --
  733. equip(sets.fc)
  734.  
  735. if(player.status == 'Resting') then
  736. equip(sets.rest)
  737. end
  738.  
  739. -- Type Fast Cast --
  740. if(sets.fc[spell.type]) then
  741. equip(sets.fc[spell.type])
  742. end
  743.  
  744. -- Skill Fast Cast --
  745. if(sets.fc[spell.skill]) then
  746. equip(sets.fc[spell.skill])
  747. end
  748.  
  749.  
  750.  
  751. -- Group Fast Cast --
  752. local group = spell_groups[spell.english]
  753. if(group and sets.fc[group]) then
  754. equip(sets.fc[group])
  755. end
  756.  
  757. -- Spell Fast Cast --
  758. if(sets.fc[spell.english]) then
  759. equip(sets.fc[spell.english])
  760. end
  761.  
  762. -- Apply Defense --
  763. -- eq_defense()
  764. end
  765.  
  766. -- Ability PreCast --
  767. if(spell.action_type == 'Ability') then
  768. -- Job Ability --
  769. if((spell.type == 'JobAbility') and sets.ja[spell.english]) then
  770. equip(sets.ja[spell.english])
  771. end
  772.  
  773. -- Weapon Skill --
  774. if((spell.type == 'WeaponSkill') and sets.ws[spell.english]) then
  775. equip(sets.ws[spell.english])
  776. end
  777. if((spell.type == 'Pet') and sets.pet[spell.english]) then
  778. equip(sets.pet[spell.english])
  779. end
  780. -- Apply Defense --
  781. -- eq_defense()
  782. end
  783. end
  784.  
  785. --------------------------------------------------------------------------------------------------
  786. -- NAME: Equip Default Midcast Gear
  787. --------------------------------------------------------------------------------------------------
  788. function eq_default_midcast(spell)
  789. local group = spell_groups[spell.english]
  790.  
  791. -- Magic MidCast --
  792. if(spell.action_type == 'Magic') then
  793. -- Generic MidCast --
  794. equip(sets.midcast)
  795.  
  796. -- Type MidCast --
  797. if(sets.midcast[spell.type]) then
  798. equip(sets.midcast[spell.type])
  799. end
  800.  
  801. -- Skill MidCast --
  802. if(sets.midcast[spell.skill]) then
  803. equip(sets.midcast[spell.skill])
  804. end
  805.  
  806. -- Group MidCast --
  807. if(group and sets.midcast[group]) then
  808. equip(sets.midcast[group])
  809. end
  810.  
  811. -- Spell MidCast --
  812. if(sets.midcast[spell.english]) then
  813. equip(sets.midcast[spell.english])
  814. end
  815.  
  816. if spell.action_type == "Magic" then
  817. if spell.element == world.weather_element then
  818. equip(sets.obi[spell.element])
  819. elseif spell.element == world.day_element then
  820. equip(sets.day[spell.element])
  821. end
  822. end
  823.  
  824. -- Apply Defense --
  825. -- eq_defense()
  826. end
  827. end
  828.  
  829.  
  830.  
  831. --------------------------------------------------------------------------------------------------
  832. -- NAME: Equip Balrahn --
  833. --------------------------------------------------------------------------------------------------
  834. function eq_balrahn()
  835. if(toau_zones:contains(zone)) then
  836. -- equip({ring1 = "Balrahn's Ring"})
  837. end
  838. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement