Phillie

Phillie_SMN

Sep 4th, 2015
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 26.12 KB | None | 0 0
  1.  include('organizer-lib')
  2.  
  3. beforecall = 0
  4. sumskill = 417 + 16 + 120
  5.  
  6. PetName = S{"Garuda", "Carbuncle", "Diabolos", "Fenrir", "Caith Sith", "Leviathan", "Ifrit", "Titan", "Shiva"}
  7. SpiritName = S{'Fire Spirit', 'Earth Spirit', 'Water Spirit', 'Air Spirit', 'Ice Spirit', 'Thunder Spirit', 'Light Spirit', 'Dark Spirit'}
  8. SpecialAvatar = S{"Alexander", "Odin"}
  9.  
  10. -- a finir
  11. Storm = {['Firestorm']='Fire',['Windstorm']='Air', ['Sandstorm']='Earth', ['Voidstorm']='Dark', ['Aurorastorm']='Light', ['Hailstorm']='Ice',['Rainstorm']='Water',['Thunderstorm']='Thunder'}
  12. StormList = {'Firestorm','Windstorm', 'Sandstorm', 'Voidstorm', 'Aurorastorm', 'Hailstorm','Rainstorm','Thunderstorm'}
  13.  
  14. AvatarElement = {["Garuda"] = "Wind", ["Carbuncle"]="Light", ["Diabolos"]="Dark", ["Fenrir"]="Dark", ["Caith Sith"]="Light", ["Leviathan"]="Water", ["Ifrit"]="Fire", ["Titan"]="Earth", ["Shiva"]="Ice", ["Ramuh"]="Thunder"}
  15.  
  16. 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'}
  17. spirit_conflict = {['Fire']='Ice', ['Earth']='Lightning', ['Water']='Fire', ['Wind']='Earth', ['Ice']='Wind', ['Lightning']='Water', ['Light']='Dark', ['Dark']='Light'}
  18.  
  19.  
  20. bp_physical = {['Regal Scratch']=true, ['Punch']=true, ['Rock Throw']=true, ['Barracuda Dive']=true, ['Claw']=true, ['Axe Kick']=true, ['Shock Strike']=true, ['Camisado']=true, ['Poison Nails']=true, ['Moonlit Charge']=true, ['Crescent Fang']=true, ['Rock Buster']=true, ['Tail Whip']=true, ['Double Punch']=true, ['Megalith Throw']=true, ['Double Slap']=true, ['Eclipse Bite']=true, ['Mountain Buster']=true, ['Spinning Dive']=true, ['Predator Claws']=true, ['Rush']=true, ['Chaotic Strike']=true}
  21. bp_hybrid = {['Burning Strike']=true, ['Flaming Crush']=true}
  22. bp_magic = {['Inferno']=true, ['Earthen Fury']=true, ['Tidal Wave']=true, ['Aerial Blast']=true, ['Diamond Dust']=true, ['Judgment Bolt']=true, ['Searing Light']=true, ['Howling Moon']=true, ['Ruinous Omen']=true, ['Zantetsuken']=true, ['Somnolence']=true, ['Nether Blast']=true}
  23. bp_magic_tp = {['Meteor Strike']=true, ['Geocrush']=true, ['Grand Fall']=true, ['Wind Blade']=true, ['Heavenly Strike']=true, ['Thunderstorm']=true, ['Fire II']=true, ['Stone II']=true, ['Water II']=true, ['Aero II']=true, ['Blizzard II']=true, ['Thunder II']=true, ['Fire IV']=true, ['Stone IV']=true, ['Water IV']=true, ['Aero IV']=true, ['Blizzard IV']=true, ['Thunder IV']=true, ['Thunderspark']=true, ['Meteorite']=true, ['Holy Mist']=true, ['Lunar Bay']=true, ['Night Terror']=true, ['Level ? Holy']=true, ['Conflag Strike']=true}
  24. bp_accuracy = {['Mewing Lullaby']=true, ['Eerie Eye']=true, ['Lunar Cry']=true, ['Nightmare']=true, ['Lunar Roar']=true, ['Slowga']=true, ['Ultimate Terror']=true, ['Sleepga']=true, ['Tidal Roar']=true, ['Diamond Storm']=true, ['Shock Squall']=true, ['Pavor Nocturnus']=true}
  25. -- Double table, for duration calculation
  26. bp_duration = {
  27.         ['Glittering Ruby']=90,
  28.         ['Shining Ruby']=180,
  29.         ['Frost Armor']=90,
  30.         ['Rolling Thunder']=60,
  31.         ['Crimson Howl']=30,
  32.         ['Lightning Armor']=90,
  33.         ['Ecliptic Growl']=180,
  34.         ['Hastega']=90,
  35.         ['Noctoshield']=180,
  36.         ['Ecliptic Howl']=180,
  37.         ['Dream Shroud']=180,
  38.         ['Earthen Armor']=60,
  39.         ['Fleet Wind']=120,
  40.         ['Heavenward Howl']=60}
  41.  
  42. icons = {
  43.             ['Earthen Armor']   = 'spells/00299.png', -- 00299 for Titan
  44.             ['Shining Ruby']    = 'spells/00043.png', -- 00043 for Protect
  45.             ['Dream Shroud']    = 'spells/00304.png', -- 00304 for Diabolos
  46.             ['Noctoshield']     = 'spells/00106.png', -- 00106 for Phalanx
  47.             ['Inferno Howl']    = 'spells/00298.png', -- 00298 for Ifrit
  48.             ['Hastega']         = 'spells/00358.png', -- 00358 for Hastega
  49.             ['Rolling Thunder'] = 'spells/00104.png', -- 00358 for Enthunder
  50.             ['Frost Armor']     = 'spells/00250.png', -- 00250 for Ice Spikes
  51.             ['Lightning Armor'] = 'spells/00251.png', -- 00251 for Shock Spikes
  52.             ['Reraise II']      = 'spells/00135.png', -- 00135 for Reraise
  53.             ['Fleet Wind']      = 'abilities/00074.png', --
  54.         }      
  55.        
  56.        
  57. bp_boon = {['Earthen Ward']=true, ['Aerial Armor']=true, ['Raise II']=true, ['Reraise II']=true, ['Healing Ruby']=true, ['Whispering Wind']=true, ['Spring Water']=true, ['Healing Ruby II']=true}
  58. bp_skill = {['Perfect Defense']=true, ['Inferno Howl']=true, ['Soothing Ruby']=true}
  59.  
  60.  
  61. MAB = S{"Stone", "Stone II", "Water", "Water II", "Aero", "Aero II", "Fire", "Fire II", "Thunder", "Thunder II", "Blizzard", "Blizzard II", "Geohelix", "Hydrohelix", "Anemohelix", "Pyrohelix", "Cryohelix", "Ionohelix", "Luminohelix", "Noctohelix"}
  62. ENF = S{"Sleepga", "Drain", "Aspir", "Dispel", "Sleep"}
  63. CUR = S{"Cure", "Cure II", "Cure III"}
  64.  
  65.  
  66. --- Hagondes Body differentiation
  67. HndPerp = { name="Helios Gloves", augments={'"Avatar perpetuation cost" -4', 'Pet: Accuracy+27 Pet: Rng. Acc.+27'}}
  68. FeetPerp = { name="Helios Boots", augments={'Pet: "Dbl. Atk."+4', 'Pet: Attack+21 Pet: Rng. Atk.+21'}}
  69. FcHd = { name ="Helios Band", augments={'Blood Pact Dmg. +4', 'Pet: Crit. Hit Rate +1%', 'Pet: "Mag. Atk. Bns."+24'}}
  70. FcBod = { name="Helios Jacket", augments={'Blood Pact Dmg. +5', 'Pet: Crit. Hit Rate +2%', 'Pet: "Mag. Atk. Bns."+25'}}
  71. FcHnd = { name="Helios Gloves", augments={'Blood Pact Dmg. +5', 'Pet: Crit. Hit Rate +3%', 'Pet: "Mag. Atk. Bns."+28'}}
  72. FcLeg = { name="Helios Spats", augments={'Blood Pact Dmg. +5', 'Pet: Crit. Hit Rate +1%', 'Pet: "Mag. Atk. Bns."+26'}}
  73. FcFeet = { name="Helios Boots", augments={'Blood Pact Dmg. +4', 'Pet: Crit. Hit Rate +4%', 'Pet: "Mag. Atk. Bns."+28'}}
  74. PhyBod = { name="Helios Jacket", augments={'Pet: Haste +3%', 'Pet: Attack+19 Pet: Rng. Atk.+19', 'Pet: "Dbl. Atk."+1'}}
  75. PhyHnd = { name="Helios Gloves", augments={'"Blood Boon"+2', 'Pet: Attack+24 Pet: Rng. Atk.+24'}}
  76. PhyLeg = { name="Helios Spats", augments={'Blood Pact Dmg. +7', 'Pet: Attack+28 Pet: Rng. Atk.+28'}}
  77. PhyFeet = { name="Helios Boots", augments={'Pet: Crit. Hit Rate +4%', 'Pet: Attack+14 Pet: Rng. Atk.+14'}}
  78.  
  79. function get_sets()
  80.        
  81.         -- IDLE
  82.         sets.idle = {
  83.                 head="Con. Horn +1",
  84.                 rear='Moonshade Earring',
  85.                 body='Con. Doublet +1',
  86.                 legs='Nares Trews',
  87.                 neck='Twilight Torque',
  88.                 main='Nirvana',
  89.                 hands='Serpentes cuffs',
  90.                 feet='Serpentes Sabots',
  91.                 waist='Fucho-no-obi',
  92.                 sub="Genbu's shield",
  93.                 ammo="Dosis Tathlum",
  94.                 back="Cheviot Cape"}
  95.  
  96.         --  Perp : -13/tick + refresh +5 from gears
  97.     sets.perpetuation = {
  98.                 main='Nirvana',
  99.                 ammo='Seraphicaller',
  100.                 head="Glyphic Horn +1",
  101.                 neck="Caller's Pendant",
  102.                 lear='Moonshade Earring',
  103.                 rear='Andoaa Earring',
  104.                 body='Glyphic Doublet +1',
  105.                 hands=HndPerp,
  106.                 rring="Evoker's Ring",
  107.                 lring='Thurandaut Ring',
  108.                 back='Samanisi Cape',
  109.                 waist='Moepapa Stone',
  110.                 legs="Con. Spats +1",
  111.                 feet=FeetPerp,
  112.                 sub="Vox Grip"}
  113.                
  114.     sets.favor = {
  115.                 main='Nirvana',
  116.                 ammo='Seraphicaller',
  117.                 head="Con. Horn +1",
  118.                 neck="Caller's Pendant",
  119.                 lear='Andoaa Earring',
  120.                 rear='Moonshade Earring',
  121.                 body='Hagondes Coat +1',
  122.                 hands='Glyphic Bracers +1',
  123.                 rring="Evoker's Ring",
  124.                 lring='Fervor Ring',
  125.                 back='Conveyance Cape',
  126.                 waist='Isa Belt',
  127.                 legs='Nares Trews',
  128.                 feet="Convoker's Pigaches"}
  129.        
  130.     sets.spirit = {
  131.                 main="Gridarvor",
  132.                 sub='Vox Grip',
  133.                 ammo='Seraphicaller',
  134.                 head="Con. Horn +1",
  135.                 neck="Caller's Pendant",
  136.                 lear='Andoaa Earring',
  137.                 rear='Moonshade Earring',
  138.                 body="Caller's Doublet +2",
  139.                 hands='Glyphic Bracers +1',
  140.                 lring='Fervor Ring',
  141.                 rring="Evoker's Ring",
  142.                 back='Conveyance Cape',
  143.                 waist='Cimmerian Sash',
  144.                 legs='Glyphic Spats',
  145.                 feet="Convoker's Pigaches +1"
  146.                 }
  147.        
  148.     sets.resting = {
  149.                 head="Con. Horn +1",
  150.                 rear='Moonshade Earring',
  151.                 body='Hagondes Coat +1',
  152.                 legs='Nares Trews',
  153.                 neck='Twilight Torque',
  154.                 main='Bolelabunga',
  155.                 hands='Serpentes cuffs',
  156.                 feet='Serpentes Sabots',
  157.                 waist='Fucho-no-obi'}
  158.    
  159.     sets.speed = {legs='Tatsu. Sitagoromo'}
  160.        
  161.         sets.ssp = {
  162.                 main='Nirvana',
  163.                 ammo='Seraphicaller',
  164.                 head="Con. Horn +1",
  165.                 neck="Caller's Pendant",
  166.                 lear='Andoaa Earring',
  167.                 rear='Moonshade Earring',
  168.                 body='Hagondes Coat +1',
  169.                 hands='Glyphic Bracers +1',
  170.                 rring="Evoker's Ring",
  171.                 lring='Fervor Ring',
  172.                 back='Conveyance Cape',
  173.                 waist='Isa Belt',
  174.                 legs='Nares Trews',
  175.                 feet="Desert Boots",
  176.                 sub="Vox Grip"}
  177.                
  178.     sets.ssi = {
  179.                 head="Con. Horn +1",
  180.                 rear='Moonshade Earring',
  181.                 body='Hagondes Coat +1',
  182.                 legs='Nares Trews',
  183.                 neck='Twilight Torque',
  184.                 main='Bolelabunga',
  185.                 hands='Serpentes cuffs',
  186.                 feet='Desert Boots',
  187.                 waist='Fucho-no-obi',
  188.                 sub="Genbu's shield",
  189.                 ammo="Dosis Tathlum",
  190.                 back="Cheviot Cape"}  
  191.  
  192.     sets.precast = {}
  193.        
  194.     sets.precast.delay = {
  195.                 ammo='Seraphicaller',
  196.                 head='Glyphic Horn +1',
  197.                 lear="Caller's Earring",
  198.                 body='Gylphic Doublet +1',
  199.                 hands='Glyphic Bracers +1',
  200.                 back="Conveyance Cape",
  201.                 feet='Glyphic Pigaches',
  202.                 legs='Glyphic Spats +1'}
  203.                
  204.     sets.precast.cede = {hands='Call. Bracers +2'}
  205.        
  206.     sets.precast.siphon = {
  207.                 main="Keraunos",
  208.                 sub="Vox Grip",
  209.                 head="Con. Horn +1",
  210.                 neck="Caller's Pendant",
  211.                 rear="Smn. Earring",
  212.                 lear="Andoaa earring",
  213.                 body="Caller's Doublet +2",
  214.                 hands="Glyptic Bracers +1",
  215.                 lring="Evoker's Ring",
  216.                 rring="Fervor Ring",
  217.                 back="Conveyance Cape",
  218.                 legs="Ngen Seraweels",
  219.                 feet="Caller's Pgch. +2"}
  220.                
  221.     sets.precast.FC = {
  222.                 head="Nahtirah Hat",
  223.                 neck="Orunmila's Torque",
  224.                 ear1="Loquacious Earring",
  225.                 body="Marduk's Jubbah",
  226.                 hands="Repartie Gloves",
  227.                 ring2="Prolix Ring",
  228.                 back="Swith Cape",
  229.                 waist="Witful belt",
  230.                 legs="Artsieq hose",
  231.                 feet="Chelona Boots",
  232.                 sub="Vivid Strap",
  233.                 main="Nirvana"}
  234.                
  235.         sets.precast.cure = set_combine(sets.precast.FC, { legs="Nabu's Shalwar" })
  236.    
  237.         sets.midcast = {}
  238.        
  239.     sets.midcast.cure = {
  240.                 body=FcBod,
  241.                 head=PhyHd,
  242.                 hands="Bokwus Gloves",
  243.                 neck="Phalaina Locket",
  244.                 legs="Nabu's Shalwar",
  245.                 back="Pahtli Cape",
  246.                 main="Tamaxchi",
  247.                 sub="Genbu's shield"}
  248.                
  249.     sets.midcast.stoneskin = {
  250.                 neck='Stone Gorget',
  251.                 lear='Magnetic Earring',
  252.                 rear='Loquacious Earring',
  253.                 back='Swith Cape',
  254.                 waist='Siegel Sash',
  255.                 legs='Artsieq Hose',
  256.                 head="Umuthi Hat",
  257.                 hands="Gende. Gloves +1",
  258.                 body="Anhur Robe"}
  259.                
  260.     sets.midcast.regen = {
  261.                 head="Umuthi Hat",
  262.                 main="Bolelabunga",
  263.                 body="Anhur Robe",
  264.                 waist="Siegel Sash",
  265.                 back="Swith cape"}
  266.        
  267.     sets.midcast.Enf = {
  268.                 main="Nirvana",
  269.                 sub="Mephitis Grip",
  270.                 head="Buremte Hat",
  271.                 neck="Eddy Necklace",
  272.                 ear1="Hecate's Earring",
  273.                 ear2="Friomisi Earring",
  274.                 hands="Lurid Mitts",
  275.                 ring1="Perception Ring",
  276.                 ring2="Sangoma Ring",
  277.                 body="Artsieq Jubbah",
  278.                 back="Twilight Cape",
  279.                 waist="Fucho-no-obi",
  280.                 legs="Artsieq Hose",
  281.                 feet="Uk'uxkaj boots"}
  282.                
  283.     sets.midcast.Mab = {
  284.                 main="Eminent Staff",
  285.                 sub="Zuuxowu Grip",
  286.                 head="Buremte Hat",
  287.                 neck="Eddy Necklace",
  288.                 ear1="Hecate's Earring",ear2="Friomisi Earring",
  289.                 hands="Otomi Gloves",
  290.                 ring1="Icesoul Ring",
  291.                 ring2="Acumen Ring",
  292.                 body=HBodMAB,
  293.                 back="Toro Cape",
  294.                 waist="Sekhmet Corset",
  295.                 legs="Hagondes Pants",
  296.                 feet="Umbani Boots",
  297.                 }
  298.                
  299.     sets.pet_midcast = {}
  300.        
  301.     sets.pet_midcast.physical = {
  302.                 main="Nirvana",
  303.                 sub="Vox Grip",
  304.                 ammo="Seraphicaller",
  305.                 head=PhyHd,
  306.                 ear1="Esper Earring",
  307.                 ear2="Domes. Earring",
  308.                 body=PhyBod,
  309.                 hands=PhyHnd,
  310.                 ring1="Evoker's Ring",
  311.                 ring2="Thurandaut Ring",
  312.                 legs=PhyLeg,
  313.                 feet=PhyFeet,
  314.                 neck="Caller's Pendant",
  315.                 back="Conveyance Cape",
  316.                 waist="Mujin Obi"}
  317.                
  318.     sets.pet_midcast.magic = {
  319.                 main='Nirvana',
  320.                 sub='Vox Grip',
  321.                 ammo='Seraphicaller',
  322.                 head=FcHd,
  323.                 neck='Eidolon Pendant +1',
  324.                 lear='Esper Earring',
  325.                 rear='Gelos Earring',
  326.                 body=FcBod,
  327.                 hands=FcHnd,
  328.                 lring="Evoker's Ring",
  329.                 rring="Thurandaut Ring",
  330.                 back='Conveyance Cape',
  331.                 waist="Caller's Sash",
  332.                 legs=FcLeg,
  333.                 feet=FcFeet}
  334.                
  335.     sets.pet_midcast.magic.tp = {
  336.                 main='Nirvana',
  337.                 sub='Vox Grip',
  338.                 ammo='Seraphicaller',
  339.                 head=FcHd,
  340.                 neck='Eidolon Pendant +1',
  341.                 lear='Esper Earring',
  342.                 rear='Gelos Earring',
  343.                 body=FcBod,
  344.                 hands=FcHnd,
  345.                 lring="Evoker's Ring",
  346.                 rring="Thurandaut Ring",
  347.                 back='Conveyance Cape',
  348.                 waist="Caller's Sash",
  349.                 legs=FcLeg,
  350.                 feet=FcFeet}
  351.                
  352.     sets.pet_midcast.accuracy = {
  353.                 main='Nirvana',
  354.                 sub='Vox Grip',
  355.                 ammo='Seraphicaller',
  356.                 head=FcHd,
  357.                 neck='Eidolon Pendant',
  358.                 lear='Esper Earring',
  359.                 rear='Gelos Earring',
  360.                 body=FcBod,
  361.                 hands=FcHnd,
  362.                 lring="Evoker's Ring",
  363.                 rring="Thurandaut Ring",
  364.                 back='Conveyance Cape',
  365.                 waist="Caller's Sash",
  366.                 legs=FcLeg,
  367.                 feet=FcFeet}
  368.                
  369.     sets.pet_midcast.boon = {
  370.                 rear='Gifted Earring',
  371.                 waist="Jaq'ij Sash",
  372.                 legs="Caller's Spats +2"}
  373.    
  374.         sets.pet_midcast.skill = { --- TOTAL = 120
  375.                 main="Kirin's Pole",            -- 12
  376.                 sub='Vox Grip',                 -- 3
  377.                 ammo='Seraphicaller',           --
  378.                 head="Con. Horn +1",            -- 15
  379.                 neck="Caller's Pendant",        -- 9
  380.                 ear1='Smn. Earring',            -- 3
  381.                 ear2="Andoaa Earring",          -- 5
  382.                 body="Beckoner's Doublet",      -- 12
  383.                 hands='Glyphic Bracers +1',     -- 19
  384.                 lring="Evoker's Ring",          -- 10
  385.                 rring="Fervor Ring",            -- 4
  386.                 back='Conveyance Cape',         -- 9
  387.                 waist='Cimmerian Sash',         -- 5
  388.                 legs="Adapa's Slacks +1",       --14
  389.                 feet='Rubeus Boots'}            --
  390.    
  391.         sets.pet_midcast.duration = {
  392.                 main="Kirin's Pole",
  393.                 sub='Vox Grip',
  394.                 ammo='Seraphicaller',
  395.                 head="Con. Horn +1",
  396.                 neck="Caller's Pendant",
  397.                 lear='Smn. Earring',
  398.                 rear='Andoaa Earring',
  399.                 body="Caller's Doublet +2",
  400.                 hands='Glyphic Bracers +1',
  401.                 lring='Fervor Ring',
  402.                 rring="Evoker's Ring",
  403.                 back='Conveyance Cape',
  404.                 waist='Cimmerian Sash',
  405.                 legs='Ngen Seraweels',
  406.                 feet='Nashira Crackows'}
  407.                
  408.         sets.pet_midcast.hybrid = {
  409.                 main='Nirvana',
  410.                 sub='Vox Grip',
  411.                 ammo=Seraphicaller,
  412.                 head=FcHd,
  413.                 neck='Eidolon Pendant +1',
  414.                 lear='Esper Earring',
  415.                 rear='Gelos Earring',
  416.                 body=FcBod,
  417.                 hands=FcHnd,
  418.                 lring="Evoker's Ring",
  419.                 rring="Fervor Ring",
  420.                 back='Conveyance Cape',
  421.                 waist="Mujin Obi",
  422.                 legs=FcLeg,
  423.                 feet=FcFeet}
  424.  
  425.    
  426.  
  427.         sets.perpetuation['Alexander'] = sets.pet_midcast.skill
  428.     sets.perpetuation['Odin'] = sets.pet_midcast.magic
  429.        
  430.    
  431. end
  432.  
  433.  
  434.  
  435. function buff_change(name, gain)
  436.     if name == "Sandstorm" then
  437.         if gain then
  438.             equip({feet="Desert Boots"})
  439.         else
  440.             idle()
  441.         end
  442.     end
  443.    
  444. end
  445.  
  446.        
  447.      
  448.  
  449. function pet_change(pets, gain)
  450.         beforecall = 1
  451.     if pet.isvalid then
  452.                 --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - Called ] *-*-*-*-*-*-*-*-*')
  453.                 if pet.name then
  454.                         if pet.name:find('Spirit') then
  455.                                 equip(sets.spirit)
  456.                         elseif pet.name == "Alexander" then
  457.                                 equip(sets.pet_midcast.skill)
  458.                         elseif pet.name == "Odin" then
  459.                                 equip(sets.pet_midcast.magic)
  460.                         else
  461.                                 equip(sets.perpetuation[pet.name] or sets.perpetuation)
  462.                         end
  463.         else
  464.             equip(sets.perpetuation[pet.name] or sets.perpetuation)
  465.         end
  466.     else
  467.         equip(sets.idle)
  468.     end
  469.        
  470.          
  471. end
  472.  
  473.  
  474. function status_change(new, old)
  475.     if pet.isvalid == false then
  476.         elseif new == 'Idle' then
  477.            idle()
  478.         elseif new == 'Resting' then
  479.               idle()
  480.     end
  481. end
  482.  
  483.  
  484. function precast(spell)
  485.     if pet.isvalid then
  486.         if spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then
  487.             equip(sets.precast.delay)
  488.             elseif spell.name == 'Elemental Siphon' then
  489.             equip(sets.precast.siphon)
  490.         elseif spell.name == 'Mana Cede' then
  491.             equip(sets.precast.cede)
  492.                 elseif CUR:contains(spell.name) then
  493.                                 equip(sets.precast.cure)      
  494.                 elseif spell.action_type == 'Magic' then
  495.                equip(sets.precast.FC)                  
  496.         end
  497.         elseif spell.action_type == 'Magic' then
  498.                equip(sets.precast.FC)
  499.         end
  500.     if spell.name:find('Spirit') and beforecall == 1 then
  501.                 beforecall = 0
  502.                 b = 0
  503.                 -- A FINIR
  504.                 -- First : check storm, then check weather, then check day
  505.                 for i=1, 8 do
  506.                         elem = StormList[i]
  507.                         if buffactive[elem] then
  508.                                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..elem..' active - '..Storm[elem]..' ] *-*-*-*-*-*-*-*-*')
  509.                                 cancel_spell()
  510.                                 send_command('input /ma "'..Storm[elem]..' Spirit" <me>')
  511.                                 b=1
  512.                         end
  513.                         i=i+1
  514.                 end
  515.                 if b == 0 then
  516.                         if world.weather_element ~= "None" then
  517.                                 cancel_spell()
  518.                                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..world.weather_element..' weather ] *-*-*-*-*-*-*-*-*')
  519.                                 windower.send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element]))
  520.                         else
  521.                                 cancel_spell()
  522.                                 windower.send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
  523.                                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..world.day_element..' day ] *-*-*-*-*-*-*-*-*')
  524.                         end
  525.                 end
  526.     elseif spell.name == 'Sneak' then
  527.         windower.ffxi.cancel_buff(71)
  528.     elseif spell.name == 'Stoneskin' then
  529.         windower.ffxi.cancel_buff(37)
  530.                
  531.          
  532.        
  533.        
  534.     end
  535. end
  536.  
  537. function midcast(spell)
  538.        
  539.         if spell.type == 'BloodPactRage'  or spell.type == 'BloodPactWard' then
  540.                 equip(sets.precast.delay)
  541.         elseif spell.action_type == 'Magic' then
  542.        
  543.                
  544.                 if ENF:contains(spell.name) then
  545.                         equip(sets.midcast.Enf)
  546.                 elseif spell.name  =='Stoneskin' then
  547.                         equip(sets.midcast.stoneskin)
  548.                 elseif CUR:contains(spell.name) then
  549.                         equip(sets.midcast.cure)
  550.                 elseif MAB:contains(spell.name) then
  551.                         equip(sets.midcast.Mab)
  552.        
  553.                 end
  554.        
  555.        
  556.     end
  557.  
  558. end
  559.  
  560.  
  561. function pet_midcast(spell)
  562.         if SpecialAvatar:contains(pet.name) then
  563.                 return
  564.         else
  565.     if spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then
  566.         if bp_physical[spell.name] then
  567.             equip(sets.pet_midcast.physical)
  568.         elseif bp_magic_tp[spell.name] then
  569.             if pet.tp < 250 then
  570.                 equip(sets.pet_midcast.magic.tp)
  571.             else
  572.                 equip(sets.pet_midcast.magic)
  573.             end
  574.         elseif bp_magic[spell.name] then
  575.             equip(sets.pet_midcast.magic)
  576.                 elseif bp_hybrid[spell.name] then
  577.                     equip(sets.pet_midcast.hybrid)
  578.         elseif bp_accuracy[spell.name] then
  579.             equip(sets.pet_midcast.accuracy)
  580.         elseif bp_duration[spell.name] then
  581.                         duration = bp_duration[spell.name] + sumskill - 300
  582.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Duration of '..spell.name..' = '..duration..' seconds ] *-*-*-*-*-*-*-*-*')
  583.             equip(sets.pet_midcast.skill)
  584.                         duration_pact_timer(spell.name)
  585.         elseif bp_boon[spell.name] then
  586.             equip(sets.pet_midcast.skill)
  587.         elseif bp_skill[spell.name] then
  588.             equip(sets.pet_midcast.skill)
  589.         end
  590.     end
  591.         end
  592. end
  593.  
  594.  
  595. function aftercast(spell)
  596.     idle()
  597. end
  598.  
  599. function status_change(new,old)
  600.         if new=="resting" then
  601.         idle()
  602.         elseif new=="engaged" then
  603.         return
  604.         else
  605.         idle()
  606.         end
  607. end
  608.  
  609.  
  610.        
  611. function self_command(command)
  612.     if command == 'Idle' then
  613.         idle()
  614.     end
  615. end
  616.  
  617.  
  618. function pet_aftercast(spell)
  619.   idle()
  620. end
  621.  
  622.  
  623.  
  624. function idle()
  625.     if pet.isvalid then
  626.         if string.find(pet.name,'Spirit') then
  627.             equip(sets.spirit)
  628.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - SpiritPerp Set ] *-*-*-*-*-*-*-*-*')
  629.                        
  630.         elseif buffactive["Avatar's Favor"] then
  631.             equip(sets.favor)
  632.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - Avatar Favor Set ] *-*-*-*-*-*-*-*-*')
  633.         else
  634.           equip(sets.perpetuation[pet.name] or sets.perpetuation)
  635.                   add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - Perp Set ] *-*-*-*-*-*-*-*-*')
  636.      
  637.          
  638.            
  639.         end
  640.                 else
  641.          equip(sets.idle)
  642.         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ NO Pet - Idle Set ] *-*-*-*-*-*-*-*-*')
  643.        
  644.          end
  645. end
  646.  
  647. -- Février et Mars DB
  648.  
  649.  
  650. function duration_pact_timer(spell_name)
  651.         -- Create custom timers for ward pacts.
  652.     if bp_duration[spell_name] then
  653.         local duration = bp_duration[spell_name]
  654.         if duration < 181 then
  655.             local skill = player.skills.summoning_magic
  656.             if skill > 300 then
  657.                 skill = skill - 300
  658.                 if skill > 200 then skill = 200 end
  659.                 duration = duration + skill
  660.             end
  661.         end
  662.        
  663.                 local timer_cmd = 'timers c "'..spell_name..'" '..tostring(duration)..' down'
  664.                
  665.                 if icons[spell_name] then
  666.                         timer_cmd = timer_cmd..' '..icons[spell_name]
  667.                 end
  668.  
  669.                 send_command(timer_cmd)
  670.     end
  671. end
Advertisement
Add Comment
Please, Sign In to add comment