Advertisement
Quixacotl

[LUA] FFXI SMN LUA

Jan 1st, 2014
846
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.59 KB | None | 0 0
  1. -- updated 1/02/2014.
  2.  
  3. function get_sets()
  4.     -- Precast Sets
  5.     sets.precast = {}
  6.     sets.precast['Shock Squall'] = {
  7.         main="Soulscourge",
  8.         sub="Vox grip",
  9.         ammo="Eminent Sachet",
  10.         head="Caller's horn +2",
  11.         neck="Caller's Pendant",
  12.         ear1="Caller's Earring",
  13.         ear2="Gifted Earring",
  14.         body="Call. Doublet +2",
  15.         hands="Call. Bracers +2",
  16.         ring1="Evoker's Ring",
  17.         ring2="Fervor Ring",
  18.         back="Astute Cape",
  19.         waist="Diabolos's Rope",
  20.         legs="Caller's Spats +2",
  21.         feet="Rubeus Boots"
  22.         }
  23.  
  24.     sets.precast.BP = {
  25.         main="Soulscourge",
  26.         sub="Vox grip",
  27.         ammo="Eminent Sachet",
  28.         head="Caller's horn +2",
  29.         neck="Caller's Pendant",
  30.         ear1="Caller's Earring",
  31.         ear2="Gifted Earring",
  32.         body="Call. Doublet +2",
  33.         hands="Call. Bracers +2",
  34.         ring1="Evoker's Ring",
  35.         ring2="Fervor Ring",
  36.         back="Tiresias' Cape",
  37.         waist="Diabolos's Rope",
  38.         legs="Caller's Spats +2",
  39.         feet="Rubeus Boots"
  40.         }
  41.  
  42.     sets.precast.Fastcast = {
  43.         sub="Arbuda Grip",
  44.         ammo="Hasty Pinion",
  45.         head="Nahtirah Hat",
  46.         hands="Gendewitha Gages",
  47.         legs="Bokwus Slops",
  48.         feet="Argute Loafers +2",
  49.         neck="Stoicheion Medal",
  50.         waist="Witful Belt",
  51.         left_ear="Loquac. Earring",
  52.         left_ring="Prolix Ring",
  53.         back="Swith Cape"
  54.         }
  55.  
  56.     sets.precast.SneakInvis = {back="Skulker's Cape"}
  57.  
  58.     sets.precast.Cure = {
  59.         main="Arka IV",
  60.         head="Caller's Horn +2",
  61.         ear2="Novia earring",
  62.         body="Heka's Kalasiris",
  63.         back="Pahtli Cape"
  64.         }
  65.  
  66.     -- Midcast Sets
  67.     sets.midcast = {}
  68.     sets.BP_Base = {
  69.         main="Soulscourge",
  70.         sub="Vox grip",
  71.         ammo="Eminent Sachet",
  72.         head="Caller's horn +2",
  73.         neck="Caller's Pendant",
  74.         ear1="Caller's Earring",
  75.         ear2="Gifted Earring",
  76.         body="Call. Doublet +2",
  77.         hands="Call. Bracers +2",
  78.         ring1="Evoker's Ring",
  79.         ring2="Fervor Ring",
  80.         back="Astute Cape",
  81.         waist="Diabolos's Rope",
  82.         legs="Caller's Spats +2",
  83.         feet="Caller's Pgch. +2"
  84.         }
  85.  
  86.     sets.midcast.Physical_BP = set_combine(sets.BP_Base,{
  87.         main="Soulscourge",
  88.         ammo="Eminent Sachet",
  89.         head="Caller's horn +2",
  90.         neck="Sacrifice torque",
  91.         back="Astute Cape",
  92.         waist="Mujin Obi"
  93.         })
  94.  
  95.     sets.midcast.MAB_No_TP_BP = set_combine(sets.BP_Base,{
  96.         main="Yaskomo's Pole",
  97.         ammo="Eminent Sachet",
  98.         head="Bokwus Circlet",
  99.         neck="Eidolon Pendant",
  100.         hands="Call. Bracers +2",
  101.         back="Tiresias' Cape",
  102.         waist="Caller's sash",
  103.         legs="Caller's Spats +2",
  104.         feet="Hagondes Sabots"
  105.         })
  106.  
  107.     sets.midcast.MAB_TP_BP = set_combine(sets.BP_Base,{
  108.         main="Yaskomo's Pole",
  109.         ammo="Eminent Sachet",
  110.         head="Bokwus Circlet",
  111.         neck="Eidolon Pendant",
  112.         hands="Call. Bracers +2",
  113.         back="Tiresias' Cape",
  114.         waist="Caller's sash",
  115.         legs="Caller's spats +2",
  116.         feet="Hagondes Sabots"
  117.         })
  118.  
  119.     sets.midcast.MAB_Spell = set_combine(sets.BP_Base,{
  120.         main="Yaskomo's Pole",
  121.         ammo="Eminent Sachet",
  122.         head="Bokwus Circlet",
  123.         neck="Eidolon Pendant",
  124.         hands="Call. Bracers +2",
  125.         back="Tiresias' Cape",
  126.         waist="Caller's sash",
  127.         legs="Caller's Spats +2",
  128.         feet="Hagondes Sabots"
  129.         })
  130.  
  131.     sets.midcast.MACC_BP = set_combine(sets.BP_Base,{
  132.         main="Yaskomo's Pole",
  133.         ammo="Eminent Sachet",
  134.         head="Bokwus Circlet",
  135.         neck="Caller's Pendant",
  136.         body="Anhur Robe",
  137.         hands="Smn. Bracers +2",
  138.         back="Tiresias' Cape",
  139.         legs="Smn. spats +2",
  140.         feet="Hagondes Sabots"
  141.         })
  142.  
  143.     sets.midcast.Buff_BP = set_combine(sets.BP_Base,{
  144.         main="Soulscourge",
  145.         head="Caller's Horn +2",
  146.         neck="Caller's Pendant",
  147.         hands="Smn. Bracers +2",
  148.         back="Astute Cape",
  149.         legs="Caller's Spats +2"
  150.         })
  151.  
  152.     sets.midcast.Cure = {
  153.         main="Arka IV",
  154.         head="Caller's Horn +2",
  155.         ear2="Novia earring",
  156.         body="Heka's Kalasiris",
  157.         back="Pahtli Cape",
  158.         legs="Caller's Spats +2"
  159.         }
  160.  
  161.     sets.midcast.SneakInvis = {back="Skulker's Cape"}
  162.  
  163.     sets.midcast.Stoneskin = {
  164.         head="Caller's Horn +2",
  165.         neck="Stone Gorget",
  166.         body="Call. Doublet +2",
  167.         hands="Call. Bracers +2",
  168.         waist="Siegel Sash",
  169.         legs="Caller's Spats +2"
  170.         }
  171.  
  172.     -- Status Sets
  173.     sets.Idle = {}
  174.     sets.Idle.PDT = {
  175.         main="Chatoyant Staff",
  176.         sub="Vox Grip",
  177.         ammo="Brigantia Pebble",
  178.         head="Hagondes Hat",
  179.         body="Hagondes Coat",
  180.         hands="Yaoyotl Gloves",
  181.         legs="Hagondes Pants",
  182.         feet="Hagondes Sabots",
  183.         neck="Twilight Torque",
  184.         waist="Slipor Sash",
  185.         left_ear="Moonshade Earring",
  186.         right_ear="Gifted Earring",
  187.         left_ring="Evoker's Ring",
  188.         right_ring="Paguroidea Ring",
  189.         back="Cheviot Cape"
  190.         }
  191.  
  192.     sets.Idle.Perpetuation = {
  193.         main="Chatoyant Staff",
  194.         sub="Vox Grip",
  195.         ammo="Eminent Sachet",
  196.         head="Caller's Horn +2",
  197.         neck="Caller's Pendant",
  198.         left_ear="Moonshade Earring",
  199.         right_ear="Gifted Earring",
  200.         body="Caller's Doublet +2",
  201.         hands="Call. Bracers +2",
  202.         ring1="Evoker's Ring",
  203.         ring2="Fervor Ring",
  204.         back="Astute Cape",
  205.         waist="Moepapa Stone",
  206.         legs="Caller's Spats +2",
  207.         feet="Caller's Pgch. +2"
  208.         }
  209.  
  210.     sets.Idle.Favor = {
  211.         main="Chatoyant Staff",
  212.         sub="Vox grip",
  213.         ammo="Eminent Sachet",
  214.         head="Caller's Horn +2",
  215.         neck="Caller's Pendant",
  216.         left_ear="Moonshade Earring",
  217.         right_ear="Gifted Earring",
  218.         body="Caller's Doublet +2",
  219.         hands="Call. Bracers +2",
  220.         ring1="Evoker's Ring",
  221.         ring2="Fervor Ring",
  222.         back="Astute Cape",
  223.         waist="Moepapa Stone",
  224.         legs="Caller's Spats +2",
  225.         feet="Rubeus Boots"
  226.         }
  227.  
  228.     sets.Resting = {
  229.         main="Chatoyant Staff",
  230.         sub="Ariesian Grip",
  231.         ammo="Clarus Stone",
  232.         body="Hagondes Coat",
  233.         hands="Yaoyotl Gloves",
  234.         legs="Sagacity Lappas",
  235.         feet="Hagondes Sabots",
  236.         neck="Eidolon Pendant",
  237.         waist="Austerity Belt",
  238.         left_ear="Moonshade Earring",
  239.         right_ear="Antivenom Earring",
  240.         left_ring="Evoker's Ring",
  241.         right_ring="Paguroidea Ring",
  242.         back="Cheviot Cape"
  243.         }
  244.  
  245.     sets.JA = {}
  246.     sets.JA['Mana Cede'] = {hands="Call. Bracers +2"}
  247.     sets.JA['Elemental Siphon'] = {
  248.         main="Soulscourge",
  249.         sub="Vox grip",
  250.         ammo="Eminent Sachet",
  251.         head="Caller's horn +2",
  252.         neck="Caller's Pendant",
  253.         ear1="Caller's Earring",
  254.         ear2="Gifted Earring",
  255.         body="Call. Doublet +2",
  256.         hands="Call. Bracers +2",
  257.         ring1="Evoker's Ring",
  258.         ring2="Fervor Ring",
  259.         back="Astute Cape",
  260.         waist="Diabolos's Rope",
  261.         legs="Caller's Spats +2",
  262.         feet="Rubeus Boots"
  263.         }
  264.  
  265.     -- Avatars
  266.     sets.Carbuncle = {main="Chatoyant Staff"}
  267.     sets.Ifrit = {main="Chatoyant Staff"}
  268.     sets.Titan = {main="Chatoyant Staff"}
  269.     sets.Leviathan = {main="Chatoyant Staff"}
  270.     sets.Shiva = {main="Chatoyant Staff"}
  271.     sets.Ramuh = {main="Chatoyant Staff"}
  272.     sets.Garuda = {main="Vayuvata III"}
  273.     sets.Fenrir = {main="Xsaeta III"}  
  274.     sets.Diabolos = {main="Xsaeta III",waist="Diabolos's Rope"}
  275.  
  276.     sets.LightSpirit = {main="Chatoyant Staff",back="Astute Cape"}
  277.     sets.FireSpirit = {main="Chatoyant Staff",back="Astute Cape"}
  278.     sets.EarthSpirit = {main="Chatoyant Staff",back="Astute Cape"}
  279.     sets.WaterSpirit = {main="Chatoyant Staff",back="Astute Cape"}
  280.     sets.IceSpirit = {main="Chatoyant Staff",back="Astute Cape"}
  281.     sets.ThunderSpirit = {main="Chatoyant Staff",back="Astute Cape"}
  282.     sets.AirSpirit = {main="Vayuvata III",back="Astute Cape"}
  283.     sets.DarkSpirit = {main="Xsaeta III",back="Astute Cape"}
  284.  
  285.     -- Variables and notes to myself
  286.     -- Set to allow us to determine if we're in a city zone.
  287.     -- Eventually may add other types of zone groups.
  288.     areas = {}
  289.     areas.Cities = S{"ru'lude gardens", 'upper jeuno','lower jeuno','port jeuno',
  290.         'port windurst','windurst waters','windurst woods','windurst walls','heavens tower',
  291.         "port san s'oria","northern san s'oria","southern san s'oria",
  292.         'port bastok','bastok markets','bastok mines','metalworks',
  293.         'aht urhgan whitegate','tavanazian safehold','nashmau',
  294.         'selbina','mhaura','norg','eastern adoulin','western adoulin'}
  295.  
  296.     Return_Spells = T{'Arts','Bar','Raise','Raise II','Release','Tractor','Warp','Warp II'} -- We don't need to blink when casting these spells.
  297.  
  298.     Debuff_BPs = T{'Diamond Storm','Sleepga','Slowga','Tidal Roar','Shock Squall','Nightmare','Pavor Nocturnus','Ultimate Terror','Somnolence','Lunar Cry','Lunar Roar'}
  299.     Magical_BPs_affected_by_TP = T{'Heavenly Strike','Wind Blade','Holy Mist','Night Terror','Thunderstorm','Geocrush','Meteor Strike','Grand Fall','Lunar Bay','Thunderspark'} -- Unsure if Thunderspark is affected by TP
  300.     Magical_BPs_unaffected_by_TP = T{'Nether Blast','Aerial Blast','Searing Light','Diamond Dust','Earthen Fury','Zantetsuken','Tidal Wave','Judgment Bolt','Inferno','Howling Moon','Ruinous Omen','Flaming Crush'}
  301.     Additional_effect_BPs = T{'Rock Throw'}
  302.  
  303.     send_command('input /macro book 15;wait .1;input /macro set 1')
  304. end
  305.  
  306. function precast(spell,action)
  307.     if Return_Spells:contains(spell.name) or string.find(spell.english,'Teleport') then
  308.         return
  309.     end
  310.  
  311.     if sets.JA[spell.english] then
  312.         equip(sets.JA[spell.english])
  313.     end
  314.  
  315.     if tonumber(spell.casttime) > 5 then
  316.         verify_equip()
  317.     end
  318.  
  319.     if action.type == 'Magic' then
  320.         if string.find(spell.english,'Cur') then
  321.                 equip(sets.precast.Cure)
  322.         elseif string.find(spell.type,'BloodPact') then
  323.             if buffactive['Astral Conduit'] then
  324.                 midcast(spell,action)
  325.             else
  326.                 equip(sets.precast.BP)
  327.             end
  328.         elseif spell.type == 'SummonerPact' then
  329.             equip(sets.precast.BP)
  330.         end
  331.         else
  332.             equip(sets.precast.Fastcast)
  333.             if spell.english == 'Sneak' or spell.english == 'Invisible' then
  334.                 equip(sets.precast.SneakInvis)
  335.             end
  336.     end
  337. end
  338.  
  339.  
  340. function midcast(spell,action)
  341.     if spell.type == 'SummonerPact' then
  342.         equip(sets.precast.BP)
  343.     elseif spell.name:sub(1,3) == 'Bar' then
  344.         return
  345.     elseif string.find(spell.english,'Cur') then
  346.         equip(sets.midcast.Cure)
  347.     elseif spell.english=='Stoneskin' then
  348.         equip(sets.midcast.Stoneskin)
  349.     elseif spell.english == 'Sneak' or spell.english == 'Invisible' then
  350.         equip(sets.midcast.SneakInvis)
  351.     else -- Bloodpacts don't have a midcast, so don't worry about them.
  352.         idle()
  353.     end
  354. end
  355.  
  356. function aftercast(spell,action)
  357.     if spell.name and spell.name:sub(1,3) == 'Bar' then
  358.         return
  359.     end
  360.  
  361.     if not spell.type or not string.find(spell.type,'BloodPact') then
  362.         -- Don't want to swap away too quickly if I'm about to put BP damage gear on
  363.         -- Need to wait 1 in order to allow pet information to update on Release.
  364.         send_command('@wait 1;gs c Idle')
  365.     end
  366.  
  367. end
  368.  
  369. function status_change(new,action)
  370.     if new=='Idle' then
  371.         idle()
  372.     elseif new=='Resting' then
  373.         equip(sets.Resting)
  374.     end
  375. end
  376.  
  377. function pet_midcast(spell,action)
  378.     if spell.name == 'Perfect Defense' then
  379.         equip(sets['precast_Elemental Siphon'],{feet="Rubeus Boots"})
  380.     elseif spell.type=='BloodPactWard' then
  381.         if Debuff_BPs:contains(spell.name) then
  382.             equip(sets.midcast.MACC_BP)
  383.         else
  384.             equip(sets.midcast.Buff_BP)
  385.         end
  386.     elseif spell.type=='BloodPactRage' then
  387.         if Magical_BPs_affected_by_TP:contains(spell.name) or string.find(spell.name,' II') or string.find(spell.name,' IV') then
  388.             if (spell.name == 'Heavenly Strike' and pet.TP > 120) or pet.TP > 280 then
  389.                 equip(sets.midcast.MAB_No_TP_BP)
  390.             else
  391.                 equip(sets.midcast.MAB_TP_BP)
  392.  
  393.             end
  394.         elseif Magical_BPs_unaffected_by_TP:contains(spell.name) then
  395.             equip(sets.midcast.MAB_No_TP_BP)
  396.         elseif Additional_effect_BPs:contains(spell.name) then -- for BPs where the additional effect matters more than the damage
  397.             equip(sets.midcast.MACC_BP)
  398.         else
  399.             equip(sets.midcast.Physical_BP)
  400.         end
  401.     elseif spell.type=='BlackMagic' then
  402.         equip(sets.midcast.MAB_Spell)
  403.     elseif spell.skill == 'EnhancingMagic' then
  404.         equip(sets.midcast.Buff_BP)
  405.     end
  406. end
  407.  
  408. function pet_aftercast(spell,action)
  409.     idle()
  410. end
  411.  
  412. function self_command(command)
  413.     if command == 'Idle' then
  414.         idle()
  415.     end
  416. end
  417.  
  418. function idle()
  419.     equip(sets.Idle.PDT)
  420.     if pet.isvalid then
  421.         if buffactive["Avatar's Favor"] then
  422.             equip(sets.Idle.Favor,sets[pet.name])
  423.         else
  424.             equip(sets.Idle.Perpetuation,sets[pet.name])
  425.         end
  426.     end
  427. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement