Advertisement
Quixacotl

[LUA] FFXI WHM LUA

Aug 24th, 2014
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.40 KB | None | 0 0
  1. -- updated 8/21/2014 by Quixacotl. --
  2.  
  3. function get_sets()
  4.     ------------------
  5.     -- Precast Sets --
  6.     ------------------
  7.  
  8.     sets.precast = {}
  9.  
  10.     sets.precast.FC = {ammo="Incantor Stone",
  11.         head="Nahtirah Hat", neck="Orison Locket",
  12.         ear2="Loquac. Earring",
  13.         body="Vanir Cotehardie", hands="Gendewitha Gages",
  14.         ring1="Prolix Ring",
  15.         back="Swith Cape", waist="Goading Belt",
  16.         legs="Orvail Pants +1",feet="Chelona Boots +1"}
  17.  
  18.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC,
  19.         {waist="Siegel Sash"})
  20.  
  21.     sets.precast.FC.Stoneskin = set_combine(sets.precast.FC['Enhancing Magic'],
  22.         {head="Umuthi Hat"})
  23.  
  24.     sets.precast.FC['Healing Magic'] = set_combine(sets.precast.FC,
  25.         {legs="Orsn. Pantaln. +2"})
  26.  
  27.     sets.precast.FC.StatusRemoval = sets.precast.FC['Healing Magic']
  28.  
  29.     sets.precast.FC.Cure = set_combine(sets.precast.FC['Healing Magic'],
  30.         {main="Arka IV",sub="Achaq Grip",ammo="Impatiens"})
  31.  
  32.     sets.precast.FC.Curaga = sets.precast.FC.Cure
  33.  
  34.     sets.precast.SneakInvis = {back="Skulker's Cape"}
  35.  
  36.  
  37.     ------------------
  38.     -- Midcast Sets --
  39.     ------------------
  40.  
  41.     sets.midcast = {}
  42.  
  43.     sets.midcast.Cure = {main="Arka IV",
  44.         sub="Achaq Grip", ammo="Incantor Stone",
  45.         head="Orison Cap +2", neck="Orison Locket",
  46.         ear1="Lifestorm Earring",ear2="Orison Earring",
  47.         body="Orison Bliaud +2", hands="Theophany Mitts",
  48.         ring1="Prolix Ring",ring2="Sirona's Ring",
  49.         back="Orison Cape", waist="Goading Belt",
  50.         legs="Orison Pantaloons +2",feet="Theo. Duckbills"}
  51.  
  52.     sets.midcast.Curaga = sets.midcast.Cure
  53.  
  54.     sets.midcast['Enhancing Magic'] = {
  55.         head="Umuthi Hat", neck="Colossus's Torque",
  56.         body="Manasa Chasuble", hands="Dynasty Mitts",
  57.         back="Mending Cape", waist="Olympus Sash",
  58.         legs="Piety Pantaloons",feet="Orison Duckbills +2"}
  59.  
  60.     sets.midcast.Protectra = {
  61.         ring1="Prolix Ring", ring2="Sheltered Ring",
  62.         legs="Piety Pantaloons", feet="Piety Duckbills"}
  63.  
  64.     sets.midcast.Shellra = {
  65.         ring1="Prolix Ring", ring2="Sheltered Ring",
  66.         legs="Piety Pantaloons", feet="Piety Duckbills"}
  67.  
  68.     sets.midcast.Stoneskin = {waist="Siegel Sash"}
  69.  
  70.     sets.midcast.Cursna = {
  71.         head="Orison Cap +2", neck="Malison Medallion",
  72.         body="Orison Bliaud +2", hands="Hieros Mittens",
  73.         ring1="Ephedra Ring",ring2="Sirona's Ring",
  74.         back="Mending Cape",waist="Goading Belt",
  75.         legs="Theophany Pantaloons",feet="Gendewitha Galoshes"}
  76.  
  77.     sets.midcast.StatusRemoval = {
  78.         head="Orison Cap +2",legs="Orison Pantaloons +2"}
  79.  
  80.     sets.midcast.Auspice = {hands="Dynasty Mitts",feet="Orison Duckbills +2"}
  81.  
  82.     sets.midcast.BarSpell = {
  83.         head="Orison Cap +2", neck="Colossus's Torque",
  84.         body="Orison Bliaud +2", hands="Orison Mitts +2",
  85.         back="Mending Cape", waist="Olympus Sash",
  86.         legs="Piety Pantaloons",feet="Orison Duckbills +2"}
  87.  
  88.     sets.midcast.Regen = {
  89.         main="Bolelabunga", sub="Genbu's Shield",
  90.         body="Piety Briault", hands="Orison Mitts +2",
  91.         legs="Theophany Pantaloons"}
  92.  
  93.     sets.midcast['Divine Magic'] = {
  94.         main="Bolelabunga", sub="Genbu's Shield",
  95.         head="Buremte Hat", neck="Colossus's Torque",
  96.         ear1="Psystorm Earring", ear2="Lifestorm Earring",
  97.         body="Vanir Cotehardie", hands="Yaoyotl Gloves",
  98.         ring2="Sangoma Ring",
  99.         back="Refraction Cape", waist="Goading Belt",
  100.         legs="Theophany Pantaloons",feet="Gendewitha Galoshes"}
  101.  
  102.     sets.midcast['Dark Magic'] = {
  103.         main="Bolelabunga", sub="Genbu's Shield",
  104.         head="Buremte Hat", neck="Aesir Torque",
  105.         ear1="Psystorm Earring", ear2="Lifestorm Earring",
  106.         body="Vanir Cotehardie", hands="Yaoyotl Gloves",
  107.         ring1="Strendu Ring", ring2="Sangoma Ring",
  108.         back="Refraction Cape", waist="Demonry Sash",
  109.         legs="Bokwus Slops",feet="Piety Duckbills"}
  110.  
  111.     sets.midcast['Enfeebling Magic'] = {
  112.         head="Buremte Hat", neck="Weike Torque",
  113.         ear1="Psystorm Earring",ear2="Lifestorm Earring",
  114.         body="Vanir Cotehardie", hands="Yaoyotl Gloves",
  115.         ring1="Aquasoul Ring", ring2="Sangoma Ring",
  116.         back="Refraction Cape", waist="Demonry Sash",
  117.         legs="Bokwus Slops",feet="Piety Duckbills"}
  118.  
  119.  
  120.     ----------------------
  121.     -- Status Gear Sets --
  122.     ----------------------
  123.  
  124.     sets.Idle = {main="Bolelabunga",
  125.         sub="Genbu's Shield", ammo="Incantor Stone",
  126.         head="Buremte Hat", neck="Wiglen Gorget",
  127.         ear1="Lifestorm Earring", ear2="Orison Earring",
  128.         body="Orison Bliaud +2", hands="Theophany Mitts",
  129.         ring1="Paguroidea Ring", ring2="Sheltered Ring",
  130.         back="Trepidity Mantle", waist="Siegel Sash",
  131.         legs="Piety Pantaloons", feet="Manabyss Pigaches"}
  132.  
  133.     sets.Idle.Town = {main="Bolelabunga",
  134.         sub="Genbu's Shield", ammo="Incantor Stone",
  135.         head="Buremte Hat", neck="Wiglen Gorget",
  136.         ear1="Lifestorm Earring", ear2="Orison Earring",
  137.         body="Orison Bliaud +2", hands="Theophany Mitts",
  138.         ring1="Paguroidea Ring", ring2="Sheltered Ring",
  139.         back="Trepidity Mantle", waist="Siegel Sash",
  140.         legs="Piety Pantaloons", feet="Manabyss Pigaches"}
  141.  
  142.     sets.Resting = {main="Iridal Staff",
  143.         sub="Achaq Grip", ammo="Clarus Stone",
  144.         head="Buremte Hat",
  145.         ear2="Antivenom Earring",
  146.         neck="Eidolon Pendant",
  147.         body="Gendewitha Bliaut", hands="Serpentes Cuffs",
  148.         waist="Austerity Belt",
  149.         legs="Nares Trews", feet="Chelona Boots"}
  150.  
  151.     sets.Engaged = {ammo="Incantor Stone",
  152.         head="Buremte Hat", neck="Wiglen Gorget",
  153.         ear1="Lifestorm Earring", ear2="Orison Earring",
  154.         body="Orison Bliaud +2", hands="Theophany Mitts",
  155.         ring1="Paguroidea Ring", ring2="Sheltered Ring",
  156.         back="Trepidity Mantle", waist="Siegel Sash",
  157.         legs="Piety Pantaloons", feet="Manabyss Pigaches"}
  158.  
  159.     ----------------------
  160.     -- Weaponskill sets --
  161.     ----------------------
  162.  
  163.     sets.WS = {}
  164.     sets.WS['Spirit Taker'] = set_combine(sets.Engaged,{
  165.         neck="Aife's Medal",
  166.         back="Pahtli Cape",
  167.         waist="Kuku Stone",
  168.         })
  169.  
  170.     sets.WS['Retribution'] = sets.WS['Spirit Taker']
  171.     sets.WS['Shattersoul'] = sets.WS['Spirit Taker']
  172.     sets.WS['Myrkr'] = sets.WS['Spirit Taker']
  173.     sets.WS['Realmrazer'] = sets.WS['Spirit Taker']
  174.     sets.WS['Mystic Boon'] = sets.WS['Spirit Taker']
  175.     sets.WS['Dagan'] = sets.WS['Spirit Taker']
  176.     sets.WS['Hexa Strike'] = sets.WS['Spirit Taker']
  177.     sets.WS['Black Halo'] = sets.WS['Spirit Taker']
  178.  
  179.     ---------------------------------
  180.     -- Precast sets to enhance JAs --
  181.     ---------------------------------
  182.  
  183.     sets.JA = {}
  184.     sets.JA['Benediction'] = {body="Piety Briault"}
  185.  
  186.     -----------------------------------
  187.     -- Variables and notes to myself --
  188.     -----------------------------------
  189.  
  190.     BarSpells = S{"Barstonra", "Barwatera", "Baraera", "Barfira", "Barblizzara", "Barthundra", "Barstone", "Barwater", "Baraero", "Barfire", "Barblizzard", "Barthunder"}
  191.  
  192.     NaSpells = S{"Esuna", "Paralyna", "Silena", "Viruna", "Erase", "Stona", "Blindna", "Poisona"}
  193.  
  194.     NoBlink = S{"Escape", "Retrace", "Warp", "Warp II", "Teleport-Altep", "Teleport-Dem", "Teleport-Mea", "Teleport-Holla", "Teleport-Vahzl", "Teleport-Yhoat", "Recall-Jugner", "Recall-Meriph", "Recall-Pashh"}
  195.  
  196.  
  197.     -- City areas for town gear and behavior.
  198.     areas = {}
  199.     areas.Cities = S{
  200.         "Eastern Adoulin", "Western Adoulin",
  201.         "Ru'Lude Gardens", "Upper Jeuno", "Lower Jeuno", "Port Jeuno",
  202.         "Port Windurst", "Windurst Waters", "Windurst Woods",
  203.         "Windurst Walls", "Heavens Tower",
  204.         "Port San d'Oria", "Northern San d'Oria", "Southern San d'Oria",
  205.         "Port Bastok", "Bastok Markets",
  206.         "Bastok Mines", "Metalworks",
  207.         "Aht Urhgan Whitegate",
  208.         "Tavanazian Safehold",
  209.         "Nashmau", "Selbina",
  210.         "Mhaura", "Norg", "Kazham"}
  211.  
  212.     send_command('input /macro book 1;wait .1;input /macro set 2')
  213. end
  214.  
  215.  
  216. function precast(spell)
  217.     if NoBlink:contains(spell.name) then
  218.         return
  219.     elseif spell.name == 'Sneak' or spell.name == 'Invisible' and spell.target.name == player.name then
  220.         equip(sets.precast.SneakInvis)
  221.     elseif spell.english == "Stoneskin" then
  222.         equip(sets.precast.FC.Stoneskin)
  223.     elseif sets.precast[spell.name] then
  224.         equip(sets.precast[spell.name])
  225.     elseif spell.name:startswith('Cure') then
  226.         equip(sets.precast.FC.Cure)
  227.     elseif spell.name:startswith('Curaga') then
  228.         equip(sets.precast.FC.Curaga)
  229.     elseif sets.JA[spell.name] then
  230.         equip(sets.JA[spell.name])
  231.     elseif sets.WS[spell.name] then
  232.         equip(sets.WS[spell.name])
  233.     elseif spell.type == "WeaponSkill" then
  234.         equip(sets.WS)
  235.     elseif spell.skill == "Enhancing Magic" then
  236.         equip(sets.precast.FC['Enhancing Magic'])
  237.     elseif spell.skill == "Healing Magic" then
  238.         equip(sets.precast.FC['Healing Magic'])
  239.     else
  240.         equip(sets.precast.FC)
  241.     end
  242. end
  243.  
  244. function midcast(spell)
  245.     -- if sets.midcast[spell.name] then
  246.         -- equip(sets.midcast[spell.name])
  247.     if spell.skill == "Healing Magic" then
  248.         -- add_to_chat(8,'--------- Healing Magic ---------') -- for debugging
  249.         if spell.name:startswith('Cure') then
  250.             equip(sets.midcast.Cure)
  251.         elseif spell.name:startswith('Curaga') then
  252.             equip(sets.midcast.Curaga)
  253.         elseif spell.name == "Cursna" then
  254.             equip(sets.midcast.Cursna)
  255.         elseif NaSpells:contains(spell.name) then
  256.             equip(sets.midcast.StatusRemoval)
  257.         end
  258.     elseif spell.skill == "Enhancing Magic" then
  259.         -- add_to_chat(8,'--------- Enhancing Magic ---------') -- for debugging
  260.         if spell.english == 'Sneak' and spell.target.name == player.name then
  261.             send_command('cancel 71')
  262.         elseif spell.english == 'Blink' then
  263.             send_command('cancel 36')
  264.         elseif spell.english == "Auspice" then
  265.             equip(sets.midcast.Auspice)
  266.         elseif spell.english == "Stoneskin" then
  267.             equip(sets.midcast.Stoneskin)
  268.         elseif spell.english == "Erase" then
  269.             equip(sets.midcast.StatusRemoval)
  270.         elseif BarSpells:contains(spell.name) then
  271.             equip(sets.midcast.BarSpell)
  272.         elseif spell.name:startswith('Regen') then
  273.             equip(sets.midcast.Regen)
  274.         elseif spell.name:startswith('Protect') then
  275.             equip(sets.midcast.Protectra)
  276.         elseif spell.name:startswith('Shell') then
  277.             equip(sets.midcast.Shellra)
  278.         elseif NoBlink:contains(spell.name) then
  279.             return
  280.         else
  281.             equip(sets.midcast['Enhancing Magic'])
  282.         end
  283.         elseif sets.midcast[spell.skill] then
  284.                 equip(sets.midcast[spell.skill])
  285.         end
  286. end
  287.  
  288. function aftercast(spell)
  289.     update_gear()
  290. end
  291.  
  292. function status_change(new,old)
  293.     update_gear()
  294. end
  295.  
  296. function self_command(command)
  297.     if command:lower() == 'toggle' then
  298.         update_gear()
  299.     end
  300. end
  301.  
  302. function update_gear()
  303.     if player.status == 'Engaged' then
  304.         equip(sets.Engaged)
  305.     elseif player.status == 'Idle' then
  306.         if areas.Cities:contains(world.area) then
  307.             add_to_chat(8,'----- You are at '..world.area..'. Town gear equipped! -----')
  308.             equip(sets.Idle.Town)
  309.         else
  310.             send_command('input /lockstyle on')
  311.             equip(sets.Idle)
  312.         end
  313.     else
  314.         equip(sets.Resting)
  315.     end
  316. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement