Advertisement
Arnan

WHM (mule) Lua August 2018

Aug 21st, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 19.37 KB | None | 0 0
  1.  
  2. function get_sets()
  3.     IdleIndex = 1
  4.     IdleArray = {"Full","DT","Warp"} -- Default Idle Set Is Movement --
  5.     Armor = 'None'
  6.     canceled = false
  7.     DC = false
  8.     Lock_Main = 'OFF' -- Set Default Lock Main Weapon ON or OFF Here --
  9.     Enmity = 'OFF' -- Set Default Enmity Set ON or OFF Here --
  10.     Kiting = 'OFF' -- Set Default Sublimation Kiting ON or OFF Here --
  11.     Elemental_Staff = 'OFF' -- Set Default Precast Elemental Staff ON or OFF Here --
  12.     target_distance = 6 -- Set Default Distance Here --
  13.     send_command('input /macro book 3;wait .1;input /macro set 1')
  14.  
  15.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV","Cure V","Cure VI"} -- Cure Degradation --
  16.     Curaga_Spells = {"Curaga","Curaga II","Curaga III","Curaga IV","Curaga V"} -- Curaga Degradation --
  17.     Na_Spells = S{"Paralyna","Cursna","Silena","Poisona","Blindna","Viruna","Stona"} -- For Yagrush --
  18.    
  19.         --------------------
  20.         -- Key Binds Load --
  21.         --------------------
  22.        
  23.         -- Key Bind Toggles (The Same for all my job files) (Ctrl Key) --
  24.         send_command('bind ^A input //gs c acc')
  25.         send_command('bind ^D input //gs c pdt')
  26.         send_command('bind ^I input //gs c idle')
  27.  
  28.         ----------------------
  29.         -- Key Binds Unload --
  30.         ----------------------
  31.        
  32.         function file_unload()
  33.         -- Unbind Toggles --
  34.         send_command('unbind ^A')
  35.         send_command('unbind ^D')
  36.         send_command('unbind ^I')
  37.         end
  38.        
  39.     -- Idle Set --
  40.     sets.Idle = {
  41.             main="Bolelabunga",
  42.             sub="Genmei Shield",
  43.             ammo="Homiliary",
  44.             head="Inyanga Tiara +2",
  45.             neck="Twilight Torque",
  46.             ear1="Infused Earring",
  47.             ear2="Hearty Earring",
  48.             body="Witching Robe",
  49.             hands="Inyan. Dastanas +2",
  50.             ring1="Defending Ring",
  51.             ring2="Inyanga Ring",
  52.             back="Moonbeam Cape",
  53.             waist="Hachirin-no-Obi",
  54.             legs="Inyanga Shalwar +2",
  55.             feet="Inyan. Crackows +2"}
  56.     sets.Idle.Full = set_combine(sets.Idle,{})
  57.     sets.Idle.DT = set_combine(sets.Idle,{})
  58.     sets.Idle.Warp = set_combine(sets.Idle,{ring2="Warp Ring"})
  59.    
  60.     -- Resting Set --
  61.     sets.Resting = {}
  62.  
  63.     -- PDT Set --
  64.     sets.PDT = {}
  65.  
  66.     -- Sublimation Set --
  67.     sets.Sublimation = {
  68.             main="Bolelabunga",
  69.             sub="Genmei Shield",
  70.             ammo="Homiliary",
  71.             head="Inyanga Tiara +2",
  72.             neck="Twilight Torque",
  73.             ear1="Infused Earring",
  74.             ear2="Hearty Earring",
  75.             body="Witching Robe",
  76.             hands="Inyan. Dastanas +2",
  77.             ring1="Defending Ring",
  78.             ring2="Inyanga Ring",
  79.             back="Moonbeam Cape",
  80.             waist="Hachirin-no-Obi",
  81.             legs="Inyanga Shalwar +2",
  82.             feet="Inyan. Crackows +2"}
  83.  
  84.     sets.Precast = {
  85.             ammo="Sapience Orb",
  86.             neck="Voltsurge Torque",
  87.             ear1="Loquac. Earring",
  88.             body="Inyanga Jubbah +2",
  89.             ring1="Lebeche Ring",
  90.             ring2="Kishar Ring",
  91.             back={ name="Alaunus's Cape", augments={'"Fast Cast"+10',}},
  92.             waist="Witful Belt",
  93.             legs="Artsieq Hose"}
  94.            
  95.     -- Fastcast Set --
  96.     sets.Precast.FastCast = set_combine(sets.Precast,{})
  97.  
  98.     -- Elemental Staves --
  99.     sets.Precast.Lightning = {}
  100.     sets.Precast.Water = {}
  101.     sets.Precast.Fire = {}
  102.     sets.Precast.Ice = {}
  103.     sets.Precast.Wind = {}
  104.     sets.Precast.Earth = {}
  105.     sets.Precast.Light = {}
  106.     sets.Precast.Dark = {}
  107.  
  108.     sets.Precast['Enhancing Magic'] = set_combine(sets.Precast,{waist="Siegel Sash"})
  109.     sets.Precast['Healing Magic'] = set_combine(sets.Precast,{
  110.             head="Theophany Cap +2",
  111.             ear1="Nourish. Earring",
  112.             ear2="Mendi. Earring",
  113.             legs="Ebers Pant. +1"})
  114.  
  115.     sets.Precast.Stoneskin = set_combine(sets.Precast,{head="Umuthi Hat",waist="Siegel Sash"})
  116.  
  117.     -- Cure Precast Set --
  118.     sets.Precast.Cure = set_combine(sets.Precast,{
  119.             head="Theophany Cap +2",
  120.             ear1="Nourish. Earring",
  121.             ear2="Mendi. Earring",
  122.             legs="Ebers Pant. +1"})
  123.  
  124.  
  125.     -- Midcast Base Set --
  126.     sets.Midcast = {
  127.             head="Inyanga Tiara +2",
  128.             neck="Voltsurge Torque",
  129.             ear1="Loquac. Earring",
  130.             ear2="Hearty Earring",
  131.             body="Inyanga Jubbah +2",
  132.             hands="Shrieker's Cuffs",
  133.             ring1="Defending Ring",
  134.             ring2="Kishar Ring",
  135.             back={ name="Alaunus's Cape", augments={'"Fast Cast"+10',}},
  136.             waist="Witful Belt",
  137.             legs="Inyanga Shalwar +2",
  138.             feet="Inyan. Crackows +2"}
  139.  
  140.     -- Haste Set --
  141.     sets.Midcast.Haste = set_combine(sets.MidCast,{})
  142.  
  143.     -- Cure Set --
  144.     sets.Midcast.Cure = {
  145.             main="Queller Rod",
  146.             sub="Sors Shield",
  147.             ammo="Leisure Musk +1",
  148.             head="Vanya Hood",
  149.             neck="Incanter's Torque",
  150.             ear1="Glorious Earring",
  151.             ear2="Cytherea Pearl",
  152.             body="Ebers Bliaud +1",
  153.             hands="Theophany Mitts +3",
  154.             ring1="Lebeche Ring",
  155.             ring2="Stikini Ring",
  156.             back={ name="Alaunus's Cape", augments={'MND+20','Eva.+20 /Mag. Eva.+20','MND+10','"Cure" potency +10%','Spell interruption rate down-10%',}},
  157.             waist="Pythia Sash",
  158.             legs="Ebers Pant. +1",
  159.             feet="Kaykaus Boots"}
  160.  
  161.     -- Cure Enmity Set --
  162.     sets.Midcast.Cure.Enmity = set_combine(sets.Midcast.Cure,{})
  163.  
  164.     -- Curaga Set --
  165.     sets.Midcast.Curaga = set_combine(sets.Midcast.Cure,{})
  166.  
  167.     -- Curaga Enmity Set --
  168.     sets.Midcast.Curaga.Enmity = set_combine(sets.Midcast.Curaga,{})
  169.  
  170.     -- Enhancing Set --
  171.     sets.Midcast['Enhancing Magic'] = set_combine(sets.Midcast,{
  172.             head={ name="Telchine Cap", augments={'Enh. Mag. eff. dur. +9',}},
  173.             neck="Incanter's Torque",
  174.             body={ name="Telchine Chas.", augments={'Enh. Mag. eff. dur. +9',}},
  175.             hands={ name="Telchine Gloves", augments={'Enh. Mag. eff. dur. +9',}},
  176.             ring1="Stikini Ring",
  177.             ring2="Stikini Ring",
  178.             back="Perimede Cape",
  179.             legs={ name="Telchine Braconi", augments={'Enh. Mag. eff. dur. +10',}},
  180.             feet="Theo. Duckbills +2"})
  181.  
  182.     -- Barspells Set --
  183.     sets.Midcast.Bar = set_combine(sets.Midcast['Enhancing Magic'],{
  184.             head="Ebers Cap +1",
  185.             body="Ebers Bliaud +1",
  186.             hands="Ebers Mitts +1",
  187.             legs="Piety Pantaln. +1"})
  188.  
  189.     -- Regen Set --
  190.     sets.Midcast.Regen = set_combine(sets.Midcast['Enhancing Magic'],{
  191.             main="Bolelabunga",
  192.             head="Inyanga Tiara +2",
  193.             body="Piety Briault +1",
  194.             hands="Ebers Mitts +1",
  195.             legs="Th. Pantaloons +2",
  196.             feet="Theo. Duckbills +2"})
  197.  
  198.     -- Erase Set --
  199.     sets.Midcast.Erase = set_combine(sets.Midcast,{neck="Cleric's Torque"})
  200.            
  201.     -- Stoneskin Set --
  202.     sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{})
  203.  
  204.     -- Na Set --
  205.     sets.Midcast.Na = set_combine(sets.Midcast,{legs="Ebers Pant. +1"})
  206.  
  207.     -- Cursna Set --
  208.     sets.Midcast.Cursna = set_combine(sets.Midcast,{legs="Th. Pantaloons +2"})
  209.  
  210.     -- Divine Set --
  211.     sets.Midcast['Divine Magic'] = {}
  212.  
  213.     -- Banish Set --
  214.     sets.Midcast.Banish = set_combine(sets.Midcast['Divine Magic'],{})
  215.  
  216.     -- Holy Set --
  217.     sets.Midcast.Holy = set_combine(sets.Midcast['Divine Magic'],{})
  218.    
  219.     -- Enfeebling Set --
  220.     sets.Midcast['Enfeebling Magic'] = {}
  221.  
  222.     -- Dark Magic Set --
  223.     sets.Midcast['Dark Magic'] = {}
  224.  
  225.     -- Impact Set --
  226.     sets.Midcast.Impact = {}
  227.  
  228.     -- JA Sets --
  229.     sets.JA = {}
  230.     sets.JA.Benediction = {body="Piety Briault +1"}
  231.     sets.JA.Martyr = {} --{hands="Piety Mitts +1"}--
  232.     sets.JA.Devotion = {} --{head="Piety Cap +1"}--
  233.  
  234.     -- Divine Caress Set --
  235.     sets['Divine Caress'] = {
  236.         hands="Ebers Mitts +1",
  237.         back="Mending Cape"}
  238.  
  239.     -- Melee Set --
  240.     sets.Melee = set_combine(sets.Midcast.Haste,{})
  241.  
  242.     -- WS Base Set --
  243.     sets.WS = {}
  244.     sets.WS['Hexa Strike'] = {}
  245.     sets.WS['Mystic Boon'] = {}
  246.     sets.WS.Dagan = {}
  247. end
  248.  
  249. function pretarget(spell,action)
  250.     if midaction() then
  251.         canceled = true
  252.         return
  253.     elseif spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  254.         cancel_spell()
  255.         send_command('input /item "Echo Drops" <me>')
  256.     elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  257.         cancel_spell()
  258.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  259.         return
  260.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  261.         degrade_spell(spell,Cure_Spells)
  262.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  263.         degrade_spell(spell,Curaga_Spells)
  264.     elseif Na_Spells:contains(spell.english) then -- Auto Divine Caress --
  265.         if windower.ffxi.get_ability_recasts()[32] < 1 and (spell.target.type == 'PLAYER' or spell.target.name == player.name) and not buffactive.amnesia and not buffactive.charm and spell.english ~= "Erase" then
  266.             cancel_spell()
  267.             send_command('DivineCaress;wait 1.7;input /ma "'..spell.english..'" '..spell.target.name)
  268.         end
  269.     elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  270.         if spell.english == 'Light Arts' and not buffactive['Addendum: White'] then
  271.             cancel_spell()
  272.             send_command('input /ja Addendum: White <me>')
  273.         elseif spell.english == "Manifestation" then
  274.             cancel_spell()
  275.             send_command('input /ja Accession <me>')
  276.         elseif spell.english == "Alacrity" then
  277.             cancel_spell()
  278.             send_command('input /ja Celerity <me>')
  279.         elseif spell.english == "Parsimony" then
  280.             cancel_spell()
  281.             send_command('input /ja Penury <me>')
  282.         end
  283.     elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  284.         if spell.english == 'Dark Arts' and not buffactive['Addendum: Black'] then
  285.             cancel_spell()
  286.             send_command('input /ja Addendum: Black <me>')
  287.         elseif spell.english == "Accession" then
  288.             cancel_spell()
  289.             send_command('input /ja Manifestation <me>')
  290.         elseif spell.english == "Celerity" then
  291.             cancel_spell()
  292.             send_command('input /ja Alacrity <me>')
  293.         elseif spell.english == "Penury" then
  294.             cancel_spell()
  295.             send_command('input /ja Parsimony <me>')
  296.         end
  297.     end
  298. end
  299.  
  300. function precast(spell,action)
  301.     if canceled then
  302.         return
  303.     elseif spell.action_type == 'Magic' then
  304.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  305.             cancel_spell()
  306.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  307.             return
  308.         else
  309.             if spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  310.                 equip(sets.Precast.Cure)
  311.             elseif spell.english == "Stoneskin" then
  312.                 equip(sets.Precast[spell.english])
  313.             elseif spell.english == "Impact" then
  314.                 equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  315.             elseif spell.english == 'Utsusemi: Ni' then
  316.                 if buffactive['Copy Image (3)'] then
  317.                     cancel_spell()
  318.                     add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  319.                     return
  320.                 else
  321.                     equip(sets.Precast.FastCast)
  322.                 end
  323.             elseif sets.Precast[spell.skill] then
  324.                 equip(sets.Precast[spell.skill])
  325.             else
  326.                 equip(sets.Precast.FastCast)
  327.             end
  328.         end
  329.     elseif spell.type == "JobAbility" then
  330.         if sets.JA[spell.english] then
  331.             equip(sets.JA[spell.english])
  332.         end
  333.     elseif spell.type == "WeaponSkill" then
  334.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  335.             cancel_spell()
  336.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  337.             return
  338.         else
  339.             if sets.WS[spell.english] then
  340.                 equip(sets.WS[spell.english])
  341.             end
  342.         end
  343.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  344.         cast_delay(0.2)
  345.         send_command('cancel Sneak')
  346.     end
  347.     if sets.Precast[spell.element] and not Na_Spells:contains(spell.english) and Elemental_Staff == 'ON' then
  348.         equip(sets.Precast[spell.element])
  349.     end
  350. end
  351.  
  352. function midcast(spell,action)
  353.     equipSet = {}
  354.     if spell.action_type == 'Magic' then
  355.         equipSet = sets.Midcast
  356.         if Na_Spells:contains(spell.english) then
  357.             equipSet = equipSet.Na
  358.             if DC then
  359.                 equipSet = set_combine(equipSet,sets['Divine Caress'])
  360.             end
  361.         elseif spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  362.             if spell.english:startswith('Cure') then
  363.                 if Enmity == 'ON' then
  364.                     equipSet = equipSet.Cure.Enmity
  365.                 else
  366.                     equipSet = equipSet.Cure
  367.                 end
  368.             elseif spell.english:startswith('Cura') then
  369.                 if Enmity == 'ON' then
  370.                     equipSet = equipSet.Curaga.Enmity
  371.                 else
  372.                     equipSet = equipSet.Curaga
  373.                 end
  374.             end
  375.             if world.day_element == spell.element or world.weather_element == spell.element then
  376.                 equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Hachirin-no-Obi"})
  377.             end
  378.         elseif spell.english == "Protectra V" then -- Equip Aug'ed Piety Duckbills +1 When You Cast Protectra V --
  379.             equipSet = set_combine(sets.Midcast['Enhancing Magic'],{feet="Piety Duckbills +1"})
  380.         elseif spell.english == "Shellra V" then -- Equip Aug'ed Piety Pantaln. +1 When You Cast Shellra V --
  381.             equipSet = set_combine(sets.Midcast['Enhancing Magic'],{legs="Piety Pantaln. +1"})
  382.         elseif spell.english == "Stoneskin" then
  383.             if buffactive.Stoneskin then
  384.                 send_command('@wait 2.8;cancel stoneskin')
  385.             end
  386.             equipSet = equipSet.Stoneskin
  387.         elseif spell.english == "Sneak" then
  388.             if spell.target.name == player.name and buffactive['Sneak'] then
  389.                 send_command('cancel sneak')
  390.             end
  391.             equipSet = equipSet.Haste
  392.         elseif spell.english:startswith('Bar') then
  393.             equipSet = equipSet.Bar
  394.         elseif spell.english:startswith('Regen') then
  395.             equipSet = equipSet.Regen
  396.         elseif spell.english:startswith('Banish') then
  397.             equipSet = equipSet.Banish
  398.             if world.day_element == spell.element or world.weather_element == spell.element then
  399.                 equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Hachirin-no-Obi"})
  400.             end
  401.         elseif spell.english:startswith('Holy') then
  402.             equipSet = equipSet.Holy
  403.             if world.day_element == spell.element or world.weather_element == spell.element then
  404.                 equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Hachirin-no-Obi"})
  405.             end
  406.         elseif spell.english:startswith('Reraise') then
  407.             equipSet = equipSet.Haste
  408.         elseif spell.english:startswith('Utsusemi') then
  409.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  410.                 send_command('@wait 1.7;cancel Copy Image*')
  411.             end
  412.             equipSet = equipSet.Haste
  413.         elseif spell.english == 'Monomi: Ichi' then
  414.             if buffactive['Sneak'] then
  415.                 send_command('@wait 1.7;cancel sneak')
  416.             end
  417.             equipSet = equipSet.Haste
  418.         else
  419.             if equipSet[spell.english] then
  420.                 equipSet = equipSet[spell.english]
  421.             end
  422.             if equipSet[spell.skill] then
  423.                 equipSet = equipSet[spell.skill]
  424.             end
  425.             if equipSet[spell.type] then
  426.                 equipSet = equipSet[spell.type]
  427.             end
  428.         end
  429.     elseif equipSet[spell.english] then
  430.         equipSet = equipSet[spell.english]
  431.     end
  432.     equip(equipSet)
  433. end
  434.  
  435. function aftercast(spell,action)
  436.     if canceled then
  437.         canceled = false
  438.         return
  439.     else
  440.         if not spell.interrupted then
  441.             if spell.type == "WeaponSkill" then
  442.                 send_command('wait 0.2;gs c TP')
  443.             elseif spell.english == "Repose" or spell.english == "Sleep II" then -- Repose & Sleep II Countdown --
  444.                 send_command('wait 60;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  445.             elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  446.                 send_command('wait 30;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  447.             elseif spell.english == "Banish III" then -- Banish III Countdown --
  448.                 send_command('wait 35;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  449.             end
  450.         end
  451.         status_change(player.status)
  452.     end
  453. end
  454.  
  455. function status_change(new,old)
  456.     if Armor == 'PDT' then
  457.         equip(sets.PDT)
  458.     elseif buffactive["Sublimation: Activated"] then
  459.         equip(sets.Sublimation)
  460.         if Kiting == 'ON' then
  461.             equip({feet="Herald's Gaiters"})
  462.         end
  463.     elseif new == 'Engaged' then
  464.         equip(sets.Melee)
  465.     elseif new == 'Idle' then
  466.         equipSet = sets.Idle
  467.         if equipSet[IdleArray[IdleIndex]] then
  468.             equipSet = equipSet[IdleArray[IdleIndex]]
  469.         end
  470.         if buffactive['Reive Mark'] then -- Equip Arciela's Grace +1 During Reive --
  471.             equipSet = set_combine(equipSet,{neck="Arciela's Grace +1"})
  472.         end
  473.         equip(equipSet)
  474.     elseif new == 'Resting' then
  475.         equip(sets.Resting)
  476.     end
  477. end
  478.  
  479. function buff_change(buff,gain)
  480.     buff = string.lower(buff)
  481.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  482.         if gain then
  483.             send_command('timers create "Aftermath: Lv.3" 180 down;wait 150;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 15;input /echo Aftermath: Lv.3 [WEARING OFF IN 15 SEC.];wait 5;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  484.         else
  485.             send_command('timers delete "Aftermath: Lv.3"')
  486.             add_to_chat(123,'AM3: [OFF]')
  487.         end
  488.     elseif buff == 'divine caress' then
  489.         DC = gain
  490.     elseif buff == 'weakness' then -- Weakness Timer --
  491.         if gain then
  492.             send_command('timers create "Weakness" 300 up')
  493.         else
  494.             send_command('timers delete "Weakness"')
  495.         end
  496.     end
  497.     if not midaction() then
  498.         status_change(player.status)
  499.     end
  500. end
  501.  
  502. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  503. function self_command(command)
  504.     if command == 'enm' then -- Enmity Toggle --
  505.         if Enmity == 'ON' then
  506.             Enmity = 'OFF'
  507.             add_to_chat(123,'Enmity Set: [OFF]')
  508.         else
  509.             Enmity = 'ON'
  510.             add_to_chat(158,'Enmity Set: [ON]')
  511.         end
  512.         status_change(player.status)
  513.     elseif command == 'follow' then -- Follow Toggle --
  514.         send_command('input /ta Arnan;input /lockon;wait .3;setkey numpad8 down;wait .3;setkey numpad7 down;wait .3;setkey numpad7 up;wait .3;setkey numpad8 up')
  515.     elseif command == 'kiting' then -- Kiting Toggle --
  516.         if Kiting == 'ON' then
  517.             Kiting = 'OFF'
  518.             add_to_chat(123,'Kiting Set: [Unlocked]')
  519.         else
  520.             Kiting = 'ON'
  521.             add_to_chat(158,'Kiting Set: [Locked]')
  522.         end
  523.         status_change(player.status)
  524.     elseif command == 'update' then -- Auto Update Gear Toggle --
  525.         status_change(player.status)
  526.         add_to_chat(158,'Auto Update Gear')
  527.     elseif command == 'pdt' then
  528.         if Armor == 'PDT' then -- PDT Toggle --
  529.             Armor = 'None'
  530.             add_to_chat(123,'PDT Set: [Unlocked]')
  531.         else
  532.             Armor = 'PDT'
  533.             add_to_chat(158,'PDT Set: [Locked]')
  534.         end
  535.         status_change(player.status)
  536.     elseif command == 'weapon' then -- Lock Main Weapon Toggle --
  537.         if Lock_Main == 'ON' then
  538.             Lock_Main = 'OFF'
  539.             add_to_chat(123,'Main Weapon: [Unlocked]')
  540.         else
  541.             Lock_Main = 'ON'
  542.             add_to_chat(158,'Main Weapon: [Locked]')
  543.         end
  544.         status_change(player.status)
  545.     elseif command == 'distance' then -- Distance Toggle --
  546.         if player.target.distance then
  547.             target_distance = math.floor(player.target.distance*10)/10
  548.             add_to_chat(158,'Distance: '..target_distance)
  549.         else
  550.             add_to_chat(123,'No Target Selected')
  551.         end
  552.     elseif command == 'idle' then -- Idle Toggle
  553.         IdleIndex = (IdleIndex % #IdleArray) + 1
  554.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  555.         status_change(player.status)
  556.     elseif command == 'TP' then
  557.         add_to_chat(155,'TP Return: '..tostring(player.tp))
  558.     elseif command:match('^SC%d$') then
  559.         send_command('//' .. sc_map[command])
  560.     end
  561. end
  562.  
  563. function actualCost(originalCost)
  564.     if buffactive["Penury"] then
  565.         return originalCost*.5
  566.     elseif buffactive["Light Arts"] or buffactive["Addendum: White"] then
  567.         return originalCost*.9
  568.     elseif buffactive["Dark Arts"] or buffactive["Addendum: Black"] then
  569.         return originalCost*1.1
  570.     else
  571.         return originalCost
  572.     end
  573. end
  574.  
  575. function degrade_spell(spell,degrade_array)
  576.     spell_index = table.find(degrade_array,spell.name)
  577.     if spell_index > 1 then
  578.         new_spell = degrade_array[spell_index - 1]
  579.         change_spell(new_spell,spell.target.raw)
  580.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  581.     end
  582. end
  583.  
  584. function change_spell(spell_name,target)
  585.     cancel_spell()
  586.     send_command('//'..spell_name..' '..target)
  587. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement