Advertisement
Guest User

bard.lua

a guest
Nov 22nd, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.60 KB | None | 0 0
  1. function get_sets()
  2. IdleIndex = 1
  3. IdleArray = {"PDT"}
  4. timer_reg = {}
  5. pianissimo_cycle = false
  6. Daurdabla = 'OFF'
  7. Dummy = 'OFF'
  8. ElementalStaff = 'OFF'
  9. Main = 'OFF'
  10. target_distance = 5
  11.  
  12. Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"}
  13. Curaga_Spells = {"Curaga","Curaga II"}
  14.  
  15. sets.Idle = {}
  16. sets.Idle.PDT = {
  17. main="Carnwenhan",
  18. sub="Genbu's shield",
  19. range="Gjallarhorn",
  20. head="Bihu roundlet +1",
  21. neck="Piper's torque",
  22. ear1="Aoidos' Earring",
  23. ear2="Loquacious Earring",
  24. body="Bihu Jstcorps +1",
  25. hands="Bihu cuffs +1",
  26. ring1="Prolix Ring",
  27. ring2="Defending Ring",
  28. back="Rhapsode's cape",
  29. waist="Ovate rope",
  30. legs="Bihu Cannions +1",
  31. feet="Aoidos' Cothrn. +2"}
  32. sets.Resting = set_combine(sets.Idle.PDT,{})
  33.  
  34. sets.Precast = {}
  35. sets.Precast.SongCast = {
  36. main="Felibre's Dague",
  37. sub="Genbu's Shield",
  38. head="Aoidos' Calot +2",
  39. neck="Piper's torque",
  40. ear1="Aoidos' Earring",
  41. ear2="Loquac. Earring",
  42. body="Marduk's Jubbah +1",
  43. hands="Mdk. Dastanas +1",
  44. ring1="Prolix Ring",
  45. ring2="Defending Ring",
  46. back="Swith Cape +1",
  47. waist="Wiftul Belt",
  48. legs="Gendewitha Spats",
  49. feet="Bihu Slippers +1"}
  50.  
  51. sets.Precast.Daurdabla = {range="Daurdabla"}
  52.  
  53. sets.Precast.Dummy = {
  54. main="Felibre's Dague",
  55. sub="Genbu's Shield",
  56. range="Daurdabla",
  57. ammo=empty,
  58. head="Nahtirah hat",
  59. neck="Piper's torque",
  60. ear1="Aoidos' Earring",
  61. ear2="Loquacious Earring",
  62. body="Marduk's Jubbah +1",
  63. hands="Mdk. Dastanas +1",
  64. ring1="Prolix Ring",
  65. ring2="Defending Ring",
  66. back="Swith Cape +1",
  67. waist="Witful Belt",
  68. legs="Gendewitha Spats",
  69. feet="Chelona boots +1"}
  70.  
  71. sets.Precast.Hymnus = {
  72. main="Felibre's Dague",
  73. sub="Genbu's Shield",
  74. range="Daurdabla",
  75. ammo=empty,
  76. head="Nahtirah hat",
  77. neck="Piper's torque",
  78. ear1="Aoidos' Earring",
  79. ear2="Loquacious Earring",
  80. body="Marduk's Jubbah +1",
  81. hands="Mdk. Dastanas +1",
  82. ring1="Prolix Ring",
  83. ring2="Defending Ring",
  84. back="Swith Cape +1",
  85. waist="Witful Belt",
  86. legs="Gendewitha Spats",
  87. feet="Chelona boots +1"}
  88. -- Fake Song Precast sets; this should be pure fastcast--
  89. sets.Precast.Minne = {
  90. main="Felibre's Dague",
  91. sub="Genbu's Shield",
  92. range="Daurdabla",
  93. ammo=empty,
  94. head="Aoidos' Calot +2",
  95. neck="Piper's torque",
  96. ear1="Aoidos' Earring",
  97. ear2="Loquacious Earring",
  98. body="Marduk's Jubbah +1",
  99. hands="Mdk. Dastanas +1",
  100. ring1="Prolix Ring",
  101. ring2="Defending Ring",
  102. back="Swith Cape +1",
  103. waist="Witful Belt",
  104. legs="Gendewitha Spats",
  105. feet="Bihu Slippers +1"}
  106.  
  107. sets.Precast.Paeon = {
  108. main="Felibre's Dague",
  109. sub="Genbu's Shield",
  110. range="Daurdabla",
  111. ammo=empty,
  112. head="Aoidos' Calot +2",
  113. neck="Piper's torque",
  114. ear1="Aoidos' Earring",
  115. ear2="Loquacious Earring",
  116. body="Marduk's Jubbah +1",
  117. hands="Mdk. Dastanas +1",
  118. ring1="Prolix Ring",
  119. ring2="Defending Ring",
  120. back="Swith Cape +1",
  121. waist="Witful Belt",
  122. legs="Gendewitha Spats",
  123. feet="Bihu Slippers +1"}
  124.  
  125. sets.Precast.FastCast = {
  126. head="Nahtirah Hat",
  127. ear2="Loquac. Earring",
  128. body="Marduk's Jubbah +1",
  129. hands="Mdk. Dastanas +1",
  130. ring1="Prolix Ring",
  131. ring2="Defending Ring",
  132. back="Swith Cape +1",
  133. waist="Witful Belt",
  134. legs="Artsieq Hose",
  135. feet="Chelona Boots +1"}
  136.  
  137.  
  138. sets.Midcast = {
  139. head="Nahtirah Hat",
  140. neck="Piper's torque",
  141. ear1="Aoidos' Earring",
  142. ear2="Loquacious Earring",
  143. body="Marduk's Jubbah +1",
  144. hands="Mdk. Dastanas +1",
  145. ring1="Prolix Ring",
  146. ring2="Defending Ring",
  147. back="Swith Cape +1",
  148. waist="Witful Belt",
  149. legs="Gendewitha Spats",
  150. feet="Bihu Slippers +1"}
  151.  
  152. sets.Midcast.Daurdabla = {range="Daurdabla"}
  153.  
  154. sets.Midcast.Dummy = {
  155. range="Daurdabla",
  156. ammo=empty,
  157. head="Nahtirah Hat",
  158. neck="Aoidos' Matinee",
  159. ear1="Aoidos' Earring",
  160. ear2="Loquacious Earring",
  161. body="Marduk's Jubbah +1",
  162. hands="Mdk. Dastanas +1",
  163. ring1="Prolix Ring",
  164. ring2="Defending Ring",
  165. back="Swith Cape +1",
  166. waist="Witful Belt",
  167. legs="Gendewitha Spats",
  168. feet="Bihu Slippers +1"}
  169.  
  170. sets.Midcast.Wind = {
  171. main="Venabulum",
  172. sub='Mephitis grip',
  173. range="Gjallarhorn",
  174. head="bihu roundlet +1",
  175. neck="Piper's Torque",
  176. ear1="Gwati Earring",
  177. ear2="Enchanter's Earring",
  178. body="Brioso Just. +1",
  179. hands="Bihu cuffs +1",
  180. ring1="Sangoma Ring",
  181. ring2="Perception Ring",
  182. back="Rhapsode's cape",
  183. waist="Ovate Rope",
  184. legs="bihu cannions +1",
  185. feet="Artsieq boots"}
  186.  
  187. sets.Midcast.WindBuff = {
  188. main="Carnwenhan",
  189. sub="Genbu's Shield",
  190. range="Gjallarhorn",
  191. head="Aoidos' Calot +2",
  192. neck="Piper's Torque",
  193. ear1="Aoidos' Earring",
  194. ear2="Loquacious Earring",
  195. body="Aoidos' Hngrln. +2",
  196. hands="Ad. Mnchtte. +2",
  197. ring1="Prolix Ring",
  198. ring2="Defending Ring",
  199. back="Swith Cape +1",
  200. waist="Witful Belt",
  201. legs="Aoidos' Rhing. +2",
  202. feet="Brioso Slippers +1"}
  203.  
  204. sets.Midcast.Finale = {neck="Piper's Torque",waist="Witful Belt",legs="Aoidos' Rhing. +2"}
  205. sets.Midcast.Lullaby = {hands="Brioso Cuffs +1"}
  206.  
  207. sets.Midcast.Ballad = {legs="Aoidos' Rhing. +2"}
  208. sets.Midcast.Etude = {legs="Marduk's Shalwar +1"}
  209. sets.Midcast.Hymnus = {
  210. main="Felibre's Dague",
  211. sub="Genbu's Shield",
  212. range="Daurdabla",
  213. ammo=empty,
  214. head="Nahtirah hat",
  215. neck="Piper's torque",
  216. ear1="Aoidos' Earring",
  217. ear2="Loquacious Earring",
  218. body="Marduk's Jubbah +1",
  219. hands="Mdk. Dastanas +1",
  220. ring1="Prolix Ring",
  221. ring2="Defending Ring",
  222. back="Swith Cape +1",
  223. waist="Witful Belt",
  224. legs="Gendewitha Spats",
  225. feet="Chelona boots +1"}
  226. sets.Midcast.Madrigal = {head="Aoidos' Calot +2"}
  227. sets.Midcast.March = {hands="Ad. Mnchtte. +2"}
  228. sets.Midcast.Mazurka = {head="Nahtirah Hat"}
  229. sets.Midcast.Minuet = {body="Aoidos' Hngrln. +2"}
  230. sets.Midcast.Prelude = {legs="Marduk's Shalwar +1"}
  231. sets.Midcast.Scherzo = {feet="Aoidos' Cothrn. +2"}
  232. -- Fake Song Midcast sets; this should be pure fastcast--
  233. sets.Midcast.Minne = {
  234. main="Felibre's Dague",
  235. sub="Genbu's Shield",
  236. range="Daurdabla",
  237. ammo=empty,
  238. head="Nahtirah hat",
  239. neck="Piper's torque",
  240. ear1="Aoidos' Earring",
  241. ear2="Loquacious Earring",
  242. body="Marduk's Jubbah +1",
  243. hands="Mdk. Dastanas +1",
  244. ring1="Prolix Ring",
  245. ring2="Defending Ring",
  246. back="Swith Cape +1",
  247. waist="Witful Belt",
  248. legs="Gendewitha Spats",
  249. feet="Chelona boots +1"}
  250. sets.Midcast.Paeon = {
  251. main="Felibre's Dague",
  252. sub="Genbu's Shield",
  253. range="Daurdabla",
  254. ammo=empty,
  255. head="Nahtirah hat",
  256. neck="Piper's torque",
  257. ear1="Aoidos' Earring",
  258. ear2="Loquacious Earring",
  259. body="Marduk's Jubbah +1",
  260. hands="Mdk. Dastanas +1",
  261. ring1="Prolix Ring",
  262. ring2="Defending Ring",
  263. back="Swith Cape +1",
  264. waist="Witful Belt",
  265. legs="Gendewitha Spats",
  266. feet="Chelona boots +1"}
  267.  
  268.  
  269. sets.JA = {}
  270. sets.JA.Nightingale = {feet="Bihu Slippers +1"}
  271. sets.JA.Troubadour = {body="Bihu Jstcorps +1"}
  272. sets.JA["Soul Voice"] = {legs="Bihu Cannions +1"}
  273. end
  274.  
  275. function pretarget(spell,action)
  276. if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  277. cancel_spell()
  278. send_command('input /item "Echo Drops" <me>')
  279. elseif spell.type == "BardSong" and spell.target.name == player.name and buffactive.Pianissimo then -- Change Target From <me> To <t> When Pianissimo Is Active --
  280. change_target('<t>')
  281. elseif spell.type == 'BardSong' and spell.target.type and spell.target.type == 'PLAYER' and not buffactive.Pianissimo and not spell.target.charmed and not pianissimo_cycle then -- Auto Pianoissimo When You Cast A Song On A Player --
  282. cancel_spell()
  283. pianissimo_cycle = true
  284. send_command('input /ja "Pianissimo" <me>;pause 1.5;input /ma "'..spell.name..'" '..spell.target.name..';')
  285. return
  286. elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  287. degrade_spell(spell,Cure_Spells)
  288. elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  289. degrade_spell(spell,Curaga_Spells)
  290. end
  291. if spell.name ~= 'Pianissimo' then
  292. pianissimo_cycle = false
  293. end
  294. end
  295.  
  296. function precast(spell,action)
  297. if spell.action_type == 'Magic' then
  298. if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu or BardSong If You Are Silenced or Out of Range --
  299. cancel_spell()
  300. add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  301. return
  302. else
  303. if spell.type == 'BardSong' then
  304. if buffactive.Nightingale then
  305. equip_song_gear(spell)
  306. return
  307. else
  308. equip(sets.Precast.SongCast)
  309. if string.find(spell.english,'Minne') then equip(sets.Precast.Minne) end
  310. if string.find(spell.english,'Paeon') then equip(sets.Precast.Paeon) end
  311. if string.find(spell.english,'Hymnus') then equip(sets.Precast.Hymnus) end
  312. end
  313. elseif string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  314. equip(sets.Precast.Cure)
  315. elseif string.find(spell.english,'Utsusemi') then
  316. if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  317. cancel_spell()
  318. add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
  319. return
  320. else
  321. equip(sets.Precast.FastCast)
  322. end
  323. else
  324. equip(sets.Precast.FastCast)
  325. end
  326. end
  327. elseif spell.type == "WeaponSkill" then
  328. if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  329. cancel_spell()
  330. add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  331. return
  332. else
  333. equipSet = sets.WS
  334. if equipSet[spell.english] then
  335. equipSet = equipSet[spell.english]
  336. end
  337. if equipSet[AccArray[AccIndex]] then
  338. equipSet = equipSet[AccArray[AccIndex]]
  339. end
  340. equip(equipSet)
  341. end
  342. elseif spell.type == "JobAbility" then
  343. if sets.JA[spell.english] then
  344. equip(sets.JA[spell.english])
  345. end
  346. elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  347. cast_delay(0.2)
  348. send_command('cancel Sneak')
  349. end
  350. if sets.Precast[spell.element] and not buffactive.Nightingale and ElementalStaff == 'ON' and spell.type == 'BardSong' then
  351. equip(sets.Precast[spell.element])
  352. end
  353. if Daurdabla == 'ON' and spell.type == 'BardSong' then
  354. equip(sets.Precast.Daurdabla)
  355. end
  356. if Main == 'ON' then
  357. equip(sets.MainWeapon)
  358. end
  359. end
  360.  
  361. function midcast(spell,action)
  362. equipSet = {}
  363. if spell.type == 'Magic' and not spell.type == 'BardSong' then
  364. equipSet = sets.Midcast
  365. if equipSet[spell.english] then
  366. equipSet = equipSet[spell.english]
  367. elseif string.find(spell.english,'Cure') then
  368. equipSet = equipSet.Midcast.Cure
  369. equip(equipSet)
  370. elseif string.find(spell.english,'Cura') then
  371. equipSet = equipSet.Midcast.Curaga
  372. equip(equipSet)
  373. elseif spell.english == "Stoneskin" then
  374. if buffactive.Stoneskin then
  375. send_command('@pause 2.8;cancel stoneskin')
  376. end
  377. equipSet = equipSet.Midcast.Stoneskin
  378. equip(equipSet)
  379. elseif spell.english == "Sneak" then
  380. if spell.target.name == player.name and buffactive['Sneak'] then
  381. send_command('cancel sneak')
  382. end
  383. equipSet = equipSet.Midcast.Haste
  384. elseif string.find(spell.english,'Utsusemi') then
  385. if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  386. send_command('@pause 1.7;cancel Copy Image*')
  387. end
  388. equipSet = equipSet.Midcast.Haste
  389. elseif spell.english == 'Monomi: Ichi' then
  390. if buffactive['Sneak'] then
  391. send_command('@pause 1.7;cancel sneak')
  392. end
  393. equipSet = equipSet.Midcast.Haste
  394. end
  395. elseif spell.type == 'BardSong' then
  396. equip_song_gear(spell)
  397. if string.find(spell.english,'Minne') then equip(sets.Midcast.Minne) end
  398. if string.find(spell.english,'Paeon') then equip(sets.Midcast.Paeon) end
  399. if string.find(spell.english,'Hymnus') then equip(sets.Midcast.Hymnus) end
  400. end
  401. if Daurdabla == 'ON' and spell.type == 'BardSong' then
  402. equip(sets.Midcast.Daurdabla)
  403. Daurdabla = 'OFF'
  404. end
  405. if Main == 'ON' then
  406. equip(sets.MainWeapon)
  407. end
  408. equip(equipSet)
  409. end
  410.  
  411. function aftercast(spell,action)
  412. if spell.type and spell.type == 'BardSong' and spell.target and spell.target.name == player.name and not spell.interrupted then
  413. local t = os.time()
  414.  
  415. local tempreg = {}
  416. for i,v in pairs(timer_reg) do
  417. if v < t then tempreg[i] = true end
  418. end
  419. for i,v in pairs(tempreg) do
  420. timer_reg[i] = nil
  421. end
  422.  
  423. local dur = calculate_duration(spell.name)
  424. if timer_reg[spell.name] then
  425. if (timer_reg[spell.name] - t) <= 120 then
  426. send_command('timers delete "'..spell.name..'"')
  427. timer_reg[spell.name] = t + dur
  428. send_command('timers create "'..spell.name..'" '..dur..' down')
  429. end
  430. else
  431. local maxsongs = 2
  432. if player.equipment.range == 'Daurdabla' then
  433. maxsongs = maxsongs+2
  434. end
  435. if buffactive['Clarion Call'] then
  436. maxsongs = maxsongs+1
  437. end
  438. if maxsongs < table.length(timer_reg) then
  439. maxsongs = table.length(timer_reg)
  440. end
  441.  
  442. if table.length(timer_reg) < maxsongs then
  443. timer_reg[spell.name] = t+dur
  444. send_command('timers create "'..spell.name..'" '..dur..' down')
  445. else
  446. local rep,repsong
  447. for i,v in pairs(timer_reg) do
  448. if t+dur > v then
  449. if not rep or rep > v then
  450. rep = v
  451. repsong = i
  452. end
  453. end
  454. end
  455. if repsong then
  456. timer_reg[repsong] = nil
  457. send_command('timers delete "'..repsong..'"')
  458. timer_reg[spell.name] = t+dur
  459. send_command('timers create "'..spell.name..'" '..dur..' down')
  460. end
  461. end
  462. end
  463. end
  464. status_change(player.status)
  465. end
  466.  
  467. function status_change(new,old)
  468. if new == 'Engaged' then
  469. equipSet = sets.Melee
  470. if equipSet[AccArray[AccIndex]] then
  471. equipSet = equipSet[AccArray[AccIndex]]
  472. end
  473. equip(equipSet)
  474. elseif new == 'Idle' then
  475. equip(sets.Idle[IdleArray[IdleIndex]])
  476. elseif new == 'Resting' then
  477. equip(sets.Resting)
  478. end
  479. if Main == 'ON' then
  480. equip(sets.MainWeapon)
  481. end
  482. end
  483.  
  484. function buff_change(buff,gain)
  485. buff = string.lower(buff)
  486. if buff == "aftermath: lv.3" then -- AM3 Timer --
  487. if gain then
  488. send_command('timers create "Aftermath: Lv.3" 180 down;pause 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];pause 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];pause 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  489. else
  490. send_command('timers delete "Aftermath: Lv.3"')
  491. add_to_chat(123,'AM3: [OFF]')
  492. end
  493. elseif buff == 'weakness' then -- Weakness Timer --
  494. if gain then
  495. send_command('timers create "Weakness" 300 up')
  496. else
  497. send_command('timers delete "Weakness"')
  498. end
  499. end
  500. if not midaction() then
  501. status_change(player.status)
  502. end
  503. end
  504.  
  505. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  506. function self_command(command)
  507. if command == 'Daurdabla' then -- Daurdabla Toggle --
  508. if Daurdabla == 'ON' then
  509. Daurdabla = 'OFF'
  510. add_to_chat(123,'Daurdabla: [OFF]')
  511. else
  512. Daurdabla = 'ON'
  513. add_to_chat(158,'Daurdabla: [ON]')
  514. end
  515. status_change(player.status)
  516. end
  517. end
  518.  
  519.  
  520. function equip_song_gear(spell)
  521. if spell.target.type == 'MONSTER' then
  522. equip(sets.Midcast.Wind)
  523. if string.find(spell.english,'Finale') then equip(sets.Midcast.Finale) end
  524. if string.find(spell.english,'Lullaby') then equip(sets.Midcast.Lullaby) end
  525. else
  526. equip(sets.Midcast.WindBuff)
  527. if string.find(spell.english,'Ballad') then equip(sets.Midcast.Ballad) end
  528. if string.find(spell.english,'Etude') then equip(sets.Midcast.Etude) end
  529. if string.find(spell.english,'Madrigal') then equip(sets.Midcast.Madrigal) end
  530. if string.find(spell.english,'March') then equip(sets.Midcast.March) end
  531. if string.find(spell.english,'Mazurka') then equip(sets.Midcast.Mazurka) end
  532. if string.find(spell.english,'Minuet') then equip(sets.Midcast.Minuet) end
  533. if string.find(spell.english,'Minne') then equip(sets.Midcast.Minne) end
  534. if string.find(spell.english,'Paeon') then equip(sets.Midcast.Paeon) end
  535. if string.find(spell.english,'Hymnus') then equip(sets.Midcast.Hymnus) end
  536. if string.find(spell.english,'Prelude') then equip(sets.Midcast.Prelude) end
  537. if string.find(spell.english,'Scherzo') then equip(sets.Midcast.Scherzo) end
  538. end
  539. end
  540.  
  541. function calculate_duration(name)
  542. local mult = 1
  543. if player.equipment.main == "Carnwenhan" then mult = mult + 0.5 end
  544. if player.equipment.main == "Legato Dagger" then mult = mult + 0.1 end
  545. if player.equipment.range == 'Daurdabla' then mult = mult + 0.3 end
  546. if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 end
  547. if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
  548. if player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  549. if player.equipment.legs == "Mdk. Shalwar +1" then mult = mult + 0.1 end
  550. if player.equipment.feet == "Brioso Slippers +1" then mult = mult + 0.11 end
  551.  
  552. if string.find(name,'Paeon') and player.equipment.head == 'Brioso Roundlet +1' then mult = mult + 0.1 end
  553. if string.find(name,'March') and player.equipment.hands == 'Ad. Mnchtte. +2' then mult = mult + 0.1 end
  554. if string.find(name,'Minuet') and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  555. if string.find(name,'Madrigal') and player.equipment.head == "Aoidos' Calot +2" then mult = mult + 0.1 end
  556. if string.find(name,'Ballad') and player.equipment.legs == "Aoidos' Rhing. +2" then mult = mult + 0.1 end
  557. if string.find(name,'Scherzo') and player.equipment.feet == "Aoidos' Cothrn. +2" then mult = mult + 0.1 end
  558.  
  559. if buffactive.Troubadour then
  560. mult = mult*2
  561. end
  562. if string.find(name,'Scherzo') then
  563. if buffactive['Soul Voice'] then
  564. mult = mult*2
  565. elseif buffactive['marcato'] then
  566. mult = mult*1.5
  567. end
  568. end
  569.  
  570. mult = mult - 0.05
  571.  
  572. local totalDuration = mult*120
  573.  
  574. return totalDuration
  575. end
  576.  
  577. function actualCost(originalCost)
  578. if buffactive["Penury"] then
  579. return originalCost*.5
  580. elseif buffactive["Light Arts"] then
  581. return originalCost*.9
  582. else
  583. return originalCost
  584. end
  585. end
  586.  
  587. function degrade_spell(spell,degrade_array)
  588. spell_index = table.find(degrade_array,spell.name)
  589. if spell_index>1 then
  590. new_spell = degrade_array[spell_index - 1]
  591. change_spell(new_spell,spell.target.raw)
  592. add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  593. end
  594. end
  595.  
  596. function change_spell(spell_name,target)
  597. cancel_spell()
  598. send_command('//'..spell_name..' '..target)
  599. end
  600.  
  601. function sub_job_change(newSubjob, oldSubjob)
  602. select_default_macro_book()
  603. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement