Guest User

dangeo

a guest
Oct 14th, 2014
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.19 KB | None | 0 0
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Motenten's Macro Book Function ** --
  3. -- Last Updated: 05/05/14 12:00 AM *Fixed Cure Issue* --
  4.  
  5. function get_sets()
  6. IdleIndex = 1
  7. IdleArray = {"Movement","Refresh","Geomancy"} -- Default Idle Set Is Movement --
  8. Armor = 'None'
  9. define_geomancy_values()
  10. Obi = 'ON' -- Turn Default Obi ON or OFF Here --
  11. target_distance = 5 -- Set Default Distance Here --
  12. select_default_macro_book() -- Change Default Macro Book At The End --
  13.  
  14. Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  15. Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  16. sc_map = {SC1 = "GeoTorpor", SC2 = "GeoLanguor", SC3 = "IndiFocus"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  17.  
  18. Non_Obi_Spells = S{
  19. 'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  20. 'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  21.  
  22. Cities = S{
  23. "Ru'lude Gardens","Upper Jeuno","Lower Jeuno","Port Jeuno",
  24. "Port Windurst","Windurst Waters","Windurst Woods","Windurst Walls","Heavens Tower",
  25. "Port San d'Oria","Northern San d'Oria","Southern San d'Oria",
  26. "Port Bastok","Bastok Markets","Bastok Mines","Metalworks",
  27. "Aht Urhgan Whitegate","Nashmau","Tavanazian Safehold",
  28. "Selbina","Mhaura","Norg","Eastern Adoulin","Western Adoulin","Kazham"}
  29.  
  30. -- Idle Sets --
  31. sets.Idle = {}
  32. sets.Idle.Refresh = {
  33. main="Bolelabunga",
  34. sub="Genbu's Shield",
  35. range="Dunna",
  36. head="Wivre Hairpin",
  37. neck="Wiglen Gorget",
  38. ear1="Merman's Earring",
  39. ear2="Merman's Earring",
  40. body="Geo. Tunic +1",
  41. hands="Bagua Mitaines +1",
  42. ring1="Sheltered Ring",
  43. ring2="Paguroidea Ring",
  44. back="Repulse Mantle",
  45. waist="Fucho-No-Obi",
  46. legs="Nares Trews",
  47. feet="Serpentes Sabots"}
  48. sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  49. neck="Twilight Torque",
  50. ring1="Shadow Ring",
  51. ring2="Dark Ring",
  52. feet="Geomancy Sandals"})
  53. sets.Idle.Geomancy = set_combine(sets.Idle.Refresh,{
  54. main="Terra's Staff",
  55. sub="Salubrious Grip",
  56. range="Dunna",
  57. head="Selenian Cap",
  58. neck="Twilight Torque",
  59. ear1="Merman's Earring",
  60. ear2="Merman's Earring",
  61. body="Hagondes Coat +1",
  62. hands="Geo. Mitaines +1",
  63. ring1="Shadow Ring",
  64. ring2="Dark Ring",
  65. back="Lifestream Cape"})
  66.  
  67. sets.Resting = set_combine(sets.Idle.Movement,{})
  68.  
  69. -- PDT Set --
  70. sets.PDT = {
  71. main="Tamaxchi",
  72. sub="Genbu's Shield",
  73. head="Nahtirah Hat",
  74. neck="Twilight Torque",
  75. body="Geo. Tunic +1",
  76. hands="Geo. Pants +1",
  77. ring1="Patricius Ring",
  78. ring2="Dark Ring",
  79. back="Repulse Mantle",
  80. waist="Slipor Sash",
  81. legs="Bokwus Slops",
  82. feet="Geo. Sandals +1"}
  83.  
  84. sets.Sublimation = {
  85. main="Owleyes",
  86. sub="Genbu's Shield",
  87. ammo="Oreiad's Tathlum",
  88. head="Wivre Hairpin",
  89. neck="Dualism Collar",
  90. ear1="Bloodgem Earring",
  91. ear2="Loquac. Earring",
  92. body="Geo. Tunic +1",
  93. hands="Serpentes Cuffs",
  94. ring1="K'ayres Ring",
  95. ring2="Meridian Ring",
  96. back="Gigant Mantle",
  97. waist="Forest Sash",
  98. legs="Nares Trews",
  99. feet="Geo. Sandals +1"}
  100.  
  101. sets.Precast = {}
  102. -- FastCast Sets --
  103. sets.Precast.FastCast = {
  104. ammo="Impatiens",
  105. head="Nahtirah Hat",
  106. neck="Orunmila's Torque",
  107. ear2="Loquac. Earring",
  108. body="Eirene's Manteel",
  109. hands="Geo. Pants +1",
  110. ring1="Prolix Ring",
  111. ring2="Veneficium Ring",
  112. back="Lifestream Cape",
  113. waist="Witful Belt",
  114. legs="Geo. Pants +1",
  115. feet="Chelona Boots +1"}
  116.  
  117. -- Geomancy Precast
  118. sets.Precast.GeoCast = set_combine(sets.Precast.FastCast,{
  119. ammo="Dunna",
  120. body="Bagua Tunic +1",
  121. hands="Geo. Mitaines +1",
  122. back="Lifestream Cape",
  123. legs="Bagua Pants +1",
  124. feet="Umbani Boots"})
  125.  
  126. -- Elemental Staves --
  127. sets.Precast.Thunder = {main='Apamajas I'}
  128. sets.Precast.Water = {main='Haoma I'}
  129. sets.Precast.Fire = {main='Atar I'}
  130. sets.Precast.Ice = {main='Vourukasha I'}
  131. sets.Precast.Wind = {main='Vayuvata I'}
  132. sets.Precast.Earth = {main='Vishrava I'}
  133. sets.Precast.Light = {main='Arka I'}
  134. sets.Precast.Dark = {main='Xsaeta I'}
  135.  
  136. sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  137.  
  138. -- Precast Cure Set --
  139. sets.Precast.Cure = {
  140. sub="Genbu's Shield",
  141. head="Nahtirah Hat",
  142. neck="Orunmila's Torque",
  143. ear2="Loquac. Earring",
  144. body="Heka's Kalasiris",
  145. hands="Geo. Pants +1",
  146. ring1="Prolix Ring",
  147. ring2="Veneficium Ring",
  148. back="Pahtli Cape",
  149. waist="Witful Belt",
  150. legs="Geo. Pants +1",
  151. feet="Chelona Boots +1"}
  152.  
  153. -- Midcast Base Set --
  154. sets.Midcast = {}
  155.  
  156. -- Cure Set --
  157. sets.Midcast.Cure = {
  158. main="Tamaxchi",
  159. sub="Genbu's Shield",
  160. ammo="Oreiad's Tathlum",
  161. head="Nahtirah Hat",
  162. neck="Colossus's Torque",
  163. ear1="Lifestorm Earring",
  164. ear2="Beatific Earring",
  165. body="Heka's Kalasiris",
  166. hands="Ayao's Gages",
  167. ring1="Sirona's Ring",
  168. ring2="Haoma's Ring",
  169. back="Tempered Cape",
  170. waist="Bishop's Sash",
  171. legs="Nares Trews",
  172. feet="Hagondes Sabots"}
  173.  
  174. -- Curaga Set --
  175. sets.Midcast.Curaga = {
  176. main="Tamaxchi",
  177. sub="Genbu's Shield",
  178. ammo="Oreiad's Tathlum",
  179. head="Nahtirah Hat",
  180. neck="Nuna Gorget +1",
  181. ear1="Lifestorm Earring",
  182. ear2="Loquac. Earring",
  183. body="Heka's Kalasiris",
  184. hands="Bokwus Gloves",
  185. ring1="Aquasoul Ring",
  186. ring2="Karka Ring",
  187. back="Pahtli Cape",
  188. waist="Pythia Sash +1",
  189. legs="Geo. Pants +1",
  190. feet="Geo. Sandals +1"}
  191.  
  192. -- Haste Set --
  193. sets.Midcast.Haste = {
  194. ammo="Impatiens",
  195. head="Nahtirah Hat",
  196. neck="Orunmila's Torque",
  197. ear2="Loquac. Earring",
  198. body="Hedera Cotehardie",
  199. hands="Geo. Pants +1",
  200. ring1="Prolix Ring",
  201. ring2="Veneficium Ring",
  202. back="Swith Cape +1",
  203. waist="Witful Belt",
  204. legs="Geo. Pants +1",
  205. feet="Geo. Sandals +1"}
  206.  
  207. sets.Midcast['Enhancing Magic'] = {
  208. neck="Colossus's Torque",
  209. body="Manasa Chasuble",
  210. hands="Ayao's Gages",
  211. ring1="Prolix Ring",
  212. ring2="Veneficium Ring",
  213. waist="Olympus Sash",
  214. legs="Portent Pants",
  215. feet="Gende. Galoshes"}
  216.  
  217. sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{})
  218.  
  219. sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{
  220. head="Nahtirah Hat",
  221. neck="Colossus's Torque",
  222. ear2="Beatific Earring",
  223. body="Hedera Cotehardie",
  224. hands="Bokwus Gloves",
  225. ring1="Haoma's Ring",
  226. ring2="Haoma's Ring",
  227. back="Altruistic Cape",
  228. waist="Witful Belt",
  229. legs="Bokwus Slops",
  230. feet="Geo. Sandals +1"})
  231.  
  232. sets.Midcast.Stun = {
  233. main="Atinian Staff",
  234. sub="Mephitis Grip",
  235. head="Nahtirah Hat",
  236. neck="Orunmila's Torque",
  237. ear1="Lifestorm Earring",
  238. ear2="Psystorm Earring",
  239. body="Hedera Cotehardie",
  240. hands="Geo. Pants +1",
  241. ring1="Maquette Ring",
  242. ring2="Sangoma Ring",
  243. back="Swith Cape +1",
  244. waist="Witful Belt",
  245. legs="Mes'yohi Slacks",
  246. feet="Geo. Sandals +1"}
  247. sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  248. sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  249.  
  250. -- Dark Magic Sets --
  251. sets.Midcast['Dark Magic'] = {}
  252. sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
  253. sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
  254.  
  255. -- Elemental Sets --
  256. sets.Midcast['Elemental Magic'] = {}
  257. sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{})
  258. sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{})
  259.  
  260. -- Enfeebling Sets --
  261. sets.Midcast['Enfeebling Magic'] = {}
  262. sets.Midcast['Enfeebling Magic'].MidACC = set_combine(sets.Midcast['Enfeebling Magic'],{})
  263. sets.Midcast['Enfeebling Magic'].HighACC = set_combine(sets.Midcast['Enfeebling Magic'].MidACC,{})
  264.  
  265. sets.Midcast.Impact = {
  266. main="Atinian Staff",
  267. sub="Mephitis Grip",
  268. neck="Eddy Necklace",
  269. ear1="Lifestorm Earring",
  270. ear2="Psystorm Earring",
  271. body="Twilight Cloak",
  272. hands="Hagondes Cuffs",
  273. ring1="Maquette Ring",
  274. ring2="Sangoma Ring",
  275. back="Refraction Cape",
  276. waist="Demonry Sash",
  277. legs="Mes'yohi Slacks",
  278. feet="Nares Clogs"}
  279.  
  280. -- Elemental Obi/Twilight Cape --
  281. sets.Obi = {}
  282. sets.Obi.Thunder = {back="Twilight Cape",waist='Rairin Obi'}
  283. sets.Obi.Water = {back="Twilight Cape",waist='Suirin Obi'}
  284. sets.Obi.Fire = {back="Twilight Cape",waist='Karin Obi'}
  285. sets.Obi.Ice = {back="Twilight Cape",waist='Hyorin Obi'}
  286. sets.Obi.Wind = {back="Twilight Cape",waist='Furin Obi'}
  287. sets.Obi.Earth = {back="Twilight Cape",waist='Dorin Obi'}
  288. sets.Obi.Light = {back="Twilight Cape",waist='Korin Obi'}
  289. sets.Obi.Dark = {back="Twilight Cape",waist='Anrin Obi'}
  290.  
  291. -- JA Sets --
  292. sets.JA = {}
  293. sets.JA['Life Cycle'] = {body="Geo. Tunic +1"}
  294.  
  295. -- Melee Set --
  296. sets.Melee = set_combine(sets.Midcast.Haste,{})
  297.  
  298. -- WS Base Set --
  299. sets.WS = {}
  300. sets.WS["Hexa Strike"] = {}
  301. sets.WS.Realmrazer = {}
  302. sets.WS.Shattersoul = {}
  303. end
  304.  
  305. function pretarget(spell,action)
  306. if (string.find(spell.type,'Magic') or spell.type == "Ninjutsu" or spell.type == "Geomancy") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  307. cancel_spell()
  308. send_command('input /item "Echo Drops" <me>')
  309. elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  310. degrade_spell(spell,Cure_Spells)
  311. elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  312. degrade_spell(spell,Curaga_Spells)
  313. elseif string.find(spell.english,'Geo') and pet.isvalid then -- Change Any Geo Spells To Full Circle If You Have A Luopan Active --
  314. cancel_spell()
  315. send_command('input /ja "Full Circle" <me>')
  316. elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  317. if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  318. cancel_spell()
  319. send_command('input /ja Addendum: White <me>')
  320. elseif spell.english == "Manifestation" then
  321. cancel_spell()
  322. send_command('input /ja Accession <me>')
  323. elseif spell.english == "Alacrity" then
  324. cancel_spell()
  325. send_command('input /ja Celerity <me>')
  326. elseif spell.english == "Parsimony" then
  327. cancel_spell()
  328. send_command('input /ja Penury <me>')
  329. end
  330. elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  331. if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  332. cancel_spell()
  333. send_command('input /ja Addendum: Black <me>')
  334. elseif spell.english == "Accession" then
  335. cancel_spell()
  336. send_command('input /ja Manifestation <me>')
  337. elseif spell.english == "Celerity" then
  338. cancel_spell()
  339. send_command('input /ja Alacrity <me>')
  340. elseif spell.english == "Penury" then
  341. cancel_spell()
  342. send_command('input /ja Parsimony <me>')
  343. end
  344. end
  345. end
  346.  
  347. function precast(spell,action)
  348. if spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  349. if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  350. cancel_spell()
  351. add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  352. return
  353. else
  354. if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  355. equip(sets.Precast.Cure)
  356. elseif spell.english == "Impact" then
  357. equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  358. elseif string.find(spell.english,'Utsusemi') then
  359. if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  360. cancel_spell()
  361. add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
  362. return
  363. else
  364. equip(sets.Precast.FastCast)
  365. end
  366. elseif sets.Precast[spell.skill] then
  367. equip(sets.Precast[spell.skill])
  368. else
  369. equip(sets.Precast.FastCast)
  370. end
  371. end
  372. elseif spell.type == "WeaponSkill" then
  373. if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  374. cancel_spell()
  375. add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  376. return
  377. elseif sets.WS[spell.english] then
  378. equip(sets.WS[spell.english])
  379. end
  380. elseif spell.type == "JobAbility" then
  381. if sets.JA[spell.english] then
  382. equip(sets.JA[spell.english])
  383. end
  384. elseif spell.type == "Geomancy" then
  385. if Cities:contains(world.area) then
  386. cancel_spell()
  387. add_to_chat(123,'Unable To Use Geomancy In Town')
  388. return
  389. else
  390. if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Geomancy If You Are Silenced or Out of Range --
  391. cancel_spell()
  392. add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  393. return
  394. else
  395. display_geomancy_info(spell)
  396. equip(sets.Precast.GeoCast)
  397. end
  398. end
  399. elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  400. cast_delay(0.2)
  401. send_command('cancel Sneak')
  402. end
  403. if sets.Precast[spell.element] then
  404. equip(sets.Precast[spell.element])
  405. end
  406. if StunIndex == 1 then
  407. equip(sets.Midcast.Stun)
  408. end
  409. end
  410.  
  411. function midcast(spell,action)
  412. equipSet = {}
  413. if spell.type:endswith('Magic') or spell.type == "Geomancy" or spell.type == 'Ninjutsu' then
  414. equipSet = sets.Midcast
  415. if string.find(spell.english,'Cure') then
  416. equipSet = equipSet.Cure
  417. elseif string.find(spell.english,'Cura') then
  418. equipSet = equipSet.Curaga
  419. elseif string.find(spell.english,'Banish') then
  420. equipSet = set_combine(equipSet.Haste,{ring1="Fenian Ring"})
  421. elseif spell.english == "Stoneskin" then
  422. if buffactive.Stoneskin then
  423. send_command('@wait 2.8;cancel stoneskin')
  424. end
  425. equipSet = equipSet.Stoneskin
  426. elseif spell.english == "Sneak" then
  427. if spell.target.name == player.name and buffactive['Sneak'] then
  428. send_command('cancel sneak')
  429. end
  430. equipSet = equipSet.Haste
  431. elseif string.find(spell.english,'Utsusemi') then
  432. if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  433. send_command('@wait 1.7;cancel Copy Image*')
  434. end
  435. equipSet = equipSet.Haste
  436. elseif spell.english == 'Monomi: Ichi' then
  437. if buffactive['Sneak'] then
  438. send_command('@wait 1.7;cancel sneak')
  439. end
  440. equipSet = equipSet.Haste
  441. else
  442. if equipSet[spell.english] then
  443. equipSet = equipSet[spell.english]
  444. end
  445. if equipSet[spell.skill] then
  446. equipSet = equipSet[spell.skill]
  447. end
  448. if equipSet[AccArray[AccIndex]] then
  449. equipSet = equipSet[AccArray[AccIndex]]
  450. end
  451. if equipSet[spell.type] then
  452. equipSet = equipSet[spell.type]
  453. end
  454. if (spell.skill == 'Elemental Magic' or string.find(spell.english,'Cur') or string.find(spell.english,'Bio') or string.find(spell.english,'Dia') or spell.english == 'Aspir' or spell.english == 'Drain') and not Non_Obi_Spells:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' and spell.english ~= "Cursna" then -- Use Obi Toggle To Equip Normal Waist Gear --
  455. equipSet = set_combine(equipSet,sets.Obi[spell.element])
  456. end
  457. end
  458. elseif equipSet[spell.english] then
  459. equipSet = equipSet[spell.english]
  460. end
  461. equip(equipSet)
  462. if StunIndex == 1 then
  463. equip(sets.Midcast.Stun)
  464. end
  465. end
  466.  
  467. function aftercast(spell,action)
  468. if not spell.interrupted then
  469. if spell.english == "Sleep II" then-- Sleep II Countdown --
  470. send_command('wait 60;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  471. elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  472. send_command('wait 30;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  473. elseif spell.english == "Banish II" then -- Banish II Countdown --
  474. send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  475. end
  476. end
  477. status_change(player.status)
  478. end
  479.  
  480. function status_change(new,old)
  481. if Armor == 'PDT' then
  482. equip(sets.PDT)
  483. elseif buffactive["Sublimation: Activated"] then
  484. equip(sets.Sublimation)
  485. elseif new == 'Engaged' then
  486. equip(sets.Melee)
  487. elseif new == 'Idle' then
  488. equip(sets.Idle[IdleArray[IdleIndex]])
  489. elseif new == 'Resting' then
  490. equip(sets.Resting)
  491. end
  492. if StunIndex == 1 then
  493. equip(sets.Midcast.Stun)
  494. end
  495. end
  496.  
  497. function buff_change(buff,gain)
  498. buff = string.lower(buff)
  499. if buff == 'weakness' then -- Weakness Timer --
  500. if gain then
  501. send_command('timers create "Weakness" 300 up')
  502. else
  503. send_command('timers delete "Weakness"')
  504. end
  505. end
  506. if not midaction() then
  507. status_change(player.status)
  508. end
  509. end
  510.  
  511. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  512. function self_command(command)
  513. if command == 'C1' then -- Stun Toggle --
  514. if StunIndex == 1 then
  515. StunIndex = 0
  516. add_to_chat(123,'Stun Set: [Unlocked]')
  517. else
  518. StunIndex = 1
  519. add_to_chat(158,'Stun Set: [Locked]')
  520. end
  521. status_change(player.status)
  522. elseif command == 'C5' then -- Auto Update Gear Toggle --
  523. status_change(player.status)
  524. add_to_chat(158,'Auto Update Gear')
  525. elseif command == 'C3' then -- Obi Toggle --
  526. if Obi == 'ON' then
  527. Obi = 'OFF'
  528. add_to_chat(123,'Obi: [OFF]')
  529. else
  530. Obi = 'ON'
  531. add_to_chat(158,'Obi: [ON]')
  532. end
  533. status_change(player.status)
  534. elseif command == 'C7' then -- PDT Toggle --
  535. if Armor == 'PDT' then
  536. Armor = 'None'
  537. add_to_chat(123,'PDT Set: [Unlocked]')
  538. else
  539. Armor = 'PDT'
  540. add_to_chat(158,'PDT Set: [Locked]')
  541. end
  542. status_change(player.status)
  543. elseif command == 'C8' then -- Distance Toggle --
  544. if player.target.distance then
  545. target_distance = math.floor(player.target.distance*10)/10
  546. add_to_chat(158,'Distance: '..target_distance)
  547. else
  548. add_to_chat(123,'No Target Selected')
  549. end
  550. elseif command == 'C6' then -- Idle Toggle --
  551. IdleIndex = (IdleIndex % #IdleArray) + 1
  552. add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  553. status_change(player.status)
  554. elseif command:match('^SC%d$') then
  555. send_command('//' .. sc_map[command])
  556. end
  557. end
  558.  
  559. function actualCost(originalCost)
  560. if buffactive["Penury"] then
  561. return originalCost*.5
  562. elseif buffactive["Light Arts"] then
  563. return originalCost*.9
  564. else
  565. return originalCost
  566. end
  567. end
  568.  
  569. function degrade_spell(spell,degrade_array)
  570. spell_index = table.find(degrade_array,spell.name)
  571. if spell_index > 1 then
  572. new_spell = degrade_array[spell_index - 1]
  573. change_spell(new_spell,spell.target.raw)
  574. add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  575. end
  576. end
  577.  
  578. function change_spell(spell_name,target)
  579. cancel_spell()
  580. send_command('//'..spell_name..' '..target)
  581. end
  582.  
  583. function define_geomancy_values()
  584. geomancy = {
  585. Frailty = {bonus="Defense Down"},
  586. Torpor = {bonus="Evasion Down"},
  587. Languor = {bonus="Magic Evasion Down"},
  588. Focus = {bonus="Magic Accuracy"},
  589. Malaise = {bonus="Magic Defense Down"},
  590. Precision = {bonus="Accuracy"},
  591. Refresh = {bonus="Refresh"},
  592. Fade = {bonus="Magic Attack Down"},
  593. Wilt = {bonus="Attack Down"},
  594. Vex = {bonus="Magic Accuracy Down"},
  595. Slip = {bonus="Accuracy Down"},
  596. Acumen = {bonus="Magic Attack"},
  597. Fend = {bonus="Magic Defense"},
  598. Fury = {bonus="Attack"},
  599. Attunement = {bonus="Magic Evasion"},
  600. Voidance = {bonus="Evasion"},
  601. Barrier = {bonus="Defense"}
  602. }
  603. end
  604.  
  605. function display_geomancy_info(spell)
  606. geoType=nil
  607. string.gsub(spell.english.."-","-(.-)-",function(geo) geoType=geo end)
  608. geoInfo = geomancy[geoType]
  609. if geoInfo then
  610. add_to_chat(158, spell.english..' = '..tostring(geoInfo.bonus))
  611. end
  612. end
  613.  
  614. function sub_job_change(newSubjob, oldSubjob)
  615. select_default_macro_book()
  616. end
  617.  
  618. function set_macro_page(set,book)
  619. if not tonumber(set) then
  620. add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  621. return
  622. end
  623. if set < 1 or set > 10 then
  624. add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  625. return
  626. end
  627.  
  628. if book then
  629. if not tonumber(book) then
  630. add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  631. return
  632. end
  633. if book < 1 or book > 20 then
  634. add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  635. return
  636. end
  637. send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  638. else
  639. send_command('@input /macro set '..tostring(set))
  640. end
  641. end
  642.  
  643. function select_default_macro_book()
  644. -- Default macro set/book
  645. if player.sub_job == 'RDM' then
  646. set_macro_page(1, 7)
  647. elseif player.sub_job == 'BLM' then
  648. set_macro_page(2, 7)
  649. elseif player.sub_job == 'WHM' then
  650. set_macro_page(3, 7)
  651. else
  652. set_macro_page(1, 7)
  653. end
  654. end
Advertisement
Add Comment
Please, Sign In to add comment