Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.40 KB | None | 0 0
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Some of Motenten's Functions ** --
  3.  
  4. function get_sets()
  5. include('no_interruption.lua')
  6. AccIndex = 1
  7. AccArray = {"LowACC","STP","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid/Stun. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. --
  8. WeaponIndex = 1
  9. WeaponArray = {"Ragnarok"} -- Default Main Weapon Is Liberator. Can Delete Any Weapons/Sets That You Don't Need Or Replace/Add The New Weapons That You Want To Use. --
  10. IdleIndex = 1
  11. IdleArray = {"Movement","Regen","Refresh"} -- Default Idle Set Is Movement --
  12. Armor = 'None'
  13. Twilight = 'None'
  14. Attack = 'OFF' -- Set Default WS Attack Set ON or OFF Here --
  15.  
  16. Samurai_Roll = 'ON' -- Set Default SAM Roll 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. -- Gavialis Helm --
  21. elements = {}
  22. elements.equip = {}
  23. elements.Resolution = S{}
  24. elements.Entropy = S{}
  25. elements.Catastrophe = S{}
  26. elements.Insurgency = S{}
  27.  
  28. sc_map = {SC1="Entropy", SC2="Insurgency", SC3="LastResort"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  29.  
  30. sets.Idle = {
  31. main="Ragnarok",
  32. sub="Utu Grip",
  33. ammo="Staunch Tathlum",
  34. head={ name="Valorous Mask", augments={'Accuracy+22','"Refresh"+1','Accuracy+15 Attack+15','Mag. Acc.+8 "Mag.Atk.Bns."+8',}},
  35. body="Tartarus Platemail",
  36. hands="Sulev. Gauntlets +2",
  37. legs="Carmine Cuisses +1",
  38. feet={ name="Amm Greaves", augments={'HP+50','VIT+10','Accuracy+15','Damage taken-2%',}},
  39. neck="Loricate Torque +1",
  40. waist="Flume Belt",
  41. left_ear="Etiolation Earring",
  42. right_ear="Ethereal Earring",
  43. left_ring="Defending Ring",
  44. right_ring="Moonbeam Ring",
  45. back="Moonbeam Cape",
  46. }
  47. -- Regen Set --
  48. sets.Idle.Regen = {
  49. main="Ragnarok",
  50. sub="Utu Grip",
  51. ammo="Staunch Tathlum",
  52. head={ name="Valorous Mask", augments={'Accuracy+22','"Refresh"+1','Accuracy+15 Attack+15','Mag. Acc.+8 "Mag.Atk.Bns."+8',}},
  53. body="Tartarus Platemail",
  54. hands="Sulev. Gauntlets +2",
  55. legs="Carmine Cuisses +1",
  56. feet={ name="Amm Greaves", augments={'HP+50','VIT+10','Accuracy+15','Damage taken-2%',}},
  57. neck="Loricate Torque +1",
  58. waist="Flume Belt",
  59. left_ear="Etiolation Earring",
  60. right_ear="Ethereal Earring",
  61. left_ring="Defending Ring",
  62. right_ring="Moonbeam Ring",
  63. back="Moonbeam Cape",
  64. }
  65.  
  66. sets.Idle.Regen.Ragnarok = set_combine(sets.Idle.Regen,{
  67. })
  68. sets.Idle.Regen.Ragnarok.SAM = set_combine(sets.Idle.Regen,{
  69. })
  70.  
  71.  
  72. -- Movement Sets --
  73. sets.Idle.Movement = set_combine(sets.Idle.Regen,{
  74. legs="Carmine Cuisses +1"})
  75.  
  76. sets.Idle.Movement.Ragnarok = set_combine(sets.Idle.Movement,{
  77. })
  78. sets.Idle.Movement.Ragnarok.SAM = set_combine(sets.Idle.Movement,{
  79. })
  80.  
  81.  
  82. -- Refresh Sets --
  83. sets.Idle.Refresh = set_combine(sets.Idle.Regen,{
  84. head={ name="Valorous Mask", augments={'Accuracy+22','"Refresh"+1','Accuracy+15 Attack+15','Mag. Acc.+8 "Mag.Atk.Bns."+8',}},
  85. body="Chozor. Coselete",
  86. hands={ name="Odyssean Gauntlets", augments={'Mag. Acc.+1','Weapon Skill Acc.+3','"Refresh"+1','Accuracy+6 Attack+6',}}
  87. ,})
  88.  
  89. sets.Idle.Refresh.Ragnarok = set_combine(sets.Idle.Refresh,{
  90. })
  91. sets.Idle.Refresh.Ragnarok.SAM = set_combine(sets.Idle.Refresh,{
  92. })
  93.  
  94.  
  95. sets.Twilight = {head="Twilight Helm",body="Twilight Mail"}
  96.  
  97. -- TP Base Set --
  98. sets.TP = {
  99. main="Ragnarok",
  100. sub="Utu Grip",
  101. ammo="Ginsen",
  102. head="Flam. Zucchetto +2",
  103. body={ name="Valorous Mail", augments={'Accuracy+24 Attack+24','"Store TP"+7','VIT+2','Accuracy+2','Attack+13',}},
  104. hands="Argosy Mufflers +1",
  105. legs="Odyssean Cuisses",
  106. feet="Flam. Gambieras +2",
  107. neck="Ganesha's Mala",
  108. waist="Ioskeha Belt",
  109. back="Ankou's Mantle",
  110. left_ear="Cessance Earring",
  111. right_ear="Brutal Earring",
  112. left_ring="Niqmaddu Ring",
  113. right_ring="Petrov Ring",
  114. }
  115.  
  116.  
  117.  
  118. -- Ragnarok TP Sets --
  119. sets.TP.Ragnarok = {
  120. main="Ragnarok",
  121. sub="Utu Grip",
  122. ammo="Ginsen",
  123. head="Flam. Zucchetto +2",
  124. body={ name="Valorous Mail", augments={'Accuracy+24 Attack+24','"Store TP"+7','VIT+2','Accuracy+2','Attack+13',}},
  125. hands="Argosy Mufflers +1",
  126. legs="Odyssean Cuisses",
  127. feet="Flam. Gambieras +2",
  128. neck="Ganesha's Mala",
  129. waist="Ioskeha Belt",
  130. back="Ankou's Mantle",
  131. left_ear="Cessance Earring",
  132. right_ear="Brutal Earring",
  133. left_ring="Niqmaddu Ring",
  134. right_ring="Petrov Ring",
  135. }
  136. sets.TP.Ragnarok.STP = set_combine(sets.TP.Ragnarok,{
  137. left_ear="Telos Earring",
  138. neck="Combatant's Torque",
  139. })
  140. sets.TP.Ragnarok.HighACC = set_combine(sets.TP.Ragnarok.LowACC,{})
  141.  
  142.  
  143.  
  144. -- AM3 Rancor ON Mantle --
  145.  
  146.  
  147. -- PDT/MDT Sets --
  148. sets.PDT = {
  149. ammo="Hasty Pinion +1",
  150. head="Sulevia's Mask +2",
  151. body="Tartarus Platemail",
  152. hands="Sulev. Gauntlets +2",
  153. legs="Sulev. Cuisses +2",
  154. feet={ name="Amm Greaves", augments={'HP+50','VIT+10','Accuracy+15','Damage taken-2%',}},
  155. neck="Loricate Torque +1",
  156. waist="Ioskeha Belt",
  157. left_ear="Etiolation Earring",
  158.  
  159. left_ring="Defending Ring",
  160. right_ring="Moonbeam Ring",
  161. back="Ankou's Mantle",
  162. }
  163.  
  164. sets.MDT = set_combine(sets.PDT,{})
  165.  
  166. -- Hybrid Set --
  167. sets.TP.Hybrid = set_combine(sets.PDT,{})
  168. sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{})
  169. sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{})
  170.  
  171. -- WS Base Set --
  172. sets.WS = {
  173. ammo="Knobkierrie",
  174. head="Flam. Zucchetto +2",
  175. body={ name="Argosy Hauberk", augments={'STR+10','Attack+15','"Store TP"+5',}},
  176. hands={ name="Argosy Mufflers +1", augments={'STR+20','"Dbl.Atk."+3','Haste+3%',}},
  177. legs={ name="Argosy Breeches +1", augments={'STR+12','Attack+25','"Store TP"+6',}},
  178. feet="Sulev. Leggings +1",
  179. neck="Fotia Gorget",
  180. waist="Fotia Belt",
  181. left_ear="Cessance Earring",
  182. right_ear="Brutal Earring",
  183. left_ring="Niqmaddu Ring",
  184. right_ring="Regal Ring",
  185. back="Ankou's Mantle",
  186.  
  187. }
  188.  
  189. -- Resolution Sets --
  190. sets.WS.Resolution = {
  191. ammo="Knobkierrie",
  192. head="Flam. Zucchetto +2",
  193. body={ name="Argosy Hauberk", augments={'STR+10','Attack+15','"Store TP"+5',}},
  194. hands={ name="Argosy Mufflers +1", augments={'STR+20','"Dbl.Atk."+3','Haste+3%',}},
  195. legs={ name="Argosy Breeches +1", augments={'STR+12','Attack+25','"Store TP"+6',}},
  196. feet={ name="Argosy Sollerets +1", augments={'STR+12','DEX+12','Attack+20',}},
  197. neck="Fotia Gorget",
  198. waist="Fotia Belt",
  199. left_ear="Cessance Earring",
  200. right_ear="Brutal Earring",
  201. left_ring="Niqmaddu Ring",
  202. right_ring="Regal Ring",
  203. back="Ankou's Mantle",
  204. }
  205.  
  206. sets.WS.Resolution.MidACC = set_combine(sets.WS.Resolution,{})
  207. sets.WS.Resolution.HighACC = set_combine(sets.WS.Resolution.MidACC,{})
  208.  
  209. -- Resolution(Attack) Set --
  210. sets.WS.Resolution.ATT = set_combine(sets.WS.Resolution,{})
  211.  
  212. -- Catastrophe Sets --
  213. sets.WS.Catastrophe = {}
  214. sets.WS.Catastrophe.MidACC = set_combine(sets.WS.Catastrophe,{})
  215. sets.WS.Catastrophe.HighACC = set_combine(sets.WS.Catastrophe.MidACC,{})
  216.  
  217. -- Catastrophe(Attack) Set --
  218. sets.WS.Catastrophe.ATT = set_combine(sets.WS.Catastrophe,{})
  219.  
  220. -- Entropy Sets --
  221. sets.WS.Entropy = {}
  222. sets.WS.Entropy.MidACC = set_combine(sets.WS.Entropy,{})
  223. sets.WS.Entropy.HighACC = set_combine(sets.WS.Entropy.MidACC,{})
  224.  
  225. -- Entropy(Attack) Set --
  226. sets.WS.Entropy.ATT = set_combine(sets.WS.Entropy,{})
  227.  
  228. -- Insurgency Sets --
  229. sets.WS.Insurgency = {}
  230. sets.WS.Insurgency.MidACC = set_combine(sets.WS.Insurgency,{})
  231. sets.WS.Insurgency.HighACC = set_combine(sets.WS.Insurgency.MidACC,{})
  232.  
  233. -- JA Sets --
  234. sets.JA = {}
  235. sets.JA["Blood Weapon"] = {body="Fall. Cuirass +1"}
  236. sets.JA["Diabolic Eye"] = {hands="Fall. Fin. Gaunt. +1"}
  237. sets.JA["Nether Void"] = {legs="Heath. Flanchard +1"}
  238. sets.JA["Arcane Circle"] = {feet="Igno. Sollerets +1"}
  239. sets.JA["Last Resort"] = {back="Ankou's Mantle"}
  240. sets.JA["Souleater"] = {head="Igno. Burgeonet +1"}
  241. -- Waltz Set --
  242. sets.Waltz = {}
  243.  
  244. sets.Precast = {}
  245. -- Fastcast Set --
  246. sets.Precast.FastCast = {
  247. head={ name="Carmine Mask", augments={'Accuracy+15','Mag. Acc.+10','"Fast Cast"+3',}},
  248. body={ name="Odyss. Chestplate", augments={'"Fast Cast"+5','Attack+15',}},
  249. hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
  250. legs={ name="Eschite Cuisses", augments={'"Mag.Atk.Bns."+25','"Conserve MP"+6','"Fast Cast"+5',}},
  251. feet={ name="Carmine Greaves", augments={'HP+60','MP+60','Phys. dmg. taken -3',}},
  252. neck="Orunmila's Torque",
  253. waist="Flume Belt",
  254. right_ear="Etiolation Earring",
  255. left_ear="Loquac. Earring",
  256. left_ring="Kishar Ring",
  257. right_ring="Moonbeam Ring",
  258. back="Moonbeam Cape",
  259. }
  260.  
  261. -- Precast Dark Magic --
  262. sets.Precast['Dark Magic'] = set_combine(sets.Precast.FastCast,{head="Fall. Burgeonet +1"})
  263.  
  264. -- Midcast Base Set --
  265. sets.Midcast = {}
  266.  
  267. -- Magic Haste Set --
  268. sets.Midcast.Haste = set_combine(sets.PDT,{})
  269.  
  270. -- Dark Magic Set --
  271. sets.Midcast['Dark Magic'] = {
  272. ammo="Pemphredo Tathlum",
  273. head="Igno. Burgeonet +1",
  274. body={ name="Carm. Scale Mail", augments={'MP+60','INT+10','MND+10',}},
  275. legs={ name="Eschite Cuisses", augments={'"Mag.Atk.Bns."+25','"Conserve MP"+6','"Fast Cast"+5',}},
  276. feet="Flam. Gambieras +2",
  277. neck="Erra Pendant",
  278. left_ear="Digni. Earring",
  279. right_ear="Etiolation Earring",
  280. left_ring="Kishar Ring",
  281. right_ring="Evanescence Ring",
  282. back="Moonbeam Cape",}
  283.  
  284. sets.Midcast.Drain = {
  285. ammo="Pemphredo Tathlum",
  286. head="Flam. Zucchetto +2",
  287. body="Carm. Scale Mail",
  288. hands="Fall. Fin. Gaunt. +1",
  289. legs={ name="Eschite Cuisses", augments={'"Mag.Atk.Bns."+25','"Conserve MP"+6','"Fast Cast"+5',}},
  290. feet="Flam. Gambieras +2",
  291. neck="Erra Pendant",
  292. waist="Oneiros Belt",
  293. left_ear="Digni. Earring",
  294. right_ear="Hirudinea Earring",
  295. right_ring="Moonbeam Ring",
  296. left_ring="Evanescence Ring",
  297. back={ name="Niht Mantle", augments={'Attack+6','Dark magic skill +7','"Drain" and "Aspir" potency +25',}},
  298. }
  299. sets.Midcast.Absorb = set_combine(sets.Midcast['Dark Magic'],{
  300. ammo="Pemphredo Tathlum",
  301. head="Igno. Burgeonet +1",
  302. body={ name="Carm. Scale Mail", augments={'MP+60','INT+10','MND+10',}},
  303. legs={ name="Eschite Cuisses", augments={'"Mag.Atk.Bns."+25','"Conserve MP"+6','"Fast Cast"+5',}},
  304. feet="Flam. Gambieras +2",
  305. neck="Erra Pendant",
  306. hands="Fall. Fin. Gaunt. +1",
  307. left_ear="Digni. Earring",
  308. right_ear="Etiolation Earring",
  309. left_ring="Kishar Ring",
  310. right_ring="Evanescence Ring",
  311. back="Ankou's Mantle",
  312. })
  313. -- Stun Sets --
  314. sets.Midcast.Stun = set_combine(sets.Midcast['Dark Magic'],{
  315. ammo="Pemphredo Tathlum",
  316. head="Carmine Mask",
  317. body="Carm. Scale Mail",
  318. legs={ name="Eschite Cuisses", augments={'"Mag.Atk.Bns."+25','"Conserve MP"+6','"Fast Cast"+5',}},
  319. feet="Flam. Gambieras +2",
  320. neck="Erra Pendant",
  321. hands="Leyline Gloves",
  322. right_ear="Etiolation Earring",
  323. left_ear="Dignitary's Earring",
  324. left_ring="Kishar Ring",
  325. right_ring="Sangoma Ring",
  326. back="Moonbeam Cape",
  327. })
  328. sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  329. sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  330.  
  331. -- Endark Set --
  332. sets.Midcast.Endark = set_combine(sets.Midcast['Dark Magic'],{
  333. head="Igno. Burgeonet +1",
  334. body={ name="Carm. Scale Mail", augments={'MP+60','INT+10','MND+10',}},
  335. hands={ name="Fall. Fin. Gaunt. +1", augments={'Enhances "Diabolic Eye" effect',}},
  336. legs={ name="Eschite Cuisses", augments={'"Mag.Atk.Bns."+25','"Conserve MP"+6','"Fast Cast"+5',}},
  337. neck="Incanter's Torque",
  338. left_ring="Evanescence Ring",
  339. right_ring="Moonbeam Ring",
  340. back="Moonbeam Cape",
  341. })
  342.  
  343. -- Enfeebling Magic Set --
  344. sets.Midcast['Enfeebling Magic'] = {
  345. ammo="Pemphredo Tathlum",
  346. head="Flam. Zucchetto +2",
  347. body={ name="Found. Breastplate", augments={'Accuracy+15','Mag. Acc.+15','Attack+15','"Mag.Atk.Bns."+15',}},
  348. hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15', '"Fast Cast"+3',}},
  349. feet="Flam. Gambieras +2",
  350. neck="Incanter's Torque",
  351. left_ear="Digni. Earring",
  352. right_ear="Ethereal Earring",
  353. left_ring="Kishar Ring",
  354. right_ring="Moonbeam Ring",
  355. back="Moonbeam Cape",
  356. }
  357.  
  358. -- Elemental Magic Set --
  359. sets.Midcast['Elemental Magic'] = {}
  360.  
  361. -- Dread Spikes Set --
  362. sets.Midcast['Dread Spikes'] = {
  363. ammo="Egoist's Tathlum",
  364. head="Flam. Zucchetto +2",
  365. body={ name="Yorium Cuirass", augments={'"Mag.Atk.Bns."+10','"Fast Cast"+3','Phalanx +2',}},
  366. hands={ name="Fall. Fin. Gaunt. +1", augments={'Enhances "Diabolic Eye" effect',}},
  367. legs={ name="Carmine Cuisses +1", augments={'Accuracy+20','Attack+12','"Dual Wield"+6',}},
  368. feet={ name="Amm Greaves", augments={'HP+50','VIT+10','Accuracy+15','Damage taken-2%',}},
  369. neck="Sanctity Necklace",
  370. waist="Oneiros Belt",
  371. left_ear="Eabani Earring",
  372. right_ear="Etiolation Earring",
  373. left_ring="Eihwaz Ring",
  374. right_ring="Moonbeam Ring",
  375. back="Moonbeam Cape",
  376. }
  377. end
  378.  
  379. function pretarget(spell,action)
  380. if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  381. cancel_spell()
  382. send_command('input /item "Echo Drops" <me>')
  383. elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
  384. cancel_spell()
  385. send_command('Aggressor')
  386. elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
  387. cancel_spell()
  388. send_command('ThirdEye')
  389. elseif spell.english == "Meditate" and player.tp > 2900 then -- Cancel Meditate If TP Is Above 2900 --
  390. cancel_spell()
  391. add_to_chat(123, spell.name .. ' Canceled: ['..player.tp..' TP]')
  392. elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  393. cancel_spell()
  394. add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  395. return
  396. elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  397. if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  398. cancel_spell()
  399. send_command('input /ja Addendum: White <me>')
  400. elseif spell.english == "Manifestation" then
  401. cancel_spell()
  402. send_command('input /ja Accession <me>')
  403. elseif spell.english == "Alacrity" then
  404. cancel_spell()
  405. send_command('input /ja Celerity <me>')
  406. elseif spell.english == "Parsimony" then
  407. cancel_spell()
  408. send_command('input /ja Penury <me>')
  409. end
  410. elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  411. if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  412. cancel_spell()
  413. send_command('input /ja Addendum: Black <me>')
  414. elseif spell.english == "Accession" then
  415. cancel_spell()
  416. send_command('input /ja Manifestation <me>')
  417. elseif spell.english == "Celerity" then
  418. cancel_spell()
  419. send_command('input /ja Alacrity <me>')
  420. elseif spell.english == "Penury" then
  421. cancel_spell()
  422. send_command('input /ja Parsimony <me>')
  423. end
  424. end
  425. end
  426.  
  427. function precast(spell,action)
  428. if spell.type == "WeaponSkill" then
  429. if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  430. cancel_spell()
  431. add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  432. return
  433. else
  434. equipSet = sets.WS
  435. if equipSet[spell.english] then
  436. equipSet = equipSet[spell.english]
  437. end
  438. if Attack == 'ON' then
  439. equipSet = equipSet["ATT"]
  440. end
  441. if equipSet[AccArray[AccIndex]] then
  442. equipSet = equipSet[AccArray[AccIndex]]
  443. end
  444. if elements[spell.name] and elements[spell.name]:contains(world.day_element) then
  445. equipSet = set_combine(equipSet,elements.equip)
  446. end
  447. if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
  448. equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
  449. end
  450. if (spell.english == "Entropy" or spell.english == "Resolution" or spell.english == "Insurgency") and (player.tp > 2990 or buffactive.Sekkanoki) then
  451. if world.time <= (7*60) or world.time >= (17*60) then -- 3000 TP or Sekkanoki: Equip Lugra Earring +1 From Dusk To Dawn --
  452. equipSet = set_combine(equipSet,{ear1="Lugra Earring +1"})
  453. else
  454. equipSet = set_combine(equipSet,{ear1="Bale Earring"}) -- 3000 TP or Sekkanoki: Equip Kokou's Earring --
  455. end
  456. end
  457. equip(equipSet)
  458. end
  459. elseif spell.type == "JobAbility" then
  460. if sets.JA[spell.english] then
  461. equip(sets.JA[spell.english])
  462. end
  463. elseif spell.action_type == 'Magic' then
  464. if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  465. cancel_spell()
  466. add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  467. return
  468. else
  469.  
  470. if spell.english == 'Utsusemi: Ni' then
  471. if buffactive['Copy Image (3)'] then
  472. cancel_spell()
  473. add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  474. return
  475. else
  476. equip(sets.Precast.FastCast)
  477. end
  478. elseif sets.Precast[spell.skill] then
  479. equip(sets.Precast[spell.skill])
  480. else
  481. equip(sets.Precast.FastCast)
  482. end
  483. end
  484. elseif spell.type == "Waltz" then
  485. refine_waltz(spell,action)
  486. equip(sets.Waltz)
  487. elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  488. cast_delay(0.2)
  489. send_command('cancel Sneak')
  490. end
  491. if Twilight == 'Twilight' then
  492. equip(sets.Twilight)
  493. end
  494. end
  495.  
  496. function midcast(spell,action)
  497. equipSet = {}
  498. if spell.action_type == 'Magic' then
  499. equipSet = sets.Midcast
  500. if spell.english:startswith('Absorb') then
  501. if buffactive["Dark Seal"] then -- Equip Aug'd Fall. Burgeonet +1 When You Have Dark Seal Up --
  502. equipSet = equipSet.Absorb
  503. end
  504. elseif spell.english:startswith('Drain') or spell.english:startswith('Aspir') or spell.english:startswith('Bio') then
  505. equipSet = equipSet.Drain
  506. if world.day == "Darksday" or world.weather_element == "Dark" then -- Equip Hachirin-no-Obi On Darksday or Dark Weather --
  507. equipSet = set_combine(equipSet,{waist="Hachirin-no-Obi"})
  508. end
  509. elseif spell.english == "Stoneskin" then
  510. if buffactive.Stoneskin then
  511. send_command('@wait 1.7;cancel stoneskin')
  512. end
  513. equipSet = equipSet.Stoneskin
  514. elseif spell.english == "Sneak" then
  515. if spell.target.name == player.name and buffactive['Sneak'] then
  516. send_command('cancel sneak')
  517. end
  518. equipSet = equipSet.Haste
  519. elseif spell.english:startswith('Utsusemi') then
  520. if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  521. send_command('@wait 1.7;cancel Copy Image*')
  522. end
  523. equipSet = equipSet.Haste
  524. elseif spell.english == 'Monomi: Ichi' then
  525. if buffactive['Sneak'] then
  526. send_command('@wait 1.7;cancel sneak')
  527. end
  528. equipSet = equipSet.Haste
  529. else
  530. if equipSet[spell.english] then
  531. equipSet = equipSet[spell.english]
  532. end
  533. if equipSet[AccArray[AccIndex]] then
  534. equipSet = equipSet[AccArray[AccIndex]]
  535. end
  536. if equipSet[spell.skill] then
  537. equipSet = equipSet[spell.skill]
  538. end
  539. if equipSet[spell.type] then
  540. equipSet = equipSet[spell.type]
  541. end
  542. end
  543. elseif equipSet[spell.english] then
  544. equipSet = equipSet[spell.english]
  545. end
  546. equip(equipSet)
  547. end
  548.  
  549. function aftercast(spell,action)
  550. if not spell.interrupted then
  551. if spell.type == "WeaponSkill" then
  552. send_command('wait 0.2;gs c TP')
  553. elseif spell.english == "Arcane Circle" then -- Arcane Circle Countdown --
  554. send_command('wait 260;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..': [OFF]')
  555. elseif spell.english == "Sleep II" then -- Sleep II Countdown --
  556. 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.]')
  557. elseif spell.english == "Sleep" then -- Sleep Countdown --
  558. 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.]')
  559. end
  560. end
  561. status_change(player.status)
  562. end
  563.  
  564. function status_change(new,old)
  565. check_equip_lock()
  566. if Armor == 'PDT' then
  567. equip(sets.PDT)
  568. elseif Armor == 'MDT' then
  569. equip(sets.MDT)
  570. elseif new == 'Engaged' then
  571. equipSet = sets.TP
  572. if Armor == 'Hybrid' and equipSet["Hybrid"] then
  573. equipSet = equipSet["Hybrid"]
  574. end
  575. if equipSet[WeaponArray[WeaponIndex]] then
  576. equipSet = equipSet[WeaponArray[WeaponIndex]]
  577. end
  578. if equipSet[player.sub_job] then
  579. equipSet = equipSet[player.sub_job]
  580. end
  581. if equipSet[AccArray[AccIndex]] then
  582. equipSet = equipSet[AccArray[AccIndex]]
  583. end
  584. if buffactive["Aftermath: Lv.3"] and equipSet["AM3"] then
  585. if Rancor == 'ON' then -- Default Rancor Toggle Is Rancorous Mantle --
  586. equipSet = set_combine(equipSet["AM3"],sets.TP.Rancor)
  587. else -- Use Rancor Toggle For Atheling Mantle --
  588. equipSet = equipSet["AM3"]
  589. end
  590. end
  591. if buffactive.Aftermath and equipSet["AM"] then
  592. equipSet = equipSet["AM"]
  593. end
  594. if buffactive["Last Resort"] and ((buffactive.Haste and buffactive.March == 2) or (buffactive.Embrava and (buffactive.March == 2 or (buffactive.March and buffactive.Haste))) or (buffactive[580] and (buffactive.March or buffactive.Haste or buffactive.Embrava))) and equipSet["HighHaste"] then
  595. equipSet = equipSet["HighHaste"]
  596. end
  597. if buffactive.Ionis and equipSet["Ionis"] then
  598. equipSet = equipSet["Ionis"]
  599. end
  600. if buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
  601. equipSet = equipSet["STP"]
  602. end
  603. equip(equipSet)
  604. else
  605. equipSet = sets.Idle
  606. if equipSet[IdleArray[IdleIndex]] then
  607. equipSet = equipSet[IdleArray[IdleIndex]]
  608. end
  609. if equipSet[WeaponArray[WeaponIndex]] then
  610. equipSet = equipSet[WeaponArray[WeaponIndex]]
  611. end
  612. if equipSet[player.sub_job] then
  613. equipSet = equipSet[player.sub_job]
  614. end
  615. if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
  616. equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
  617. end
  618. if world.area:endswith('Adoulin') then
  619. equipSet = set_combine(equipSet,{body="Councilor's Garb"})
  620. end
  621. equip(equipSet)
  622. end
  623. if Twilight == 'Twilight' then
  624. equip(sets.Twilight)
  625. end
  626. end
  627.  
  628. function buff_change(buff,gain)
  629. buff = string.lower(buff)
  630. if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  631. if gain then
  632. 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.]')
  633. else
  634. send_command('timers delete "Aftermath: Lv.3"')
  635. add_to_chat(123,'AM3: [OFF]')
  636. end
  637. elseif buff == 'weakness' then -- Weakness Timer --
  638. if gain then
  639. send_command('timers create "Weakness" 300 up')
  640. else
  641. send_command('timers delete "Weakness"')
  642. end
  643. end
  644. if buff == "sleep" and gain and player.hp > 200 and player.status == "Engaged" then -- Equip Berserker's Torque When You Are Asleep & Have 200+ HP --
  645. equip({neck="Berserker's Torque"})
  646. else
  647. if not midaction() then
  648. status_change(player.status)
  649. end
  650. end
  651. end
  652.  
  653. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  654. function self_command(command)
  655. if command == 'C1' then -- Accuracy Level Toggle --
  656. AccIndex = (AccIndex % #AccArray) + 1
  657. status_change(player.status)
  658. add_to_chat(158,'Accuracy Level: '..AccArray[AccIndex])
  659. elseif command == 'C17' then -- Main Weapon Toggle --
  660. WeaponIndex = (WeaponIndex % #WeaponArray) + 1
  661. add_to_chat(158,'Main Weapon: '..WeaponArray[WeaponIndex])
  662. status_change(player.status)
  663. elseif command == 'C5' then -- Auto Update Gear Toggle --
  664. status_change(player.status)
  665. add_to_chat(158,'Auto Update Gear')
  666. elseif command == 'C2' then -- Hybrid Toggle --
  667. if Armor == 'Hybrid' then
  668. Armor = 'None'
  669. add_to_chat(123,'Hybrid Set: [Unlocked]')
  670. else
  671. Armor = 'Hybrid'
  672. add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
  673. end
  674. status_change(player.status)
  675. elseif command == 'C7' then -- PDT Toggle --
  676. if Armor == 'PDT' then
  677. Armor = 'None'
  678. add_to_chat(123,'PDT Set: [Unlocked]')
  679. else
  680. Armor = 'PDT'
  681. add_to_chat(158,'PDT Set: [Locked]')
  682. end
  683. status_change(player.status)
  684. elseif command == 'C15' then -- MDT Toggle --
  685. if Armor == 'MDT' then
  686. Armor = 'None'
  687. add_to_chat(123,'MDT Set: [Unlocked]')
  688. else
  689. Armor = 'MDT'
  690. add_to_chat(158,'MDT Set: [Locked]')
  691. end
  692. status_change(player.status)
  693. elseif command == 'C16' then -- Rancor Toggle --
  694. if Rancor == 'ON' then
  695. Rancor = 'OFF'
  696. add_to_chat(123,'Rancor: [OFF]')
  697. else
  698. Rancor = 'ON'
  699. add_to_chat(158,'Rancor: [ON]')
  700. end
  701. status_change(player.status)
  702. elseif command == 'C9' then -- Attack Toggle --
  703. if Attack == 'ON' then
  704. Attack = 'OFF'
  705. add_to_chat(123,'Attack: [OFF]')
  706. else
  707. Attack = 'ON'
  708. add_to_chat(158,'Attack: [ON]')
  709. end
  710. status_change(player.status)
  711. elseif command == 'C3' then -- Twilight Toggle --
  712. if Twilight == 'Twilight' then
  713. Twilight = 'None'
  714. add_to_chat(123,'Twilight Set: [Unlocked]')
  715. else
  716. Twilight = 'Twilight'
  717. add_to_chat(158,'Twilight Set: [locked]')
  718. end
  719. status_change(player.status)
  720. elseif command == 'C8' then -- Distance Toggle --
  721. if player.target.distance then
  722. target_distance = math.floor(player.target.distance*10)/10
  723. add_to_chat(158,'Distance: '..target_distance)
  724. else
  725. add_to_chat(123,'No Target Selected')
  726. end
  727. elseif command == 'C6' then -- Idle Toggle --
  728. IdleIndex = (IdleIndex % #IdleArray) + 1
  729. status_change(player.status)
  730. add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  731. elseif command == 'TP' then
  732. add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
  733. elseif command:match('^SC%d$') then
  734. send_command('//' .. sc_map[command])
  735. end
  736. end
  737.  
  738. function check_equip_lock() -- Lock Equipment Here --
  739. 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
  740. disable('ring1','ring2')
  741. elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
  742. disable('back')
  743. else
  744. enable('ring1','ring2','back')
  745. end
  746. end
  747.  
  748. function refine_waltz(spell,action)
  749. if spell.type ~= 'Waltz' then
  750. return
  751. end
  752.  
  753. if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" then
  754. return
  755. end
  756.  
  757. local newWaltz = spell.english
  758. local waltzID
  759.  
  760. local missingHP
  761.  
  762. if spell.target.type == "SELF" then
  763. missingHP = player.max_hp - player.hp
  764. elseif spell.target.isallymember then
  765. local target = find_player_in_alliance(spell.target.name)
  766. local est_max_hp = target.hp / (target.hpp/100)
  767. missingHP = math.floor(est_max_hp - target.hp)
  768. end
  769.  
  770. if missingHP ~= nil then
  771. if player.sub_job == 'DNC' then
  772. if missingHP < 40 and spell.target.name == player.name then
  773. add_to_chat(123,'Full HP!')
  774. cancel_spell()
  775. return
  776. elseif missingHP < 150 then
  777. newWaltz = 'Curing Waltz'
  778. waltzID = 190
  779. elseif missingHP < 300 then
  780. newWaltz = 'Curing Waltz II'
  781. waltzID = 191
  782. else
  783. newWaltz = 'Curing Waltz III'
  784. waltzID = 192
  785. end
  786. else
  787. return
  788. end
  789. end
  790.  
  791. local waltzTPCost = {['Curing Waltz'] = 20, ['Curing Waltz II'] = 35, ['Curing Waltz III'] = 50}
  792. local tpCost = waltzTPCost[newWaltz]
  793.  
  794. local downgrade
  795.  
  796. if player.tp < tpCost then
  797.  
  798. if player.tp < 20 then
  799. add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
  800. cancel_spell()
  801. return
  802. elseif player.tp < 35 then
  803. newWaltz = 'Curing Waltz'
  804. elseif player.tp < 50 then
  805. newWaltz = 'Curing Waltz II'
  806. end
  807.  
  808. downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
  809. end
  810.  
  811. if newWaltz ~= spell.english then
  812. send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
  813. if downgrade then
  814. add_to_chat(8, downgrade)
  815. end
  816. cancel_spell()
  817. return
  818. end
  819.  
  820. if missingHP > 0 then
  821. add_to_chat(8,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
  822. end
  823. end
  824.  
  825. function find_player_in_alliance(name)
  826. for i,v in ipairs(alliance) do
  827. for k,p in ipairs(v) do
  828. if p.name == name then
  829. return p
  830. end
  831. end
  832. end
  833. end
  834.  
  835. function sub_job_change(newSubjob, oldSubjob)
  836. select_default_macro_book()
  837. end
  838.  
  839. function set_macro_page(set,book)
  840. if not tonumber(set) then
  841. add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  842. return
  843. end
  844. if set < 1 or set > 10 then
  845. add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  846. return
  847. end
  848.  
  849. if book then
  850. if not tonumber(book) then
  851. add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  852. return
  853. end
  854. if book < 1 or book > 20 then
  855. add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  856. return
  857. end
  858. send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  859. else
  860. send_command('@input /macro set '..tostring(set))
  861. end
  862. end
  863.  
  864. function select_default_macro_book()
  865. -- Default macro set/book
  866. if player.sub_job == 'WAR' then
  867. set_macro_page(2, 6)
  868. elseif player.sub_job == 'SAM' then
  869. set_macro_page(2, 6)
  870. elseif player.sub_job == 'NIN' then
  871. set_macro_page(2, 6)
  872. elseif player.sub_job == 'DNC' then
  873. set_macro_page(2, 6)
  874. elseif player.sub_job == 'SCH' then
  875. set_macro_page(2, 6)
  876. else
  877. set_macro_page(2, 6)
  878. end
  879. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement