Advertisement
Guest User

My Inc lua NOT WORKING

a guest
Mar 23rd, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.42 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. local spell_ignore_skill =
  404. S{
  405. 'Teleport'
  406. }
  407.  
  408. -- ToAU Zone List --
  409. toau_zones =
  410. S{
  411. "Leujaoam Sanctum",
  412. "Mamool Ja Training Grounds",
  413. "Lebros Cavern","Periqia",
  414. "Ilrusi Atoll",
  415. "Nyzul Isle",
  416. "Bhaflau Remnants",
  417. "Arrapago Remnants",
  418. "Silver Sea Remnants",
  419. "Zhayolm Remnants"
  420. }
  421.  
  422. --------------------------------------------------------------------------------------------------
  423. -- NAME: Init.
  424. --------------------------------------------------------------------------------------------------
  425. function inc_init()
  426. -- Base Sets --
  427. sets.offense = {}
  428. sets.defense = {}
  429. sets.aftermath = {}
  430. sets.fc = {}
  431. sets.ja = {}
  432. sets.ws = {}
  433. sets.pet = {}
  434. sets.midcast = {}
  435. sets.sub = {}
  436.  
  437. -- send_command('clearbinds')
  438.  
  439. -- Configure Keybinds --
  440. send_command('wait 0.2; bind %numpad0 gs c numpad0')
  441. send_command('wait 0.2; bind %numpad1 gs c numpad1')
  442. send_command('wait 0.2; bind %numpad2 gs c numpad2')
  443. send_command('wait 0.2; bind %numpad3 gs c numpad3')
  444. send_command('wait 0.2; bind %numpad4 gs c numpad4')
  445. send_command('wait 0.2; bind %numpad5 gs c numpad5')
  446. send_command('wait 0.2; bind %numpad6 gs c numpad6')
  447. send_command('wait 0.2; bind %numpad7 gs c numpad7')
  448. send_command('wait 0.2; bind %numpad8 gs c numpad8')
  449. send_command('wait 0.2; bind %numpad9 gs c numpad9')
  450.  
  451. send_command('wait 0.2; bind %1 gs c std1')
  452. send_command('wait 0.2; bind %2 gs c std2')
  453. send_command('wait 0.2; bind %3 gs c std3')
  454. send_command('wait 0.2; bind %4 gs c std4')
  455. send_command('wait 0.2; bind %5 gs c std5')
  456. send_command('wait 0.2; bind %6 gs c std6')
  457. send_command('wait 0.2; bind %7 gs c std7')
  458. send_command('wait 0.2; bind %8 gs c std8')
  459. send_command('wait 0.2; bind %9 gs c std9')
  460. send_command('wait 0.2; bind %0 gs c std0')
  461. send_command('wait 0.2; bind %- gs c std-')
  462. send_command('wait 0.2; bind %= gs c std=')
  463.  
  464. send_command('wait 0.2; bind %^1 gs c ctl1')
  465. send_command('wait 0.2; bind %^2 gs c ctl2')
  466. send_command('wait 0.2; bind %^3 gs c ctl3')
  467. send_command('wait 0.2; bind %^4 gs c ctl4')
  468. send_command('wait 0.2; bind %^5 gs c ctl5')
  469. send_command('wait 0.2; bind %^6 gs c ctl6')
  470. send_command('wait 0.2; bind %^7 gs c ctl7')
  471. send_command('wait 0.2; bind %^8 gs c ctl8')
  472. send_command('wait 0.2; bind %^9 gs c ctl9')
  473. send_command('wait 0.2; bind %^0 gs c ctl0')
  474. send_command('wait 0.2; bind %^- gs c ctl-')
  475. send_command('wait 0.2; bind %^= gs c ctl=')
  476.  
  477. send_command('wait 0.2; bind %!1 gs c alt1')
  478. send_command('wait 0.2; bind %!2 gs c alt2')
  479. send_command('wait 0.2; bind %!3 gs c alt3')
  480. send_command('wait 0.2; bind %!4 gs c alt4')
  481. send_command('wait 0.2; bind %!5 gs c alt5')
  482. send_command('wait 0.2; bind %!6 gs c alt6')
  483. send_command('wait 0.2; bind %!7 gs c alt7')
  484. send_command('wait 0.2; bind %!8 gs c alt8')
  485. send_command('wait 0.2; bind %!9 gs c alt9')
  486. send_command('wait 0.2; bind %!0 gs c alt0')
  487. send_command('wait 0.2; bind %!- gs c alt-')
  488. send_command('wait 0.2; bind %!= gs c alt=')
  489.  
  490. send_command('wait 0.2; bind ` input /target <bt>')
  491. end
  492.  
  493. --------------------------------------------------------------------------------------------------
  494. -- NAME: File Unload.
  495. --------------------------------------------------------------------------------------------------
  496. function file_unload()
  497. -- Clear Keybinds --
  498. -- send_command('clearbinds')
  499. end
  500.  
  501. --------------------------------------------------------------------------------------------------
  502. -- NAME: Cancel Buffs.
  503. -- DESC: Function to cancel buffs if they'd conflict with using the spell you're attempting.
  504. --------------------------------------------------------------------------------------------------
  505. function cancel_buffs(spell)
  506. if(spell.action_type == 'Ability') then
  507. local abil_recasts = windower.ffxi.get_ability_recasts()
  508. if(abil_recasts[spell.index] and (abil_recasts[spell.index] > 0)) then
  509. add_to_chat(123,'Cancel '..spell.english..': Ability waiting on recast.')
  510. cancel_spell()
  511. return true
  512. end
  513. elseif(spell.action_type == 'Magic') then
  514. local spell_recasts = windower.ffxi.get_spell_recasts()
  515. if(spell_recasts[spell.index] and (spell_recasts[spell.index] > 0)) then
  516. add_to_chat(123,'Cancel '..spell.english..': Spell waiting on recast.')
  517. cancel_spell()
  518. return true
  519. end
  520. end
  521.  
  522. -- Cancel Sneak --
  523. if(buffactive.sneak) then
  524. if(spell.english == 'Spectral Jig') then
  525. cast_delay(0.2)
  526. send_command('cancel sneak')
  527. elseif((spell.english == 'Sneak') and (spell.target.type == 'SELF')) then
  528. send_command('cancel sneak')
  529. elseif spell.english:startswith('Monomi') then
  530. send_command('cancel sneak')
  531. end
  532. end
  533.  
  534. -- Cancel Shadows --
  535. -- if(spell.english == 'Utsusemi: Ichi') then
  536. -- send_command('cancel copy image*')
  537. -- end
  538.  
  539. -- Cancel Stoneskin --
  540. if(spell.english == 'Stoneskin') then
  541. send_command('cancel stoneskin')
  542. end
  543.  
  544. return false
  545. end
  546.  
  547. --------------------------------------------------------------------------------------------------
  548. -- NAME: Toggle Offense
  549. --------------------------------------------------------------------------------------------------
  550. function toggle_offense()
  551. if(off == 'atk') then
  552. off = 'acc'
  553. add_to_chat(104, '-- Offense: acc --')
  554. elseif(off == 'acc') then
  555. off = 'mp'
  556. add_to_chat(104, '-- Offense: refresh/th --')
  557. else
  558. off = 'atk'
  559. add_to_chat(104, '-- Offense: atk --')
  560. end
  561.  
  562. eq_default()
  563. end
  564.  
  565. --------------------------------------------------------------------------------------------------
  566. -- NAME: Toggle Aftermath
  567. --------------------------------------------------------------------------------------------------
  568. function toggle_aftermath()
  569. if(am == 'none') then
  570. am = 'atk'
  571. add_to_chat(104, '-- Aftermath: atk --')
  572. elseif(am == 'atk') then
  573. am = 'acc'
  574. add_to_chat(104, '-- Aftermath: acc --')
  575. else
  576. am = 'none'
  577. add_to_chat(104, '-- Aftermath: none --')
  578. end
  579.  
  580. eq_default()
  581. end
  582.  
  583.  
  584.  
  585.  
  586. --------------------------------------------------------------------------------------------------
  587. -- NAME: Toggle Swap
  588. ------------------------------------------------------------------------------
  589.  
  590. function toggle_swap()
  591. if(swap) then
  592. swap = false
  593. add_to_chat(104,'Swap: Off')
  594. else
  595. swap = true
  596. add_to_chat(104,'Swap: On')
  597. end
  598. end
  599. --------------------------------------------------------------------------------------------------
  600. -- NAME: Toggle Defense
  601. --------------------------------------------------------------------------------------------------
  602. function toggle_defense()
  603. -- None/MDT/PDT Toggle --
  604. if(def == 'none') then
  605. def = 'mdt'
  606. add_to_chat(104, '-- Defense: MDT --')
  607. elseif(def == 'mdt') then
  608. def = 'pdt'
  609. add_to_chat(104, '-- Defense: PDT --')
  610. else
  611. def = 'none'
  612. add_to_chat(104, '-- Defense: None --')
  613. end
  614.  
  615. eq_default()
  616. end
  617.  
  618. --------------------------------------------------------------------------------------------------
  619. -- NAME: Get Offense.
  620. --------------------------------------------------------------------------------------------------
  621. function get_offense()
  622. return off
  623. end
  624.  
  625. --------------------------------------------------------------------------------------------------
  626. -- NAME: Get Defense.
  627. --------------------------------------------------------------------------------------------------
  628. function get_defense()
  629. return def
  630. end
  631.  
  632. --------------------------------------------------------------------------------------------------
  633. -- NAME: Get Aftermath.
  634. --------------------------------------------------------------------------------------------------
  635. function get_aftermath()
  636. return am
  637. end
  638.  
  639. --------------------------------------------------------------------------------------------------
  640. -- NAME: Get Spell Group.
  641. --------------------------------------------------------------------------------------------------
  642. function get_group(spell)
  643. return spell_groups[spell.english]
  644. end
  645.  
  646. --------------------------------------------------------------------------------------------------
  647. -- NAME: Change Spell
  648. -- DESC: Cancel the previous spell and replace it with the specified spell
  649. --------------------------------------------------------------------------------------------------
  650. function change_spell(spell)
  651. cancel_spell()
  652. send_command(spell)
  653. end
  654.  
  655. --------------------------------------------------------------------------------------------------
  656. -- Is Target PC?
  657. --------------------------------------------------------------------------------------------------
  658. function is_target_pc()
  659. if(player.target.type == 'NONE') then return true end
  660. if(player.target.type == 'SELF') then return true end
  661. if(player.target.type == 'PLAYER') then return true end
  662.  
  663. return false
  664. end
  665.  
  666. --------------------------------------------------------------------------------------------------
  667. -- Is Target Enemy?
  668. --------------------------------------------------------------------------------------------------
  669. function is_target_enemy()
  670. return player.target.type == 'MONSTER'
  671. end
  672.  
  673. --------------------------------------------------------------------------------------------------
  674. -- NAME: Equip Defense Gear.
  675. --------------------------------------------------------------------------------------------------
  676. function eq_defense()
  677. -- Apply Defense --
  678. if(sets.defense[def]) then
  679. equip(sets.defense[def])
  680. end
  681. end
  682.  
  683. --------------------------------------------------------------------------------------------------
  684. -- NAME: Equip Default Gear
  685. --------------------------------------------------------------------------------------------------
  686. function eq_default()
  687. -- Save TP --
  688. if(swap) then
  689. enable('Main', 'Sub', 'Range')
  690. else
  691. disable('Main', 'Sub', 'Range')
  692. end
  693.  
  694. if(player.status == 'Engaged') then
  695. if(sets.offense[off]) then
  696. equip(sets.offense[off])
  697. end
  698. if(buffactive.Aftermath and sets.aftermath[am]) then
  699. equip(sets.aftermath[am])
  700. end
  701. end
  702.  
  703. -- Idle Set --
  704. if(player.status == 'Idle') then
  705. equip(sets.idle)
  706. end
  707.  
  708. if(buffactive == "Sublimation: Activated" and player.status == 'Idle') then
  709. equip(sets.sub)
  710. end
  711.  
  712.  
  713. -- Apply Defense --
  714. eq_defense()
  715.  
  716. if(player.status == 'Resting') then
  717. equip(sets.rest)
  718. end
  719.  
  720. end
  721.  
  722. --------------------------------------------------------------------------------------------------
  723. -- NAME: Equip Default Precast Gear
  724. --------------------------------------------------------------------------------------------------
  725. function eq_default_precast(spell)
  726. -- Cancel Overwritten Buffs --
  727. cancel_buffs(spell)
  728.  
  729. -- Magic PreCast --
  730. if(spell.action_type == 'Magic') then
  731. -- Generic Fast Cast --
  732. equip(sets.fc)
  733.  
  734. if(player.status == 'Resting') then
  735. equip(sets.rest)
  736. end
  737.  
  738. -- Type Fast Cast --
  739. if(sets.fc[spell.type]) then
  740. equip(sets.fc[spell.type])
  741. end
  742.  
  743. -- Skill Fast Cast --
  744. if(sets.fc[spell.skill]) then
  745. equip(sets.fc[spell.skill])
  746. end
  747.  
  748.  
  749.  
  750. -- Group Fast Cast --
  751. local group = spell_groups[spell.english]
  752. if(group and sets.fc[group]) then
  753. equip(sets.fc[group])
  754. end
  755.  
  756. -- Spell Fast Cast --
  757. if(sets.fc[spell.english]) then
  758. equip(sets.fc[spell.english])
  759. end
  760.  
  761. -- Apply Defense --
  762. -- eq_defense()
  763. end
  764.  
  765. -- Ability PreCast --
  766. if(spell.action_type == 'Ability') then
  767. -- Job Ability --
  768. if((spell.type == 'JobAbility') and sets.ja[spell.english]) then
  769. equip(sets.ja[spell.english])
  770. end
  771.  
  772. -- Weapon Skill --
  773. if((spell.type == 'WeaponSkill') and sets.ws[spell.english]) then
  774. equip(sets.ws[spell.english])
  775. end
  776. if((spell.type == 'Pet') and sets.pet[spell.english]) then
  777. equip(sets.pet[spell.english])
  778. end
  779. -- Apply Defense --
  780. -- eq_defense()
  781. end
  782. end
  783.  
  784. --------------------------------------------------------------------------------------------------
  785. -- NAME: Equip Default Midcast Gear
  786. --------------------------------------------------------------------------------------------------
  787. function eq_default_midcast(spell)
  788. local group = spell_groups[spell.english]
  789.  
  790. -- Magic MidCast --
  791. if(spell.action_type == 'Magic') then
  792. -- Generic MidCast --
  793. equip(sets.midcast)
  794.  
  795. -- Type MidCast --
  796. if(sets.midcast[spell.type]) then
  797. equip(sets.midcast[spell.type])
  798. end
  799.  
  800. -- Skill MidCast --
  801. if(sets.midcast[spell.skill]) then
  802. equip(sets.midcast[spell.skill])
  803. end
  804.  
  805. -- Group MidCast --
  806. if(group and sets.midcast[group]) then
  807. equip(sets.midcast[group])
  808. end
  809.  
  810. -- Spell MidCast --
  811. if(sets.midcast[spell.english]) then
  812. equip(sets.midcast[spell.english])
  813. end
  814.  
  815. -- if spell.action_type == "Magic" then
  816. -- if spell.element == world.weather_element then
  817. -- equip(sets.obi[spell.element])
  818. -- elseif spell.element == world.day_element then
  819. -- equip(sets.day[spell.element])
  820. -- end
  821. end
  822.  
  823. -- Apply Defense --
  824. -- eq_defense()
  825. -- end
  826. end
  827.  
  828.  
  829.  
  830. --------------------------------------------------------------------------------------------------
  831. -- NAME: Equip Balrahn --
  832. --------------------------------------------------------------------------------------------------
  833. function eq_balrahn()
  834. if(toau_zones:contains(zone)) then
  835. -- equip({ring1 = "Balrahn's Ring"})
  836. end
  837. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement