Xremix

Brd

May 30th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.22 KB | None | 0 0
  1.  
  2.  
  3. function get_sets()
  4.     IdleIndex = 1
  5.     IdleArray = {"Movement","PDT"} -- Default Idle Set Is Movement --
  6.     timer_reg = {}
  7.     pianissimo_cycle = false
  8.     send_command('input /macro book 9;input /macro set 3') -- Change Default Macro Book Here --
  9.  
  10.     -- Daurdabla Trigger Songs --
  11.     DaurdSongs = S{"Army's Paeon","Army's Paeon II","Army's Paeon III","Army's Paeon IV","Army's Paeon VI","Shining Fantasia","Herb Pastoral","Goblin Gavotte"}
  12.  
  13.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  14.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  15.     sc_map = {SC1 = "ChocoboMazurka", SC2 = "HerbPastoral", SC3 = "GoblinGavotte"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  16.  
  17.     -- Idle Sets --
  18.     sets.Idle = {}
  19.     sets.Idle.Movement = {
  20.             main="Terra's staff",
  21.             sub="Mephitis grip",
  22.             range="Daurdabla",
  23.             head="Wivre hairpin",
  24.             neck="Wiglen gorget",
  25.             ear1="Loquac. Earring",
  26.             ear2="Aoidos' Earring",
  27.             body="Gende. Bilaut +1",
  28.             hands="Serpentes Cuffs",
  29.             ring1="Prolix Ring",
  30.             ring2="Sangoma Ring",
  31.             back="Rhapsode's cape",
  32.             waist="Fucho-no-obi",
  33.             legs="Nares Trews",
  34.             feet="Serpentes Sabots"}
  35.     sets.Idle.PDT = {
  36.             main="Terra's Staff",
  37.             head="Gende. Caubeen",
  38.             neck="Twilight Torque",
  39.             body="Gendewitha Bliaut",
  40.             hands="Gendewitha Gages",
  41.             ring1="Patricius Ring",
  42.             ring2="Dark Ring",
  43.             back="Repulse Mantle",
  44.             waist="Slipor Sash",
  45.             legs="Brioso Cann. +1",
  46.             feet="Brioso Slippers +1"}
  47.     sets.Resting = set_combine(sets.Idle,{})
  48.  
  49.     -- JA Sets --
  50.     sets.JA = {}
  51.     sets.JA["Nightingale"] = {feet="Brd. Slippers +2"}
  52.     sets.JA["Clarion Call"] = {range="Daurdabla"}
  53.     sets.JA["Soul Voice"] = {legs="Brd. Cannions +2"}
  54.  
  55.     -- Song Precast Set --
  56.     sets.Precast = {}
  57.     sets.Precast.SongCast = {
  58.             main="Felibre's Dague",
  59.             sub="Genbu's shield",
  60.             head="Aoidos' Calot +2",
  61.             neck="Aoidos' Matinee",
  62.             ear1="Loquac. Earring",
  63.             ear2="Aoidos' Earring",
  64.             body="Sha'ir Manteel",
  65.             hands="Gendewitha Gages",
  66.             ring1="Prolix Ring",
  67.             ring2="Sangoma Ring";
  68.             back="Swith Cape",
  69.             waist="Aoidos' Belt";
  70.             legs="Gendewitha spats",
  71.             feet="Bokwus boots"}
  72.  
  73.     -- Elemental Staves --
  74.     sets.Precast.Thunder = {main='Chatoyant Staff'}
  75.     sets.Precast.Water = {main='Chatoyant Staff'}
  76.     sets.Precast.Fire = {main='Chatoyant Staff'}
  77.     sets.Precast.Ice = {main='Chatoyant Staff'}
  78.     sets.Precast.Wind = {main='Chatoyant Staff'}
  79.     sets.Precast.Earth = {main='Chatoyant Staff'}
  80.     sets.Precast.Light = {main='Chatoyant Staff'}
  81.     sets.Precast.Dark = {main='Chatoyant Staff'}
  82.  
  83.     -- Precast Daurdabla Set --
  84.     sets.Precast.Daurdabla = {
  85.             range="Daurdabla",
  86.             main="Felibre's Dague",
  87.             sub="Genbu's shield",
  88.             head="Aoidos' Calot +2",
  89.             neck="Phalaina locket",
  90.             ear1="Loquac. Earring",
  91.             ear2="Aoidos' Earring",
  92.             body="Sha'ir Manteel",
  93.             hands="Gendewitha Gages",
  94.             ring1="Prolix Ring",
  95.             ring2="Sangoma Ring";
  96.             back="Swith Cape",
  97.             waist="Aoidos' Belt";
  98.             legs="Gendewitha spats",
  99.             feet="Bokwus Boots"}
  100.  
  101.     -- Fastcast Set --
  102.     sets.Precast.FastCast = {
  103.             head="Nahtirah Hat",
  104.             neck="Aoidos' Matinee",
  105.             ear1="Loquac. Earring",
  106.             body="Sha'ir Manteel",
  107.             hands="Gendewitha Gages",
  108.             ring1="Prolix Ring",
  109.             ring2="Sangoma Ring";
  110.             back="Swith Cape",
  111.             waist="Aoidos' Belt";
  112.             legs="Aoidos' Rhingrave +2",
  113.             feet="Bokwus Boots"}
  114.  
  115.     -- Cure Precast Set --
  116.     sets.Precast.Cure = {
  117.             head="Nahtirah Hat",
  118.             neck="Phalaina locket",
  119.             ear2="Loquac. Earring",
  120.             body="Heka's Kalasiris",
  121.             hands="Gendewitha Gages",
  122.             ring1="Prolix Ring",
  123.             ring2="Veneficium Ring",
  124.             back="Pahtli Cape",
  125.             waist="Witful Belt",
  126.             legs="Orvail Pants",
  127.             feet="Bokwus Boots"}
  128.  
  129.     -- Cure Set --
  130.     sets.Midcast = {
  131.             head="Gende. Caubeen",
  132.             neck="Phalaina locket",
  133.             ear2="Loquac. Earring",
  134.             body="Heka's Kalasiris",
  135.             hands="Bokwus gloves",
  136.             ring1="Prolix Ring",
  137.             ring2="Sangoma Ring",
  138.             back="Pahtli Cape",
  139.             waist="Witful Belt",
  140.             legs="Nares trews",
  141.             feet="Bokwus Boots"}
  142.  
  143.     -- Song Debuff Set --
  144.     sets.Midcast.Wind = {
  145.             main="Twebuliij",
  146.             range="Gjallarhorn",
  147.             head="Bihu roundlet +1",
  148.             neck="Wind Torque",
  149.             sub="Mephitis Grip",
  150.             ear1="Lifestorm Earring",
  151.             ear2="Psystorm Earring",
  152.             body="Brioso Just. +1",
  153.             hands="Bihu cuffs +1",
  154.             ring1="Perception Ring",
  155.             ring2="Sangoma Ring",
  156.             back="Rhapsode's Cape",
  157.             waist="Demonry Sash",
  158.             legs="Brioso Cannions +1",
  159.             feet="Bokwus Boots"}
  160.  
  161.     -- Song Buff Set --
  162.     sets.Midcast.WindBuff = {
  163.             main="Legato Dagger",
  164.             sub="Genbu's shield",
  165.             range="Gjallarhorn",
  166.             head="Aoidos' Calot +2",
  167.             neck="Aoidos' Matinee",
  168.             ear1="Loquac. Earring",
  169.             ear2="Aoidos' Earring",
  170.             body="Aoidos' Hngrln. +2",
  171.             hands="Ad. Mnchtte. +2",
  172.             ring1="Prolix Ring",
  173.             ring2="Sangoma Ring",
  174.             back="Rhapsode's Cape",
  175.             waist="Witful Belt",
  176.             legs="Aoidos' Rhingrave +2",
  177.             feet="Brioso Slippers +1"}
  178.  
  179.     sets.Midcast.Madrigal = {head="Aoidos' Calot +2"}
  180.     sets.Midcast.Minuet = {body="Aoidos' Hngrln. +2"}
  181.     sets.Midcast.March = {hands="Ad. Mnchtte. +2"}
  182.     sets.Midcast.Ballad = {legs="Aoidos' Rhing. +2"}
  183.     sets.Midcast.Scherzo = {feet="Aoidos' Cothrn. +2"}
  184.     sets.Midcast.Mazurka = {head="Nahtirah Hat"}
  185.     sets.Midcast.Paeon = {head="Brioso Roundlet +1"}
  186.     sets.Midcast.Finale = {}
  187.     sets.Midcast.Lullaby = {}
  188.  
  189.     sets.Midcast.Cure = {
  190.             head="Gende. Caubeen",
  191.             neck="Phalaina locket",
  192.             ear2="Loquac. Earring",
  193.             body="Heka's Kalasiris",
  194.             hands="Bokwus gloves",
  195.             ring1="Prolix Ring",
  196.             ring2="Sangoma Ring",
  197.             back="Pahtli Cape",
  198.             waist="Witful Belt",
  199.             legs="Nares trews",
  200.             feet="Umbani Boots"}
  201.  
  202.     -- Curaga Set --
  203.     sets.Midcast.Curaga = {
  204.             main="Tamaxchi",
  205.             sub="Genbu's Shield",
  206.             ammo="Oreiad's Tathlum",
  207.             head="Gende. Caubeen",
  208.             neck="Nuna Gorget +1",
  209.             ear1="Lifestorm Earring",
  210.             ear2="Loquac. Earring",
  211.             body="Heka's Kalasiris",
  212.             hands="Gendewitha Gages",
  213.             ring1="Aquasoul Ring",
  214.             ring2="Karka Ring",
  215.             back="Pahtli Cape",
  216.             waist="Pythia Sash +1",
  217.             legs="Gendewitha Spats",
  218.             feet="Umbani Boots"}
  219.  
  220.     -- Haste Set --
  221.     sets.Midcast.Haste = set_combine(sets.Precast.FastCast,{
  222.             head="Nahtirah Hat",
  223.             neck="Aoidos' Matinee",
  224.             ear1="Loquac. Earring",
  225.             body="Brioso just. +1",
  226.             hands="Gendewitha Gages",
  227.             ring1="Prolix Ring",
  228.             ring2="Veneficium Ring",
  229.             back="Swith Cape +1",
  230.             waist="Witful Belt",
  231.             legs="Brioso Cann. +1",
  232.             feet="Brioso Slippers +1"})
  233.  
  234.     sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{
  235.             ring1="Haoma's Ring",
  236.             ring2="Haoma's Ring",
  237.             feet="Gende. Galoshes"})
  238.  
  239.     sets.Midcast.Stoneskin = set_combine(sets.Midcast.Haste)
  240.  
  241.     -- Melee Set --
  242.     sets.Melee = set_combine(sets.Midcast.Haste)
  243.  
  244.     -- WS Base Set --
  245.     sets.WS = {}
  246. end
  247.  
  248. function pretarget(spell,action)
  249.     if (spell.type:endswith('Magic') or spell.type == "BardSong" or spell.type == "Ninjutsu") and buffactive.Silence then
  250.         cancel_spell()
  251.         send_command('input /item "Echo Drops" <me>')
  252.     elseif spell.type == "BardSong" and spell.target.type == 'SELF' and buffactive.pianissimo then -- Change Target From <me> To <t> When Pianissimo Is Active --
  253.         change_target('<t>')
  254.     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 --
  255.         cancel_spell()
  256.         pianissimo_cycle = true
  257.         send_command('input /ja "Pianissimo" <me>;wait 1.5;input /ma "'..spell.name..'" '..spell.target.name..';')
  258.         return
  259.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  260.         degrade_spell(spell,Cure_Spells)
  261.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  262.         degrade_spell(spell,Curaga_Spells)
  263.     end
  264.     if spell.name ~= 'Pianissimo' then
  265.         pianissimo_cycle = false
  266.     end
  267. end
  268.  
  269. function precast(spell,action)
  270.     if spell.type == 'BardSong' then
  271.         if buffactive.nightingale then
  272.             equip_song_gear(spell)
  273.             return
  274.         else
  275.             equip_song_gear(spell)
  276.             equip(sets.Precast.SongCast)
  277.         end
  278.     elseif spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  279.         if string.find(spell.english,'Cur') and spell.name~="Cursna" then
  280.             equip(sets.Precast.Cure)
  281.         elseif string.find(spell.english,'Utsusemi') then
  282.             if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  283.                 cancel_spell()
  284.                 add_to_chat(8, spell.english .. ' Canceled: [3+ Images]')
  285.                 return
  286.             else
  287.                 equip(sets.Precast.FastCast)
  288.             end
  289.         else
  290.             equip(sets.Precast.FastCast)
  291.         end
  292.     elseif spell.type == "WeaponSkill" then
  293.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  294.             cancel_spell()
  295.             add_to_chat(8,'Unable To Use WeaponSkill: [Disengaged]')
  296.             return
  297.         elseif sets.WS[spell.english] then
  298.             equip(sets.WS[spell.english])
  299.         end
  300.     elseif spell.type == "JobAbility" then
  301.         if sets.JA[spell.english] then
  302.             equip(sets.JA[spell.english])
  303.         end
  304.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  305.         cast_delay(0.2)
  306.         send_command('cancel Sneak')
  307.     end
  308.     if sets.Precast[tostring(spell.element)] then
  309.         equip(sets.Precast[tostring(spell.element)])
  310.     end
  311. end
  312.  
  313. function midcast(spell,action)
  314.     if sets.Midcast[spell.english] then
  315.         equip(sets.Midcast[spell.english])
  316.     elseif spell.type == 'BardSong' then
  317.         equip_song_gear(spell)
  318.     elseif spell.type:endswith('Magic') or spell.type=='Ninjutsu' then
  319.         if spell.skill == "Healing Magic" then
  320.             if string.find(spell.english,'Cure') then
  321.                 equip(sets.Midcast.Cure)
  322.             elseif string.find(spell.english,'Cura') then
  323.                 equip(sets.Midcast.Curaga)
  324.             else
  325.                 equip(sets.Midcast.Haste)
  326.             end
  327.         elseif spell.skill == "Enhancing Magic" then
  328.             if spell.english == "Stoneskin" and buffactive.Stoneskin then
  329.                 send_command('@wait 2.8; cancel Stoneskin')
  330.             elseif spell.english == "Sneak" then
  331.                 if spell.target.type == "SELF" and buffactive['Sneak'] then
  332.                     send_command('@wait 1.0; cancel Sneak')
  333.                 end
  334.                 equip(sets.Midcast.Haste)
  335.             else
  336.                 equip(sets.Midcast.Haste)
  337.             end
  338.         elseif string.find(spell.english,'Utsusemi') then
  339.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  340.                 send_command('@wait 1.7; cancel Copy Image*')
  341.             end
  342.             equip(sets.Midcast.Haste)
  343.         elseif spell.english == 'Monomi: Ichi' then
  344.             if buffactive.Sneak then
  345.                 send_command('@wait 1.7; cancel Sneak')
  346.             end
  347.             equip(sets.Midcast.Haste)
  348.         else
  349.             equip(sets.Midcast.Haste)
  350.         end
  351.     end
  352. end
  353.  
  354. function aftercast(spell,action)
  355.     if spell.type and spell.type == 'BardSong' and spell.target and spell.target.type:upper() == 'SELF' and not spell.interrupted then
  356.         local t = os.time()
  357.  
  358.         local tempreg = {}
  359.         for i,v in pairs(timer_reg) do
  360.             if v < t then tempreg[i] = true end
  361.         end
  362.         for i,v in pairs(tempreg) do
  363.             timer_reg[i] = nil
  364.         end
  365.        
  366.         local dur = calculate_duration(spell.name)
  367.         if timer_reg[spell.name] then
  368.             if (timer_reg[spell.name] - t) <= 120 then
  369.                 send_command('timers delete "'..spell.name..'"')
  370.                 timer_reg[spell.name] = t + dur
  371.                 send_command('timers create "'..spell.name..'" '..dur..' down')
  372.             end
  373.         else
  374.             local maxsongs = 2
  375.             if player.equipment.range == 'Daurdabla' then
  376.                 maxsongs = maxsongs+2
  377.             end
  378.             if buffactive['Clarion Call'] then
  379.                 maxsongs = maxsongs+1
  380.             end
  381.             if maxsongs < table.length(timer_reg) then
  382.                 maxsongs = table.length(timer_reg)
  383.             end
  384.            
  385.             if table.length(timer_reg) < maxsongs then
  386.                 timer_reg[spell.name] = t+dur
  387.                 send_command('timers create "'..spell.name..'" '..dur..' down')
  388.             else
  389.                 local rep,repsong
  390.                 for i,v in pairs(timer_reg) do
  391.                     if t+dur > v then
  392.                         if not rep or rep > v then
  393.                             rep = v
  394.                             repsong = i
  395.                         end
  396.                     end
  397.                 end
  398.                 if repsong then
  399.                     timer_reg[repsong] = nil
  400.                     send_command('timers delete "'..repsong..'"')
  401.                     timer_reg[spell.name] = t+dur
  402.                     send_command('timers create "'..spell.name..'" '..dur..' down')
  403.                 end
  404.             end
  405.         end
  406.     end
  407.     status_change(player.status)
  408. end
  409.  
  410. function status_change(new,old)
  411.     if new == 'Engaged' then
  412.         equip(sets.Melee)
  413.     else
  414.         equip(sets.Idle[IdleArray[IdleIndex]])
  415.     end
  416. end
  417.  
  418. function buff_change(buff,gain)
  419.     if buff:ifind("Aftermath: Lv.3") and gain then
  420.         send_command('timers create "Aftermath: Lv.3" 180 down')
  421.         add_to_chat(158,'AM3: [ON]')
  422.     elseif buff:ifind("Aftermath: Lv.3") then
  423.         send_command('timers delete "Aftermath: Lv.3"')
  424.         add_to_chat(8,'AM3: [OFF]')
  425.     end
  426.     status_change(player.status)
  427. end
  428.  
  429. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  430. function self_command(command) 
  431.     if command == 'C1' then
  432.         send_command('input /ma "Victory March" <me>')
  433.         add_to_chat(158,'Melee Speed II: [Victory March]')
  434.     elseif command == 'C2' then
  435.         send_command('input /ma "Advancing March" <me>')
  436.         add_to_chat(158,'Melee Speed: [Advancing March]')
  437.     elseif command == 'C3' then
  438.         send_command('input /ma "Valor Minuet V" <me>')
  439.         add_to_chat(158,'Melee Attack: [Valor Minuet V]')
  440.     elseif command == 'C5' then
  441.         send_command('input /ma "Valor Minuet IV" <me>')
  442.         add_to_chat(158,'Melee Attack: [Valor Minuet IV]')
  443.     elseif command == 'C7' then
  444.         send_command('input /ma "Hunter\'s Prelude" <me>')
  445.         add_to_chat(158,'Ranged Accuracy: [Hunter\'s Prelude]')
  446.     elseif command == 'C15' then
  447.         send_command('input /ma "Archer\'s Prelude" <me>')
  448.         add_to_chat(158,'Ranged Accuracy: [Archer\'s Prelude]')
  449.     elseif command == 'C9' then
  450.         send_command('input /ma "Blade Madrigal" <me>')
  451.         add_to_chat(158,'Melee Accuracy II: [Blade Madrigal]')
  452.     elseif command == 'C10' then
  453.         send_command('input /ma "Sword Madrigal" <me>')
  454.         add_to_chat(158,'Melee Accuracy: [Sword Madrigal]')
  455.     elseif command == 'C12' then
  456.         send_command('input /ma "Valor Minuet III" <me>')
  457.         add_to_chat(158,'Melee Attack: [Valor Minuet III]')
  458.     elseif command == 'C6' then -- Idle Toggle --
  459.         IdleIndex = (IdleIndex % #IdleArray) + 1
  460.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  461.         status_change(player.status)
  462.     elseif command:match('^SC%d$') then
  463.         send_command('//' .. sc_map[command])
  464.     end
  465. end
  466.  
  467. function equip_song_gear(spell)
  468.     if DaurdSongs:contains(spell.name) then
  469.         equip(sets.Precast.Daurdabla)
  470.         add_to_chat(158,'Daurdabla: [ON]')
  471.     else
  472.         if spell.target.type == 'MONSTER' then
  473.             equip(sets.Midcast.Wind)
  474.             if string.find(spell.english,'Finale') then equip(sets.Midcast.Finale) end
  475.             if string.find(spell.english,'Lullaby') then equip(sets.Midcast.Lullaby) end
  476.         else
  477.             equip(sets.Midcast.WindBuff)
  478.             if string.find(spell.english,'March') then equip(sets.Midcast.March) end
  479.             if string.find(spell.english,'Minuet') then equip(sets.Midcast.Minuet) end
  480.             if string.find(spell.english,'Madrigal') then equip(sets.Midcast.Madrigal) end
  481.             if string.find(spell.english,'Ballad') then equip(sets.Midcast.Ballad) end
  482.             if string.find(spell.english,'Scherzo') then equip(sets.Midcast.Scherzo) end
  483.             if string.find(spell.english,'Mazurka') then equip(sets.Midcast.Mazurka) end
  484.             if string.find(spell.english,'Paeon') then equip(sets.Midcast.Paeon) end
  485.         end
  486.     end
  487. end
  488.  
  489. function calculate_duration(name)
  490.     local mult = 1
  491.     if player.equipment.main == "Legato Dagger" then mult = mult + 0.5 end
  492.     if player.equipment.range == 'Daurdabla' then mult = mult + 0.3 end
  493.     if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 end
  494.     if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
  495.     if player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  496.     if player.equipment.legs == "Mdk. Shalwar +1" then mult = mult + 0.1 end
  497.     if player.equipment.feet == "Brioso Slippers +1" then mult = mult + 0.11 end
  498.  
  499.     if string.find(name,'Paeon') and player.equipment.head == 'Brioso Roundlet +1' then mult = mult + 0.1 end
  500.     if string.find(name,'March') and player.equipment.hands == 'Ad. Mnchtte. +2' then mult = mult + 0.1 end
  501.     if string.find(name,'Minuet') and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  502.     if string.find(name,'Madrigal') and player.equipment.head == "Aoidos' Calot +2" then mult = mult + 0.1 end
  503.     if string.find(name,'Ballad') and player.equipment.legs == "Aoidos' Rhing. +2" then mult = mult + 0.1 end
  504.     if string.find(name,'Scherzo') and player.equipment.feet == "Aoidos' Cothrn. +2" then mult = mult + 0.1 end
  505.  
  506.     if buffactive.Troubadour then
  507.         mult = mult*2
  508.     end
  509.     if string.find(name,'Scherzo') then
  510.         if buffactive['Soul Voice'] then
  511.             mult = mult*2
  512.         elseif buffactive['marcato'] then
  513.             mult = mult*1.5
  514.         end
  515.     end
  516.  
  517.     mult = mult - 0.05
  518.  
  519.     local totalDuration = mult*120
  520.  
  521.     return totalDuration
  522. end
  523.  
  524. function actualCost(originalCost)
  525.     if buffactive["Penury"] then
  526.         return originalCost*.5
  527.     elseif buffactive["Light Arts"] then
  528.         return originalCost*.9
  529.     else
  530.         return originalCost
  531.     end
  532. end
  533.  
  534. function degrade_spell(spell,degrade_array)
  535.     spell_index = table.find(degrade_array,spell.name)
  536.     if spell_index>1 then
  537.         new_spell = degrade_array[spell_index - 1]
  538.         change_spell(new_spell,spell.target.raw)
  539.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  540.     end
  541. end
  542.  
  543. function change_spell(spell_name,target)
  544.     cancel_spell()
  545.     send_command('//'..spell_name..' '..target)
  546. end
Advertisement
Add Comment
Please, Sign In to add comment