Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

WHM lua

a guest Dec 6th, 2018 61 in 172 days
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. TP_Set_Names = {"None", "Delay Cap" ,"Acc"}
  2. TP_Index = 1
  3.  
  4. Idle_Set_Names = {'MDT','PDT'}
  5. Idle_Index = 1
  6.  
  7. Kiting = false
  8.  
  9. send_command('bind f9 gs c cycle TP set')
  10. send_command('bind f10 gs c equip pdt')
  11. send_command('bind f11 gs c equip mdt')
  12. send_command('bind f12 gs c refresh set')
  13. send_command('bind ^k gs c toggle kiting')
  14.  
  15. function file_unload()
  16.     send_command('unbind f9')
  17.     send_command('unbind f10')
  18.     send_command('unbind f11')
  19.     send_command('unbind f12')
  20. end
  21.  
  22. function help()
  23.     add_to_chat(122, 'Keyboard Bindings:')
  24.     add_to_chat(122, 'F9: Cycle TP set')
  25.     add_to_chat(122, 'F10: Turn on idle pdt')
  26.     add_to_chat(122, 'F11: Turn on idle mdt')
  27.     add_to_chat(122, 'F12: Refresh gear and turn on job abilities')
  28.     add_to_chat(122, 'Ctrl + k: Toggle kiting')
  29. end
  30.  
  31. help()
  32.  
  33. function get_sets()
  34.  
  35.     sets = {}
  36.    
  37.      -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  38.      sets.divine_caress = {hands="Ebers mitts"}
  39.      sets.afflatus_solace = {body="Ebers Bliaud +1"}
  40.  
  41.     --- Sets for Enhanced Job Abilities ---
  42.    
  43.     sets.ja = {}
  44.    
  45.     sets.ja['Afflatus Solace'] = sets.afflatus_solace
  46.     sets.ja['Benediction'] = {body="Piety Briault +1"}
  47.     sets.ja['Devotion'] = {body="Piety Cap +1"}
  48.    
  49.     --- Fast Cast Sets ---
  50.     sets.fc = {
  51.         main="Gada",
  52.         sub="Chanter's shield",
  53.         ammo="Incantor Stone",
  54.         head="Vanya hood",
  55.         neck="Cleric's torque",
  56.         ear2="Loquacious Earring",
  57.         body="Inyanga jubbah +2",
  58.         hands="Kaykaus cuffs",
  59.         ring1="Prolix Ring",
  60.         back="Alaunus's cape",
  61.         legs="Lengo pants",
  62.         feet="Kaykaus boots"
  63.     }
  64.    
  65.     sets.fc.heal = set_combine(sets.fc, {legs="ebers pantaloons +1"})
  66.    
  67.     sets.fc.cure = set_combine(sets.fc, {
  68.         main="Queller rod",
  69.         neck="Aceso's choker +1",
  70.         sub="Sors shield",
  71.         ammo="Incantor stone",
  72.         ear1="Nourishing earring +1",
  73.         head="Piety cap +1",
  74.         feet="Hygieia Clogs +1"
  75.     })
  76.    
  77.     sets.fc.stoneskin = set_combine(sets.fc, {
  78.         head="Umuthi hat"
  79.     })
  80.    
  81.     sets.ws = {
  82.         head="Aya. Zucchetto +2",
  83.         body="Ayanmo Corazza +2",
  84.         hands="Aya. Manopolas +2",
  85.         legs="Aya. Cosciales +2",
  86.         feet="Aya. Gambieras +2",
  87.         neck="Fotia Gorget",
  88.         waist="Fotia Belt",
  89.         left_ear="Cessance Earring",
  90.         right_ear="Brutal Earring",
  91.         left_ring="Rajas Ring",
  92.         right_ring="Chirich Ring",
  93.         back="Moonbeam Cape",
  94.     }
  95.    
  96.     sets.ws["Hexa Strike"] = {
  97.         ammo="Staunch Tathlum",
  98.         head="Aya. Zucchetto +2",
  99.         body="Ayanmo Corazza +2",
  100.         hands="Aya. Manopolas +2",
  101.         legs="Aya. Cosciales +2",
  102.         feet="Aya. Gambieras +2",
  103.         neck="Fotia Gorget",
  104.         waist="Fotia Belt",
  105.         left_ear="Cessance Earring",
  106.         right_ear="Brutal Earring",
  107.         left_ring="Rajas Ring",
  108.         right_ring="Chirich Ring",
  109.         back="Moonbeam Cape",
  110.     }
  111.      
  112.    
  113.     sets.tp = {}
  114.    
  115.     sets.tp['Delay Cap'] = {
  116.         ammo="Staunch Tathlum",
  117.         head="Aya. Zucchetto +2",
  118.         body="Ayanmo Corazza +2",
  119.         hands="Aya. Manopolas +2",
  120.         legs="Aya. Cosciales +2",
  121.         feet="Aya. Gambieras +2",
  122.         neck="Sanctity Necklace",
  123.         waist="Grunfeld Rope",
  124.         left_ear="Cessance Earring",
  125.         right_ear="Telos Earring",
  126.         left_ring="Petrov Ring",
  127.         right_ring="Hetairoi Ring",
  128.         back="Moonbeam Cape",
  129.     }
  130.  
  131.     sets.tp['Acc'] = {
  132.         ammo="Staunch Tathlum",
  133.         head="Aya. Zucchetto +2",
  134.         body="Ayanmo Corazza +2",
  135.         hands="Aya. Manopolas +2",
  136.         legs="Aya. Cosciales +2",
  137.         feet="Aya. Gambieras +2",
  138.         neck="Sanctity Necklace",
  139.         waist="Grunfeld Rope",
  140.         left_ear="Cessance Earring",
  141.         right_ear="Brutal Earring",
  142.         left_ring="Rajas Ring",
  143.         right_ring="Chirich Ring",
  144.         back="Moonbeam Cape",
  145.     }
  146.    
  147.    
  148.     sets.Idle = {}
  149.    
  150.     sets.Idle['PDT'] = {
  151.         main="Mafic cudgel",
  152.         sub="Genbu's Shield",
  153.         ammo="Staunch tathlum",
  154.         head="Ayanmo zucchetto +2",
  155.         neck="Loricate Torque +1",
  156.         ear1="Etiolation earring",
  157.         ear2="Hearty earring",
  158.         body="Ayanmo corazza +2",
  159.         hands="Ayanmo manopolas +2",
  160.         ring1="Defending Ring",
  161.         ring2="Ayanmo ring",
  162.         back={ name="Alaunus's Cape", augments={'MND+20','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity-10','Occ. inc. resist. to stat. ailments+10'}},
  163.         waist="Latria sash",
  164.         legs="Ayanmo cosciales +2",
  165.         feet="Ayanmo gambieras +2"
  166.     }
  167.                
  168.     sets.Idle['MDT'] = {
  169.         main="Mafic cudgel",
  170.         sub="Genbu's Shield",
  171.         ammo="Staunch tathlum",
  172.         head="Inyanga tiara +2",
  173.         neck="Loricate Torque +1",
  174.         ear1="Etiolation earring",
  175.         ear2="Hearty earring",
  176.         body="Inyanga jubbah +2",
  177.         hands="Shrieker's cuffs",
  178.         ring1="Defending Ring",
  179.         ring2="Inyanga ring",
  180.         back={ name="Alaunus's Cape", augments={'MND+20','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity-10','Occ. inc. resist. to stat. ailments+10'}},
  181.         waist="Latria sash",
  182.         legs="Inyanga Shalwar +2",
  183.         feet="Inyanga crackows +2"
  184.     }
  185.  
  186.     sets.midcast = {}
  187.  
  188.     sets.midcast.Statusremoval = {
  189.         main="Yagrush",
  190.         head="Vanya hood",
  191.         body="Ebers bliaud +1",
  192.         neck="Cleric's torque",
  193.         head="Vanya hood",
  194.         legs="ebers pantaloons +1",
  195.         back={ name="Alaunus's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','Enmity-10','Spell interruption rate down-10%'}}
  196.     }
  197.  
  198.     sets.midcast.Cursna = set_combine( sets.midcast.Statusremoval, {
  199.         neck="Debilis Medallion",
  200.         hands="Fanatic gloves",
  201.         ring1="Haoma's ring",
  202.         ring2="Haoma's ring",
  203.         legs="Theophany pantaloons +2",
  204.         feet="Gendewitha Galoshes"
  205.     })
  206.    
  207.     sets.midcast.Cure = {
  208.         main="Queller rod",
  209.         sub="Genbu's Shield",
  210.         ammo="Incantor Stone",
  211.         head="Ebers cap +1",
  212.         neck="Cleric's torque",
  213.         ear1="Nourishing earring +1",
  214.         ear2="Glorious earring",
  215.         body="Theophany briault +3",
  216.         hands="Kaykaus cuffs",
  217.         ring1="Prolix Ring",
  218.         ring2="Sirona's Ring",
  219.         back={ name="Alaunus's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','Enmity-10','Spell interruption rate down-10%'}},
  220.         legs="ebers pantaloons +1",
  221.         feet="Kaykaus boots"
  222.     }
  223.  
  224.     sets.midcast.Enhancing = {
  225.         main="Beneficus",
  226.         sub="Ammurapi shield",
  227.         head="Umuthi Hat",
  228.         back={ name="Alaunus's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','Enmity-10','Spell interruption rate down-10%'}},
  229.         legs="Piety Pantaloons +1",
  230.         feet="Theophany duckbills +2"
  231.     }
  232.  
  233.     sets.midcast.BarElement = set_combine( sets.midcast.Enhancing, {
  234.         main="Beneficus",
  235.         head="Ebers cap +1",
  236.         body="Ebers Bliaud +1",
  237.         hands="Ebers mitts",
  238.         legs="Piety Pantaloons +1",
  239.         feet="Ebers duckbills +1"
  240.     })
  241.    
  242.     sets.midcast['Auspice'] = {
  243.         feet="Ebers duckbills +1"
  244.     }
  245.  
  246.     sets.midcast.Protect = set_combine(sets.midcast.Enhancing, {
  247.         ring1="Sheltered Ring",
  248.         feet="Piety duckbills +1"
  249.     })
  250.  
  251.     sets.midcast.Shell = set_combine(sets.midcast.Enhancing, {
  252.         ring1="Sheltered Ring",
  253.         legs="Piety Pantaloons +1"
  254.     })
  255.  
  256.     sets.midcast.Regen = set_combine(sets.midcast.Enhancing, {
  257.         main="Bolelabunga",
  258.         head="Inyanga tiara +2",
  259.         body="Piety Briault +1",
  260.         hands="Ebers mitts",
  261.         legs="Theophany pantaloons +2",
  262.     })
  263.  
  264.     sets.midcast.Enfeebling = {
  265.         main="Gada",
  266.         head="Befouled crown",
  267.         neck="Sanctity necklace",
  268.         ear1="Gwati earring",
  269.         ear2="Hermetic earring",
  270.         body="Theophany briault +3",
  271.         hands="Inyanga dastanas +2",
  272.         ring1="Globidonta ring",
  273.         ring2="Sangoma Ring",
  274.         back={ name="Alaunus's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','Enmity-10','Spell interruption rate down-10%'}},
  275.         waist="Rumination sash",
  276.         legs="Theophany pantaloons +2",
  277.         feet="Piety duckbills +1"
  278.     }
  279.  
  280.     sets.kiting = {
  281.         ring2='Shneddick ring'
  282.     }
  283.  
  284. end
  285.  
  286. function precast(spell)
  287.     -- print_set(spell)
  288.    
  289.     if (sets.ja[spell.english]) then
  290.         equip(sets.ja[spell.english])
  291.     elseif spell.skill == 'Healing Magic' then
  292.         if spell.name:contains("Cure") or spell.name:contains("Curaga") or spell.name:contains("Cura") then
  293.             equip(sets.fc.Cure)
  294.         else
  295.             equip(sets.fc.heal)
  296.         end
  297.     elseif spell.name == "Stoneskin" then
  298.         equip(sets.fc.stoneskin)
  299.     elseif spell.action_type == "Magic" then
  300.         equip(sets.fc)
  301.     end
  302. end
  303.  
  304. function midcast(spell)
  305.     -- print_set(spell)
  306.     local set_to_equip = sets.Idle[Idle_Set_Names[Idle_Index]]
  307.     if spell.skill == 'Healing Magic' or spell.name == "Erase" then
  308.         if spell.name:contains("Cure") then
  309.             if buffactive['Afflatus Solace'] then
  310.                 local solace_cure_set = set_combine(sets.afflatus_solace, sets.midcast.cure)
  311.                 set_to_equip = set_combine(set_to_equip, solace_cure_set)
  312.             else
  313.                 set_to_equip = set_combine(set_to_equip, sets.midcast.Cure)
  314.             end
  315.         elseif spell.name:contains("Curaga") or spell.name:contains("Cura") then
  316.             set_to_equip = set_combine(set_to_equip, sets.midcast.Cure)
  317.         elseif spell.name == "Cursna" then
  318.             if buffactive['Divine Caress'] then
  319.                 local cursna_divine_caress_set = set_combine(sets.divine_caress, sets.midcast.Cursna)
  320.                 set_to_equip = set_combine(set_to_equip, cursna_divine_caress_set)
  321.             else
  322.                 set_to_equip = set_combine(set_to_equip, sets.midcast.Cursna)
  323.             end            
  324.         else
  325.             if buffactive['Divine Caress'] then
  326.                 local status_removal_dc = set_combine(sets.divine_caress, sets.midcast.Statusremoval)
  327.                 set_to_equip = set_combine(set_to_equip, status_removal_dc)
  328.             else
  329.                 set_to_equip = set_combine(set_to_equip, sets.midcast.Statusremoval)
  330.             end
  331.         end    
  332.     --Enfeebling Magic 
  333.     elseif spell.skill == 'Enfeebling Magic' then
  334.         set_to_equip = set_combine(set_to_equip, sets.midcast.Enfeebling)      
  335.     --Enhancing Magic      
  336.     elseif spell.skill == 'Enhancing Magic' then
  337.         if spell.name == 'Stoneskin' then
  338.             set_to_equip = set_combine(set_to_equip, sets.midcast.Stoneskin)
  339.         elseif spell.english:contains('Regen') then
  340.             set_to_equip = set_combine(set_to_equip, sets.midcast.regen)
  341.         elseif spell.english:contains('Bar') then
  342.             if buffactive['Afflatus Solace'] then
  343.                 local bar_as = set_combine(sets.afflatus_solace, sets.midcast.BarElement)
  344.                 set_to_equip = set_combine(set_to_equip, bar_as)
  345.             else
  346.                 set_to_equip = set_combine(set_to_equip, sets.midcast.BarElement)
  347.             end
  348.         elseif spell.english:contains('Protect') then
  349.             set_to_equip = set_combine(set_to_equip, sets.midcast.Protect)
  350.         elseif spell.english:contains('Shell') then
  351.             set_to_equip = set_combine(set_to_equip, sets.midcast.Shell)
  352.         elseif sets.midcast[spell.english] then
  353.             set_to_equip = set_combine(set_to_equip, sets.midcast[spell.english])
  354.         else
  355.             set_to_equip = set_combine(set_to_equip, sets.midcast.Enhancing)
  356.         end
  357.     end
  358.     -- print_set(set_to_equip)
  359.     equip(set_to_equip)
  360. end
  361.  
  362. function equip_set(status)
  363.     local set_to_equip = nil
  364.     if status=='Engaged' then
  365.         local tp_set_mode = TP_Set_Names[TP_Index]
  366.         if tp_set_mode == 'None' then
  367.             set_to_equip= sets.Idle[Idle_Set_Names[Idle_Index]]
  368.         else
  369.             set_to_equip = sets.tp[TP_Set_Names[TP_Index]]
  370.         end
  371.     else
  372.         set_to_equip = sets.Idle[Idle_Set_Names[Idle_Index]]
  373.     end
  374.  
  375.     if Kiting then
  376.         set_to_equip = set_combine(set_to_equip, sets.kiting)
  377.     end
  378.  
  379.     equip(set_to_equip)
  380. end
  381.  
  382. function aftercast(spell)
  383.     equip_set(player.status)
  384. end
  385.  
  386. function status_change(new,old)
  387.     equip_set(new)
  388. end
  389.  
  390. function self_command(command)
  391.     if command == 'cycle TP set' then
  392.         TP_Index = TP_Index +1
  393.         if TP_Index > #TP_Set_Names then TP_Index = 1 end
  394.         send_command('@input /echo ----- TP Set changed to '..TP_Set_Names[TP_Index]..' -----')
  395.         equip_set(player.status)
  396.     elseif command == 'equip pdt' then
  397.         Idle_Index = 2
  398.         send_command('@input /echo ----- Idle Set changed to '..Idle_Set_Names[Idle_Index]..' -----')
  399.         equip_set(player.status)
  400.     elseif command == 'equip mdt' then
  401.         Idle_Index = 1
  402.         send_command('@input /echo ----- Idle Set changed to '..Idle_Set_Names[Idle_Index]..' -----')
  403.         equip_set(player.status)
  404.     elseif command == 'toggle kiting' then
  405.         Kiting = not Kiting
  406.         if Kiting then
  407.             send_command('@input /echo ----- Kiting Set On -----')
  408.         else
  409.             send_command('@input /echo ----- Kiting Set Off -----')
  410.         end
  411.         equip_set(player.status)
  412.     elseif command == 'refresh set' then
  413.         local needsArts =
  414.             player.sub_job:lower() == 'sch' and
  415.             not buffactive['Light Arts'] and
  416.             not buffactive['Addendum: White'] and
  417.             not buffactive['Dark Arts'] and
  418.             not buffactive['Addendum: Black']
  419.            
  420.         if not buffactive['Afflatus Solace'] and not buffactive['Afflatus Misery'] then
  421.             if needsArts then
  422.                 send_command('@input /ja "Afflatus Solace" <me>;wait 1.2;input /ja "Light Arts" <me>')
  423.             else
  424.                 send_command('@input /ja "Afflatus Solace" <me>')
  425.             end
  426.         end
  427.  
  428.         local kitingStatus = (Kiting and "On" or "Off")
  429.         send_command('@input /echo Idle Set: '..Idle_Set_Names[Idle_Index]..' || TP Set: '..TP_Set_Names[TP_Index]..' || Kite: '..kitingStatus )
  430.         equip_set(player.status)
  431.     end
  432. end
  433.  
  434. --I don't like this stuff in my gear swap. Uncomment if you do.
  435. -- function buff_change(buff,gain_or_loss)
  436. --     if gain_or_loss and buff == 'Silence' then
  437. --      send_command('@input /item "Echo Drops" <me>')
  438. --  elseif gain_or_loss and buff == 'Paralyze' then
  439. --      send_command('@input /item "Remedy" <me>')
  440. --     end
  441. -- end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top