Advertisement
Guest User

RDM

a guest
Aug 24th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.15 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. function get_sets()
  6. AccIndex = 1
  7. 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 --
  8. IdleIndex = 1
  9. IdleArray = {"Refresh","Regen","Movement"} -- Default Idle Set Is Movement --
  10. Armor = 'None'
  11. StunIndex = 0
  12. Obi = 'OFF' -- Turn Default Obi ON or OFF Here --
  13. target_distance = 5 -- Set Default Distance Here --
  14. select_default_macro_book() -- Change Default Macro Book At The End --
  15.  
  16. Non_Obi_Spells = S{
  17. 'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  18. 'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  19.  
  20. Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  21. Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  22. 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. --
  23.  
  24. -- Idle Sets --
  25. sets.Idle = {}
  26. sets.Idle.Refresh = {
  27. main="Bolelabunga",
  28. sub="Genbu's Shield",
  29. ammo="Mana Ampulla",
  30. head="Viti. Chapeau +1",
  31. neck="Wiglen Gorget",
  32. ear1="Loquac. Earring",
  33. ear2="Moonshade Earring",
  34. body="Gende. Bilaut +1",
  35. hands="Serpentes Cuffs",
  36. ring1="Sheltered Ring",
  37. ring2="Defending Ring",
  38. back="Umbra Cape",
  39. waist="Fucho-no-Obi",
  40. legs="Nares Trews",
  41. feet="Serpentes Sabots"}
  42. sets.Idle.Regen = {
  43. main="Bolelabunga",
  44. sub="Genbu's Shield",
  45. ammo="Mana Ampulla",
  46. head="Viti. Chapeau +1",
  47. neck="Wiglen Gorget",
  48. ear1="Loquac. Earring",
  49. ear2="Moonshade Earring",
  50. body="Gende. Bilaut +1",
  51. hands="Serpentes Cuffs",
  52. ring1="Sheltered Ring",
  53. ring2="Paguroidea Ring",
  54. back="Kumbira Cape",
  55. waist="Slipor Sash",
  56. legs="Nares Trews",
  57. feet="Serpentes Sabots"}
  58. sets.Idle.Movement = set_combine(sets.Idle.Refresh,{})
  59. sets.Resting = set_combine(sets.Idle.Movement,{
  60. main="Bolelabunga",
  61. sub="Genbu's Shield",
  62. ammo="Mana Ampulla",
  63. head="Viti. Chapeau +1",
  64. neck="Wiglen Gorget",
  65. ear1="Loquac. Earring",
  66. ear2="Moonshade Earring",
  67. body="Gende. Bilaut +1",
  68. hands="Serpentes Cuffs",
  69. ring1="Sheltered Ring",
  70. ring2="Defending Ring",
  71. back="Umbra Cape",
  72. waist="Fucho-no-Obi",
  73. legs="Nares Trews",
  74. feet="Serpentes Sabots"})
  75.  
  76. -- PDT Set --
  77. sets.PDT = {
  78. main="Bolelabunga",
  79. sub="Genbu's Shield",
  80. head="Gende. Caubeen +1",
  81. neck="Wiglen Torque",
  82. body="Gende. Bilaut +1",
  83. hands="Vivi. Gloves +1",
  84. ring1="Sheltered Ring",
  85. ring2="Defending Ring",
  86. back="Umbra Cape",
  87. waist="Fucho-no-obi",
  88. legs="Vivi. Tights +1",
  89. feet="Gende. Galosh. +1"}
  90.  
  91. sets.Sublimation = {
  92. main="Bolelabunga",
  93. sub="Genbu's Shield",
  94. ammo="Mana Ampulla",
  95. head="Viti. Chapeau +1",
  96. neck="Wiglen Gorget",
  97. ear1="Loquac. Earring",
  98. ear2="Moonshade Earring",
  99. body="Gende. Bilaut +1",
  100. hands="Serpentes Cuffs",
  101. ring1="Sheltered Ring",
  102. ring2="Defending Ring",
  103. back="Umbra Cape",
  104. waist="Fucho-no-Obi",
  105. legs="Nares Trews",
  106. feet="Serpentes Sabots"}
  107.  
  108. sets.Precast = {}
  109.  
  110. -- Fastcast Set --
  111. sets.Precast.FastCast = {
  112. head="Atrophy Chapeau +1",
  113. neck="Orunmila's Torque",
  114. hands="Gendewitha Gages +1",
  115. ear1="Loquac. Earring",
  116. back="Swith Cape +1",
  117. body="Viti. Tabard +1",
  118. ring2="Veneficium Ring",
  119. waist="Witful Belt",
  120. legs="Artsieq Hose",
  121. feet="Chelona Boots +1"}
  122.  
  123. -- Elemental Staves --
  124. sets.Precast.Thunder = {main='Apamajas I'}
  125. sets.Precast.Water = {main='Haoma I'}
  126. sets.Precast.Fire = {main='Atar I'}
  127. sets.Precast.Ice = {main='Vourukasha I'}
  128. sets.Precast.Wind = {main='Vayuvata I'}
  129. sets.Precast.Earth = {main='Vishrava I'}
  130. sets.Precast.Light = {main='Arka I'}
  131. sets.Precast.Dark = {main='Xsaeta I'}
  132.  
  133. -- Precast Enhancing Magic --
  134. sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{
  135. head="Umuthi Hat",
  136. waist="Siegel Sash"})
  137.  
  138. -- Precast Cure Set --
  139. sets.Precast.Cure = {
  140. head="Atrophy Chapeau +1",
  141. neck="Orunmila's Torque",
  142. hands="Gendewitha Gages +1",
  143. ear1="Loquac. Earring",
  144. ear2="Estq. Earring",
  145. back="Swith Cape +1",
  146. body="Viti. Tabard +1",
  147. ring2="Veneficium Ring",
  148. waist="Witful Belt",
  149. legs="Artsieq Hose",
  150. feet="Chelona Boots +1"}
  151.  
  152. -- Midcast Base Set --
  153. sets.Midcast = {
  154. main="Seveneyes",
  155. sub="Genbu's Shield",
  156. ammo="Incantor Stone",
  157. head="Gendewitha Caubeen +1",
  158. neck="Orunmila's Torque",
  159. ear1="Loquac. Earring",
  160. ear2="Magnetic Earring",
  161. back="Swith Cape +1",
  162. body="Hedera Cotehardie",
  163. hands="Vivi. Gloves +1",
  164. ring2="Veneficium Ring",
  165. waist="Witful Belt",
  166. legs="Artsieq Hose",
  167. feet="Umbani Boots"}
  168.  
  169. -- Haste Set --
  170. sets.Midcast.Haste = {
  171. main="Seveneyes",
  172. sub="Genbu's Shield",
  173. ammo="Incantor Stone",
  174. head="Gendewitha Caubeen +1",
  175. neck="Orunmila's Torque",
  176. ear1="Loquac. Earring",
  177. ear2="Magnetic Earring",
  178. back="Swith Cape +1",
  179. body="Vanir Cotehardie",
  180. hands="Vivi. Gloves +1",
  181. ring2="Veneficium Ring",
  182. waist="Witful Belt",
  183. legs="Artsieq Hose",
  184. feet="Umbani Boots"}
  185.  
  186. -- Cure Set --
  187. sets.Midcast.Cure = {
  188. main="Tamaxchi",
  189. sub="Genbu's Shield",
  190. ammo="Oreiad's Tathlum",
  191. head="Gende. Caubeen +1",
  192. neck="Colossus's Torque",
  193. ear2="Beatific Earring",
  194. ear1="Novia Earring",
  195. body="Heka's Kalasiris",
  196. hands="Hagondes Cuffs +1",
  197. ring1="Haoma's Ring",
  198. ring2="Haoma's Ring",
  199. back="Ghostfyre Cape",
  200. waist="Pythia Sash +1",
  201. legs="Artsieq Hose",
  202. feet="Rubeus Boots"}
  203.  
  204.  
  205. -- Curaga Set --
  206. sets.Midcast.Curaga = {
  207. main="Tamaxchi",
  208. sub="Genbu's Shield",
  209. ammo="Leisure Musk",
  210. head="Gende. Caubeen +1",
  211. neck="Colossus's Torque",
  212. ear2="Beatific Earring",
  213. ear1="Novia Earring",
  214. body="Heka's Kalasiris",
  215. hands="Hagondes Cuffs +1",
  216. ring1="Haoma's Ring",
  217. ring2="Kuchekula Ring",
  218. back="Ghostfyre Cape",
  219. waist="Pythia Sash +1",
  220. legs="Artsieq Hose",
  221. feet="Rubeus Boots"}
  222. -- Enhancing Magic --
  223. sets.Midcast['Enhancing Magic'] = {
  224. main="Seveneyes",
  225. sub="Genbu's Shield",
  226. head="Umuthi Hat",
  227. neck="Colossus's Torque",
  228. ear1="Andoaa Earring",
  229. ear2="Augment. Earring",
  230. body="Anhur Robe",
  231. hands="Viti. Gloves +1",
  232. back="Estoqueur's Cape",
  233. waist="Olympus Sash",
  234. legs="Shedir Seraweels",
  235. feet="Estq. Houseaux +2"}
  236.  
  237. -- Stoneskin --
  238. sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{waist="Siegel Sash",legs="Shedir Seraweels"})
  239.  
  240. -- Refresh --
  241. sets.Midcast.Refresh = set_combine(sets.Midcast.Haste,{feet ="Estq. Houseaux +2",back="Estoqueur's Cape",legs="Estqr. Fuseau +2"})
  242.  
  243. -- Cursna --
  244. sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{
  245. main="Seveneyes",
  246. sub="Genbu's Shield",
  247. ammo="Leisure Musk",
  248. head="Gendewitha Caubeen +1",
  249. neck="Debilis Medallion",
  250. ear1="Beatific Earring",
  251. ear2="Magnetic Earring",
  252. body="Hedera Cotehardie",
  253. hands="Hieros Mittens",
  254. ring1="Haoma's Ring",
  255. ring2="Haoma's Ring",
  256. back="Swith Cape +1",
  257. waist="Bishop's Sash",
  258. legs="Artsieq Hose",
  259. feet="Gende. Galosh. +1"})
  260.  
  261. -- Stun Sets --
  262. sets.Midcast.Stun = {
  263. main="Ngqoqwanb",
  264. sub="Mephitis Grip",
  265. ammo="Oreiad's Tathlum",
  266. head="Atrophy Chapeau +1",
  267. neck="Orunmila's Torque",
  268. ear1="Lifestorm Earring",
  269. ear2="Psystorm Earring",
  270. back="Swith Cape +1",
  271. body="Vanir Cotehardie",
  272. hands="Lurid Mitts",
  273. ring1="Perception Ring",
  274. ring2="Sangoma Ring",
  275. waist="Witful Belt",
  276. legs="Artsieq Hose",
  277. feet="Bokwus Boots"}
  278. sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  279. sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  280.  
  281. -- Dark Magic Sets --
  282. sets.Midcast['Dark Magic'] = {
  283. main="Ngqoqwanb",
  284. ammo="Oreiad's Tathlum",
  285. sub="Mephitis Grip",
  286. head="Atrophy Chapeau +1",
  287. neck="Orunmila's Torque",
  288. ear1="Lifestorm Earring",
  289. ear2="Psystorm Earring",
  290. back="Swith Cape +1",
  291. body="Vanir Cotehardie",
  292. hands="Lurid Mitts",
  293. ring2="Veneficium Ring",
  294. waist="Witful Belt",
  295. legs="Artsieq Hose",
  296. feet="Bokwus Boots"}
  297. sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
  298. sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
  299.  
  300. -- Elemental Sets --
  301. sets.Midcast['Elemental Magic'] = {
  302. main="Ngqoqwanb",
  303. sub="Wizzan Grip",
  304. ammo="Oreiad's Tathlum",
  305. neck="Stoicheion Medal",
  306. head="Hagondes Hat +1",
  307. ear1="Strophadic Earring",
  308. ear2="Hecate's Earring",
  309. back="Toro Cape",
  310. body="Vanir Cotehardie",
  311. hands="Otomi Gloves",
  312. ring1="Strendu Ring",
  313. ring2="Acumen Ring",
  314. waist="Sekhmet Corset",
  315. legs="Hagondes Pants +1",
  316. feet="Vitivation Boots +1"}
  317. sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{})
  318. sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{})
  319.  
  320. -- Enfeebling Sets --
  321. sets.Midcast['Enfeebling Magic'] = {
  322. main="Ngqoqwanb",
  323. sub="Mephitis Grip",
  324. ammo="Oreiad's Tathlum",
  325. head="Viti. Chapeau +1",
  326. neck="Enfeebling Torque",
  327. ear1="Lifestorm Earring",
  328. ear2="Psystorm Earring",
  329. back="Astute Cape",
  330. body="Atrophy Tabard +1",
  331. hands="Lurid Mitts",
  332. ring1="Perception Ring",
  333. ring2="Sangoma Ring",
  334. waist="Casso Sash",
  335. legs="Artsieq Hose",
  336. feet="Rubeus Boots"}
  337. sets.Midcast['Enfeebling Magic'].MidACC = set_combine(sets.Midcast['Enfeebling Magic'],{})
  338. sets.Midcast['Enfeebling Magic'].HighACC = set_combine(sets.Midcast['Enfeebling Magic'].MidACC,{})
  339.  
  340. -- Impact --
  341. sets.Midcast.Impact = {
  342. main="Ngqoqwanb",
  343. sub="Wizzan Grip",
  344. ammo="Oreiad's Tathlum",
  345. neck="Stoicheion Medal",
  346. ear1="Strophadic Earring",
  347. ear2="Hecate's Earring",
  348. back="Toro Cape",
  349. body="Twilight Cloak",
  350. hands="Otomi Gloves",
  351. ring1="Strendu Ring",
  352. ring2="Acumen Ring",
  353. waist="Sekhmet Corset",
  354. legs="Hagondes Pants +1",
  355. feet="Vitivation Boots +1"}
  356.  
  357. -- Elemental Obi/Twilight Cape --
  358. sets.Obi = {}
  359. sets.Obi.Thunder = {back="Twilight Cape",waist='Rairin Obi'}
  360. sets.Obi.Water = {back="Twilight Cape",waist='Suirin Obi'}
  361. sets.Obi.Fire = {back="Twilight Cape",waist='Karin Obi'}
  362. sets.Obi.Ice = {back="Twilight Cape",waist='Hyorin Obi'}
  363. sets.Obi.Wind = {back="Twilight Cape",waist='Furin Obi'}
  364. sets.Obi.Earth = {back="Twilight Cape",waist='Dorin Obi'}
  365. sets.Obi.Light = {back="Twilight Cape",waist='Korin Obi'}
  366. sets.Obi.Dark = {back="Twilight Cape",waist='Anrin Obi'}
  367.  
  368. -- JA Sets --
  369. sets.JA = {}
  370. sets.JA.Composure = {
  371. head="Estq. Chappel +2",
  372. body="Estq. Sayon +2",
  373. hands="Estq. Ganthrt. +2",
  374. legs="Estqr. Fuseau +2",
  375. feet="Estq. Houseaux +2"}
  376. sets.JA.Chainspell = {body="Viti. Tabard +1"}
  377. sets.JA.Saboteur = {hands="Estq. Ganthrt. +2"}
  378.  
  379. -- Melee Set --
  380. sets.Melee = set_combine(sets.Midcast.Haste,{})
  381.  
  382. -- WS Base Set --
  383. sets.WS = {}
  384. sets.WS["Chant du Cygne"] = {}
  385. sets.WS.Requiescat = {}
  386. sets.WS["Knights of Round"] = {}
  387. sets.WS.Exenterator = {}
  388. sets.WS.Evisceration = {}
  389. end
  390.  
  391. function pretarget(spell,action)
  392. if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  393. cancel_spell()
  394. send_command('input /item "Echo Drops" <me>')
  395. elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  396. degrade_spell(spell,Cure_Spells)
  397. elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  398. degrade_spell(spell,Curaga_Spells)
  399. elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  400. if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  401. cancel_spell()
  402. send_command('input /ja Addendum: White <me>')
  403. elseif spell.english == "Manifestation" then
  404. cancel_spell()
  405. send_command('input /ja Accession <me>')
  406. elseif spell.english == "Alacrity" then
  407. cancel_spell()
  408. send_command('input /ja Celerity <me>')
  409. elseif spell.english == "Parsimony" then
  410. cancel_spell()
  411. send_command('input /ja Penury <me>')
  412. end
  413. elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  414. if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  415. cancel_spell()
  416. send_command('input /ja Addendum: Black <me>')
  417. elseif spell.english == "Accession" then
  418. cancel_spell()
  419. send_command('input /ja Manifestation <me>')
  420. elseif spell.english == "Celerity" then
  421. cancel_spell()
  422. send_command('input /ja Alacrity <me>')
  423. elseif spell.english == "Penury" then
  424. cancel_spell()
  425. send_command('input /ja Parsimony <me>')
  426. end
  427. end
  428. end
  429.  
  430. function precast(spell,action)
  431. if spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  432. if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  433. cancel_spell()
  434. add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  435. return
  436. else
  437. if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  438. equip(sets.Precast.Cure)
  439. elseif spell.english == "Stun" then
  440. if buffactive.Composure then -- Cancel Composure When You Cast Stun --
  441. cast_delay(0.2)
  442. send_command('cancel Composure')
  443. end
  444. equip(sets.Precast.FastCast)
  445. elseif spell.english == "Impact" then
  446. equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  447. elseif string.find(spell.english,'Utsusemi') then
  448. if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  449. cancel_spell()
  450. add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
  451. return
  452. else
  453. equip(sets.Precast.FastCast)
  454. end
  455. elseif sets.Precast[spell.skill] then
  456. equip(sets.Precast[spell.skill])
  457. else
  458. equip(sets.Precast.FastCast)
  459. end
  460. end
  461. elseif spell.type == "WeaponSkill" then
  462. if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  463. cancel_spell()
  464. add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  465. return
  466. else
  467. if sets.WS[spell.english] then
  468. equip(sets.WS[spell.english])
  469. end
  470. end
  471. elseif spell.type == "JobAbility" then
  472. if sets.JA[spell.english] then
  473. equip(sets.JA[spell.english])
  474. end
  475. elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  476. cast_delay(0.2)
  477. send_command('cancel Sneak')
  478. end
  479. if sets.Precast[spell.element] then
  480. equip(sets.Precast[spell.element])
  481. end
  482. if StunIndex == 1 then
  483. equip(sets.Midcast.Stun)
  484. end
  485. end
  486.  
  487. function midcast(spell,action)
  488. equipSet = {}
  489. if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
  490. equipSet = sets.Midcast
  491. if string.find(spell.english,'Cure') then
  492. equipSet = equipSet.Cure
  493. elseif string.find(spell.english,'Cura') then
  494. equipSet = equipSet.Curaga
  495. elseif string.find(spell.english,'Refresh') then
  496. equipSet = equipSet.Refresh
  497. elseif spell.english == "Stoneskin" then
  498. if buffactive.Stoneskin then
  499. send_command('@wait 2.8;cancel stoneskin')
  500. end
  501. equipSet = equipSet.Stoneskin
  502. elseif spell.english == "Sneak" then
  503. if spell.target.name == player.name and buffactive['Sneak'] then
  504. send_command('cancel sneak')
  505. end
  506. equipSet = equipSet.Haste
  507. elseif spell.english == "Phalanx II" then -- Viti. Gloves +1 For Phalanx II --
  508. equipSet = set_combine(equipSet,{hands="Viti. Gloves +1"})
  509. elseif spell.english == "Dia III" or spell.english == "Slow II" then -- Viti. Chapeau +1 For Dia III or Slow II --
  510. equipSet = set_combine(equipSet['Enfeebling Magic'],{head="Viti. Chapeau +1"})
  511. elseif spell.english == "Paralyze II" then -- Vitivation Boots +1 For Paralyze II --
  512. equipSet = set_combine(equipSet,{feet="Vitivation Boots +1"})
  513. elseif spell.english == "Blind II" or spell.english == "Bio III" then -- Viti. Tights +1 For Blind II or Bio III --
  514. equipSet = set_combine(equipSet,{legs="Viti. Tights +1"})
  515. elseif string.find(spell.english,'Utsusemi') then
  516. if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  517. send_command('@wait 1.7; cancel Copy Image*')
  518. end
  519. equipSet = equipSet.Haste
  520. elseif spell.english == 'Monomi: Ichi' then
  521. if buffactive['Sneak'] then
  522. send_command('@wait 1.7;cancel sneak')
  523. end
  524. equipSet = equipSet.Haste
  525. else
  526. if equipSet[spell.english] then
  527. equipSet = equipSet[spell.english]
  528. end
  529. if equipSet[spell.skill] then
  530. equipSet = equipSet[spell.skill]
  531. end
  532. if equipSet[AccArray[AccIndex]] then
  533. equipSet = equipSet[AccArray[AccIndex]]
  534. end
  535. if equipSet[spell.type] then
  536. equipSet = equipSet[spell.type]
  537. end
  538. 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 --
  539. equipSet = set_combine(equipSet,sets.Obi[spell.element])
  540. end
  541. end
  542. elseif equipSet[spell.english] then
  543. equipSet = equipSet[spell.english]
  544. end
  545. equip(equipSet)
  546. if StunIndex == 1 then
  547. equip(sets.Midcast.Stun)
  548. end
  549. end
  550.  
  551. function aftercast(spell,action)
  552. if not spell.interrupted then
  553. if spell.english == "Sleep II" then -- Sleep II Countdown --
  554. 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.]')
  555. elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  556. 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.]')
  557. elseif spell.english == "Banish II" then -- Banish II Countdown --
  558. send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  559. end
  560. end
  561. status_change(player.status)
  562. end
  563.  
  564. function status_change(new,old)
  565. if Armor == 'PDT' then
  566. equip(sets.PDT)
  567. elseif buffactive["Sublimation: Activated"] then
  568. equip(sets.Sublimation)
  569. elseif new == 'Engaged' then
  570. equip(sets.Melee)
  571. elseif new == 'Idle' then
  572. equip(sets.Idle[IdleArray[IdleIndex]])
  573. elseif new == 'Resting' then
  574. equip(sets.Resting)
  575. end
  576. if StunIndex == 1 then
  577. equip(sets.Midcast.Stun)
  578. end
  579. end
  580.  
  581. function buff_change(buff,gain)
  582. buff = string.lower(buff)
  583. if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  584. if gain then
  585. 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.]')
  586. else
  587. send_command('timers delete "Aftermath: Lv.3"')
  588. add_to_chat(123,'AM3: [OFF]')
  589. end
  590. elseif buff == 'weakness' then -- Weakness Timer --
  591. if gain then
  592. send_command('timers create "Weakness" 300 up')
  593. else
  594. send_command('timers delete "Weakness"')
  595. end
  596. end
  597. if not midaction() then
  598. status_change(player.status)
  599. end
  600. end
  601.  
  602. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  603. function self_command(command)
  604. if command == 'C1' then -- Magic Accuracy Toggle --
  605. AccIndex = (AccIndex % #AccArray) + 1
  606. add_to_chat(158,'Magic Accuracy Level: ' .. AccArray[AccIndex])
  607. status_change(player.status)
  608. elseif command == 'C5' then -- Auto Update Gear Toggle --
  609. status_change(player.status)
  610. add_to_chat(158,'Auto Update Gear')
  611. elseif command == 'C2' then -- Stun Toggle --
  612. if StunIndex == 1 then
  613. StunIndex = 0
  614. add_to_chat(123,'Stun Set: [Unlocked]')
  615. else
  616. StunIndex = 1
  617. add_to_chat(158,'Stun Set: [Locked]')
  618. end
  619. status_change(player.status)
  620. elseif command == 'C3' then -- Obi Toggle --
  621. if Obi == 'ON' then
  622. Obi = 'OFF'
  623. add_to_chat(123,'Obi: [OFF]')
  624. else
  625. Obi = 'ON'
  626. add_to_chat(158,'Obi: [ON]')
  627. end
  628. status_change(player.status)
  629. elseif command == 'C7' then -- PDT Toggle --
  630. if Armor == 'PDT' then
  631. Armor = 'None'
  632. add_to_chat(123,'PDT Set: [Unlocked]')
  633. else
  634. Armor = 'PDT'
  635. add_to_chat(158,'PDT Set: [Locked]')
  636. end
  637. status_change(player.status)
  638. elseif command == 'C8' then -- Distance Toggle --
  639. if player.target.distance then
  640. target_distance = math.floor(player.target.distance*10)/10
  641. add_to_chat(158,'Distance: '..target_distance)
  642. else
  643. add_to_chat(123,'No Target Selected')
  644. end
  645. elseif command == 'C6' then -- Idle Toggle --
  646. IdleIndex = (IdleIndex % #IdleArray) + 1
  647. add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  648. status_change(player.status)
  649. elseif command:match('^SC%d$') then
  650. send_command('//' .. sc_map[command])
  651. end
  652. end
  653.  
  654. function actualCost(originalCost)
  655. if buffactive["Penury"] then
  656. return originalCost*.5
  657. elseif buffactive["Light Arts"] then
  658. return originalCost*.9
  659. else
  660. return originalCost
  661. end
  662. end
  663.  
  664. function degrade_spell(spell,degrade_array)
  665. spell_index = table.find(degrade_array,spell.name)
  666. if spell_index > 1 then
  667. new_spell = degrade_array[spell_index - 1]
  668. change_spell(new_spell,spell.target.raw)
  669. add_to_chat(8,spell.name..' Canceled: [Current MP = ' .. player.mp .. ' | ' .. player.mpp .. '%] Using '..new_spell..' instead.')
  670. end
  671. end
  672.  
  673. function change_spell(spell_name,target)
  674. cancel_spell()
  675. send_command('//'..spell_name..' '..target)
  676. end
  677.  
  678. function sub_job_change(newSubjob, oldSubjob)
  679. select_default_macro_book()
  680. end
  681.  
  682. function set_macro_page(set,book)
  683. if not tonumber(set) then
  684. add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  685. return
  686. end
  687. if set < 1 or set > 10 then
  688. add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  689. return
  690. end
  691.  
  692. if book then
  693. if not tonumber(book) then
  694. add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  695. return
  696. end
  697. if book < 1 or book > 20 then
  698. add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  699. return
  700. end
  701. send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  702. else
  703. send_command('@input /macro set '..tostring(set))
  704. end
  705. end
  706.  
  707. function select_default_macro_book()
  708. -- Default macro set/book
  709. if player.sub_job == 'WHM' then
  710. set_macro_page(1, 3)
  711. elseif player.sub_job == 'BLM' then
  712. set_macro_page(1, 3)
  713. elseif player.sub_job == 'SCH' then
  714. set_macro_page(1, 3)
  715. elseif player.sub_job == 'DNC' then
  716. set_macro_page(1, 3)
  717. elseif player.sub_job == 'WAR' then
  718. set_macro_page(1, 3)
  719. elseif player.sub_job == 'NIN' then
  720. set_macro_page(1, 3)
  721. else
  722. set_macro_page(1, 3)
  723. end
  724. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement