Advertisement
Arnan

BRD (mule) Lua January 2018

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