Advertisement
Guest User

MNK GS file

a guest
May 30th, 2014
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.29 KB | None | 0 0
  1. -- Original File: MNK.xml
  2. -- Generated By: SpellcastLua 0.12 (beta)
  3.  
  4. spellcast = {}
  5.  
  6. spellcast.vars = {
  7. ['gear'] = 1,
  8. }
  9.  
  10. spellcast.group = 'MNK'
  11. spellcast.groups = {
  12. {
  13. name = 'MNK',
  14. {
  15. name = 'TP',
  16. items = {
  17. main = 'Rigor Baghnakhs',
  18. ammo = 'Thew Bomblet',
  19. head = 'Thurandaut Chapeau',
  20. neck = 'Asperity Necklace',
  21. lear = 'Steelflash Earring',
  22. rear = 'Bladeborn Earring',
  23. body = 'Thaumas Coat',
  24. hands = 'Melee Gloves +2',
  25. lring = 'Rajas Ring',
  26. rring = 'Epona's Ring',
  27. back = 'Atheling Mantle',
  28. waist = 'Black Belt',
  29. legs = 'Manibozho Brais',
  30. feet = 'Manibozho Boots',
  31. },
  32. locks = {}
  33. },
  34. {
  35. name = 'Idle',
  36. items = {
  37. ammo = 'Thew Bomblet',
  38. head = 'Oce. Headpiece +1',
  39. neck = 'Wiglen Gorget',
  40. lear = 'Steelflash Earring',
  41. rear = 'Bladeborn Earring',
  42. body = 'Thaumas Coat',
  43. hands = 'Melee Gloves +2',
  44. lring = 'Paguroidea Ring',
  45. rring = 'Sheltered Ring',
  46. back = 'Atheling Mantle',
  47. waist = 'Black Belt',
  48. legs = 'Manibozho Brais',
  49. feet = 'Hermes' Sandals',
  50. },
  51. locks = {}
  52. },
  53. {
  54. name = 'MidACC',
  55. base_set = 'TP',
  56. items = {
  57. body = 'Manibozho Jerkin',
  58. },
  59. locks = {}
  60. },
  61. {
  62. name = 'HighACC',
  63. base_set = 'TP',
  64. items = {
  65. body = 'Manibozho Jerkin',
  66. waist = 'Anguinus Belt',
  67. },
  68. locks = {}
  69. },
  70. {
  71. name = 'Ascetics',
  72. items = {
  73. ammo = 'Tantra Tathlum',
  74. head = 'Thurandaur Chapeau',
  75. neck = 'Rancor Collar',
  76. lear = 'Brutal Earring',
  77. rear = 'Kemas Earring',
  78. body = 'Kirin's Osode',
  79. hands = 'Heafoc Mitts',
  80. lring = 'Rajas Ring',
  81. rring = 'Pyrosoul Ring',
  82. back = 'Atheling mantle',
  83. waist = 'Warwolf Belt',
  84. legs = 'Manibozho Brais',
  85. feet = 'Tantra Gaiters +2',
  86. },
  87. locks = {}
  88. },
  89. {
  90. name = 'Resting',
  91. items = {
  92. back = 'Melee Cape',
  93. },
  94. locks = {}
  95. },
  96. {
  97. name = 'Asuran',
  98. items = {
  99. ammo = 'Thew Bomblet',
  100. head = 'Aias Bonnet',
  101. neck = 'Justiciar's Torque',
  102. lear = 'Aesir Ear Pendant',
  103. rear = 'Merman's Earring',
  104. body = 'Kirin's Osode',
  105. hands = 'Melee Gloves +2',
  106. lring = 'Rajas Ring',
  107. rring = 'Pyrosoul Ring',
  108. back = 'Atheling mantle',
  109. waist = 'Caudata Belt',
  110. legs = 'Tantra Hose +2',
  111. feet = 'Tantra Gaiters +2',
  112. },
  113. locks = {}
  114. },
  115. {
  116. name = 'Shijin',
  117. items = {
  118. ammo = 'Demonry Core',
  119. head = 'Thurandaut Chapeau',
  120. neck = 'Justiciar's Torque',
  121. lear = 'Steelflash Earring',
  122. rear = 'Bladeborn Earring',
  123. body = 'Manibozho Jerkin',
  124. hands = 'Thurandaut Gloves',
  125. lring = 'Rajas Ring',
  126. rring = 'Epona Ring',
  127. back = 'Atheling Mantle',
  128. waist = 'Caudata Belt',
  129. legs = 'Manibozho Brais',
  130. feet = 'Scopuli Nails',
  131. },
  132. locks = {}
  133. },
  134. {
  135. name = 'WS',
  136. base_set = 'Asuran',
  137. items = {
  138. head = 'Ocelo. Headpiece +1',
  139. hands = 'Heafoc Mitts',
  140. feet = 'Tantra Gaiters +2',
  141. },
  142. locks = {}
  143. },
  144. {
  145. name = 'Cata',
  146. items = {
  147. ammo = 'Thew Bomblet',
  148. head = 'Thurandaut Chapeau',
  149. neck = 'Atemis Medal',
  150. lear = 'Hecate's Earring',
  151. rear = 'Moldavite Earring',
  152. body = 'Kirin's Osode',
  153. hands = 'Heafoc Mitts',
  154. lring = 'Rajas Ring',
  155. rring = 'Pyrosoul Ring',
  156. back = 'Atheling Mantle',
  157. waist = 'Anguinus Belt',
  158. legs = 'Manibozho Brais',
  159. feet = 'Tantra Gaiters +2',
  160. },
  161. locks = {}
  162. },
  163. {
  164. name = 'ImpetusUp',
  165. items = {
  166. body = 'Thaumas Coat',
  167. },
  168. locks = {}
  169. },
  170. {
  171. name = 'Perfect Counter',
  172. items = {
  173. head = 'Tantra Crown +2',
  174. },
  175. locks = {}
  176. },
  177. {
  178. name = 'Chakra',
  179. items = {
  180. ammo = 'Tantra Tathlum',
  181. head = 'Genbu's Kabuto',
  182. rear = 'Kemas Earring',
  183. body = 'Temple Cyclas',
  184. hands = 'Melee Gloves +2',
  185. lring = 'Rajas Ring',
  186. rring = 'Spiral Ring',
  187. back = 'Melee Cape',
  188. waist = 'Caudata Belt',
  189. feet = 'Thurandaut Boots',
  190. },
  191. locks = {}
  192. },
  193. {
  194. name = 'Chi Blast',
  195. items = {
  196. head = 'Temple Crown',
  197. body = 'Kirin's Osode',
  198. lring = 'Dark Ring',
  199. rring = 'Dark Ring',
  200. back = 'Melee Cape',
  201. waist = 'Crudelis Belt',
  202. feet = 'Thurandaut Boots',
  203. },
  204. locks = {}
  205. },
  206. {
  207. name = 'PDT',
  208. items = {
  209. ammo = 'Tantra Tathlum',
  210. head = 'Arh. Jinpachi +1',
  211. neck = 'Twilight Torque',
  212. lear = 'Brutal Earring',
  213. rear = 'Darkness Earring',
  214. body = 'Arhat's Gi +1',
  215. hands = 'Tantra Gloves +1',
  216. lring = 'Rajas Ring',
  217. rring = 'Jelly Ring',
  218. back = 'Shadow Mantle',
  219. waist = 'Black Belt',
  220. legs = 'Tantra Hose +2',
  221. feet = 'Thurandaut Boots',
  222. },
  223. locks = {}
  224. },
  225. {
  226. name = 'MDT',
  227. items = {
  228. ammo = 'Thew Bomblet',
  229. head = 'Ganesha's Mask',
  230. neck = 'Twilight Torque',
  231. lear = 'Merman's Earring',
  232. rear = 'Merman's Earring',
  233. body = 'Avalon Breastplate',
  234. hands = 'Thurandaut Gloves',
  235. lring = 'Dark Ring',
  236. rring = 'Dark Ring',
  237. back = 'Mollusca Mantle',
  238. waist = 'Black Belt',
  239. legs = 'Manibozho Brais',
  240. feet = 'Manibozho Boots',
  241. },
  242. locks = {}
  243. },
  244. {
  245. name = 'MDTShellV',
  246. items = {
  247. ammo = 'Thew Bomblet',
  248. head = 'Ganesha's Mask',
  249. neck = 'Twilight Torque',
  250. body = 'Avalon Breastplate',
  251. hands = 'Thurandaut Gloves',
  252. lring = 'Dark Ring',
  253. rring = 'Dark Ring',
  254. back = 'Mollusca Mantle',
  255. waist = 'Black Belt',
  256. legs = 'Manibozho Brais',
  257. feet = 'Manibozho Boots',
  258. },
  259. locks = {}
  260. },
  261. {
  262. name = 'Turtle',
  263. items = {
  264. ammo = 'Tantra Tathlum',
  265. head = 'Arh. Jinpachi +1',
  266. neck = 'Twilight Torque',
  267. lear = 'Merman's Earring',
  268. rear = 'Merman's Earring',
  269. body = 'Avalon Breastplate',
  270. hands = 'Thurandaut Gloves',
  271. lring = 'Epona's RIng',
  272. rring = 'Dark Ring',
  273. back = 'Mollusca Mantle',
  274. waist = 'Black Belt',
  275. legs = 'Manibozho Brais',
  276. feet = 'Thrandaut Boots',
  277. },
  278. locks = {}
  279. },
  280. {
  281. name = 'Weap',
  282. items = {
  283. main = 'Rigor Baghnakhs',
  284. },
  285. locks = {}
  286. },
  287. },
  288. {
  289. {
  290. items = {
  291. hands = 'Temple Gloves',
  292. },
  293. locks = {}
  294. },
  295. {
  296. items = {
  297. feet = 'Melee Gaiters',
  298. },
  299. locks = {}
  300. },
  301. {
  302. items = {
  303. feet = 'Temple Gaiters',
  304. },
  305. locks = {}
  306. },
  307. {
  308. items = {
  309. head = 'Temple Crown',
  310. },
  311. locks = {}
  312. },
  313. {
  314. base_set = 'TP',
  315. items = {
  316. lear = 'Loquac. earring',
  317. },
  318. locks = {}
  319. },
  320. {
  321. items = {},
  322. locks = {
  323. head = true,
  324. }
  325. },
  326. {
  327. items = {},
  328. locks = {
  329. rear = true,
  330. }
  331. },
  332. {
  333. items = {},
  334. locks = {
  335. lear = true,
  336. }
  337. },
  338. {
  339. items = {},
  340. locks = {
  341. rring = true,
  342. }
  343. },
  344. {
  345. items = {},
  346. locks = {
  347. lring = true,
  348. }
  349. },
  350. },
  351. }
  352.  
  353. function pretarget(spell, action)
  354. if spellcast.precast_equip then
  355. equip(spellcast.precast_equip)
  356. spellcast.precast_equip = nil
  357. return
  358. end
  359.  
  360. spellcast.pass = { 'precast' }
  361. local s = { spell = spell,
  362. original_spell = spell,
  363. equip = {},
  364. locks = {} }
  365.  
  366. local rules = function()
  367. -- BEGIN RULES
  368. if windower.wc_match(player.status, 'Engaged') then
  369. if spellcast.buffactive('Impetus') then
  370. spellcast.equip(s, 'ImpetusUp')
  371. elseif spellcast.buffactive('Perfect Counter') then
  372. spellcast.equip(s, 'Perfect Counter')
  373. end
  374. end
  375. if windower.wc_match(s.spell.type, 'WeaponSkill') then
  376. if windower.wc_match(s.spell.english, 'Ascetic's Fury') then
  377. spellcast.equip(s, 'Ascetics')
  378. add_to_chat(32, '****Ascetics Equipped****')
  379. end
  380. if windower.wc_match(s.spell.english, 'Asuran Fists') then
  381. spellcast.equip(s, 'Asuran')
  382. add_to_chat(32, '****Asuran Equipped****')
  383. end
  384. if windower.wc_match(s.spell.english, 'Shijin Spiral') then
  385. spellcast.equip(s, 'Shijin')
  386. add_to_chat(32, '****Shijin Equipped****')
  387. end
  388. if windower.wc_match(s.spell.english, 'Combo|Shoulder Tackle|One Inch Punch|Backhand Blow|Raging Fist|Spinning Attack|Howling FIst|Dragon Kick|Tornado Kick') then
  389. spellcast.equip(s, 'ws')
  390. add_to_chat(32, '****WS Equipped****')
  391. end
  392. elseif windower.wc_match(s.spell.type, 'JobAbility') then
  393. if windower.wc_match(s.spell.english, 'Boost') then
  394. spellcast.equip(s, spellcast.groups[2][1])
  395. end
  396. if windower.wc_match(s.spell.english, 'Counterstance') then
  397. spellcast.equip(s, spellcast.groups[2][2])
  398. end
  399. if windower.wc_match(s.spell.english, 'Impetus') then
  400. spellcast.equip(s, 'ImpetusUp')
  401. end
  402. if windower.wc_match(s.spell.english, 'Dodge') then
  403. spellcast.equip(s, spellcast.groups[2][3])
  404. end
  405. if windower.wc_match(s.spell.english, 'Focus') then
  406. spellcast.equip(s, spellcast.groups[2][4])
  407. end
  408. if windower.wc_match(s.spell.english, 'Chakra') then
  409. spellcast.equip(s, 'Chakra')
  410. end
  411. if windower.wc_match(s.spell.english, 'Chi Blast') then
  412. spellcast.equip(s, 'Chi Blast')
  413. end
  414. if windower.wc_match(s.spell.english, 'Perfect Counter') then
  415. spellcast.equip(s, 'Perfect Counter')
  416. end
  417. end
  418. if player.equipment.body == 'empty' or player.equipment.head == 'empty' or player.equipment.legs == 'empty' or player.equipment.feet == 'empty' or player.equipment.hands == 'empty' then
  419. add_to_chat(32, '***YOU NEKKID BRO***')
  420. if windower.wc_match(player.status, 'Engaded') then
  421. spellcast.equip(s, 'TP')
  422. end
  423. end
  424. if player.equipment.main == 'empty' then
  425. add_to_chat(32, '***ReEquipping Weap***')
  426. spellcast.equip(s, 'Weap')
  427. end
  428. if windower.wc_match(s.spell.english, 'Spectral Jig') then
  429. send_command('cancel 71')
  430. elseif windower.wc_match(s.spell.type, 'Ninjutsu') and not spellcast.buffactive('Silence|Sleep|Stun|Terror') and windower.wc_match(s.spell.english, 'Utsusemi*') then
  431. spellcast.equip(s, spellcast.groups[2][5])
  432. end
  433. if windower.wc_match(s.spell.english, 'Stone V') then
  434. if spellcast.get_var(s, 'GEAR') == '0' then
  435. add_to_chat(204, '--------------------Melee Hose LOCKED--------------------')
  436. send_command('input /equip legs "Melee Hose +2"')
  437. spellcast.disable('Legs')
  438. send_command('sc var set GEAR 1')
  439. cancel_spell()
  440. elseif spellcast.get_var(s, 'GEAR') == '1' then
  441. add_to_chat(204, '--------------------Melee Hose UNLOCKED--------------------')
  442. spellcast.enable('Legs')
  443. send_command('sc var set GEAR 0')
  444. if windower.wc_match(player.status, 'Idle') then
  445. send_command('sc set Idle')
  446. elseif windower.wc_match(player.status, 'Engaged') then
  447. send_command('sc set TP')
  448. end
  449. cancel_spell()
  450. end
  451. end
  452. if windower.wc_match(s.spell.english, 'Water V') then
  453. if spellcast.get_var(s, 'GEAR') == '0' then
  454. add_to_chat(204, '--------------------Melee Gloves LOCKED--------------------')
  455. send_command('input /equip hands "Melee Gloves +2"')
  456. spellcast.disable('Hands')
  457. send_command('sc var set GEAR 1')
  458. cancel_spell()
  459. elseif spellcast.get_var(s, 'GEAR') == '1' then
  460. add_to_chat(204, '--------------------Melee Gloves UNLOCKED-----------------')
  461. spellcast.enable('Hands')
  462. send_command('sc var set GEAR 0')
  463. if windower.wc_match(player.status, 'Idle') then
  464. send_command('sc set Idle')
  465. elseif windower.wc_match(player.status, 'Engaged') then
  466. send_command('sc set TP')
  467. end
  468. cancel_spell()
  469. end
  470. end
  471. if windower.wc_match(s.spell.english, 'Thunder V') then
  472. add_to_chat(204, '----------STNA Removing debuff----------')
  473. send_command('input //stna')
  474. cancel_spell()
  475. end
  476. if windower.wc_match(s.spell.english, 'Stonega IV') then
  477. if spellcast.buffactive('slow') then
  478. send_command('input /p Slowed ')
  479. end
  480. if spellcast.buffactive('paralysis') then
  481. send_command('input /p Paralysed ')
  482. end
  483. if spellcast.buffactive('petrification') then
  484. send_command('input /p Petrified ')
  485. end
  486. if spellcast.buffactive('charm') then
  487. send_command('input /p Charmed !! Please sleep me! ')
  488. end
  489. if spellcast.buffactive('Amnesia') then
  490. send_command('input /p Amnesia ')
  491. end
  492. if spellcast.buffactive('Sleep') then
  493. send_command('input /p zzz Please wake me ')
  494. end
  495. if spellcast.buffactive('Silence') then
  496. send_command('input /p Silenced ')
  497. end
  498. if spellcast.buffactive('Attack Down') then
  499. send_command('input /p Attack Down ')
  500. end
  501. if spellcast.buffactive('Accuracy Down') then
  502. send_command('input /p Acc Down ')
  503. end
  504. end
  505. if windower.wc_match(player.equipment.head, 'Reraise Hairpin') and not spellcast.buffactive('Reraise') then
  506. spellcast.equip(s, spellcast.groups[2][6])
  507. add_to_chat(204, '. . . . . . . . . . . . . . - - Reraise Hairpin Locked - - . . . . . . . . . . . . . .')
  508. elseif windower.wc_match(player.equipment.right_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
  509. spellcast.equip(s, spellcast.groups[2][7])
  510. add_to_chat(204, '. . . . . . . . . . . . . . - - Reraise Earring Locked - - . . . . . . . . . . . . . .')
  511. elseif windower.wc_match(player.equipment.left_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
  512. spellcast.equip(s, spellcast.groups[2][8])
  513. add_to_chat(204, '. . . . . . . . . . . . . . - - Reraise Earring Locked - - . . . . . . . . . . . . . .')
  514. end
  515. if windower.wc_match(player.equipment.right_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
  516. spellcast.equip(s, spellcast.groups[2][9])
  517. add_to_chat(204, '. . . . . . . . . . . . . . - - EXP Ring Locked - - . . . . . . . . . . . . . .')
  518. elseif windower.wc_match(player.equipment.left_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
  519. spellcast.equip(s, spellcast.groups[2][10])
  520. add_to_chat(204, '. . . . . . . . . . . . . . - - EXP Ring Locked - - . . . . . . . . . . . . . .')
  521. end
  522. -- END RULES
  523. end
  524.  
  525. rules()
  526.  
  527. if s.spell.name ~= spell.name then
  528. spellcast.precast_equip = s.equip
  529. cancel_spell()
  530. send_command(spell.prefix .. ' "' .. s.spell.name .. '" ' .. spell.target.raw)
  531. else
  532. equip(s.equip)
  533. end
  534. end
  535.  
  536. function midcast(spell, action)
  537. spellcast.pass = { 'midcast' }
  538. local s = { spell = spell,
  539. original_spell = spell,
  540. equip = {},
  541. locks = {} }
  542.  
  543. local rules = function()
  544. -- BEGIN RULES
  545. if windower.wc_match(player.status, 'Engaged') then
  546. if spellcast.buffactive('Impetus') then
  547. spellcast.equip(s, 'ImpetusUp')
  548. elseif spellcast.buffactive('Perfect Counter') then
  549. spellcast.equip(s, 'Perfect Counter')
  550. end
  551. end
  552. if not windower.wc_match(s.spell.type, 'WeaponSkill') and windower.wc_match(s.spell.type, 'JobAbility') then
  553. if windower.wc_match(s.spell.english, 'Impetus') then
  554. spellcast.equip(s, 'ImpetusUp')
  555. end
  556. if windower.wc_match(s.spell.english, 'Perfect Counter') then
  557. spellcast.equip(s, 'Perfect Counter')
  558. end
  559. end
  560. if not windower.wc_match(s.spell.english, 'Spectral Jig') and windower.wc_match(s.spell.type, 'Ninjutsu') and not spellcast.buffactive('Silence|Sleep|Stun|Terror') then
  561. if windower.wc_match(s.spell.english, 'Utsusemi*') then
  562. if windower.wc_match(s.spell.english, 'Utsusemi: Ichi') and spellcast.buffactive('Copy Image|Copy Image (2)|Copy Image (3)') then
  563. send_command('cancel 66')
  564. send_command('cancel 444')
  565. send_command('cancel 445')
  566. end
  567. elseif windower.wc_match(s.spell.english, 'Monomi*') and spellcast.buffactive('Sneak') and windower.wc_match(s.original_spell.target.type, 'Self') then
  568. send_command('cancel 71')
  569. end
  570. end
  571. if windower.wc_match(player.equipment.head, 'Reraise Hairpin') and not spellcast.buffactive('Reraise') then
  572. spellcast.equip(s, spellcast.groups[2][6])
  573. elseif windower.wc_match(player.equipment.right_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
  574. spellcast.equip(s, spellcast.groups[2][7])
  575. elseif windower.wc_match(player.equipment.left_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
  576. spellcast.equip(s, spellcast.groups[2][8])
  577. end
  578. if windower.wc_match(player.equipment.right_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
  579. spellcast.equip(s, spellcast.groups[2][9])
  580. elseif windower.wc_match(player.equipment.left_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
  581. spellcast.equip(s, spellcast.groups[2][10])
  582. end
  583. -- END RULES
  584. end
  585.  
  586. rules()
  587.  
  588. equip(s.equip)
  589. end
  590.  
  591. function aftercast(spell, action)
  592. spellcast.pass = { 'aftercast' }
  593. local s = { spell = spell,
  594. original_spell = spell,
  595. equip = {},
  596. locks = {} }
  597.  
  598. local rules = function()
  599. -- BEGIN RULES
  600. if not windower.wc_match(player.status, 'Engaged') then
  601. spellcast.equip(s, 'Idle')
  602. else
  603. spellcast.equip(s, 'TP')
  604. end
  605. if windower.wc_match(player.status, 'Engaged') then
  606. if spellcast.buffactive('Impetus') then
  607. spellcast.equip(s, 'ImpetusUp')
  608. elseif spellcast.buffactive('Perfect Counter') then
  609. spellcast.equip(s, 'Perfect Counter')
  610. else
  611. spellcast.equip(s, 'TP')
  612. end
  613. end
  614. if windower.wc_match(s.spell.type, 'WeaponSkill') then
  615. if windower.wc_match(s.spell.english, 'Ascetic's Fury') then
  616. spellcast.equip(s, 'TP')
  617. end
  618. if windower.wc_match(s.spell.english, 'Asuran Fists') then
  619. spellcast.equip(s, 'TP')
  620. end
  621. if windower.wc_match(s.spell.english, 'Shijin Spiral') then
  622. spellcast.equip(s, 'TP')
  623. end
  624. if windower.wc_match(s.spell.english, 'Combo|Shoulder Tackle|One Inch Punch|Backhand Blow|Raging Fist|Spinning Attack|Howling FIst|Dragon Kick|Tornado Kick') then
  625. spellcast.equip(s, 'TP')
  626. end
  627. elseif windower.wc_match(s.spell.type, 'JobAbility') then
  628. if windower.wc_match(s.spell.english, 'Boost') then
  629. send_command('wait 15;input /echo **********Boost Ready**********')
  630. end
  631. if windower.wc_match(s.spell.english, 'Counterstance') then
  632. send_command('wait 296;input /echo **********Counter Stance Ready**********')
  633. end
  634. if windower.wc_match(s.spell.english, 'Impetus') then
  635. spellcast.equip(s, 'ImpetusUp')
  636. send_command('input /echo Impetus active Locking Body!')
  637. send_command('wait 296;input /echo **********Dodge Focus Impetus Ready!**********')
  638. end
  639. if windower.wc_match(s.spell.english, 'Chakra') then
  640. send_command('wait 296;input /echo **********Chakra Ready**********')
  641. end
  642. if windower.wc_match(s.spell.english, 'Chi Blast') then
  643. send_command('wait 180;input /echo **********Chi Blast Ready**********')
  644. end
  645. if windower.wc_match(s.spell.english, 'Perfect Counter') then
  646. spellcast.equip(s, 'Perfect Counter')
  647. send_command('input /echo Perfect Counter active Locking Head!')
  648. send_command('wait 60;input /echo **********Perfect Counter Ready**********')
  649. end
  650. end
  651. if windower.wc_match(player.equipment.head, 'Reraise Hairpin') and not spellcast.buffactive('Reraise') then
  652. spellcast.equip(s, spellcast.groups[2][6])
  653. elseif windower.wc_match(player.equipment.right_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
  654. spellcast.equip(s, spellcast.groups[2][7])
  655. elseif windower.wc_match(player.equipment.left_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
  656. spellcast.equip(s, spellcast.groups[2][8])
  657. end
  658. if windower.wc_match(player.equipment.right_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
  659. spellcast.equip(s, spellcast.groups[2][9])
  660. elseif windower.wc_match(player.equipment.left_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
  661. spellcast.equip(s, spellcast.groups[2][10])
  662. end
  663. -- END RULES
  664. end
  665.  
  666. rules()
  667.  
  668. equip(s.equip)
  669. end
  670.  
  671. function status_change(spell, action)
  672. spellcast.pass = { 'autoset', player.status }
  673. local s = { spell = spell,
  674. original_spell = spell,
  675. equip = {},
  676. locks = {} }
  677.  
  678. local rules = function()
  679. -- BEGIN RULES
  680. if windower.wc_match(s.spell.english, 'autoset') then
  681. if spellcast.when('resting') then
  682. spellcast.equip(s, 'Resting')
  683. end
  684. if spellcast.when('idle') then
  685. spellcast.equip(s, 'Idle')
  686. end
  687. if spellcast.when('engaged') then
  688. spellcast.equip(s, 'TP')
  689. end
  690. end
  691. if windower.wc_match(player.status, 'Engaged') then
  692. if spellcast.buffactive('Impetus') then
  693. if spellcast.when('Engaged|Precast|Midcast|AfterCast') then
  694. spellcast.equip(s, 'ImpetusUp')
  695. end
  696. elseif not spellcast.buffactive('Perfect Counter') and spellcast.when('Engaged|AfterCast') then
  697. spellcast.equip(s, 'TP')
  698. end
  699. end
  700. if windower.wc_match(s.spell.type, 'WeaponSkill') then
  701. if windower.wc_match(s.spell.english, 'Ascetic's Fury') and spellcast.when('engaged|precast') then
  702. spellcast.equip(s, 'Ascetics')
  703. end
  704. elseif windower.wc_match(s.spell.type, 'JobAbility') then
  705. if windower.wc_match(s.spell.english, 'Impetus') and spellcast.when('All') then
  706. spellcast.equip(s, 'ImpetusUp')
  707. end
  708. if windower.wc_match(s.spell.english, 'Perfect Counter') and spellcast.when('All') then
  709. spellcast.equip(s, 'Perfect Counter')
  710. end
  711. end
  712. if windower.wc_match(s.spell.english, 'Stone V') then
  713. if spellcast.get_var(s, 'GEAR') == '0' then
  714. spellcast.disable('Legs')
  715. cancel_spell()
  716. elseif spellcast.get_var(s, 'GEAR') == '1' then
  717. spellcast.enable('Legs')
  718. cancel_spell()
  719. end
  720. end
  721. if windower.wc_match(s.spell.english, 'Water V') then
  722. if spellcast.get_var(s, 'GEAR') == '0' then
  723. spellcast.disable('Hands')
  724. cancel_spell()
  725. elseif spellcast.get_var(s, 'GEAR') == '1' then
  726. spellcast.enable('Hands')
  727. cancel_spell()
  728. end
  729. end
  730. if windower.wc_match(s.spell.english, 'Thunder V') then
  731. cancel_spell()
  732. end
  733. if windower.wc_match(player.equipment.head, 'Reraise Hairpin') and not spellcast.buffactive('Reraise') then
  734. if spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
  735. spellcast.equip(s, spellcast.groups[2][6])
  736. end
  737. elseif windower.wc_match(player.equipment.right_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') then
  738. if spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
  739. spellcast.equip(s, spellcast.groups[2][7])
  740. end
  741. elseif windower.wc_match(player.equipment.left_ear, 'Reraise Earring') and not spellcast.buffactive('Reraise') and spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
  742. spellcast.equip(s, spellcast.groups[2][8])
  743. end
  744. if windower.wc_match(player.equipment.right_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') then
  745. if spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
  746. spellcast.equip(s, spellcast.groups[2][9])
  747. end
  748. elseif windower.wc_match(player.equipment.left_ring, 'Emperor Band|Empress Band|Anniversary Ring|Kupofried's Ring') and not spellcast.buffactive('Dedication') and spellcast.when('precast|midcast|aftercast|engaged|idle|resting') then
  749. spellcast.equip(s, spellcast.groups[2][10])
  750. end
  751. -- END RULES
  752. end
  753.  
  754. rules()
  755.  
  756. equip(s.equip)
  757. end
  758.  
  759. -- UTILITY FUNCTIONS
  760.  
  761. function spellcast.buffactive(name)
  762. for k, v in pairs(buffactive) do
  763. if windower.wc_match(k, name) then
  764. return true
  765. end
  766. end
  767. return false
  768. end
  769.  
  770. function spellcast.changelock(s, slot, lock)
  771. local slot_list = { 'main', 'sub', 'range', 'ammo',
  772. 'head', 'neck', 'lear', 'rear',
  773. 'body', 'hands', 'lring', 'rring',
  774. 'back', 'waist', 'legs', 'feet' }
  775.  
  776. if windower.wc_match('all', slot) then
  777. for k, v in pairs(slot_list) do
  778. if lock then
  779. s.locks[v] = true
  780. else
  781. s.locks[v] = nil
  782. end
  783. end
  784. else
  785. for k, v in pairs(slot_list) do
  786. if windower.wc_match(v, slot) then
  787. if lock then
  788. s.locks[v] = true
  789. else
  790. s.locks[v] = nil
  791. end
  792. end
  793. end
  794. end
  795. end
  796.  
  797. function spellcast.changespell(s, name)
  798. name = tostring(name):lower()
  799. if s.spell.name:lower() ~= name then
  800. local spell = gearswap.r_spells[gearswap.validabils.english['/ma'][name]]
  801. local abil = gearswap.r_abilities[gearswap.validabils.english['/ja'][name]]
  802. if spell then
  803. if abil and abil.prefix == '/pet' then
  804. if player.main_job_id == BLU then
  805. s.spell = spell
  806. elseif (player.main_job_id == BST or player.main_job_id == SMN or
  807. player.sub_job_id == BST or player.sub_job_id == SMN) and pet.isvalid then
  808. s.spell = abil
  809. end
  810. else
  811. s.spell = spell
  812. end
  813. elseif abil then
  814. s.spell = abil
  815. end
  816. end
  817. end
  818.  
  819. function spellcast.disable(slot)
  820. local slot_list = { main = 'main', sub = 'sub', range = 'range', ammo = 'ammo',
  821. head = 'head', neck = 'neck', lear = 'left_ear', rear = 'right_ear',
  822. body = 'body', hands = 'hands', lring = 'left_ring', rring = 'right_ring',
  823. back = 'back', waist = 'waist', legs = 'legs', feet = 'feet' }
  824.  
  825. if windower.wc_match('all', slot) then
  826. disable('main', 'sub', 'range', 'ammo',
  827. 'head', 'neck', 'left_ear', 'right_ear',
  828. 'body', 'hands', 'left_ring', 'right_ring',
  829. 'back', 'waist', 'legs', 'feet')
  830. else
  831. for k, v in pairs(slot_list) do
  832. if windower.wc_match(k, slot) then
  833. disable(v)
  834. end
  835. end
  836. end
  837. end
  838.  
  839. function spellcast.enable(slot)
  840. local slot_list = { main = 'main', sub = 'sub', range = 'range', ammo = 'ammo',
  841. head = 'head', neck = 'neck', lear = 'left_ear', rear = 'right_ear',
  842. body = 'body', hands = 'hands', lring = 'left_ring', rring = 'right_ring',
  843. back = 'back', waist = 'waist', legs = 'legs', feet = 'feet' }
  844.  
  845. if windower.wc_match('all', slot) then
  846. enable('main', 'sub', 'range', 'ammo',
  847. 'head', 'neck', 'left_ear', 'right_ear',
  848. 'body', 'hands', 'left_ring', 'right_ring',
  849. 'back', 'waist', 'legs', 'feet')
  850. else
  851. for k, v in pairs(slot_list) do
  852. if windower.wc_match(k, slot) then
  853. enable(v)
  854. end
  855. end
  856. end
  857. end
  858.  
  859. function spellcast.equip(s, set, group)
  860. if set ~= nil and set ~= '' then
  861. group = group or spellcast.group or player.main_job
  862. local base_set, set_base_set, set_base_group = '', '', ''
  863. if type(set) ~= 'table' then
  864. set = tostring(set)
  865. base_set, set = set:match('^(.-)|?([^|]*)$')
  866. for k, v in ipairs(spellcast.groups) do
  867. if v.name and windower.wc_match(group, v.name) then
  868. for q, r in ipairs(v) do
  869. if r.name and windower.wc_match(set, r.name) then
  870. set = r
  871. if r.base_group then
  872. if type(r.base_group) ~= 'function' then
  873. set_base_group = r.base_group
  874. else
  875. set_base_group = r.base_group()
  876. end
  877. end
  878. if r.base_set then
  879. if type(r.base_set) ~= 'function' then
  880. set_base_set = r.base_set
  881. else
  882. set_base_set = r.base_set()
  883. end
  884. end
  885. break
  886. end
  887. end
  888. end
  889. end
  890. end
  891. if set_base_set ~= '' then
  892. if set_base_group ~= '' then
  893. spellcast.equip(s, set_base_set, set_base_group)
  894. else
  895. spellcast.equip(s, set_base_set, group)
  896. end
  897. end
  898. if base_set ~= '' then
  899. spellcast.equip(s,base_set,group)
  900. end
  901. if type(set) == 'table' then
  902. if set.base_set then
  903. base_set = type(set.base_set) ~= 'function' and set.base_set or set.base_set(s)
  904. spellcast.equip(s, base_set, set.base_group or group)
  905. end
  906. for k, v in pairs(set.items) do
  907. if not s.locks[k] then
  908. s.equip[k] = v
  909. end
  910. end
  911. for k, v in pairs(set.locks) do
  912. s.locks[k] = v
  913. end
  914. end
  915. end
  916. end
  917.  
  918. function spellcast.get_var(s, name)
  919. local normalized_name = tostring(name):lower()
  920. local match = nil
  921. local match_len = 0
  922. for k, v in pairs(spellcast.vars) do
  923. local len = k:len()
  924. if len > match_len and normalized_name:sub(1, len) == k then
  925. match = v
  926. match_len = len
  927. end
  928. end
  929. if match == nil then
  930. if type(match) == 'function' then
  931. match = match(s)
  932. end
  933. return match .. name:sub(match_len + 1)
  934. end
  935. return '$' .. name
  936. end
  937.  
  938. function spellcast.when(test)
  939. if windower.wc_match('all', test) then
  940. return true
  941. end
  942. for k, v in pairs(spellcast.pass) do
  943. if windower.wc_match(v, test) then
  944. return true
  945. end
  946. end
  947. return false
  948. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement