Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.28 KB | None | 0 0
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Motenten's Macro Book Function ** --
  3.  
  4. function get_sets()
  5. AccIndex = 1
  6. AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Magic. Default ACC Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  7. IdleIndex = 1
  8. IdleArray = {"Movement","Refresh"} -- Default Idle Set Is Movement --
  9. Armor = 'None'
  10. StunIndex = 0
  11. Lock_Main = 'OFF' -- Set Default Lock Main Weapon ON or OFF Here --
  12. Obi = 'OFF' -- Turn Default Obi ON or OFF Here --
  13. LowNuke = 'OFF' -- Set Default Low Tier Nuke ON or OFF Here --
  14. MB = 'OFF' -- Set Default MB ON or OFF Here --
  15. Elemental_Staff = 'OFF' -- Set Default Precast Elemental Staff ON or OFF Here --
  16. Enspells = 'OFF' -- Set Default Enspells ON or OFF Here --
  17. target_distance = 5 -- Set Default Distance Here --
  18. select_default_macro_book() -- Change Default Macro Book At The End --
  19.  
  20. Low_Tier_Spells = S{
  21. 'Fire','Aero','Water','Blizzard','Stone','Thunder','Fire II','Aero II','Water II',
  22. 'Blizzard II','Stone II','Thunder II'}
  23.  
  24. Non_Obi_Spells = S{
  25. 'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  26. 'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  27.  
  28. Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  29. Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  30. sc_map = {SC1 = "Composure", SC2 = "Stun", SC3 = "Chainspell"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  31.  
  32. sets.Idle = {}
  33. -- Idle Sets --
  34. sets.Idle.Refresh = {
  35. ammo="Homiliary",
  36. head="Vitivation Chapeau +1",
  37. neck="Loricate Torque +1",
  38. ear1="Etiolation Earring",
  39. ear2="Infused Earring",
  40. body="Witching Robe",
  41. hands="Chironic Gloves",
  42. ring1="Defending Ring",
  43. ring2="Warden's Ring",
  44. back="Solemnity Cape",
  45. waist="Fucho-no-obi",
  46. legs="Carmine Cuisses +1",
  47. feet="Chironic Slippers"}
  48. sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  49. legs="Carmine Cuisses +1"})
  50. sets.Resting = set_combine(sets.Idle.Movement,{})
  51.  
  52. -- PDT Set --
  53. sets.PDT = {}
  54.  
  55. -- Sublimation Set --
  56. sets.Sublimation = {}
  57.  
  58. sets.Precast = {}
  59.  
  60. -- Fastcast Set (empty = To Fix Club/Staff Issue) --
  61. sets.Precast.FastCast = {
  62. ammo="Impatiens",
  63. head="Carmine Mask +1",
  64. neck="Voltsurge Torque",
  65. ear1="Etiolation Earring",
  66. ear2="Loquac. Earring",
  67. body="Anhur Robe",
  68. hands="Leyline Gloves",
  69. ring1="Veneficium Ring",
  70. ring2="Weather. Ring",
  71. back="Ogapepo Cape",
  72. waist="Witful Belt",
  73. legs="Psycloth Lappas",
  74. feet="Carmine Greaves +1"}
  75.  
  76. -- Elemental Staves --
  77. sets.Precast.Lightning = {main='Apamajas I'}
  78. sets.Precast.Water = {main='Haoma I'}
  79. sets.Precast.Fire = {main='Atar I'}
  80. sets.Precast.Ice = {main='Vourukasha I'}
  81. sets.Precast.Wind = {main='Vayuvata I'}
  82. sets.Precast.Earth = {main='Vishrava I'}
  83. sets.Precast.Light = {main='Arka I'}
  84. sets.Precast.Dark = {main='Xsaeta I'}
  85.  
  86. -- Precast Enhancing Magic --
  87. sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  88.  
  89. -- Precast Enfeebling Magic --
  90. sets.Precast['Enfeebling Magic'] = set_combine(sets.Precast.FastCast,{head="Leth. Chappel +1"})
  91.  
  92. -- Precast Cure Set --
  93. sets.Precast.Cure = {
  94. ammo="Impatiens",
  95. head="Carmine Mask +1",
  96. neck="Voltsurge Torque",
  97. ear1="Etiolation Earring",
  98. ear2="Loquac. Earring",
  99. body="Anhur Robe",
  100. hands="Leyline Gloves",
  101. ring1="Veneficium Ring",
  102. ring2="Weather. Ring",
  103. back="Swith Cape",
  104. waist="Witful Belt",
  105. legs="Lengo Pants",
  106. feet="Carmine Geaves +1"}
  107.  
  108. -- Midcast Base Set --
  109. sets.Midcast = {}
  110.  
  111. -- Haste Set --
  112. sets.Midcast.Haste = {
  113. head="Telchine Cap",
  114. body="Telchine Chasuble",
  115. hands="Atrophy Gloves +1",
  116. back="Sucellos's Cape",
  117. legs="Telchine Braconi",
  118. feet="Leth. Houseaux +1"}
  119.  
  120. -- Cure Set --
  121. sets.Midcast.Cure = {
  122. ammo="Hydrocera",
  123. head="Kaykaus Mitra",
  124. neck="Incanter's Torque",
  125. ear1="Gifted Earring",
  126. ear2="Mendicant's Earring",
  127. body="Vanya Robe",
  128. hands="Kaykaus Cuffs",
  129. ring1="Kuchekula Ring",
  130. ring2="Vertigo Ring",
  131. back="Solemnity Cape",
  132. waist="Luminary Sash",
  133. legs="Gyve Trousers",
  134. feet="Kaykaus Boots"}
  135.  
  136. -- Curaga Set --
  137. sets.Midcast.Curaga = {}
  138.  
  139. -- Enhancing Magic --
  140. sets.Midcast['Enhancing Magic'] = {
  141. head="Befouled Crown",
  142. neck="Incanter's Torque",
  143. ear1="Gifted Earring",
  144. ear2="Andoaa Earring",
  145. body="Telchine Chasuble",
  146. hands="Atrophy Gloves +1",
  147. back="Ghostfyre Cape",
  148. legs="Carmine Cuisses +1",
  149. feet="Leth. Houseaux +1"}
  150.  
  151. -- Refresh --
  152. sets.Midcast.Refresh = set_combine(sets.Midcast.Haste,{
  153. head="Amalric Coif",
  154. back="Sucellos's Cape",
  155. waist="Gishdubar Sash",
  156. legs="Leth. Fuseau +1",
  157. feet="Inspirited Boots"})
  158.  
  159. -- Aquaveil --
  160. sets.Midcast.Aquaveil = set_combine(sets.Midcast.Haste,{
  161. head="Amalric Coif"})
  162.  
  163. -- Composure(Enhancing Magic On Others) Set --
  164. sets.Composure = {
  165. head="Leth. Chappel +1",
  166. body="Lethargy Sayon +1",
  167. hands="Atrophy Gloves +1",
  168. back="Ghostfyre Cape",
  169. legs="Leth. Fuseau +1",
  170. feet="Leth. Houseaux +1"}
  171.  
  172. -- Stoneskin --
  173. sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{
  174. neck="Nodens Gorget",
  175. hands="Stone Mufflers",
  176. back="Siegel Sash"})
  177.  
  178. -- Phalanx --
  179. sets.Midcast.Phalanx = set_combine(sets.Midcast['Enhancing Magic'],{})
  180.  
  181. -- Cursna --
  182. sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{})
  183.  
  184. -- Stun Sets --
  185. sets.Midcast.Stun = {}
  186. sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  187. sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  188.  
  189. -- Dark Magic Sets --
  190. sets.Midcast['Dark Magic'] = {}
  191. sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
  192. sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
  193.  
  194. -- Low Tier Set --
  195. sets.LowNuke = {}
  196.  
  197. -- MB Set --
  198. sets.MB = {}
  199.  
  200. -- Elemental Sets --
  201. sets.Midcast['Elemental Magic'] = {
  202. ammo="Pemphredo Tathlum",
  203. head="Chironic Hat",
  204. neck="Sanctity Necklace",
  205. ear1="Friomisi Earring",
  206. ear2="Strophadic Earring",
  207. body="Jhakri Robe +1",
  208. hands="Amalric Gages",
  209. ring1="Vertigo Ring",
  210. ring2="Shiva Ring",
  211. waist="Yamabuki-no-Obi",
  212. legs="Merlinic Shalwar",
  213. feet="Merlinic Crackows"}
  214. sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{})
  215. sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{})
  216.  
  217. -- Enfeebling Sets --
  218. sets.Midcast['Enfeebling Magic'] = {
  219. ammo="Pemphredo Tathlum",
  220. head="Carmine Mask +1",
  221. neck="Sanctity Necklace",
  222. ear2="Digni. Earring",
  223. body="Vanya Robe",
  224. hands="Kaykaus Cuffs",
  225. ring1="Vertigo Ring",
  226. ring2="Weather. Ring",
  227. back="Aurist's Cape",
  228. waist="Luminary Sash",
  229. legs="Chironic Hose",
  230. feet="Medium's Sabots"}
  231. sets.Midcast['Enfeebling Magic'].MidACC = set_combine(sets.Midcast['Enfeebling Magic'],{})
  232. sets.Midcast['Enfeebling Magic'].HighACC = set_combine(sets.Midcast['Enfeebling Magic'].MidACC,{})
  233.  
  234. -- Impact --
  235. sets.Midcast.Impact = {
  236. body="Twilight Cloak"}
  237.  
  238. -- Elemental Obi/Twilight Cape --
  239. sets.Obi = {}
  240. sets.Obi.Lightning = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  241. sets.Obi.Water = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  242. sets.Obi.Fire = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  243. sets.Obi.Ice = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  244. sets.Obi.Wind = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  245. sets.Obi.Earth = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  246. sets.Obi.Light = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  247. sets.Obi.Dark = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  248.  
  249. -- JA Sets --
  250. sets.JA = {}
  251. sets.JA.Chainspell = {body="Viti. Tabard +1"}
  252. sets.JA.Saboteur = {hands="Leth. Gantherots +1"}
  253.  
  254. -- Melee Sets --
  255. sets.Melee = {
  256. ammo="Ginsen",
  257. head="Carmine Mask +1",
  258. neck="Lissome Necklace",
  259. ear1="Suppanomimi",
  260. ear2="Cessance Earring",
  261. body="Taeon Tabard",
  262. hands="Taeon Gloves",
  263. ring1="Petrov Ring",
  264. ring2="Hetairoi Ring",
  265. back="Sucellos's Cape",
  266. waist="Shetal Stone",
  267. legs="Carmine Cuisses +1",
  268. feet="Carmine Greaves +1"}
  269. sets.Melee.MidACC = set_combine(sets.Melee,{
  270. ear1="Digni. Earring",
  271. waist="Kentarch Belt +1"})
  272. sets.Melee.HighACC = set_combine(sets.Melee.MidACC,{})
  273.  
  274. -- WS Base Set --
  275. sets.WS = {}
  276.  
  277. -- Chant du Cygne Sets --
  278. sets.WS["Chant du Cygne"] = {
  279. ammo="Yetshila",
  280. head="Carmine Mask +1",
  281. neck="Fotia Gorget",
  282. ear1="Mache Earring",
  283. ear2="Cessance Earring",
  284. body="Taeon Tabard",
  285. hands="Taeon Gloves",
  286. ring1="Begruding Ring",
  287. ring2="Hetairoi Ring",
  288. back="Sucellos's Cape",
  289. waist="Fotia Belt",
  290. legs="Carmine Cuisses +1",
  291. feet="Thereoid Greaves"}
  292. sets.WS["Chant du Cygne"].MidACC = set_combine(sets.WS["Chant du Cygne"],{})
  293. sets.WS["Chant du Cygne"].HighACC = set_combine(sets.WS["Chant du Cygne"].MidACC,{})
  294.  
  295. -- Requiescat Sets --
  296. sets.WS.Requiescat = {}
  297. sets.WS.Requiescat.MidACC = set_combine(sets.WS.Requiescat,{})
  298. sets.WS.Requiescat.HighACC = set_combine(sets.WS.Requiescat.MidACC,{})
  299.  
  300. -- Knights of Round Set --
  301. sets.WS["Knights of Round"] = {}
  302.  
  303. -- Exenterator Sets --
  304. sets.WS.Exenterator = {}
  305. sets.WS.Exenterator.MidACC = set_combine(sets.WS.Exenterator,{})
  306. sets.WS.Exenterator.HighACC = set_combine(sets.WS.Exenterator.MidACC,{})
  307.  
  308. -- Evisceration Sets --
  309. sets.WS.Evisceration = {}
  310. sets.WS.Evisceration.MidACC = set_combine(sets.WS.Evisceration,{})
  311. sets.WS.Evisceration.HighACC = set_combine(sets.WS.Evisceration.MidACC,{})
  312.  
  313. -- Idle Reive Set --
  314. sets.Reive = {neck="Adoulin's Refuge +1"}
  315. end
  316.  
  317. function pretarget(spell,action)
  318. if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  319. cancel_spell()
  320. send_command('input /item "Echo Drops" <me>')
  321. elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  322. cancel_spell()
  323. add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  324. return
  325. elseif spell.english:startswith("Cure") and player.mp<actualCost(spell.mp_cost) then
  326. degrade_spell(spell,Cure_Spells)
  327. elseif spell.english:startswith("Curaga") and player.mp<actualCost(spell.mp_cost) then
  328. degrade_spell(spell,Curaga_Spells)
  329. elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  330. if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  331. cancel_spell()
  332. send_command('input /ja Addendum: White <me>')
  333. elseif spell.english == "Manifestation" then
  334. cancel_spell()
  335. send_command('input /ja Accession <me>')
  336. elseif spell.english == "Alacrity" then
  337. cancel_spell()
  338. send_command('input /ja Celerity <me>')
  339. elseif spell.english == "Parsimony" then
  340. cancel_spell()
  341. send_command('input /ja Penury <me>')
  342. end
  343. elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  344. if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  345. cancel_spell()
  346. send_command('input /ja Addendum: Black <me>')
  347. elseif spell.english == "Accession" then
  348. cancel_spell()
  349. send_command('input /ja Manifestation <me>')
  350. elseif spell.english == "Celerity" then
  351. cancel_spell()
  352. send_command('input /ja Alacrity <me>')
  353. elseif spell.english == "Penury" then
  354. cancel_spell()
  355. send_command('input /ja Parsimony <me>')
  356. end
  357. end
  358. end
  359.  
  360. function precast(spell,action)
  361. if spell.action_type == 'Magic' then
  362. if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  363. cancel_spell()
  364. add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  365. return
  366. else
  367. if spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  368. equip(sets.Precast.Cure)
  369. elseif spell.english == "Stun" then
  370. if buffactive.Composure then -- Cancel Composure When You Cast Stun --
  371. cast_delay(0.2)
  372. send_command('cancel Composure')
  373. end
  374. equip(sets.Precast.FastCast)
  375. elseif spell.english == "Impact" then
  376. equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  377. elseif spell.english:startswith("En") and Enspells == 'ON' then
  378. local list={Dark="blizzard",Water="water",Earth="stone",Ice="blizzard",Fire="fire",Wind="aero",Lightning="thunder",Light="fire"}
  379. if spell.english ~= 'En'..list[world.day_element]..''..(spell.english:endswith(' II') and ' II' or '') then
  380. cancel_spell()
  381. send_command('@input /ma "En'..list[world.day_element]..''..(spell.english:endswith(' II') and ' II' or '')..'" <me>')
  382. return
  383. end
  384. elseif spell.english == 'Utsusemi: Ni' then
  385. if buffactive['Copy Image (3)'] then
  386. cancel_spell()
  387. add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  388. return
  389. else
  390. equip(sets.Precast.FastCast)
  391. end
  392. elseif sets.Precast[spell.skill] then
  393. equip(sets.Precast[spell.skill])
  394. else
  395. equip(sets.Precast.FastCast)
  396. end
  397. end
  398. elseif spell.type == "WeaponSkill" then
  399. if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  400. cancel_spell()
  401. add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  402. return
  403. else
  404. equipSet = sets.WS
  405. if equipSet[spell.english] then
  406. equipSet = equipSet[spell.english]
  407. end
  408. if equipSet[AccArray[AccIndex]] then
  409. equipSet = equipSet[AccArray[AccIndex]]
  410. end
  411. if (spell.english == "Chant du Cygne" or spell.english == "Evisceration") and player.tp > 2990 then -- Equip Jupiter's Pearl When You Have 3000 TP --
  412. equipSet = set_combine(equipSet,{ear1="Jupiter's Pearl"})
  413. end
  414. equip(equipSet)
  415. end
  416. elseif spell.type == "JobAbility" then
  417. if sets.JA[spell.english] then
  418. equip(sets.JA[spell.english])
  419. end
  420. elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  421. cast_delay(0.2)
  422. send_command('cancel Sneak')
  423. end
  424. if sets.Precast[spell.element] and Elemental_Staff == 'ON' then
  425. equip(sets.Precast[spell.element])
  426. end
  427. if StunIndex == 1 then
  428. equip(sets.Midcast.Stun)
  429. end
  430. end
  431.  
  432. function midcast(spell,action)
  433. equipSet = {}
  434. if spell.action_type == 'Magic' then
  435. equipSet = sets.Midcast
  436. if spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  437. if spell.english:startswith('Cure') then
  438. equipSet = equipSet.Cure
  439. elseif spell.english:startswith('Cura') then
  440. equipSet = equipSet.Curaga
  441. end
  442. if world.day_element == spell.element or world.weather_element == spell.element then
  443. equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Hachirin-no-Obi"})
  444. end
  445. elseif spell.english:startswith('Refresh') then
  446. equipSet = equipSet.Refresh
  447. elseif spell.english:startswith('Haste') then
  448. equipSet = equipSet.Haste
  449. elseif spell.english:startswith('Flurry') then
  450. equipSet = equipSet.Haste
  451. elseif spell.english == "Stoneskin" then
  452. if buffactive.Stoneskin then
  453. send_command('@wait 2.8;cancel stoneskin')
  454. end
  455. equipSet = equipSet.Stoneskin
  456. elseif spell.english == "Phalanx II" then -- Equip Aug'd Viti. Gloves +1 When You Cast Phalanx II --
  457. equipSet = set_combine(equipSet,{hands="Viti. Gloves +1"})
  458. elseif spell.english == "Dia III" or spell.english == "Slow II" then -- Equip Aug'd Viti. Chapeau +1 When You Cast Dia III or Slow II --
  459. equipSet = set_combine(equipSet,{head="Viti. Chapeau +1"})
  460. elseif spell.english == "Paralyze II" then -- Equip Aug'd Vitivation Boots +1 When You Cast Paralyze II --
  461. equipSet = set_combine(equipSet,{feet="Vitivation Boots +1"})
  462. elseif spell.english == "Blind II" or spell.english == "Bio III" then -- Equip Aug'd Viti. Tights +1 When You Cast Blind II or Bio III --
  463. equipSet = set_combine(equipSet,{legs="Viti. Tights +1"})
  464. elseif spell.english == "Sneak" then
  465. if spell.target.name == player.name and buffactive['Sneak'] then
  466. send_command('cancel sneak')
  467. end
  468. equipSet = equipSet.Haste
  469. elseif spell.english:startswith('Banish') then
  470. equipSet = set_combine(equipSet.Haste,{ring1="Fenian Ring"})
  471. elseif Low_Tier_Spells:contains(spell.english) and LowNuke == 'ON' then
  472. equipSet = set_combine(equipSet,sets.LowNuke)
  473. elseif spell.skill == 'Elemental Magic' and MB == 'ON' then
  474. equipSet = set_combine(equipSet,sets.MB)
  475. elseif spell.english:startswith('Utsusemi') then
  476. if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  477. send_command('@wait 1.7; cancel Copy Image*')
  478. end
  479. equipSet = equipSet.Haste
  480. elseif spell.english == 'Monomi: Ichi' then
  481. if buffactive['Sneak'] then
  482. send_command('@wait 1.7;cancel sneak')
  483. end
  484. equipSet = equipSet.Haste
  485. else
  486. if equipSet[spell.english] then
  487. equipSet = equipSet[spell.english]
  488. end
  489. if equipSet[spell.skill] then
  490. equipSet = equipSet[spell.skill]
  491. end
  492. if equipSet[AccArray[AccIndex]] then
  493. equipSet = equipSet[AccArray[AccIndex]]
  494. end
  495. if equipSet[spell.type] then
  496. equipSet = equipSet[spell.type]
  497. end
  498. if (spell.skill == 'Elemental Magic' or spell.english:startswith('Cur') or spell.english:startswith('Bio') or spell.english:startswith('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 --
  499. equipSet = set_combine(equipSet,sets.Obi[spell.element])
  500. end
  501. end
  502. end
  503. if buffactive.Composure and spell.skill == "Enhancing Magic" and spell.target.type == 'PLAYER' then -- Equip Composure Set When You Cast Enhancing Spells On Others --
  504. equipSet = set_combine(equipSet,sets.Composure)
  505. elseif equipSet[spell.english] then
  506. equipSet = equipSet[spell.english]
  507. end
  508. equip(equipSet)
  509. if StunIndex == 1 then
  510. equip(sets.Midcast.Stun)
  511. end
  512. end
  513.  
  514. function aftercast(spell,action)
  515. if not spell.interrupted then
  516. if spell.english == "Sleep II" then -- Sleep II Countdown --
  517. 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.]')
  518. elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  519. 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.]')
  520. elseif spell.english == "Banish II" then -- Banish II Countdown --
  521. send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  522. end
  523. end
  524. status_change(player.status)
  525. end
  526.  
  527. function status_change(new,old)
  528. check_equip_lock()
  529. if Armor == 'PDT' then
  530. equip(sets.PDT)
  531. elseif buffactive["Sublimation: Activated"] then
  532. equip(sets.Sublimation)
  533. elseif new == 'Engaged' then
  534. equipSet = sets.Melee
  535. if equipSet[AccArray[AccIndex]] then
  536. equipSet = equipSet[AccArray[AccIndex]]
  537. end
  538. equip(equipSet)
  539. elseif new == 'Idle' then
  540. equipSet = sets.Idle
  541. if equipSet[IdleArray[IdleIndex]] then
  542. equipSet = equipSet[IdleArray[IdleIndex]]
  543. end
  544. if buffactive['Reive Mark'] then -- Equip Arciela's Grace +1 During Reive --
  545. equipSet = set_combine(equipSet,sets.Reive)
  546. end
  547. equip(equipSet)
  548. elseif new == 'Resting' then
  549. equip(sets.Resting)
  550. end
  551. if StunIndex == 1 then
  552. equip(sets.Midcast.Stun)
  553. end
  554. end
  555.  
  556. function buff_change(buff,gain)
  557. buff = string.lower(buff)
  558. if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  559. if gain then
  560. send_command('timers create "Aftermath: Lv.3" 180 down;wait 150;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 15;input /echo Aftermath: Lv.3 [WEARING OFF IN 15 SEC.];wait 5;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  561. else
  562. send_command('timers delete "Aftermath: Lv.3"')
  563. add_to_chat(123,'AM3: [OFF]')
  564. end
  565. elseif buff == 'weakness' then -- Weakness Timer --
  566. if gain then
  567. send_command('timers create "Weakness" 300 up')
  568. else
  569. send_command('timers delete "Weakness"')
  570. end
  571. end
  572. if not midaction() then
  573. status_change(player.status)
  574. end
  575. end
  576.  
  577. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  578. function self_command(command)
  579. if command == 'C1' then -- Accuracy Toggle --
  580. AccIndex = (AccIndex % #AccArray) + 1
  581. add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
  582. status_change(player.status)
  583. elseif command == 'C5' then -- Auto Update Gear Toggle --
  584. status_change(player.status)
  585. add_to_chat(158,'Auto Update Gear')
  586. elseif command == 'C2' then -- Stun Toggle --
  587. if StunIndex == 1 then
  588. StunIndex = 0
  589. add_to_chat(123,'Stun Set: [Unlocked]')
  590. else
  591. StunIndex = 1
  592. add_to_chat(158,'Stun Set: [Locked]')
  593. end
  594. status_change(player.status)
  595. elseif command == 'C3' then -- Obi Toggle --
  596. if Obi == 'ON' then
  597. Obi = 'OFF'
  598. add_to_chat(123,'Obi: [OFF]')
  599. else
  600. Obi = 'ON'
  601. add_to_chat(158,'Obi: [ON]')
  602. end
  603. status_change(player.status)
  604. elseif command == 'C7' then -- PDT Toggle --
  605. if Armor == 'PDT' then
  606. Armor = 'None'
  607. add_to_chat(123,'PDT Set: [Unlocked]')
  608. else
  609. Armor = 'PDT'
  610. add_to_chat(158,'PDT Set: [Locked]')
  611. end
  612. status_change(player.status)
  613. elseif command == 'C15' then -- LowNuke Toggle --
  614. if LowNuke == 'ON' then
  615. LowNuke = 'OFF'
  616. add_to_chat(123,'Low Nuke: [OFF]')
  617. else
  618. LowNuke = 'ON'
  619. add_to_chat(158,'Low Nuke: [ON]')
  620. end
  621. status_change(player.status)
  622. elseif command == 'C9' then -- MB Toggle --
  623. if MB == 'ON' then
  624. MB = 'OFF'
  625. add_to_chat(123,'MB: [OFF]')
  626. else
  627. MB = 'ON'
  628. add_to_chat(158,'MB: [ON]')
  629. end
  630. status_change(player.status)
  631. elseif command == 'C17' then -- Lock Main Weapon Toggle --
  632. if Lock_Main == 'ON' then
  633. Lock_Main = 'OFF'
  634. add_to_chat(123,'Main Weapon: [Unlocked]')
  635. else
  636. Lock_Main = 'ON'
  637. add_to_chat(158,'Main Weapon: [Locked]')
  638. end
  639. status_change(player.status)
  640. elseif command == 'C15' then -- Enspells Toggle --
  641. if Enspells == 'ON' then
  642. Enspells = 'OFF'
  643. add_to_chat(123,'Enspells: [OFF]')
  644. else
  645. Enspells = 'ON'
  646. add_to_chat(158,'Enspells: [ON]')
  647. end
  648. status_change(player.status)
  649. elseif command == 'C8' then -- Distance Toggle --
  650. if player.target.distance then
  651. target_distance = math.floor(player.target.distance*10)/10
  652. add_to_chat(158,'Distance: '..target_distance)
  653. else
  654. add_to_chat(123,'No Target Selected')
  655. end
  656. elseif command == 'C6' then -- Idle Toggle --
  657. IdleIndex = (IdleIndex % #IdleArray) + 1
  658. add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  659. status_change(player.status)
  660. elseif command:match('^SC%d$') then
  661. send_command('//' .. sc_map[command])
  662. end
  663. end
  664.  
  665. function check_equip_lock() -- Lock Equipment Here --
  666. if player.equipment.left_ring == "Warp Ring" or player.equipment.left_ring == "Capacity Ring" or player.equipment.right_ring == "Warp Ring" or player.equipment.right_ring == "Capacity Ring" then
  667. disable('ring1','ring2')
  668. elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
  669. disable('back')
  670. elseif Lock_Main == 'ON' then
  671. disable('main','sub')
  672. else
  673. enable('main','sub','ring1','ring2','back')
  674. end
  675. end
  676.  
  677. function actualCost(originalCost)
  678. if buffactive["Penury"] then
  679. return originalCost*.5
  680. elseif buffactive["Light Arts"] then
  681. return originalCost*.9
  682. else
  683. return originalCost
  684. end
  685. end
  686.  
  687. function degrade_spell(spell,degrade_array)
  688. spell_index = table.find(degrade_array,spell.name)
  689. if spell_index > 1 then
  690. new_spell = degrade_array[spell_index - 1]
  691. change_spell(new_spell,spell.target.raw)
  692. add_to_chat(8,spell.name..' Canceled: [Current MP = ' .. player.mp .. ' | ' .. player.mpp .. '%] Using '..new_spell..' instead.')
  693. end
  694. end
  695.  
  696. function change_spell(spell_name,target)
  697. cancel_spell()
  698. send_command('//'..spell_name..' '..target)
  699. end
  700.  
  701. function sub_job_change(newSubjob, oldSubjob)
  702. select_default_macro_book()
  703. end
  704.  
  705. function set_macro_page(set,book)
  706. if not tonumber(set) then
  707. add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  708. return
  709. end
  710. if set < 1 or set > 10 then
  711. add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  712. return
  713. end
  714.  
  715. if book then
  716. if not tonumber(book) then
  717. add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  718. return
  719. end
  720. if book < 1 or book > 20 then
  721. add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  722. return
  723. end
  724. send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  725. else
  726. send_command('@input /macro set '..tostring(set))
  727. end
  728. end
  729.  
  730. function select_default_macro_book()
  731. -- Default macro set/book
  732. if player.sub_job == 'WHM' then
  733. set_macro_page(1, 6)
  734. elseif player.sub_job == 'BLM' then
  735. set_macro_page(2, 11)
  736. elseif player.sub_job == 'SCH' then
  737. set_macro_page(3, 11)
  738. elseif player.sub_job == 'DNC' then
  739. set_macro_page(1, 7)
  740. elseif player.sub_job == 'WAR' then
  741. set_macro_page(9, 11)
  742. elseif player.sub_job == 'NIN' then
  743. set_macro_page(1, 8)
  744. else
  745. set_macro_page(1, 11)
  746. end
  747. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement