usnapoleon

smn for review

Mar 25th, 2015
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.94 KB | None | 0 0
  1. function get_sets()
  2. --  hagondes_head_atk = {name='Hagondes Hat +1', augments={'Phys. dmg. taken -4%', 'Pet: Attack+23 Pet: Rng.Atk.+23'}}
  3. --  hagondes_head_macc = {name='Hagondes Hat', augments={'Phys. dmg. taken -3%', 'Pet: Mag. Acc.+24'}}
  4. --  hagondes_body_perp = {name='Hagondes Coat +1', augments={'Phys. dmg. taken -3%', '"Avatar perpetuation cost" -5'}}
  5. --  hagondes_body_macc = {name='Hagondes Coat', augments={'Phys. dmg. taken -3%', 'Pet: Mag. Acc.+25'}}
  6. --  hagondes_hands_mab = {name='Hagondes Cuffs', augments={'Phys. dmg. taken -3%', 'Pet: "Mag.Atk.Bns."+25'}}
  7. --  hagondes_hands_macc = {name='Hagondes Cuffs +1', augments={'Phys. dmg. taken -4%', 'Magic dmg. taken -3%', 'Pet: Mag. Acc.+23'}}
  8. --  hagondes_hands_fc = {name='Hagondes Cuffs', augments={'Phys. dmg. taken -3%', '"Fast Cast"+4'}}
  9. --  hagondes_legs_mab = {name='Hagondes Pants', augments={'Phys. dmg. taken -3%', 'Pet: "Mag.Atk.Bns."+25'}}
  10. --  hagondes_legs_macc = {name='Hagondes Pants +1', augments={'Phys. dmg. taken -3%', 'Magic dmg. taken -2%', 'Pet: Mag. Acc.+23'}}
  11. --  hagondes_feet_mab = {name='Hag. Sabots +1', augments={'Phys. dmg. taken -3%', 'Pet: "Mag.Atk.Bns."+23'}}
  12. --  hagondes_feet_macc = {name='Hagondes Sabots', augments={'Phys. dmg. taken -3%', 'Pet: Mag. Acc.+23'}}
  13.  
  14.     sets.precast = {}
  15.     sets.midcast = {}
  16.     sets.aftercast = {}
  17.     sets.avatar = {}
  18.  
  19. ------------------------------------------
  20.     -- WS sets
  21.     -- So it's easy to determine if new obtained gear can replace anything, listed str/mnd/int stats per piece 
  22. -------------------------------------------
  23.     sets.precast.WSStr = {
  24.         ammo="Flame Sachet", --2/0/0
  25.         head="Sukeroku Hachi.", --25/20/20
  26.         neck="Asperity Necklace",
  27.         lear="Bladeborn Earring",
  28.         rear="Steelflash Earring",
  29.         body="Artsieq Jubbah", --21/29/29
  30.         hands="Otomi Gloves", --11/38/19
  31.         lring="K'ayres Ring",
  32.         rring="Rajas Ring", --5/0/0
  33.         back="Potentia Cape", --6/0/6
  34.         waist="Goading Belt",
  35.         legs="Hagondes Pants +1", --25/24/34
  36.         feet="Hagondes Sabots"} --10/24/22
  37.    
  38.     sets.precast.WSStrMnd = set_combine(sets.precast.WSStr, {
  39.         ammo="Mana Ampulla", --0/0/4
  40.         lring="Diamond Ring" }) --0/4/4
  41.        
  42.     sets.precast.WSStrInt = set_combine(sets.precast.WSStr, {
  43.         hands="Yaoyotl Gloves", --6/33/19
  44.         lring="Sprial Ring", --5/0/5
  45.         waist="Wanion Belt"}) --8/(5)/8
  46.        
  47.     sets.precast.WSMnd = {
  48.         ammo="Mana Ampulla", --0/0/4
  49.         head="Sukeroku Hachi.", --25/20/20
  50.         body="Artsieq Jubbah", --21/29/29
  51.         hands="Otomi Gloves", --11/38/19
  52.         lring="Sprial Ring", --5/0/5
  53.         back="Pahtli Cape", --6/0/6
  54.         waist="Wanion Belt", --8/(5)/8
  55.         legs="Hagondes Pants +1", --25/24/34
  56.         feet="Hagondes Sabots"} --10/24/22
  57.        
  58. -------------------------------------------
  59.     -- Fastcast sets:  
  60. -------------------------------------------
  61.     sets.precast.Fastcast = {
  62.         ammo="Impatiens",
  63.         head="Nahtirah Hat",
  64.         neck="Twilight Torque",
  65.         lear="Loquac. Earring",
  66.         rear="Enchntr. Earring +1",
  67.         body="Artsieq Jubbah",
  68.         hands="Hagondes Cuffs",
  69.         lring="Dark Ring",
  70.         rring="Defending Ring",
  71.         back="Shadow Mantle",
  72.         waist="Goading Belt",
  73.         legs="Artsieq Hose",
  74.         feet="Augur's Gaiters"}
  75.  
  76.     sets.precast.HasteEnhancing = set_combine(sets.precast.Fastcast, {
  77.         waist="Siegel Sash"})
  78.    
  79.     sets.precast.HasteStoneskin = set_combine(sets.precast.HasteEnhancing, {
  80.         head="Umuthi Hat",
  81.         hands="Carapacho Cuffs"})
  82.    
  83.     sets.precast.HasteHealing = set_combine(sets.precast.Fastcast, {
  84.         main="Tamaxchi",
  85.         sub="Genbu's Shield",
  86.         body="Heka's Kalasiris",
  87.         back="Pahtli Cape"})
  88.    
  89.     sets.precast.HasteElemental = set_combine(sets.precast.Fastcast, {
  90.         main="Boonwell Staff",
  91.         sub="Zuuxowu Grip",
  92.         neck="Stoicheion Medal"})
  93.    
  94.     sets.precast.HasteSummoning = set_combine(sets.precast.Fastcast, {
  95.         hands="Carbuncle's Cuffs"})
  96.  
  97. -------------------------------------------
  98.     -- Spell (precast) Avatar-related sets:  
  99. -------------------------------------------        
  100.     sets.precast['Blood Pact'] = {
  101.         ammo="Seraphicaller",
  102.         head="Con. Horn +1",
  103.         lear="Caller's Earring",
  104.         body="Glyphic Doublet",
  105.         hands="Glyphic Bracers +1",
  106.         back="Conveyance Cape",
  107.         legs="Glyphic Spats",
  108.         feet="Glyph. Pigaches +1"} -- delay I: -8-1-6-5=-20 (15 max); delay II: -5-1-1=-7
  109.        
  110. -------------------------------------------
  111.     -- Spell (midcast) sets:  
  112. -------------------------------------------
  113.     sets.midcast['Elemental Magic'] = {
  114.         main="Boonwell Staff",
  115.         sub="Zuuxowu Grip",
  116.         ammo="Dosis Tathlum",
  117.         head="Hagondes Hat +1",
  118.         neck="Eddy Necklace",
  119.         lear="Friomisi Earring",
  120.         rear="Crematio Earring",
  121.         body="Artsieq Jubbah",
  122.         hands="Otomi Gloves",
  123.         lring="Strendu Ring",
  124.         rring="Acumen Ring",
  125.         back="Toro Cape",
  126.         waist="Sekhmet Corset",
  127.         legs="Hagondes Pants +1",
  128.         feet="Umbani Boots"}
  129.        
  130.     sets.midcast.Stone = set_combine(sets.midcast['Elemental Magic'], {
  131.         neck="Quanpur Necklace"})
  132.        
  133.     sets.midcast['Dark Magic'] = set_combine(sets.midcast['Elemental Magic'], {
  134.         ammo="Ombre Tathlum +1",
  135.         legs="Portent Pants"})
  136.        
  137.     sets.midcast['Enfeebling Magic'] = {
  138.         main="Boonwell Staff",
  139.         sub="Zuuxowu Grip",
  140.         ammo="Ombre Tathlum +1",
  141.         head="Buremte Hat",
  142.         neck="Eddy Necklace",
  143.         lear="Gifted Earring",
  144.         rear="Enchntr. Earring +1",
  145.         body="Artsieq Jubbah",
  146.         hands="Lurid Mitts",
  147.         lring="Globidonta Ring",
  148.         rring="Strendu Ring",
  149.         back="Shadow Mantle",
  150.         waist="Yamabuki-no-Obi",
  151.         legs="Portent Pants",
  152.         feet="Rubeus Boots"}
  153.    
  154.     sets.midcast['Enhancing Magic'] = {
  155.         main="Bolelabunga",
  156.         sub="Genbu's Shield",
  157.         ammo="Impatiens",
  158.         head="Umuthi Hat",
  159.         neck="Twilight Torque",
  160.         lear="Gifted Earring",
  161.         rear="Enchntr. Earring +1",
  162.         body="Artsieq Jubbah",
  163.         hands="Augur's Gloves",
  164.         lring="Globidonta Ring",
  165.         rring="Sirona's Ring",
  166.         back="Pahtli Cape",
  167.         waist="Siegel Sash",
  168.         legs="Portent Pants",
  169.         feet="Rubeus Boots"}
  170.        
  171.     sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {
  172.         neck="Stone Gorget",
  173.         waist="Siegel Sash",
  174.         legs="Haven Hose"})
  175.        
  176.     sets.midcast['Healing Magic'] = {
  177.         --55% potency
  178.         -- commented stats are potency/skill/mnd (ignoring vitality)
  179.         main="Tamaxchi", --22/0/5
  180.         sub="Genbu's Shield", --4/0/0
  181.         ammo="Mana Ampulla", --0/0/3
  182.         head="Nahtirah Hat", --0/0/24
  183.         neck="Phalaina Locket", --4/0/3
  184.         lear="Gifted Earring",
  185.         rear="Enchntr. Earring +1",
  186.         body="Heka's Kalasiris", --15/0/17
  187.         hands="Hagondes Cuffs", --0/0/26
  188.         lring="Sirona's Ring", --0/10/3
  189.         rring="Ephedra Ring", --0/7/0
  190.         back="Oretania's Cape", --4/0/0
  191.         waist="Korin Obi", --0/0/5
  192.         legs="Nares Trews", --7/0/14
  193.         feet="Rubeus Boots"} --0/10/0
  194.    
  195.     sets.midcast.ProtectShell = set_combine(sets.midcast['Healing Magic'], {
  196.         lring="Sheltered Ring"})
  197.        
  198.     sets.midcast.Cursna = set_combine(sets.precast.Fastcast, {
  199.         lring="Sirona's Ring", --0/10/3
  200.         rring="Ephedra Ring", --0/7/0
  201.         feet="Rubeus Boots"}) --0/10/0
  202.        
  203.     sets.midcast['Divine Magic'] = set_combine(sets.midcast['Healing Magic'], {
  204.         ammo="Ombre Tathlum +1",
  205.         lring="Globidonta Ring"})
  206.    
  207.     sets.midcast['Summoning Magic'] = set_combine(sets.precast.HasteSummoning, {
  208.         lring="Prolix Ring",
  209.         waist="Witful Belt"})
  210.  
  211. -------------------------------------------
  212.     -- Spell (aftercast) Avatar-related sets:
  213.     -- These is the gear for Bloodpacts.  
  214.     -- 'Aftercast' ensures you're standing in right gear after you initiate BP, and continue wearing gear as avatar readies BP
  215.     -- The pet_aftercast rules will return you to -perp idle gear after the pet does the BP.
  216. -------------------------------------------
  217.     sets.aftercast.physical = {
  218.         main="Uffrat +1",
  219.         sub="Vox Grip",
  220.         ammo="Seraphicaller",
  221.         head="Con. Horn +1",
  222.         neck="Caller's Pendant",
  223.         lear="Gifted Earring",
  224.         rear="Smn. Earring",
  225.         body="Con. Doublet +1",
  226.         hands="Glyphic Bracers +1",
  227.         lring="Evoker's Ring",
  228.         rring="Globidonta Ring",
  229.         back="Samanisi Cape",
  230.         waist="Mujin Obi",
  231.         legs="Caller's Spats +2",
  232.         feet="Con. Pigaches +1"}
  233.    
  234.     sets.aftercast.hybrid = set_combine(sets.aftercast.physical, {
  235.         neck="Eidolon Pendant",
  236.         waist="Caller's Sash"})
  237.    
  238.     sets.aftercast.magical = set_combine(sets.aftercast.physical, {
  239.         head="Glyphic Horn +1",
  240.         neck="Eidolon Pendant",
  241.         rring="Globidonta Ring",
  242.         waist="Caller's Sash",
  243.         feet="Hagondes Sabots +1"})
  244.    
  245.     sets.aftercast.magical.ifrit = set_combine(sets.aftercast.magical, {
  246.         rring="Fervor Ring"})
  247.        
  248.     sets.aftercast.magical.garuda = set_combine(sets.aftercast.magical, {
  249.         head="Chimera Hairpin",
  250.         back="Kaikias' Cape"})
  251.        
  252.     sets.aftercast.debuff = set_combine(sets.aftercast.physical, {
  253.         main="Yaskomo's Pole",
  254.         hands="Regimen Mittens",
  255.         legs="Glyphic Spats",
  256.         feet="Caller's Pigaches +2"})
  257.        
  258.     sets.aftercast.buff = set_combine(sets.aftercast.physical, {
  259.         main="Soulscourge", --7
  260.         head="Con. Horn +1", --15
  261.         body="Call. Doublet +2", --10
  262.         back="Conveyance Cape", --8
  263.         waist="Diabolos's Rope",
  264.         feet="Rubeus Boots"})
  265.         -- smn magic skill by gear: 7+3+15+9+3+10+18+10+5+8+6+10=104, plus lvl 99 cap of 417=521
  266.        
  267.     sets.aftercast.other = set_combine(sets.aftercast.physical, {})
  268.  
  269. -------------------------------------------
  270.     -- Job Ability sets
  271. -------------------------------------------
  272.     sets.precast.elemental_siphon = {
  273.         main="Soulscourge",
  274.         sub="Vox Grip",
  275.         ammo="Seraphicaller",
  276.         head="Con. Horn +1",
  277.         neck="Caller's Pendant",
  278.         lear="Gifted Earring",
  279.         rear="Smn. Earring",
  280.         body="Call. Doublet +2",
  281.         hands="Glyphic Bracers +1",
  282.         lring="Evoker's Ring",
  283.         rring="Globidonta Ring",
  284.         back="Conveyance Cape",
  285.         waist="Mujin Obi",
  286.         legs="Caller's Spats +2",
  287.         feet="Caller's Pgch. +2"}
  288.        
  289.     sets.precast.elemental_siphon.weather = set_combine(sets.precast.elemental_siphon, {
  290.         main="Chatoyant Staff"})
  291.        
  292.     sets.precast.elemental_siphon.day = set_combine(sets.precast.elemental_siphon, {
  293.         lring="Zodiac Ring"})
  294.  
  295.     sets.precast['Astral Flow'] = {head="Glyphic Horn +1"}
  296.     sets.precast['Mana Cede'] = {hands="Call. Bracers +2"}
  297.  
  298. -------------------------------------------
  299.     -- Idle sets for when Avatar is present, depending on avatar's mode, mixtures of -perp and 'mode' gear
  300. -------------------------------------------
  301.     sets.avatar.normal = {
  302.         main="Fay Crozier", -- -3
  303.         sub="Vox Grip",
  304.         ammo="Seraphicaller",
  305.         head="Glyphic Horn +1", -- -4
  306.         neck="Caller's Pendant",
  307.         lear="Moonshade Earring",
  308.         rear="Smn. Earring",
  309.         body="Glyphic Doublet", -- -4
  310.         hands="Caller's Bracers +2",
  311.         lring="Evoker's Ring", -- -1
  312.         rring="Globidonta Ring",
  313.         back="Pahtli Cape",
  314.         waist="Mujin Obi",
  315.         legs="Nares Trews",
  316.         feet="Con. Pigaches +1"} -- -4
  317.        
  318.     sets.avatar.tank = set_combine(sets.avatar.normal, {
  319.         head="Con. Horn +1",
  320.         hands="Regimen Mittens",
  321.         legs="Con. Spats +1"})
  322.    
  323.     sets.avatar.attack = set_combine(sets.avatar.normal, {
  324.         hands="Glyphic Bracers +1",
  325.         waist="Mujin Obi",
  326.         legs="Con. Spats +1"})
  327.        
  328.     sets.avatar.favor = set_combine(sets.avatar.normal, {
  329.         head="Caller's Horn +2"})
  330.        
  331.     sets.avatar.alexander = {
  332.         main="Soulscourge", --7
  333.         sub="Vox Grip", --3
  334.         ammo="Seraphicaller",
  335.         head="Con. Horn +1", --15
  336.         neck="Caller's Pendant", --9
  337.         lear="Gifted Earring",
  338.         rear="Smn. Earring", --3
  339.         body="Call. Doublet +2", --10
  340.         hands="Glyphic Bracers +1", --18
  341.         lring="Evoker's Ring", --10
  342.         rring="Globidonta Ring", --5
  343.         back="Conveyance Cape", --8
  344.         waist="Diabolos's Rope",
  345.         legs="Caller's Spats +2", --6
  346.         feet="Rubeus Boots"} --10
  347.         -- smn magic skill by gear: 104, plus lvl 99 cap of 417=521
  348.                
  349.     sets.avatar.odin = sets.aftercast.magical
  350.     sets.avatar.atomos = sets.aftercast.debuff
  351.  
  352.     sets.spirit = {
  353.         main="Soulscourge", --7
  354.         sub="Vox Grip", --3
  355.         ammo="Seraphicaller",
  356.         head="Con. Horn +1", --15
  357.         neck="Caller's Pendant", --9
  358.         lear="Gifted Earring",
  359.         rear="Smn. Earring", --3
  360.         body="Call. Doublet +2", --10
  361.         hands="Glyphic Bracers +1", --18
  362.         lring="Evoker's Ring", --10
  363.         rring="Globidonta Ring", --5
  364.         back="Conveyance Cape", --8
  365.         waist="Diabolos's Rope",
  366.         legs="Caller's Spats +2", --6
  367.         feet="Rubeus Boots"} --10
  368.        
  369.     sets.spirit.light = set_combine(sets.spirit, {
  370.         lring="Sheltered Ring"})
  371.  
  372.     sets.idle = {
  373.         main="Bolelabunga",
  374.         sub="Genbu's Shield",
  375.         ammo="Mana Ampulla",
  376.         head="Con. Horn +1",
  377.         neck="Twilight Torque",
  378.         lear="Gifted Earring",
  379.         rear="Enchntr. Earring +1",
  380.         body="Artsieq Jubbah",
  381.         hands="Glyphic Bracers +1",
  382. --      hands="Serpentes Cuffs",
  383.         lring="Dark Ring",
  384.         rring="Defending Ring",
  385.         back="Pahtli Cape",
  386.         waist="Slipor Sash",
  387.         legs="Nares Trews",
  388.         feet="Umbani Boots"}
  389.        
  390.     sets.slept = {
  391.         neck="Sacrifice Torque"}
  392.        
  393.     sets.speed = {
  394.         feet="Herald's Gaiters"}
  395.  
  396. end
  397.  
  398. bp_physical = S{'Punch', 'Rock Throw', 'Barracuda Dive', 'Claw', 'Axe Kick', 'Shock Strike', 'Camisado', 'Regal Scratch', 'Poison Nails', 'Moonlit Charge', 'Crescent Fang', 'Rock Buster', 'Tail Whip', 'Double Punch', 'Megalith Throw', 'Double Slap', 'Eclipse Bite', 'Mountain Buster', 'Spinning Dive', 'Predator Claws', 'Rush', 'Chaotic Strike', 'Crag Throw', 'Volt Strike', 'Blindside', 'Regal Gash'}
  399. bp_hybrid = S{'Burning Strike', 'Flaming Crush'}
  400. bp_magical = S{'Inferno', 'Earthen Fury', 'Tidal Wave', 'Aerial Blast', 'Diamond Dust', 'Judgment Bolt', 'Searing Light', 'Howling Moon', 'Ruinous Omen', 'Fire II', 'Stone II', 'Water II', 'Aero II', 'Blizzard II', 'Thunder II', 'Thunderspark', 'Somnolence', 'Meteorite', 'Fire IV', 'Stone IV', 'Water IV', 'Aero IV', 'Blizzard IV', 'Thunder IV', 'Nether Blast', 'Meteor Strike', 'Geocrush', 'Grand Fall', 'Wind Blade', 'Heavenly Strike', 'Thunderstorm', 'Level ? Holy', 'Holy Mist', 'Lunar Bay', 'Night Terror', 'Conflagration Strike'}
  401. bp_debuff = S{'Lunar Cry', 'Mewing Lullaby', 'Nightmare', 'Lunar Roar', 'Slowga', 'Ultimate Terror', 'Sleepga', 'Eerie Eye', 'Tidal Roar', 'Diamond Storm', 'Shock Squall', 'Pavor Nocturnus', 'Impact'}
  402. bp_buff = S{'Shining Ruby', 'Frost Armor', 'Rolling Thunder', 'Crimson Howl', 'Lightning Armor', 'Ecliptic Growl', 'Hastega', 'Noctoshield', 'Ecliptic Howl', 'Dream Shroud', 'Earthen Armor', 'Fleet Wind', 'Inferno Howl', 'Soothing Ruby', 'Heavenward Howl', 'Soothing Current', 'Hastega II', 'Crystal Blessing'}
  403. bp_other = S{'Healing Ruby', 'Raise II', 'Aerial Armor', 'Reraise II', 'Whispering Wind', 'Glittering Ruby', 'Earthen Ward', 'Spring Water', 'Healing Ruby II'}
  404.  
  405. aftermath_timers = {['Aftermath: Lv.1']=270, ['Aftermath: Lv.2']=270, ['Aftermath: Lv.3']=180}
  406.  
  407. spirit_element = {Fire='Fire Spirit', Earth='Earth Spirit', Water='Water Spirit', Wind='Air Spirit', Ice='Ice Spirit', Lightning='Thunder Spirit', Light='Light Spirit', Dark='Dark Spirit'}
  408. spirit_conflict = {Fire='Ice', Earth='Lightning', Water='Fire', Wind='Earth', Ice='Wind', Lightning='Water', Light='Dark', Dark='Light'}
  409.  
  410. avatar_mode = 'normal'
  411. bp_repeat = true
  412. tp_lock = false
  413.  
  414. function pet_change(pet, gain)
  415.     if gain then
  416.         if pet.name == 'Odin' then
  417.             equip(sets.avatar.odin)
  418.         elseif pet.name == 'Alexander' then
  419.             equip(sets.avatar.alexander)
  420.         elseif pet.name == 'Atomos' then
  421.             equip(sets.avatar.atomos)
  422.         elseif pet.name:match('Light') then
  423.             equip(sets.spirit.light)
  424.         elseif pet.name:match('Spirit') then
  425.             equip(sets.spirit)
  426.         elseif buffactive["Avatar's Favor"] then
  427.             equip(sets.avatar.favor)
  428.         else
  429.             equip(sets.avatar[avatar_mode])
  430.         end
  431.         disable('main', 'ammo')
  432.     else
  433.         if not tp_lock then
  434.             enable('main', 'ammo')
  435.         end
  436.         equip(sets.idle)
  437.     end
  438. end
  439.  
  440. function buff_change(name, gain)
  441.     if pet.isvalid and name == "Avatar's Favor" then
  442.         equip(gain and sets.avatar.favor or sets.avatar[avatar_mode])
  443.     elseif pet.isvalid and name == 'sleep' then
  444.         if gain then
  445.             windower.ffxi.cancel_buff(37)
  446.             equip(sets.slept)
  447.         else
  448.             pet_change(pet, pet.isvalid)
  449.         end
  450.     elseif aftermath_timers[name] then
  451.         if gain then
  452.             send_command('timers c "Aftermath" %s':format(aftermath_timers[name]))
  453.         else
  454.             send_command('timers d "Aftermath"')
  455.         end
  456.     end
  457. end
  458.  
  459. function status_change(new, old)
  460.     if new == 'Idle' or new == 'Resting' then
  461.         pet_change(pet, pet.isvalid)
  462.     end
  463. end
  464.  
  465. function precast(spell,action)
  466.     if player.equipment.head == 'Reraise Hairpin' then disable('head')
  467.     else enable('head') end
  468.     if player.equipment.left_ear == 'Reraise Earring' then disable('ear1')
  469.     else enable('ear1') end
  470.     if spell.action_type == 'Magic' or spell.type == 'Ninjutsu' then
  471.         if spell.skill == 'Elemental Magic' then
  472.             if spell.cast_time < 9 then
  473.                 if spell.english:startswith('Stone') then
  474.                     equip(sets.midcast.Stone,{head="Buremte Hat"})         
  475.                 else equip(sets.midcast.ElementalLow)
  476.                 end
  477.                 if spell.element == world.weather_element or spell.element == world.day_element then
  478.                     equip(sets.midcast.weather)
  479.                 end
  480.             elseif spell.name == 'Impact' then
  481.                 equip(sets.precast.HasteElemental,{body="Twilight Cloak"})
  482.             else equip(sets.precast.HasteElemental)
  483.             end
  484.         elseif spell.skill == 'Enhancing Magic' then
  485.             if spell.name == 'Stoneskin' then
  486.                 windower.ffxi.cancel_buff(37)
  487.                 equip(sets.precast.HasteStoneskin)
  488.             elseif spell.name == 'Sneak' then
  489.                 windower.ffxi.cancel_buff(71)
  490.                 equip(sets.precast.HasteEnhancing)
  491.             else equip(sets.precast.HasteEnhancing)
  492.             end
  493.         elseif spell.skill == 'Healing Magic' then
  494.             if spell.english:startswith('Cur') then
  495.                 if spell.name == 'Cursna' then
  496.                     equip(sets.midcast.Cursna)
  497.                 elseif spell.cast_time < 9 then
  498.                     equip(sets.midcast.CureSingle)
  499.                 else equip(sets.precast.HasteHealing)
  500.                 end            
  501.             else equip(sets.precast.HasteHealing)
  502.             end
  503.         elseif spell.type == 'SummonerPact' then
  504.             if spell.name == 'Dark Spirit' then
  505.                 if world.weather_element == 'Dark' then
  506.                     equip(sets.precast.HasteSummoning)
  507.                 elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then
  508.                     cancel_spell()
  509.                     send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element]))
  510.                 elseif world.day_element == 'Dark' then
  511.                     equip(sets.precast.HasteSummoning)
  512.                 else
  513.                     cancel_spell()
  514.                     send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
  515.                 end
  516.             elseif (spell.name == 'Alexander' or spell.name == 'Odin') and not pet.isvalid and not buffactive['Astral Flow'] and windower.ffxi.get_ability_recasts()[0] == 0 then
  517.                 cast_delay(1)
  518.                 send_command('input /ja "Astral Flow" <me>')
  519.             else
  520.                 equip(sets.precast.HasteSummoning)
  521.             end
  522.         else equip(sets.precast.Fastcast)
  523.         end
  524.     elseif spell.type == 'WeaponSkill' then
  525.         if spell.english == 'Brainshaker' or 'Skullbreaker' or 'True Strike' or 'Heavy Swing' or 'Full Swing' or 'Shell Crusher' then
  526.             equip(sets.precast.WSStr)
  527.         elseif spell.english == 'Shining Strike' or 'Seraph Strike' or 'Judgement' or 'Hexa Strike' or 'Black Halo' or 'Flash Nova' or 'Starburst' or 'Sunburst' or 'Retribution' then
  528.             equip(sets.precast.WSStrMnd)
  529.         elseif spell.english == 'Rock Crusher' or 'Earth Crusher' or 'Spirit Taker' or 'Cataclysm' then
  530.             equip(sets.precast.WSStrInt)
  531.         elseif spell.english == 'Garland of Bliss' then
  532.             equip(sets.precast.WSMnd)
  533.         else equip(sets.precast.WSStr)
  534.         end
  535.     elseif (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') and not buffactive['Astral Conduit'] then
  536.         equip(sets.precast['Blood Pact'])
  537.     elseif spell.name == 'Elemental Siphon' then
  538.         enable('main', 'sub', 'ranged', 'ammo')
  539.         equip(sets.precast.elemental_siphon)
  540.         if pet.element == world.weather_element then
  541.             equip(sets.precast.elemental_siphon.weather)
  542.         end
  543.         if pet.element ~= 'Dark' and pet.element ~= 'Light' and pet.element == world.day_element then
  544.             equip(sets.precast.elemental_siphon.day)
  545.         end
  546.     elseif sets.precast[spell.english] then
  547.         equip(sets.precast[spell.english])
  548.     end
  549. end
  550.  
  551. function midcast(spell,action)
  552.     if spell.action_type == 'Magic' then
  553.         if spell.skill == 'Elemental Magic' then
  554.             if spell.cast_time < 9 then
  555.                 if spell.english:startswith('Stone') then
  556.                     equip(sets.midcast.Stone,{head="Buremte Hat"})         
  557.                 else equip(sets.midcast.ElementalLow)
  558.                 end
  559.             elseif spell.english:startswith('Stone') then
  560.                 equip(sets.midcast.Stone)  
  561.             elseif spell.english == 'Impact' then
  562.                 equip(sets.midcast.Impact,{body="Twilight Cloak"})
  563.             else equip(sets.midcast['Elemental Magic'])
  564.             end
  565.             if spell.element == world.weather_element or spell.element == world.day_element then
  566.                     equip(sets.obi[spell.element])
  567.             end
  568.         elseif spell.skill == 'Enhancing Magic' then
  569.             if spell.english:startswith('Protect') or spell.english:startswith('Shell') then
  570.                 equip(sets.midcast.ProtectShell)
  571.             elseif spell.name == 'Stoneskin' then
  572.                 equip(sets.midcast.Stoneskin)
  573.             else equip(sets.midcast['Enhancing Magic'])
  574.             end
  575.         elseif sets.midcast[spell.skill] then
  576.             equip(sets.midcast[spell.skill])
  577.         else equip(sets.precast.Fastcast)
  578.         end
  579.     end
  580. end
  581.  
  582. function aftercast(spell)
  583.     if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') and not spell.interrupted then
  584.         if bp_physical:contains(spell.name) then
  585.             equip(sets.aftercast.physical)
  586.         elseif bp_hybrid:contains(spell.name) then
  587.             equip(sets.aftercast.hybrid)
  588.         elseif bp_magical:contains(spell.name) then
  589.             if pet.name == 'Ifrit' then
  590.                 equip(sets.aftercast.magical.ifrit)
  591.             elseif pet.name == 'Garuda' then
  592.                 equip(sets.aftercast.magical.garuda)
  593.             else equip(sets.aftercast.magical)
  594.             end
  595.         elseif bp_debuff:contains(spell.name) then
  596.             equip(sets.aftercast.debuff)
  597.         elseif bp_buff:contains(spell.name) then
  598.             equip(sets.aftercast.buff)
  599.         elseif bp_other:contains(spell.name) then
  600.             equip(sets.aftercast.other)
  601.         end
  602.     elseif spell.type == 'SummonerPact' and not spell.interrupted then
  603.         pet_change(spell, true)
  604.     elseif spell.name == 'Release' and not spell.interrupted then
  605.         pet_change(spell, false)
  606.     else
  607.         pet_change(pet, pet.isvalid)
  608.         if spell.name == 'Elemental Siphon' then
  609.             disable('main', 'ammo')
  610.             if tp_lock then
  611.                 disable('sub', 'ranged')
  612.             end
  613.         end
  614.     end
  615. end
  616.  
  617. function pet_aftercast(spell)
  618.     if bp_repeat and spell.type == 'BloodPactRage' and spell.name ~= 'Perfect Defense' and spell.name ~= 'Zantetsuken' and windower.ffxi.get_ability_recasts()[173] == 0 and not spell.interrupted then
  619.         send_command('input /pet "%s" <t>':format(spell.name))
  620.     else
  621.         pet_change(pet, pet.isvalid)
  622.     end
  623. end
  624.  
  625. function self_command(command)
  626.     if command == 'toggle TP set' then
  627.         if avatar_mode == 'normal' then
  628.             avatar_mode = 'tank'
  629.             pet_change(pet, pet.isvalid)
  630.             send_command('@input /echo Avatar Tank SET')
  631.         elseif avatar_mode == 'tank' then
  632.             avatar_mode = 'attack'
  633.             pet_change(pet, pet.isvalid)
  634.             send_command('@input /echo Avatar Attack SET')
  635.         elseif avatar_mode == 'attack' then
  636.             avatar_mode = 'normal'
  637.             pet_change(pet, pet.isvalid)
  638.             send_command('@input /echo Avatar Normal SET')
  639.         end
  640.     end
  641.    
  642.  
  643.     if command:lower() == 'lock' then
  644.         tp_lock = not tp_lock
  645.         if tp_lock then
  646.             disable('main', 'sub', 'ranged', 'ammo')
  647.         else
  648.             enable('sub', 'ranged')
  649.             if not pet.isvalid then
  650.                 enable('main', 'ammo')
  651.             end
  652.         end
  653.     end
  654.     add_to_chat(207, '---- avatar mode: \31\200%s\30\1, bp repeat: %s, tp lock: %s ----':format(avatar_mode, bp_repeat and '\31\204on\30\1' or '\31\167off\30\1', tp_lock and '\31\204on\30\1' or '\31\167off\30\1'))
  655. end
Advertisement
Add Comment
Please, Sign In to add comment