Advertisement
usnapoleon

Whm lua cure issues

Nov 9th, 2014
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.72 KB | None | 0 0
  1. function get_sets()
  2. -------------------------------------------
  3.     -- aftercast for returning to TP and Idle sets
  4.     -- the 'self command' area will change the set defined as aftercast.TP
  5. -------------------------------------------    
  6.     sets.aftercast = {}
  7.     sets.engaged = {}
  8.     sets.precast = {}
  9.     sets.midcast = {}
  10.        
  11.     sets.obi = {
  12.         Fire = {waist="Karin Obi"},
  13.         Earth = {waist="Dorin Obi"},
  14.         Water = {waist="Suirin Obi"},
  15.         Wind = {waist="Furin Obi"},
  16.         Ice = {waist="Hyorin Obi"},
  17.         Lightning = {waist="Rairin Obi"},
  18.         Light = {waist="Korin Obi"},
  19.         Dark = {waist="Anrin Obi"},
  20.         }
  21.    
  22.     sets.aftercast.Idle = {
  23.         main="Bolelabunga",
  24.         sub="Genbu's Shield",
  25.         ammo="Mana Ampulla",
  26.         head="Nahtirah Hat",
  27.         neck="Twilight Torque",
  28.         lear="Graiai Earring",
  29.         rear="Gifted Earring",
  30.         body="Artsieq Jubbah",
  31.         hands="Otomi Gloves",
  32. --      hands="Serpentes Cuffs",
  33.         lring="Dark Ring",
  34.         rring="Defending Ring",
  35.         back="Pahtli Cape",
  36.         waist="Slipor Sash",
  37.         legs="Nares Trews",
  38.         feet="Gende. Galoshes"}
  39.  
  40.     sets.aftercast.Resting = set_combine(sets.aftercast.Idle, {
  41.         main="Boonwell Staff",
  42.         ammo="Mana Ampulla",
  43.         rear="Relaxing Earring",
  44.         hands="Nares Cuffs",
  45.         waist="Austerity Belt",
  46.         legs="Nisse Slacks"})
  47.    
  48. -------------------------------------------
  49. -- The outermost table has to be named "sets", but
  50. -- otherwise there are no restrictions.
  51. -------------------------------------------
  52.  
  53.     sets.engaged.TPnormal = {
  54.         main="Bolelabunga",
  55.         ammo="Flame Sachet",
  56.         head="Theo. Cap +1",
  57.         neck="Asperity Necklace",
  58.         lear="Bladeborn Earring",
  59.         rear="Steelflash Earring",
  60.         body="Artsieq Jubbah",
  61.         hands="Otomi Gloves",
  62.         lring="K'ayres Ring",
  63.         rring="Rajas Ring",
  64.         back="Potentia Cape",
  65.         waist="Ninurta's Sash",
  66.         legs="Rubeus Spats",
  67.         feet="Gende. Galoshes"} --6+3+3+6+3+3=24 haste
  68.        
  69.     sets.engaged.TPacc = set_combine(sets.engaged.TPnormal, {
  70.         lring="Patricius Ring",
  71.         rring="Mars's Ring"}) --6+3+3+5+4+3=24 haste
  72.    
  73.     sets.aftercast.TP = sets.engaged.TPnormal
  74. -------------------------------------------
  75.     -- WS sets
  76.     -- So it's easy to determine if new obtained gear can replace anything, listed str/mnd/int stats per piece 
  77. -------------------------------------------
  78.     sets.precast.WSStr = {
  79.         ammo="Flame Sachet", --2/0/0
  80.         head="Sukeroku Hachi.", --25/20/20
  81.         neck="Asperity Necklace",
  82.         lear="Bladeborn Earring",
  83.         rear="Steelflash Earring",
  84.         body="Theo. Briault", --21/29/29
  85.         hands="Theo. Mitts +1", --11/38/19
  86.         lring="K'ayres Ring",
  87.         rring="Rajas Ring", --5/0/0
  88.         back="Potentia Cape", --6/0/6
  89.         waist="Goading Belt",
  90.         legs="Theo. Pant. +1", --25/24/34
  91.         feet="Theo. Duckbills +1"} --10/24/22
  92.    
  93.     sets.precast.WSStrMnd = set_combine(sets.precast.WSStr, {
  94.         ammo="Mana Ampulla", --0/0/4
  95.         neck="Mizu. Kubikazari", --0/4/4
  96.         lring="Diamond Ring" }) --0/4/4
  97.        
  98.     sets.precast.WSStrInt = set_combine(sets.precast.WSStr, {
  99.         neck="Mizu. Kubikazari", --0/4/4
  100.         lring="Sprial Ring", --5/0/5
  101.         waist="Wanion Belt"}) --8/(5)/8
  102. -------------------------------------------
  103.     -- Fastcast sets:  
  104. -------------------------------------------
  105.     sets.precast.Fastcast = {
  106.         ammo="Incantor Stone",
  107.         head="Nahtirah Hat",
  108.         neck="Orison Locket",
  109.         lear="Loquacious Earring",
  110.         rear="Gifted Earring",
  111.         body="Artsieq Jubbah",
  112.         hands="Gendewitha Gages",
  113.         lring="Dark Ring",
  114.         rring="Defending Ring",
  115.         back="Shadow Mantle",
  116.         waist="Goading Belt",
  117.         legs="Artsieq Hose",
  118.         feet="Theo. Duckbills +1"}
  119.  
  120.     sets.precast.HasteEnhancing = set_combine(sets.precast.Fastcast, {
  121.         waist="Siegel Sash"})
  122.    
  123.     sets.precast.HasteStoneskin = set_combine(sets.precast.HasteEnhancing, {
  124.         head="Umuthi Hat",
  125.         hands="Carapacho Cuffs"})
  126.    
  127.     sets.precast.HasteHealing = set_combine(sets.precast.Fastcast, {
  128.         main="Tamaxchi",
  129.         sub="Genbu's Shield",
  130.         head="Theo. Cap +1",
  131.         body="Heka's Kalasiris",
  132.         back="Pahtli Cape",
  133.         legs="Orsn. Pantaln. +2",
  134.         feet="Cure Clogs"})
  135.    
  136.     sets.precast.HasteElemental = set_combine(sets.precast.Fastcast, {
  137.         main="Boonwell Staff",
  138.         sub="Zuuxowu Grip",
  139.         neck="Stoicheion Medal"})
  140. -------------------------------------------
  141.     -- Spell (midcast) sets:  
  142. -------------------------------------------
  143.     sets.midcast['Elemental Magic'] = {
  144.         main="Boonwell Staff",
  145.         sub="Zuuxowu Grip",
  146.         ammo="Dosis Tathlum",
  147.         head="Buremte Hat",
  148.         neck="Mizu. Kubikazari",
  149.         lear="Friomisi Earring",
  150.         rear="Crematio Earring",
  151.         body="Artsieq Jubbah",
  152.         hands="Otomi Gloves",
  153.         lring="Strendu Ring",
  154.         rring="Acumen Ring",
  155.         back="Toro Cape",
  156.         waist="Sekhmet Corset",
  157.         legs="Gendewitha Spats",
  158.         feet="Gende. Galoshes"}
  159.    
  160.     sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {
  161.         body="Twilight Cloak"})
  162.    
  163.     sets.midcast.Stone = set_combine(sets.midcast['Elemental Magic'], {
  164.         neck="Quanpur Necklace"})
  165.        
  166.     sets.midcast['Dark Magic'] = set_combine(sets.midcast['Elemental Magic'], {
  167.         legs="Portent Pants"})
  168.        
  169.     sets.midcast['Enfeebling Magic'] = {
  170.         sub="Zuuxowu Grip",
  171.         ammo="Ombre Tathlum +1",
  172.         head="Buremte Hat",
  173.         neck="Stoicheion Medal",
  174.         lear="Loquacious Earring",
  175.         rear="Gifted Earring",
  176.         body="Theo. Briault",
  177.         hands="Rubeus Gloves",
  178.         lring="Dark Ring",
  179.         rring="Strendu Ring",
  180.         back="Mending Cape",
  181.         waist="Yamabuki-no-Obi",
  182.         legs="Portent Pants",
  183.         feet="Theo. Duckbills +1"}
  184.    
  185.     sets.midcast['Enhancing Magic'] = {
  186.         main="Bolelabunga",
  187.         sub="Genbu's Shield",
  188.         ammo="Impatiens",
  189.         head="Umuthi Hat",
  190.         neck="Twilight Torque",
  191.         lear="Loquacious Earring",
  192.         rear="Gifted Earring",
  193.         body="Artsieq Jubbah",
  194.         hands="Dynasty Mitts",
  195.         lring="Sirona's Ring",
  196.         rring="Defending Ring",
  197.         back="Mending Cape",
  198.         waist="Siegel Sash",
  199.         legs="Portent Pants",
  200.         feet="Theo. Duckbills +1"}
  201.        
  202.     sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {
  203.         neck="Stone Gorget",
  204.         waist="Siegel Sash",
  205.         legs="Haven Hose"})
  206.        
  207.     sets.midcast['Healing Magic'] = {
  208.         -- Commented stats are potency/skill/mnd (ignoring vitality)
  209.         main="Tamaxchi", --22/0/5
  210.         sub="Genbu's Shield", --4/0/0
  211.         ammo="Impatiens",
  212.         head="Theo. Cap +1", --10/0/27
  213.         neck="Phalaina Locket", --4/0/3
  214.         lear="Loquacious Earring",
  215.         rear="Gifted Earring",
  216.         body="Orison Bliaud +2", --0/20/0
  217.         hands="Theo. Mitts +1", --0/17/38
  218.         lring="Sirona's Ring", --0/10/3
  219.         rring="Ephedra Ring", --0/7/0
  220.         back="Mending Cape", --5/3/0
  221.         waist="Korin Obi", --0/0/0
  222.         legs="Orsn. Pantaln. +2", --0/0/7 do not remove, has 'converts cure to mp trait'
  223.         feet="Rubeus Boots"} --0/10/0
  224.        
  225.     sets.midcast.CureSingle = set_combine(sets.midcast['Healing Magic'], {
  226.         -- For single target cure spells, which has a power formula that values healing skill > mnd > vit
  227.         hands="Bokwus Gloves"}) --13/0/13
  228.        
  229.     sets.midcast.CureAOE = set_combine(sets.midcast['Healing Magic'], {
  230.         -- For single target cure spells, which has a power formula that values mnd > vit > healing skill
  231.         body="Theo. Bliaud", --7/0/29
  232.         legs="Theo. Pant. +1", --0/0/34
  233.         feet="Theo. Duckbills +1"}) --0/0/24
  234.    
  235.     sets.midcast.ProtectShell = set_combine(sets.midcast['Enhancing Magic'], {
  236.         lring="Sheltered Ring"})
  237.        
  238.     sets.midcast.Cursna = set_combine(sets.precast.Fastcast, {
  239.         lring="Sirona's Ring",
  240.         rring="Ephedra Ring",
  241.         back="Mending Cape",
  242.         legs="Theo. Pant. +1",
  243.         feet="Gende. Galoshes"})
  244.        
  245.     sets.midcast['Divine Magic'] = set_combine(sets.midcast['Healing Magic'], {
  246.         legs="Theo. Pant. +1"})
  247.  
  248.    
  249. -------------------------------------------
  250.     -- Job Ability sets
  251. -------------------------------------------
  252.        
  253.     sets.precast.Benediction = {}
  254.     sets.precast["Afflatus Solace"] = {feet="Orison Bliaud +2"}
  255.     sets.precast.Martyr = {}
  256.     sets.precast.Devotion = {}
  257.     sets.precast["Divine Caress"] = {hands="Orison Mitts +2",back="Mending Cape"}
  258.    
  259.     send_command('input /macro book 7')
  260. end
  261.  
  262. function precast(spell,action)
  263.     if player.equipment.head == 'Reraise Hairpin' then disable('head')
  264.     else enable('head') end
  265.     if player.equipment.left_ear == 'Reraise Earring' then disable('ear1')
  266.     else enable('ear1') end
  267.     if spell.action_type == 'Magic' or spell.type == 'Ninjutsu' then
  268.         if spell.skill == 'Elemental Magic' then
  269.             if spell.cast_time < 9 then
  270.                 if spell.english:startswith('Stone') then
  271.                     equip(sets.midcast.Stone,{head="Buremte Hat"})         
  272.                 else equip(sets.midcast.ElementalLow)
  273.                 end
  274.             elseif spell.name == 'Impact' then
  275.                 equip(sets.precast.HasteElemental,{body="Twilight Cloak"})
  276.             else equip(sets.precast.HasteElemental)
  277.             end
  278.         elseif spell.skill == 'Enhancing Magic' then
  279.             if spell.name == 'Stoneskin' then
  280.                 equip(sets.precast.HasteStoneskin)
  281.             else equip(sets.precast.HasteEnhancing)
  282.             end
  283.         elseif spell.skill == 'Healing Magic' then
  284.             if spell.english:startswith('Cur') then
  285.                 if spell.name == 'Cursna' then
  286.                     equip(sets.midcast.Cursna)
  287.                 elseif spell.cast_time < 9 then
  288.                     equip(sets.midcast.CureSingle)
  289.                 else equip(sets.precast.HasteHealing)
  290.                 end            
  291.             else equip(sets.precast.HasteHealing)
  292.             end
  293.         else equip(sets.precast.Fastcast)
  294.         end
  295.     elseif spell.type == 'WeaponSkill' then
  296.         if spell.english == 'Brainshaker' or 'Skullbreaker' or 'True Strike' or 'Heavy Swing' or 'Shell Crusher' then
  297.             equip(sets.precast.WSStr)
  298.         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
  299.             equip(sets.precast.WSStrMnd)
  300.         elseif spell.english == 'Rock Crusher' or 'Earth Crusher' or 'Spirit Taker' or 'Vidohunir' or 'Cataclysm' then
  301.             equip(sets.precast.WSStrInt)
  302.         else equip(sets.precast.WSStr)
  303.         end
  304.     elseif sets.precast[spell.english] then
  305.         equip(sets.precast[spell.english])
  306.     end
  307. end
  308.  
  309. function midcast(spell,action)
  310.     if spell.action_type == 'Magic' then
  311.         if spell.skill == 'Elemental Magic' then
  312.             if spell.cast_time < 9 then
  313.                 if spell.english:startswith('Stone') then
  314.                     equip(sets.midcast.Stone,{head="Buremte Hat"})         
  315.                 else equip(sets.midcast.ElementalLow)
  316.                 end
  317.             elseif spell.english:startswith('Stone') then
  318.                 equip(sets.midcast.Stone)  
  319.             elseif spell.english == 'Impact' then
  320.                 equip(sets.midcast.Impact)
  321.             else equip(sets.midcast['Elemental Magic'])
  322.             end
  323. --          if spell.cast_time > 9 then
  324.                 if spell.element == world.weather_element or spell.element == world.day_element then
  325.                     equip(sets.obi[spell.element])
  326.                 end
  327. --          end
  328.         elseif spell.skill == 'Enhancing Magic' then
  329.             if spell.english:startswith('Protect') or spell.english:startswith('Shell') then
  330.                 equip(sets.midcast.ProtectShell)
  331.             elseif spell.name == 'Stoneskin' then
  332.                 equip(sets.midcast.Stoneskin)
  333.             else equip(sets.midcast['Enhancing Magic'])
  334.             end
  335.         elseif spell.skill == 'Healing Magic' then
  336.             if spell.english:startswith('Curaga') then
  337.                 equip(sets.midcast.CureAOE)
  338.             elseif spell.english:startswith('Cure') then
  339.                 equip(sets.midcast.CureSingle)
  340.             elseif sets.midcast[spell.english] then
  341.                 equip(sets.midcast[spell.english])
  342.             else equip(sets.midcast[spell.skill])
  343.             end
  344.         elseif sets.midcast[spell.skill] then
  345.             equip(sets.midcast[spell.skill])
  346.         else equip(sets.precast.Fastcast)
  347.         end
  348.     end
  349. end
  350.  
  351. function aftercast(spell)
  352.     if player.status == 'Engaged' then
  353.         equip(sets.aftercast.TP)
  354.     else
  355.         equip(sets.aftercast.Idle)
  356.     end
  357. end
  358.  
  359. function status_change(new,old)
  360.     if T{'Idle','Resting'}:contains(new) then
  361.         equip(sets.aftercast.Idle)
  362.     elseif new == 'Engaged' then
  363.         equip(sets.aftercast.TP)
  364.     end
  365. end
  366.  
  367. function self_command(command)
  368.     if command == 'toggle TP set' then
  369.         if sets.aftercast.TP == sets.engaged.TPnormal then
  370.             sets.aftercast.TP = sets.engaged.TPacc
  371.             send_command('@input /echo ACC SET')
  372.         elseif sets.aftercast.TP == sets.engaged.TPacc then
  373.             sets.aftercast.TP = sets.engaged.TPnormal
  374.             send_command('@input /echo NORMAL SET')
  375.         end
  376.     end
  377. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement