Advertisement
Arnan

BRD (mule) Lua August 2018

Aug 21st, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.12 KB | None | 0 0
  1. function get_sets()
  2.     AccIndex = 1
  3.     AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  4.     IdleIndex = 1
  5.     IdleArray = {"Full","DT","Warp"} -- Default Idle Set Is Full --
  6.     Armor = 'None'
  7.     timer_reg = {}
  8.     pianissimo_cycle = false
  9.     Daurdabla = 'OFF' -- Set Default Lock Daurdabla ON or OFF Here --
  10.     Elemental_Staff = 'OFF' -- Set Default Precast Elemental Staves ON or OFF Here --
  11.     Lock_Main = 'OFF' -- Set Default Lock Main Weapon ON or OFF Here --
  12.     target_distance = 6 -- Set Default Distance Here --
  13.     send_command('input /macro book 2;wait .1;input /macro set 1') -- Change Default Macro Book Here --
  14.  
  15.     -- Daurdabla Trigger Songs: Use The Following Songs or Daurdabla Toggle To Equip Daurdabla, Add or Remove Daurdabla Songs --
  16.     DaurdSongs = S{"Army's Paeon","Army's Paeon II","Shining Fantasia","Herb Pastoral","Goblin Gavotte"}
  17.  
  18.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  19.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  20.    
  21.         --------------------
  22.         -- Key Binds Load --
  23.         --------------------
  24.        
  25.         -- Key Bind Toggles (The Same for all my job files) (Ctrl Key) --
  26.         send_command('bind ^A input //gs c acc')
  27.         send_command('bind ^D input //gs c pdt')
  28.         send_command('bind ^I input //gs c idle')
  29.  
  30.         ----------------------
  31.         -- Key Binds Unload --
  32.         ----------------------
  33.        
  34.         function file_unload()
  35.         -- Unbind Toggles --
  36.         send_command('unbind ^A')
  37.         send_command('unbind ^D')
  38.         send_command('unbind ^I')
  39.         end
  40.        
  41.  
  42.     -- Idle Sets --
  43.     sets.Idle = {
  44.             head="Inyanga Tiara +2",
  45.             neck="Twilight Torque",
  46.             ear1="Ethereal Earring",
  47.             ear2="Hearty Earring",
  48.             body="Inyanga Jubbah +2",
  49.             ring1="Defending Ring",
  50.             ring2="Inyanga Ring",
  51.             hands="Inyan. Dastanas +2",
  52.             back="Moonbeam Cape",
  53.             waist="Flume Belt",
  54.             legs="Assid. Pants +1",
  55.             feet="Fili Cothurnes +1"}
  56.     sets.Idle.Full = set_combine(sets.Idle,{})
  57.     sets.Idle.DT = set_combine(sets.Idle,{})
  58.     sets.Idle.Warp = set_combine(sets.Idle,{
  59.             ring2="Warp Ring"})
  60.  
  61.     -- PDT Set --
  62.     sets.PDT = {
  63.             head="Inyanga Tiara +2",
  64.             neck="Twilight Torque",
  65.             ear1="Ethereal Earring",
  66.             ear2="Hearty Earring",
  67.             body="Inyanga Jubbah +2",
  68.             ring1="Defending Ring",
  69.             ring2="Gelatinous Ring +1",
  70.             hands="Inyan. Dastanas +2",
  71.             back="Moonbeam Cape",
  72.             waist="Flume Belt",
  73.             legs="Brioso Cannions +2",
  74.             feet="Inyan. Crackows +2"}
  75.  
  76.     sets.Precast = {
  77.             neck="Voltsurge Torque",
  78.             ear1="Loquac. Earring",
  79.             body="Inyanga Jubbah +2",
  80.             hands="Leyline Gloves",
  81.             ring1="Lebeche Ring",
  82.             ring2="Kishar Ring",
  83.             back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Spell interruption rate down-10%',}},
  84.             waist="Witful Belt",
  85.             legs="Artsieq Hose"}
  86.            
  87.     -- Song Precast Set --
  88.     sets.Precast.SongCast = set_combine(sets.Precast,{
  89.             head="Fili Calot +1",
  90.             legs="Querkening brais",
  91.             feet="Coalrake Sabots"})
  92.  
  93.     -- Elemental Staves --
  94.     sets.Precast.Lightning = {}
  95.     sets.Precast.Water = {}
  96.     sets.Precast.Fire = {}
  97.     sets.Precast.Ice = {}
  98.     sets.Precast.Wind = {}
  99.     sets.Precast.Earth = {}
  100.     sets.Precast.Light = {}
  101.     sets.Precast.Dark = {}
  102.  
  103.     -- Precast Daurdabla Set --
  104.     sets.Precast.Daurdabla = set_combine(sets.Precast.SongCast,{
  105.             range="Daurdabla",
  106.             ammo=empty})
  107.            
  108.     -- Precast Honor March --
  109.     sets.Precast['Honor March'] = set_combine(sets.Precast.SongCast,{range="Marsyas"})
  110.  
  111.     -- Fastcast Set --
  112.     sets.Precast.FastCast = set_combine(sets.Precast,{})
  113.  
  114.     -- Cure Precast Set --
  115.     sets.Precast.Cure = set_combine(sets.Precast,{
  116.             ear2="Mendi. Earring",
  117.             feet="Kaykaus Boots"})
  118.  
  119.     -- Midcast Base Set --
  120.     sets.Midcast = {}  -- Leave This blank or it will use this set insted of song sets, unsure why --
  121.  
  122.     -- Song Debuff Set --
  123.     sets.Midcast.Wind = {
  124.             range="Gjallarhorn",
  125.             head="Brioso Roundlet +2",
  126.             neck="Mnbw. Whistle +1",
  127.             ear1="Gwati Earring",
  128.             ear2="Musical Earring",
  129.             body="Brioso Justau. +2",
  130.             hands="Brioso Cuffs +2",
  131.             ring1="Stikini Ring",
  132.             ring2="Stikini Ring",
  133.             waist="Harfner's Sash",
  134.             legs="Brioso Cannions +2",
  135.             feet="Brioso Slippers +3",
  136.             back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Spell interruption rate down-10%',}}}
  137.  
  138.     -- Song Buff Set --
  139.     sets.Midcast.WindBuff = {
  140.             range="Gjallarhorn",
  141.             head="Fili Calot +1",
  142.             neck="Mnbw. Whistle +1",
  143.             ear1="Loquac. Earring",
  144.             ear2="Musical Earring",
  145.             body="Fili Hongreline +1",
  146.             hands="Fili Manchettes +1",
  147.             ring1="Stikini Ring",
  148.             ring2="Stikini Ring",
  149.             waist="Harfner's Sash",
  150.             legs="Inyanga Shalwar +2",
  151.             feet="Brioso Slippers +3",
  152.             back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Spell interruption rate down-10%',}}}
  153.  
  154.     sets.Midcast.March = set_combine(sets.Midcast.WindBuff,{hands="Fili Manchettes +1"})
  155.     sets.Midcast['Honor March'] = set_combine(sets.Midcast.March,{range="Marsyas"})
  156.     sets.Midcast.Minuet = set_combine(sets.Midcast.WindBuff,{body="Fili Hongreline +1"})
  157.     sets.Midcast.Madrigal = set_combine(sets.Midcast.WindBuff,{head="Fili Calot +1","Intarabus's Cape"})
  158.     sets.Midcast.Ballad = set_combine(sets.Midcast.WindBuff,{}) -- legs="Fili Rhingrave" --
  159.     sets.Midcast.Scherzo = set_combine(sets.Midcast.WindBuff,{feet="Fili Cothurnes +1"})
  160.     sets.Midcast.Mazurka = set_combine(sets.Midcast.WindBuff,{})
  161.     sets.Midcast.Paeon = set_combine(sets.Midcast.WindBuff,{head="Brioso Roundlet +2"})
  162.     sets.Midcast.Finale = set_combine(sets.Midcast.Wind,{})
  163.     sets.Midcast.Lullaby = set_combine(sets.Midcast.Wind,{
  164.             range="Daurdabla",
  165.             body="Fili Hongreline +1",
  166.             legs="Inyanga Shalwar +2",
  167.             feet="Brioso Slippers +3"})
  168.  
  169.     -- Cure Set --
  170.     sets.Midcast.Cure = {
  171.             head="Vanya Hood",
  172.             neck="Phalaina Locket",
  173.             ear1="Mendi. Earring",
  174.             ear2="Lifestorm Earring",
  175.             body="Inyanga Jubbah +2",
  176.             hands="Telchine Gloves",
  177.             ring1="Lebeche Ring",
  178.             ring2="Stikini Ring",
  179.             back="Solemnity Cape",
  180.             waist="Pythia Sash",
  181.             legs="Artsieq Hose",
  182.             feet="Kaykaus Boots"}
  183.  
  184.     -- Curaga Set --
  185.     sets.Midcast.Curaga = set_combine(sets.Midcast.Cure,{})
  186.  
  187.     -- Haste Set --
  188.     sets.Midcast.Haste = set_combine(sets.Midcast,{})
  189.  
  190.     -- Cursna Set --
  191.     sets.Midcast.Cursna = set_combine(sets.Midcast,{})
  192.  
  193.     -- Stoneskin Set --
  194.     sets.Midcast.Stoneskin = set_combine(sets.Midcast,{})
  195.  
  196.     -- JA Sets --
  197.     sets.JA = {}
  198.     sets.JA.Nightingale = {feet="Bihu Slippers"}
  199.     sets.JA.Troubadour = {body="Bihu Justaucorps"}
  200.     sets.JA["Soul Voice"] = {legs="Bihu Cannions"}
  201.  
  202.     -- Waltz --
  203.     sets.Waltz = {}
  204.  
  205.     -- Melee Sets --
  206.     sets.Melee = {
  207.             head="Aya. Zucchetto +2",
  208.             body="Ayanmo Corazza +2",
  209.             hands="Aya. Manopolas +2",
  210.             legs="Aya. Cosciales +1",
  211.             feet="Aya. Gambieras +2",
  212.             neck="Lissome Necklace",
  213.             waist="Windbuffet Belt +1",
  214.             left_ear="Suppanomimi",
  215.             right_ear="Cessance Earring",
  216.             left_ring="Petrov Ring",
  217.             right_ring="Ayanmo Ring",
  218.             back={ name="Intarabus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}}
  219.     sets.Melee.MidACC = set_combine(sets.Melee,{})
  220.     sets.Melee.HighACC = set_combine(sets.Melee.MidACC,{})
  221.  
  222.     -- WS Base Set --
  223.     sets.WS = {}
  224.  
  225.     sets.WS.Exenterator = {}
  226.     sets.WS.Exenterator.MidACC = set_combine(sets.WS.Exenterator,{})
  227.     sets.WS.Exenterator.HighACC = set_combine(sets.WS.Exenterator.MidACC,{})
  228.  
  229.     sets.WS.Evisceration = {}
  230.     sets.WS.Evisceration.MidACC = set_combine(sets.WS.Evisceration,{})
  231.     sets.WS.Evisceration.HighACC = set_combine(sets.WS.Evisceration.MidACC,{})
  232.  
  233.     sets.WS["Mercy Stroke"] = {}
  234.     sets.WS["Mercy Stroke"].MidACC = set_combine(sets.WS["Mercy Stroke"],{})
  235.     sets.WS["Mercy Stroke"].HighACC = set_combine(sets.WS["Mercy Stroke"].MidACC,{})
  236.  
  237.     sets.WS["Rudra's Storm"] = {}
  238.     sets.WS["Rudra's Storm"].MidACC = set_combine(sets.WS["Rudra's Storm"],{})
  239.     sets.WS["Rudra's Storm"].HighACC = set_combine(sets.WS["Rudra's Storm"].MidACC,{})
  240.  
  241.     sets.WS["Mordant Rime"] = {
  242.             head="Aya. Zucchetto +2",
  243.             body="Ayanmo Corazza +2",
  244.             hands="Aya. Manopolas +2",
  245.             legs="Aya. Cosciales +1",
  246.             feet="Aya. Gambieras +2",
  247.             neck="Lissome Necklace",
  248.             waist="Windbuffet Belt +1",
  249.             left_ear="Suppanomimi",
  250.             right_ear="Cessance Earring",
  251.             left_ring="Petrov Ring",
  252.             right_ring="Ayanmo Ring",
  253.             back={ name="Intarabus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}}
  254. end
  255.  
  256. function pretarget(spell,action)
  257.     if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  258.         cancel_spell()
  259.         send_command('input /item "Echo Drops" <me>')
  260.     elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  261.         cancel_spell()
  262.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  263.         return
  264.     elseif spell.type == "BardSong" and spell.target.name == player.name and buffactive.Pianissimo then -- Change Target From <me> To <t> When Pianissimo Is Active --
  265.         change_target('<t>')
  266.     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 --
  267.         cancel_spell()
  268.         pianissimo_cycle = true
  269.         send_command('input /ja "Pianissimo" <me>;wait 1.5;input /ma "'..spell.name..'" '..spell.target.name..';')
  270.         return
  271.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  272.         degrade_spell(spell,Cure_Spells)
  273.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  274.         degrade_spell(spell,Curaga_Spells)
  275.     end
  276.     if spell.name ~= 'Pianissimo' then
  277.         pianissimo_cycle = false
  278.     end
  279. end
  280.  
  281. function precast(spell,action)
  282.     if spell.action_type == 'Magic' then
  283.         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 --
  284.             cancel_spell()
  285.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  286.             return
  287.         else
  288.             if spell.type == 'BardSong' then
  289.                 if Daurdabla == 'ON' then
  290.                     equip(sets.Precast.Daurdabla)
  291.                 else
  292.                     if buffactive.Nightingale then
  293.                         equip_song_gear(spell)
  294.                         return
  295.                     else
  296.                         equip_song_gear(spell)
  297.                         equip(sets.Precast.SongCast)
  298.                     end
  299.                 end
  300.             elseif spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  301.                 equip(sets.Precast.Cure)
  302.             elseif spell.english == 'Utsusemi: Ni' then
  303.                 if buffactive['Copy Image (3)'] then
  304.                     cancel_spell()
  305.                     add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  306.                     return
  307.                 else
  308.                     equip(sets.Precast.FastCast)
  309.                 end
  310.             else
  311.                 equip(sets.Precast.FastCast)
  312.             end
  313.         end
  314.     elseif spell.type == "WeaponSkill" then
  315.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  316.             cancel_spell()
  317.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  318.             return
  319.         else
  320.             equipSet = sets.WS
  321.             if equipSet[spell.english] then
  322.                 equipSet = equipSet[spell.english]
  323.             end
  324.             if equipSet[AccArray[AccIndex]] then
  325.                 equipSet = equipSet[AccArray[AccIndex]]
  326.             end
  327.             if spell.english == "Evisceration" and player.tp > 2990 then
  328.                 equipSet = set_combine(equipSet,{})
  329.             end
  330.             equip(equipSet)
  331.         end
  332.     elseif spell.type == "JobAbility" then
  333.         if sets.JA[spell.english] then
  334.             equip(sets.JA[spell.english])
  335.         end
  336.     elseif spell.type == "Waltz" then
  337.         equip(sets.Waltz)
  338.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  339.         cast_delay(0.2)
  340.         send_command('cancel Sneak')
  341.     end
  342.     if sets.Precast[spell.element] and not buffactive.Nightingale and Elemental_Staff == 'ON' then
  343.         equip(sets.Precast[spell.element])
  344.     end
  345. end
  346.  
  347. function midcast(spell,action)
  348.     equipSet = {}
  349.     if spell.action_type == 'Magic' then
  350.         equipSet = sets.Midcast
  351.         if equipSet[spell.english] then
  352.             equipSet = equipSet[spell.english]
  353.         elseif spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  354.             if spell.english:startswith('Cure') then
  355.                 equipSet = equipSet.Cure
  356.             elseif spell.english:startswith('Cura') then
  357.                 equipSet = equipSet.Curaga
  358.             end
  359.             if world.day_element == spell.element or world.weather_element == spell.element then
  360.                 equipSet = set_combine(equipSet,{})
  361.             end
  362.         elseif spell.english == "Stoneskin" then
  363.             if buffactive.Stoneskin then
  364.                 send_command('@wait 2.8;cancel stoneskin')
  365.             end
  366.             equipSet = equipSet.Stoneskin
  367.         elseif spell.english == "Sneak" then
  368.             if spell.target.name == player.name and buffactive['Sneak'] then
  369.                 send_command('cancel sneak')
  370.             end
  371.             equipSet = equipSet.Haste
  372.         elseif spell.english:startswith('Utsusemi') then
  373.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  374.                 send_command('@wait 1.7;cancel Copy Image*')
  375.             end
  376.             equipSet = equipSet.Haste
  377.         elseif spell.english == 'Monomi: Ichi' then
  378.             if buffactive['Sneak'] then
  379.                 send_command('@wait 1.7;cancel sneak')
  380.             end
  381.             equipSet = equipSet.Haste
  382.         elseif spell.type == 'BardSong' then
  383.             if Daurdabla == 'ON' then
  384.                 equip(sets.Precast.Daurdabla)
  385.             else
  386.                 equip_song_gear(spell)
  387.             end
  388.         end
  389.     end
  390.     equip(equipSet)
  391. end
  392.  
  393. function aftercast(spell,action)
  394.     if midaction() then
  395.         return
  396.     else
  397.         status_change(player.status)
  398.     end
  399. end
  400.  
  401. function status_change(new,old)
  402.     if Armor == 'PDT' or buffactive.Terror or buffactive.Stun or buffactive.Petrification or buffactive.Sleep then
  403.         equip(sets.PDT)
  404.     elseif new == 'Engaged' then
  405.         equipSet = sets.Melee
  406.         if equipSet[AccArray[AccIndex]] then
  407.             equipSet = equipSet[AccArray[AccIndex]]
  408.         end
  409.         equip(equipSet)
  410.     elseif new == 'Idle' then
  411.         equipSet = sets.Idle
  412.         if equipSet[IdleArray[IdleIndex]] then
  413.             equipSet = equipSet[IdleArray[IdleIndex]]
  414.         end
  415.         if buffactive['Reive Mark'] then -- Equip Arciela's Grace +1 During Reive --
  416.             equipSet = set_combine(equipSet,{})
  417.         end
  418.         equip(equipSet)
  419.     elseif new == 'Resting' then
  420.         equip(sets.Resting)
  421.     end
  422. end
  423.  
  424.  function buff_change(buff,gain,loss)
  425.     buff = string.lower(buff)
  426.     if gain then  
  427.         add_to_chat(158,'--- Gained: ['..buff..']')
  428.     elseif loss then
  429.         add_to_chat(123,'--- Lost: ['..buff..']')
  430.     end
  431.     if not midaction() then
  432.         status_change(player.status)
  433.     end
  434.  end
  435.  
  436. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  437. function self_command(command)
  438.     if command == 'pdt' then -- PDT Toggle --
  439.         if Armor == 'PDT' then
  440.             Armor = 'None'
  441.             add_to_chat(123,'PDT Set: [Unlocked]')
  442.         else
  443.             Armor = 'PDT'
  444.             add_to_chat(158,'PDT Set: [Locked]')
  445.         end
  446.         status_change(player.status)
  447.     elseif command == 'mainlock' then -- Lock Main Weapon Toggle --
  448.         if Lock_Main == 'ON' then
  449.             Lock_Main = 'OFF'
  450.             add_to_chat(123,'Main Weapon: [Unlocked]')
  451.         else
  452.             Lock_Main = 'ON'
  453.             add_to_chat(158,'Main Weapon: [Locked]')
  454.         end
  455.         status_change(player.status)
  456.     elseif command == 'Daurdabla' then -- Daurdabla Toggle --
  457.         if Daurdabla == 'ON' then
  458.             Daurdabla = 'OFF'
  459.             add_to_chat(123,'Daurdabla: [OFF]')
  460.         else
  461.             Daurdabla = 'ON'
  462.             add_to_chat(158,'Daurdabla: [ON]')
  463.         end
  464.         status_change(player.status)
  465.     elseif command == 'acc' then -- Accuracy Level Toggle --
  466.         AccIndex = (AccIndex % #AccArray) + 1
  467.         status_change(player.status)
  468.         add_to_chat(155,'Accuracy Level: ' .. AccArray[AccIndex])
  469.     elseif command == 'update' then -- Auto Update Gear Toggle --
  470.         status_change(player.status)
  471.         add_to_chat(155,'Auto Update Gear')
  472.     elseif command == 'distance' then -- Distance Toggle --
  473.         if player.target.distance then
  474.             target_distance = math.floor(player.target.distance*10)/10
  475.             add_to_chat(155,'Distance: '..target_distance)
  476.         else
  477.             add_to_chat(123,'No Target Selected')
  478.         end
  479.     elseif command == 'idle' then -- Idle Toggle --
  480.         IdleIndex = (IdleIndex % #IdleArray) + 1
  481.         add_to_chat(155,'Idle Set: '..IdleArray[IdleIndex])
  482.         status_change(player.status)
  483.     elseif command:match('^SC%d$') then
  484.         send_command('//' .. sc_map[command])
  485.     end
  486. end
  487.  
  488. function equip_song_gear(spell)
  489.     if DaurdSongs:contains(spell.english) then
  490.         equip(sets.Precast.Daurdabla)
  491.         add_to_chat(158,'Daurdabla: [ON]')
  492.     else
  493.         if spell.target.type == 'MONSTER' then
  494.             equip(sets.Midcast.Wind)
  495.             if string.find(spell.english,'Finale') then equip(sets.Midcast.Finale) end
  496.             if string.find(spell.english,'Lullaby') then equip(sets.Midcast.Lullaby) end
  497.         else
  498.             equip(sets.Midcast.WindBuff)
  499.             if string.find(spell.english,'March') then equip(sets.Midcast.March) end
  500.             if string.find(spell.english,'Honor March') then equip(sets.Midcast['Honor March']) end
  501.             if string.find(spell.english,'Minuet') then equip(sets.Midcast.Minuet) end
  502.             if string.find(spell.english,'Madrigal') then equip(sets.Midcast.Madrigal) end
  503.             if string.find(spell.english,'Ballad') then equip(sets.Midcast.Ballad) end
  504.             if string.find(spell.english,'Scherzo') then equip(sets.Midcast.Scherzo) end
  505.             if string.find(spell.english,'Mazurka') then equip(sets.Midcast.Mazurka) end
  506.             if string.find(spell.english,'Paeon') then equip(sets.Midcast.Paeon) end
  507.         end
  508.     end
  509. end
  510.  
  511. function actualCost(originalCost)
  512.     if buffactive["Penury"] then
  513.         return originalCost*.5
  514.     elseif buffactive["Light Arts"] or buffactive["Addendum: White"] then
  515.         return originalCost*.9
  516.     elseif buffactive["Dark Arts"] or buffactive["Addendum: Black"] then
  517.         return originalCost*1.1
  518.     else
  519.         return originalCost
  520.     end
  521. end
  522.  
  523. function degrade_spell(spell,degrade_array)
  524.     spell_index = table.find(degrade_array,spell.name)
  525.     if spell_index > 1 then
  526.         new_spell = degrade_array[spell_index - 1]
  527.         change_spell(new_spell,spell.target.raw)
  528.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  529.     end
  530. end
  531.  
  532. function change_spell(spell_name,target)
  533.     cancel_spell()
  534.     send_command('//'..spell_name..' '..target)
  535. end
  536.  
  537. function find_player_in_alliance(name)
  538.     for i,v in ipairs(alliance) do
  539.         for k,p in ipairs(v) do
  540.             if p.name == name then
  541.                 return p
  542.             end
  543.         end
  544.     end
  545. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement