Advertisement
Byrth

Byrth_SMN.lua

Dec 9th, 2013
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.60 KB | None | 0 0
  1. function get_sets()
  2.     -- Precast Sets
  3.     sets['precast_Elemental Siphon'] = {main="Soulscourge",sub="Vox Grip",
  4.         head="Marduk's Tiara +1",neck="Caller's Pendant",rear="Smn. Earring",
  5.         body="Call. Doublet +2",hands="Smn. Bracers +2",lring="Evoker's Ring",rring="Fervor Ring",
  6.         back="Conveyance Cape",legs="Mdk. Shalwar +1",feet="Caller's Pgch. +2"}
  7.    
  8.     sets['precast_Shock Squall'] = {main="Soulscourge",sub="Vox Grip",
  9.         head="Marduk's Tiara +1",neck="Caller's Pendant",rear="Smn. Earring",
  10.         body="Call. Doublet +2",hands="Smn. Bracers +2",lring="Evoker's Ring",rring="Fervor Ring",
  11.         back="Tiresias' cape",legs="Smn. Spats +2",feet="Smn. Pigaches +2"}
  12.    
  13.     sets.precast_BP = {hands="Smn. Bracers +2",back="Tiresias' cape",legs="Smn. Spats +2",feet="Smn. Pigaches +2"}
  14.    
  15.     sets['precast_Mana Cede'] = {hands="Call. Bracers +2"}
  16.    
  17.     sets.precast_FC = {head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Loquac. Earring",body="Marduk's Jubbah +1",
  18.         hands="Mdk. Dastanas +1",ring2="Prolix Ring",back="Swith Cape +1",waist="Siegel Sash",legs="Orvail Pants +1",
  19.         feet="Chelona Boots +1"}
  20.        
  21.     sets.precast_Cur = {body="Heka's Kalasiris",legs="Nabu's Shalwar",back="Pahtli Cape"}
  22.    
  23.     sets.precast_FC_Thunder = {main='Apamajas I'}
  24.     sets.precast_FC_Fire = {main='Atar I'}
  25.    
  26.     -- Midcast Sets
  27.     sets.BP_Base = {main="Balsam Staff",sub="Vox grip",ammo="Dashavatara Sachet",
  28.         head="Hagondes Hat",ear1="Gifted Earring",ear2="Smn. Earring",
  29.         body="Call. Doublet +2",hands="Spurrina Gages",ring1="Evoker's Ring",ring2="Fervor Ring",
  30.         legs="Ngen Seraweels",feet="Convoker's Pigaches"}
  31.    
  32.     sets.midcast_Phys_BP = set_combine(sets.BP_Base,{main="Soulscourge",head="Caller's horn +2",neck="Sacrifice torque",back="Conveyance Cape",waist="Mujin Obi"})
  33.        
  34.     sets.midcast_MAB_No_TP_BP = set_combine(sets.BP_Base,{neck="Eidolon Pendant",hands="Hagondes Cuffs",back="Tiresias' Cape",waist="Caller's sash",legs="Hagondes Pants",feet="Hagondes Sabots"})
  35.        
  36.     sets.midcast_MAB_TP_BP = set_combine(sets.BP_Base,{neck="Eidolon Pendant",hands="Hagondes Cuffs",back="Tiresias' Cape",waist="Caller's sash",legs="Caller's spats +2",feet="Hagondes Sabots"})
  37.        
  38.     sets.midcast_MAB_Spell = set_combine(sets.BP_Base,{neck="Eidolon Pendant",hands="Hagondes Cuffs",back="Tiresias' Cape",waist="Caller's sash",legs="Hagondes Pants",feet="Hagondes Sabots"})
  39.        
  40.     sets.midcast_MAcc_BP = set_combine(sets.BP_Base,{main="Yaskomo's Pole",neck="Caller's Pendant",body="Anhur Robe",hands="Smn. Bracers +2",back="Conveyance Cape",legs="Smn. spats +2",feet="Caller's Pgch. +2"})
  41.    
  42.     sets.midcast_Buff_BP = set_combine(sets.BP_Base,{head="Caller's Horn +2",neck="Caller's Pendant",hands="Smn. Bracers +2",back="Conveyance Cape",legs="Nares Trews"})
  43.                    
  44.     sets.midcast_Cur = {main="Arka IV",head="Marduk's Tiara +1",ear2="Novia earring",
  45.         body="Heka's Kalasiris"}
  46.        
  47.     sets.midcast_Stoneskin = {head="Marduk's Tiara +1",neck="Stone Gorget",body="Marduk's Jubbah +1",
  48.         hands="Marduk's Dastanas +1",waist="Siegel Sash",legs="Shedir Seraweels"}
  49.    
  50.    
  51.     --Aftercast Sets
  52.     sets.aftercast_None = {main="Terra's Staff",sub="Oneiros Grip",
  53.         head="Caller's Horn +2",neck="Twilight Torque",ear1="Loquac. Earring",ear2="Antivenom Earring",
  54.         body="Marduk's Jubbah +1",hands="Marduk's Dastanas +1",ring1="Dark Ring",ring2="Defending Ring",
  55.         back="Umbra Cape",waist="Hierarch belt",legs="Nares Trews",feet="Herald's Gaiters"}
  56.    
  57.     sets.aftercast_Favor = {main="Chatoyant Staff",sub="Vox grip",ammo="Dashavatara Sachet",
  58.         head="Caller's Horn +2",neck="Caller's Pendant",ear1="Loquac. Earring",ear2="Antivenom Earring",
  59.         body="Caller's Doublet +2",hands="Smn. Bracers +2",ring1="Evoker's Ring",ring2="Fervor Ring",
  60.         back="Conveyance Cape",waist="Hierarch belt",legs="Ngen Seraweels",feet="Rubeus Boots"}
  61.    
  62.     sets.aftercast_Perp_Base = {main="Chatoyant Staff",sub="Oneiros Grip",ammo="Dashavatara Sachet",
  63.         head="Caller's Horn +2",neck="Caller's Pendant",
  64.         body="Caller's Doublet +2",hands="Adhara Gages",ring1="Evoker's Ring",ring2="Defending Ring",
  65.         waist="Hierarch belt",legs="Nares Trews",feet="Caller's Pgch. +2"}
  66.    
  67.     sets.aftercast_Avatar_Carbuncle = {hands="Carbuncle Mitts"}
  68.    
  69.     sets.aftercast_Avatar_Diabolos = {waist="Diabolos's Rope"}
  70.    
  71.     sets.aftercast_Avatar_Spirit = {main="Soulscourge",sub="Vox grip",ammo="Dashavatara Sachet",
  72.         head="Caller's Horn +2",neck="Caller's Pendant",ear2="Smn. Earring",
  73.         body="Caller's Doublet +2",hands="Smn. Bracers +2",ring1="Evoker's Ring",ring2="Fervor Ring",
  74.         back="Conveyance Cape",legs="Smn. spats +2",feet="Rubeus Boots"}
  75.                
  76.     sets.aftercast_Resting = {main="Numen Staff",sub="Ariesian Grip",ammo="Mana Ampulla",
  77.         head="Caller's Horn +2",neck="Eidolon Pendant",ear1="Relaxing Earring",ear2="Antivenom Earring",
  78.         body="Marduk's Jubbah +1",hands="Nares Cuffs",ring1="Celestial Ring",ring2="Angha Ring",
  79.         back="Vita cape",waist="Austerity belt",legs="Nares Trews",feet="Oracle's Pigaches"}
  80.    
  81.     sets.aftercast_Idle = sets.aftercast_None
  82.    
  83.    
  84.     -- Variables and notes to myself
  85.     Debuff_BPs = T{'Diamond Storm','Sleepga','Slowga','Tidal Roar','Shock Squall','Nightmare','Pavor Nocturnus','Ultimate Terror','Somnolence','Lunar Cry','Lunar Roar'}
  86.     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
  87.     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'}
  88.     Additional_effect_BPs = T{'Rock Throw'}
  89.     send_command('input /macro book 8;wait .1;input /macro set 1')
  90. end
  91.  
  92. function precast(spell,action)
  93.     if spell.name:sub(1,3) == 'Bar' then
  94.         return
  95.     end
  96.     if tonumber(spell.casttime) > 5 then
  97.         verify_equip()
  98.     end
  99.     if action.type == 'Magic' then
  100.         equip(sets.precast_FC)
  101.         if string.find(spell.english,'Cur') then
  102.             equip(sets.precast_Cur)
  103.         end
  104.     elseif string.find(spell.type,'BloodPact') then
  105.         if buffactive['Astral Conduit'] then
  106.             midcast(spell,action)
  107.         else
  108.             equip(sets.precast_BP)
  109.         end
  110.     end
  111.    
  112.     if sets['precast_FC_'..tostring(spell.element)] then equip(sets['precast_FC_'..spell.element]) end
  113.     if sets['precast_'..spell.english] then equip(sets['precast_'..spell.english]) end
  114. end
  115.  
  116. function midcast(spell,action)
  117.     if spell.name:sub(1,3) == 'Bar' then
  118.         return
  119.     end
  120.     if string.find(spell.english,'Cur') then
  121.         equip(sets.midcast_Cur)
  122.     elseif spell.english=='Stoneskin' then
  123.         equip(sets.midcast_Stoneskin)
  124.     else -- Bloodpacts don't have a midcast, so don't worry about them.
  125.         idle()
  126.     end
  127. end
  128.  
  129. function aftercast(spell,action)
  130.     if spell.name and spell.name:sub(1,3) == 'Bar' then
  131.         return
  132.     end
  133.     if not spell.type or not string.find(spell.type,'BloodPact') then
  134.         -- Don't want to swap away too quickly if I'm about to put BP damage gear on
  135.         -- Need to wait 1 in order to allow pet information to update on Release.
  136.         send_command('@wait 1;gs c Idle')
  137.     end
  138. end
  139.  
  140. function status_change(new,action)
  141.     if new=='Idle' then
  142.         idle()
  143.     elseif new=='Resting' then
  144.         equip(sets['aftercast_Resting'])
  145.     end
  146. end
  147.  
  148. function pet_midcast(spell,action)
  149.     if spell.name == 'Perfect Defense' then
  150.         equip(sets['precast_Elemental Siphon'],{feet="Rubeus Boots"})
  151.     elseif spell.type=='BloodPactWard' then
  152.         if Debuff_BPs:contains(spell.name) then
  153.             equip(sets.midcast_MAcc_BP)
  154.         else
  155.             equip(sets.midcast_Buff_BP)
  156.         end
  157.     elseif spell.type=='BloodPactRage' then
  158.         if Magical_BPs_affected_by_TP:contains(spell.name) or string.find(spell.name,' II') or string.find(spell.name,' IV') then
  159.             if (spell.name == 'Heavenly Strike' and pet.TP > 120) or pet.TP > 280 then
  160.                 equip(sets.midcast_MAB_No_TP_BP)
  161.             else
  162.                 equip(sets.midcast_MAB_TP_BP)
  163.             end
  164.         elseif Magical_BPs_unaffected_by_TP:contains(spell.name) then
  165.             equip(sets.midcast_MAB_No_TP_BP)
  166.         elseif Additional_effect_BPs:contains(spell.name) then -- for BPs where the additional effect matters more than the damage
  167.             equip(sets.midcast_MAcc_BP)
  168.         else
  169.             equip(sets.midcast_Phys_BP)
  170.         end
  171.     elseif spell.type=='BlackMagic' then
  172.         equip(sets.midcast_MAB_Spell)
  173.     end
  174. end
  175.  
  176. function pet_aftercast(spell,action)
  177.     idle()
  178. end
  179.  
  180. function self_command(command)
  181.     if command == 'Idle' then
  182.         idle()
  183.     end
  184. end
  185.  
  186. function idle()
  187.     equip(sets.aftercast_None)
  188.     if pet.isvalid then
  189.         if string.find(pet.name,'Spirit') then
  190.             equip(sets.aftercast_Avatar_Spirit)
  191.         elseif buffactive["Avatar's Favor"] then
  192.             equip(sets.aftercast_Favor)
  193.         else
  194.             equip(sets.aftercast_Perp_Base)
  195.             if sets['aftercast_Avatar_'..pet.name] then
  196.                 equip(sets['aftercast_Avatar_'..pet.name])
  197.             end
  198.         end
  199.     end
  200. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement