Advertisement
Guest User

Untitled

a guest
Sep 28th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.67 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 Magic Sets* --
  4.  
  5.  
  6.  
  7.  
  8. include('organizer-lib')
  9. function get_sets()
  10. AccIndex = 1
  11. AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For Magic. Default ACC Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  12. IdleIndex = 1
  13. IdleArray = {"Movement","Refresh"} -- Default Idle Set Is Movement --
  14. Armor = 'None'
  15. StunIndex = 0
  16. Obi = 'ON' -- Turn Default Obi 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. Non_Obi_Spells = S{
  21. 'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  22. 'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  23.  
  24. Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  25. Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  26. sc_map = {SC1 = "Stun", SC2 = "ThunderV", SC3 = "BlizzardV"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  27.  
  28. -- Idle Sets --
  29. sets.Idle = {}
  30. sets.Idle.Refresh = {
  31. main="bolelabunga",
  32. sub="Genbu's Shield",
  33. ammo="Vanir Battery",
  34. head="none",
  35. neck="Twilight torque",
  36. ear1="ethereal Earring",
  37. ear2="moonshade Earring",
  38. body="respite cloak",
  39. hands="Serpentes Cuffs",
  40. ring1="Paguroidea Ring",
  41. ring2="sheltered Ring",
  42. back="shadow Mantle",
  43. waist="slipor sash",
  44. legs="assiduity pants +1",
  45. feet="herald's gaiters"}
  46. sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  47. neck="Twilight Torque",
  48. ring1="Paguroidea ring",
  49. ring2="Sheltered ring",
  50. feet="herald's gaiters"})
  51. sets.Resting = set_combine(sets.Idle.Movement,{})
  52.  
  53. -- PDT Set --
  54. sets.PDT = {
  55. main="Tamaxchi",
  56. sub="Genbu's Shield",
  57. head="Nahtirah Hat",
  58. neck="Twilight Torque",
  59. body="Hagondes Coat",
  60. hands="Hagondes Cuffs",
  61. ring1="Patricius Ring",
  62. ring2="Dark Ring",
  63. back="Repulse Mantle",
  64. waist="Slipor Sash",
  65. legs="Bokwus Slops",
  66. feet="Hagondes Sabots"}
  67.  
  68. sets.Sublimation = {
  69. main="bolelabunga",
  70. sub="Genbu's Shield",
  71. ammo="Oreiad's Tathlum",
  72. head="Wivre Hairpin",
  73. neck="Twilight Gorget",
  74. ear1="Lifestorm Earring",
  75. ear2="Loquac. Earring",
  76. body="Hagondes Coat",
  77. hands="Serpentes Cuffs",
  78. ring1="defending Ring",
  79. ring2="Shadow Ring",
  80. back="shadow Mantle",
  81. waist="Fucho-no-obi",
  82. legs="Nares Trews",
  83. feet="Serpentes Sabots"}
  84.  
  85. sets.Precast = {}
  86.  
  87. -- Fastcast Set --
  88. sets.Precast.FastCast = {
  89. ammo="Impatiens",
  90. head="haruspex Hat +1",
  91. neck="Orunmila's Torque",
  92. ear1="Enchanter earring +1",
  93. ear2="Loquac. Earring",
  94. body="Vanir Cotehardie",
  95. hands="Helios Gloves",
  96. ring1="Prolix Ring",
  97. ring2="weatherspoon Ring",
  98. back="Swith Cape +1",
  99. waist="Witful Belt";
  100. legs="Artsieq Hose",
  101. feet="regal pumps +1"}
  102.  
  103. -- Elemental Staves --
  104. sets.Precast.Thunder = {main='Apamajas I'}
  105. sets.Precast.Water = {main='Haoma I'}
  106. sets.Precast.Fire = {main='Atar I'}
  107. sets.Precast.Ice = {main='Vourukasha I'}
  108. sets.Precast.Wind = {main='Vayuvata I'}
  109. sets.Precast.Earth = {main='Vishrava I'}
  110. sets.Precast.Light = {main='Arka I'}
  111. sets.Precast.Dark = {main='Xsaeta I'}
  112.  
  113. sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  114.  
  115. -- Precast Cure Set --
  116. sets.Precast.Cure = {
  117. main="tamaxchi",
  118. sub="Genbu's Shield",
  119. ammo="Impatiens",
  120. head="haruspex Hat +1",
  121. neck="Orunmila's Torque",
  122. ear1="Enchanter earring +1",
  123. ear2="Loquac. Earring",
  124. body="Vanir Cotehardie",
  125. hands="Helios Gloves",
  126. ring1="Prolix Ring",
  127. ring2="weatherspoon Ring",
  128. back="Swith Cape +1",
  129. waist="Witful Belt";
  130. legs="Artsieq Hose",
  131. feet="regal pumps +1"}
  132.  
  133. -- Midcast Base Set --
  134. sets.Midcast = {}
  135.  
  136. -- Haste Set --
  137. sets.Midcast.Haste = {
  138. ammo="Impatiens",
  139. head="haruspex Hat +1",
  140. neck="Orunmila's Torque",
  141. ear1="Enchanter earring +1",
  142. ear2="Loquac. Earring",
  143. body="Vanir Cotehardie",
  144. hands="Helios Gloves",
  145. ring1="Prolix Ring",
  146. ring2="weatherspoon Ring",
  147. back="Swith Cape +1",
  148. waist="Witful Belt";
  149. legs="Artsieq Hose",
  150. feet="regal pumps +1-"}
  151.  
  152. -- Cure Set --
  153. sets.Midcast.Cure = {
  154. main="Tamaxchi",
  155. sub="Genbu's Shield",
  156. ammo="Oreiad's Tathlum",
  157. head="haruspex Hat +1",
  158. neck="Colossus's Torque",
  159. ear1="beatific Earring",
  160. ear2="healing Earring",
  161. body="Heka's Kalasiris",
  162. hands="Ayao's Gages",
  163. ring1="Sirona's Ring",
  164. ring2="Haoma's Ring",
  165. back="Tempered Cape",
  166. waist="Bishop's Sash",
  167. legs="Nares Trews",
  168. feet="Rubeus Boots"}
  169.  
  170. -- Curaga Set --
  171. sets.Midcast.Curaga = {
  172. main="Tamaxchi",
  173. sub="Genbu's Shield",
  174. ammo="Oreiad's Tathlum",
  175. head="Nahtirah Hat",
  176. neck="Nuna Gorget +1",
  177. ear1="Lifestorm Earring",
  178. ear2="Loquac. Earring",
  179. body="Heka's Kalasiris",
  180. hands="Bokwus Gloves",
  181. ring1="Aquasoul Ring",
  182. ring2="Karka Ring",
  183. back="Pahtli Cape",
  184. waist="Pythia Sash +1",
  185. legs="Hagondes Pants",
  186. feet="Hagondes Sabots"}
  187.  
  188. -- Enhancing Magic Set --
  189. sets.Midcast['Enhancing Magic'] = {
  190. neck="Colossus's Torque",
  191. body="anhur robe",
  192. hands="Ayao's Gages",
  193. ring1="Prolix Ring",
  194. ring2="Veneficium Ring",
  195. waist="Olympus Sash",
  196. legs="Portent Pants",
  197. feet="Rubeus Boots"}
  198.  
  199. -- Stoneskin Set --
  200. sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{neck="Stone Gorget", Waist="Siegel sash", legs="haven hose"})
  201.  
  202. -- Cursna Set --
  203. sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{
  204. head="Nahtirah Hat",
  205. neck="Colossus's Torque",
  206. ear2="Beatific Earring",
  207. body="Hedera Cotehardie",
  208. hands="Bokwus Gloves",
  209. ring1="Haoma's Ring",
  210. ring2="Haoma's Ring",
  211. back="Altruistic Cape",
  212. waist="Witful Belt",
  213. legs="Bokwus Slops",
  214. feet="Hagondes Sabots"})
  215.  
  216. -- Stun Sets --
  217. sets.Midcast.Stun = {
  218. main="keraunos",
  219. sub="Mephitis Grip",
  220. ammo="Kalboron Stone",
  221. head="artsieq hat",
  222. neck="stoicheion medal",
  223. ear1="Lifestorm Earring",
  224. ear2="Psystorm Earring",
  225. body="artsieq jubbah",
  226. hands="artsieq cuffs",
  227. ring1="archon Ring",
  228. ring2="Sangoma Ring",
  229. back="bane cape",
  230. waist="aswang sash",
  231. legs="artsieq hose",
  232. feet="artsieq boots"}
  233. sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  234. sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  235.  
  236. -- Dark Magic Sets --
  237. sets.Midcast['Dark Magic'] = {
  238. main="keraunos",
  239. sub="benthos Grip",
  240. ammo="oreiad's tathlum",
  241. head="pixie hairpin +1",
  242. neck="Dark torque",
  243. ear1="gwati Earring",
  244. ear2="harudinea Earring",
  245. body="vanir cotehardie",
  246. hands="hagondes cuffs",
  247. ring1="weatherspoon Ring",
  248. ring2="Sangoma Ring",
  249. back="bane cape",
  250. waist="fucho-no-obi",
  251. legs="artsieq hose",
  252. feet="artsieq boots"}
  253. sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
  254. sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
  255.  
  256. -- Elemental Sets --
  257. sets.Midcast['Elemental Magic'] = {
  258. main={ name="Keraunos", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst mdg.+6%','INT+17 MND+17',}},
  259. sub="Elder's Grip +1",
  260. ammo="Dosis Tathlum",
  261. head={ name="Helios Band", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Occult Acumen"+10','INT+10',}},
  262. body={ name="Witching Robe", augments={'MP+45','Mag. Acc.+14','"Mag.Atk.Bns."+14',}},
  263. hands="Wicce gloves +1",
  264. legs="hagondes Pants +1",
  265. feet={ name="Helios Boots", augments={'"Mag.Atk.Bns."+25','"Fast Cast"+5','INT+4 MND+4',}},
  266. neck="Saevus Pendant +1",
  267. waist="Othila Sash",
  268. left_ear="Friomisi Earring",
  269. right_ear="Hecate's Earring",
  270. left_ring="Shiva Ring +1",
  271. right_ring="Shiva Ring +1",
  272. back="Toro cape",
  273. }
  274. sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{
  275. main={ name="Keraunos", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst mdg.+6%','INT+17 MND+17',}},
  276. sub="Elder's Grip +1",
  277. ammo="Dosis Tathlum",
  278. head={ name="Helios Band", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Occult Acumen"+10','INT+10',}},
  279. body={ name="Witching Robe", augments={'MP+45','Mag. Acc.+14','"Mag.Atk.Bns."+14',}},
  280. hands="Psycloth Manillas",
  281. legs={ name="Lengo Pants", augments={'INT+9','Mag. Acc.+15','"Mag.Atk.Bns."+14',}},
  282. feet="helios Boots",
  283. neck="Eddy necklace",
  284. waist="Othila Sash",
  285. left_ear="Friomisi Earring",
  286. right_ear="Hecate's Earring",
  287. left_ring="Shiva Ring +1",
  288. right_ring="Shiva Ring +1",
  289. back="Toro cape",
  290. })
  291. sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{
  292. sub="mephitis grip",
  293. head="buremte hat"})
  294.  
  295. -- Enfeebling Sets --
  296. sets.Midcast['Enfeebling Magic'] = {
  297. main="keraunos",
  298. sub="benthos Grip",
  299. ammo="Kalboron Stone",
  300. head="artsieq hat",
  301. neck="imbodla necklace",
  302. ear1="Lifestorm Earring",
  303. ear2="Psystorm Earring",
  304. body="artsieq jubbah",
  305. hands="artsieq cuffs",
  306. ring1="leviathan ring +1",
  307. ring2="leviathan ring +1",
  308. back="refraction cape",
  309. waist="cascade belt",
  310. legs="artsieq hose",
  311. feet="artsieq boots"}
  312. sets.Midcast['Enfeebling Magic'].MidACC = set_combine(sets.Midcast['Enfeebling Magic'],{})
  313. sets.Midcast['Enfeebling Magic'].HighACC = set_combine(sets.Midcast['Enfeebling Magic'].MidACC,{})
  314.  
  315. -- Impact Set --
  316. sets.Midcast.Impact = {
  317. main="keraunos",
  318. sub="elder's Grip +1",
  319. neck="Saevus Pendant +1",
  320. ear1="Lifestorm Earring",
  321. ear2="Psystorm Earring",
  322. body="Twilight Cloak",
  323. hands="Hagondes Cuffs",
  324. ring1="Maquette Ring",
  325. ring2="Sangoma Ring",
  326. back="Refraction Cape",
  327. waist="Demonry Sash",
  328. legs="Mes'yohi Slacks",
  329. feet="Nares Clogs"}
  330.  
  331. -- Meteor Set --
  332. sets.Midcast.Meteor = {}
  333.  
  334. -- Elemental Obi/Twilight Cape --
  335. sets.Obi = {waist="Hachirin-no-Obi"}
  336. sets.Obi.Lightning = {back="Twilight Cape",waist="Hachirin-no-Obi"}
  337. sets.Obi.Water = {back="Twilight Cape",waist="Hachirin-no-Obi"}
  338. sets.Obi.Fire = {back="Twilight Cape",waist="Hachirin-no-Obi"}
  339. sets.Obi.Ice = {back="Twilight Cape",waist="Hachirin-no-Obi"}
  340. sets.Obi.Wind = {back="Twilight Cape",waist="Hachirin-no-Obi"}
  341. sets.Obi.Earth = {back="Twilight Cape",waist="Hachirin-no-Obi"}
  342. sets.Obi.Light = {back="Twilight Cape",waist="Hachirin-no-Obi"}
  343. sets.Obi.Dark = {back="Twilight Cape",waist="Hachirin-no-Obi"}
  344.  
  345. -- JA Sets --
  346. sets.JA = {}
  347. sets.JA.Manafont = {body="Src. Coat +2"}
  348. sets.JA['Enmity Douse'] = {hands="Goetia Gloves +2"}
  349. sets.JA['Mana Wall'] = {feet="Goetia Sabots +2"}
  350.  
  351. -- Melee Set --
  352. sets.Melee = set_combine(sets.Midcast.Haste,{})
  353.  
  354. -- WS Base Set --
  355. sets.WS = {}
  356. sets.WS.Shattersoul = {}
  357. sets.WS.Myrkr = {
  358. main={ name="Keraunos", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst mdg.+6%','INT+17 MND+17',}},
  359. sub="Elder's Grip +1",
  360. ammo="Strobilus",
  361. head="pixie hairpin +1",
  362. body={ name="Weatherspoon Robe", augments={'MP+120',}},
  363. hands="Otomi Gloves",
  364. legs={ name="Weathersp. Pants", augments={'MP+60',}},
  365. feet="Llwyd's Clogs",
  366. neck="Dualism collar +1",
  367. waist="Shinjutsu-no-Obi",
  368. left_ear="Loquac. Earring",
  369. right_ear="Andoaa Earring",
  370. left_ring="Sangoma Ring",
  371. right_ring="Fenrir Ring +1",
  372. back={ name="Bane Cape", augments={'Elem. magic skill +8','"Mag.Atk.Bns."+4',}},
  373. }
  374. sets.WS.Vidohunir = {}
  375. sets.WS["Gate of Tartarus"] = {}
  376. end
  377.  
  378. function pretarget(spell,action)
  379. if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  380. cancel_spell()
  381. send_command('input /item "Echo Drops" <me>')
  382. elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  383. degrade_spell(spell,Cure_Spells)
  384. elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  385. degrade_spell(spell,Curaga_Spells)
  386. elseif spell.english == "Meteor" and not buffactive['Elemental Seal'] then -- Auto Elemental Seal When You Use Meteor --
  387. cancel_spell()
  388. send_command('input /ja "Elemental Seal" <me>;wait 1;input /ma "Meteor" <t>')
  389. elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  390. if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  391. cancel_spell()
  392. send_command('input /ja Addendum: White <me>')
  393. elseif spell.english == "Manifestation" then
  394. cancel_spell()
  395. send_command('input /ja Accession <me>')
  396. elseif spell.english == "Alacrity" then
  397. cancel_spell()
  398. send_command('input /ja Celerity <me>')
  399. elseif spell.english == "Parsimony" then
  400. cancel_spell()
  401. send_command('input /ja Penury <me>')
  402. end
  403. elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  404. if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  405. cancel_spell()
  406. send_command('input /ja Addendum: Black <me>')
  407. elseif spell.english == "Accession" then
  408. cancel_spell()
  409. send_command('input /ja Manifestation <me>')
  410. elseif spell.english == "Celerity" then
  411. cancel_spell()
  412. send_command('input /ja Alacrity <me>')
  413. elseif spell.english == "Penury" then
  414. cancel_spell()
  415. send_command('input /ja Parsimony <me>')
  416. end
  417. end
  418. end
  419.  
  420. function precast(spell,action)
  421. if spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  422. if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  423. cancel_spell()
  424. add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  425. return
  426. else
  427. if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  428. equip(sets.Precast.Cure)
  429. elseif spell.english == "Impact" then
  430. equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  431. elseif string.find(spell.english,'Utsusemi') then
  432. if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  433. cancel_spell()
  434. add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
  435. return
  436. else
  437. equip(sets.Precast.FastCast)
  438. end
  439. elseif sets.Precast[spell.skill] then
  440. equip(sets.Precast[spell.skill])
  441. else
  442. equip(sets.Precast.FastCast)
  443. end
  444. end
  445. elseif spell.type == "WeaponSkill" then
  446. if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  447. cancel_spell()
  448. add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  449. return
  450. else
  451. if sets.WS[spell.english] then
  452. equip(sets.WS[spell.english])
  453. end
  454. end
  455. elseif spell.type == "JobAbility" then
  456. if sets.JA[spell.english] then
  457. equip(sets.JA[spell.english])
  458. end
  459. elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  460. cast_delay(0.2)
  461. send_command('cancel Sneak')
  462. end
  463. if sets.Precast[spell.element] then
  464. equip(sets.Precast[spell.element])
  465. end
  466. if StunIndex == 1 then
  467. equip(sets.Midcast.Stun)
  468. end
  469. end
  470.  
  471. function midcast(spell,action)
  472. equipSet = {}
  473. if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' or spell.type == 'BardSong' then
  474. equipSet = sets.Midcast
  475. if string.find(spell.english,'Cure') then
  476. equipSet = equipSet.Cure
  477. elseif string.find(spell.english,'Cura') then
  478. equipSet = equipSet.Curaga
  479. elseif string.find(spell.english,'Banish') then
  480. equipSet = set_combine(equipSet.Haste,{ring1="Fenian Ring"})
  481. elseif spell.english == "Stoneskin" then
  482. if buffactive.Stoneskin then
  483. send_command('@wait 2.8;cancel stoneskin')
  484. end
  485. equipSet = equipSet.Stoneskin
  486. elseif spell.english == "Sneak" then
  487. if spell.target.name == player.name and buffactive['Sneak'] then
  488. send_command('cancel sneak')
  489. end
  490. equipSet = equipSet.Haste
  491. elseif string.find(spell.english,'Utsusemi') then
  492. if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  493. send_command('@wait 1.7;cancel Copy Image*')
  494. end
  495. equipSet = equipSet.Haste
  496. elseif spell.english == 'Monomi: Ichi' then
  497. if buffactive['Sneak'] then
  498. send_command('@wait 1.7;cancel sneak')
  499. end
  500. equipSet = equipSet.Haste
  501. else
  502. if equipSet[spell.english] then
  503. equipSet = equipSet[spell.english]
  504. end
  505. if equipSet[spell.skill] then
  506. equipSet = equipSet[spell.skill]
  507. end
  508. if equipSet[AccArray[AccIndex]] then
  509. equipSet = equipSet[AccArray[AccIndex]]
  510. end
  511. if equipSet[spell.type] then
  512. equipSet = equipSet[spell.type]
  513. end
  514. if (spell.skill == 'Elemental Magic' or string.find(spell.english,'Cur') or string.find(spell.english,'Bio') or string.find(spell.english,'Dia')) 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' then -- Use Obi Toggle To Equip Normal Waist Gear --
  515. equipSet = set_combine(equipSet,sets.Obi[spell.element])
  516. end
  517. end
  518. elseif equipSet[spell.english] then
  519. equipSet = equipSet[spell.english]
  520. end
  521. equip(equipSet)
  522. if StunIndex == 1 then
  523. equip(sets.Midcast.Stun)
  524. end
  525. end
  526.  
  527. function aftercast(spell,action)
  528. if not spell.interrupted then
  529. if spell.english == 'Mana Wall' and player.equipment.feet == "Goetia Sabots +2" then
  530. disable('feet')
  531. elseif spell.english == "Sleep II" or spell.english == "Sleepga II" then -- Sleep II & Sleepga II Countdown --
  532. 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.]')
  533. elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  534. 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.]')
  535. elseif spell.english == "Banish II" then -- Banish II Countdown --
  536. send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  537. end
  538. end
  539. status_change(player.status)
  540. end
  541.  
  542. function status_change(new,old)
  543. if Armor == 'PDT' then
  544. equip(sets.PDT)
  545. elseif buffactive["Sublimation: Activated"] then
  546. equip(sets.Sublimation)
  547. elseif new=='Engaged' then
  548. equip(sets.Melee)
  549. elseif new == 'Idle' then
  550. equip(sets.Idle[IdleArray[IdleIndex]])
  551. elseif new == 'Resting' then
  552. equip(sets.Resting)
  553. end
  554. if StunIndex == 1 then
  555. equip(sets.Midcast.Stun)
  556. end
  557. end
  558.  
  559. function buff_change(buff,gain)
  560. buff = string.lower(buff)
  561. if buff == "mana wall" and not gain then
  562. enable('feet')
  563. elseif buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  564. if gain then
  565. send_command('timers create "Aftermath: Lv.3" 180 down;wait 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  566. else
  567. send_command('timers delete "Aftermath: Lv.3"')
  568. add_to_chat(123,'AM3: [OFF]')
  569. end
  570. elseif buff == 'weakness' then -- Weakness Timer --
  571. if gain then
  572. send_command('timers create "Weakness" 300 up')
  573. else
  574. send_command('timers delete "Weakness"')
  575. end
  576. end
  577. if not midaction() then
  578. status_change(player.status)
  579. end
  580. end
  581.  
  582. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  583. function self_command(command)
  584. if command == 'C1' then -- Magic Accuracy Toggle --
  585. AccIndex = (AccIndex % #AccArray) + 1
  586. add_to_chat(158,'Magic Accuracy Level: ' .. AccArray[AccIndex])
  587. status_change(player.status)
  588. elseif command == 'C5' then -- Auto Update Gear Toggle --
  589. status_change(player.status)
  590. add_to_chat(158,'Auto Update Gear')
  591. elseif command == 'C2' then -- Stun Toggle --
  592. if StunIndex == 1 then
  593. StunIndex = 0
  594. add_to_chat(123,'Stun Set: [Unlocked]')
  595. else
  596. StunIndex = 1
  597. add_to_chat(158,'Stun Set: [Locked]')
  598. end
  599. status_change(player.status)
  600. elseif command == 'C3' then -- Obi Toggle --
  601. if Obi == 'ON' then
  602. Obi = 'OFF'
  603. add_to_chat(123,'Obi: [OFF]')
  604. else
  605. Obi = 'ON'
  606. add_to_chat(158,'Obi: [ON]')
  607. end
  608. status_change(player.status)
  609. elseif command == 'C7' then -- PDT Toggle --
  610. if Armor == 'PDT' then
  611. Armor = 'None'
  612. add_to_chat(123,'PDT Set: [Unlocked]')
  613. else
  614. Armor = 'PDT'
  615. add_to_chat(158,'PDT Set: [Locked]')
  616. end
  617. status_change(player.status)
  618. elseif command == 'C8' then -- Distance Toggle --
  619. if player.target.distance then
  620. target_distance = math.floor(player.target.distance*10)/10
  621. add_to_chat(158,'Distance: '..target_distance)
  622. else
  623. add_to_chat(123,'No Target Selected')
  624. end
  625. elseif command == 'C6' then -- Idle Toggle --
  626. IdleIndex = (IdleIndex % #IdleArray) + 1
  627. add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  628. status_change(player.status)
  629. elseif command:match('^SC%d$') then
  630. send_command('//' .. sc_map[command])
  631. end
  632. end
  633.  
  634. function actualCost(originalCost)
  635. if buffactive["Penury"] then
  636. return originalCost*.5
  637. elseif buffactive["Light Arts"] then
  638. return originalCost*.9
  639. else
  640. return originalCost
  641. end
  642. end
  643.  
  644. function degrade_spell(spell,degrade_array)
  645. spell_index = table.find(degrade_array,spell.name)
  646. if spell_index > 1 then
  647. new_spell = degrade_array[spell_index - 1]
  648. change_spell(new_spell,spell.target.raw)
  649. add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  650. end
  651. end
  652.  
  653. function change_spell(spell_name,target)
  654. cancel_spell()
  655. send_command('//'..spell_name..' '..target)
  656. end
  657.  
  658. function sub_job_change(newSubjob, oldSubjob)
  659. select_default_macro_book()
  660. end
  661.  
  662. function set_macro_page(set,book)
  663. if not tonumber(set) then
  664. add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  665. return
  666. end
  667. if set < 1 or set > 10 then
  668. add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  669. return
  670. end
  671.  
  672. if book then
  673. if not tonumber(book) then
  674. add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  675. return
  676. end
  677. if book < 1 or book > 20 then
  678. add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  679. return
  680. end
  681. send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  682. else
  683. send_command('@input /macro set '..tostring(set))
  684. end
  685. end
  686.  
  687. function select_default_macro_book()
  688. -- Default macro set/book
  689. if player.sub_job == 'WHM' then
  690. set_macro_page(1, 1)
  691. elseif player.sub_job == 'RDM' then
  692. set_macro_page(2, 1)
  693. elseif player.sub_job == 'SCH' then
  694. set_macro_page(3, 1)
  695. elseif player.sub_job == 'DNC' then
  696. set_macro_page(10, 1)
  697. elseif player.sub_job == 'NIN' then
  698. set_macro_page(5, 1)
  699. else
  700. set_macro_page(1, 1)
  701. end
  702. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement