Advertisement
Rosienaikanaro

Kanryu_RUN.lua

May 2nd, 2016
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.42 KB | None | 0 0
  1. --[[
  2.  
  3.     Kanryu_RUN
  4.    
  5.     2/4/2016
  6.  
  7. ]]
  8.  
  9. --!!INIT!!--
  10.  
  11.     --Organizer--
  12.     include('organizer-lib')
  13.    
  14.     organizer_items = {
  15.         main    =   'Epeolatry',
  16.         main    =   'Aettir',
  17.         main    =   'Vampirism',
  18.         sub     =   'Duplus Grip',
  19.         rear    =   'Moonshade Earring',
  20.         rring   =   'Warp Ring',
  21.         lring   =   'Echad Ring',
  22.         rring   =   'Trizek Ring',
  23.         back    =   'Mecisto. Mantle',
  24.         waist   =   'Fucho-no-Obi'
  25.     }
  26.  
  27.     --Command Aliases--
  28.     send_command('alias rune gs c rune')
  29.     send_command('alias pdt gs c pdt')
  30.     send_command('alias mdt gs c mdt')
  31.     send_command('alias acc gs c acc')
  32.     send_command('alias spi gs c spi')
  33.     send_command('alias cp gs c cp')
  34.    
  35.     --Setup--
  36.     send_command('gs enable all')
  37.     send_command('bind ^1 rune')
  38.    
  39.     --Set Macro Book--
  40.     send_command('input /macro book 20; wait .1;input /macro set 10; wait 2.5; input /lockstyleset 004')
  41.  
  42. --Main()--
  43. function get_sets()
  44.  
  45.     --Rune Ladder Setup--
  46.    
  47.     runeIndex = 1
  48.     runeArray = {"Tellus", "Unda", "Flabra", "Ignis", "Gelus", "Sulpor", "Lux", "Tenebrae"}
  49.    
  50.     --Command Triggers--
  51.    
  52.     PDTTrigger  =   1
  53.     MDTTrigger  =   0
  54.     AccTrigger  =   0
  55.     SpellInt    =   0  
  56.     CPTrigger   =   0
  57.    
  58.     ShadowType  =   'None'
  59.    
  60.     target_distance = 6
  61.  
  62.     --Idle Sets--
  63.        
  64.         sets.Idle = {}
  65.        
  66.         sets.Idle.Standard = {
  67.             ammo    =   "Homiliary",
  68.             head    =   "Iuitl Headgear +1",
  69.             neck    =   "Twilight Torque",
  70.             lear    =   "Ethereal Earring",
  71.             rear    =   "Genmei Earring",
  72.             body    =   "Emet Harness +1",
  73.             hands   =   "Erilaz Gauntlets +1",
  74.             lring   =   "Paguroidea Ring",
  75.             rring   =   "Sheltered Ring",
  76.             back    =   "Evasionist's Cape",
  77.             waist   =   "Flume Belt",
  78.             legs    =   "Eri. Leg Guards +1",
  79.             feet    =   "Skd. Jambeaux +1"
  80.         }
  81.            
  82.         sets.Idle.PDT = {
  83.             ammo    =   "Inlamvuyeso",
  84.             head    =   "Iuitl Headgear +1",
  85.             neck    =   "Twilight Torque",
  86.             lear    =   "Ethereal Earring",
  87.             rear    =   "Genmei Earring",
  88.             body    =   "Erilaz Surcoat +1",
  89.             hands   =   "Erilaz Gauntlets +1",
  90.             lring   =   "Vocane Ring",
  91.             rring   =   "Defending Ring",
  92.             back    =   "Evasionist's Cape",
  93.             waist   =   "Flume Belt",
  94.             legs    =   "Eri. Leg Guards +1",
  95.             feet    =   "Erilaz Greaves +1"
  96.         }
  97.            
  98.         sets.Idle.MDT = {
  99.             ammo    =   "Vanir Battery",
  100.             head    =   "Fu. Bandeau +1",
  101.             neck    =   "Twilight Torque",
  102.             lear    =   "Ethereal Earring",
  103.             rear    =   "Spellbr. Earring",
  104.             body    =   "Futhark Coat +1",
  105.             hands   =   "Futhark Mitons +1",
  106.             lring   =   "Shadow Ring",
  107.             rring   =   "Defending Ring",
  108.             back    =   "Engulfer Cape +1",
  109.             waist   =   "Carrier's Sash",
  110.             legs    =   "Rune. Trousers +1",
  111.             feet    =   "Manabyss Pigaches"
  112.         }
  113.        
  114.         sets.Idle.Regen = set_combine(sets.Idle.Standard, {
  115.             head    =   "Oce. Headpiece +1",
  116.             neck    =   "Wiglen Gorget",
  117.             lear    =   "Infused Earring",
  118.             rear    =   "Dawn Earring",
  119.             body    =   "Futhark Coat +1",
  120.             lring   =   "Sheltered Ring",
  121.             rring   =   "Paguroidea Ring",
  122.             back    =   "Scuta Cape"
  123.         })
  124.        
  125.         sets.Idle.Refresh = set_combine(sets.Idle.Standard, {
  126.             ammo    =   "Homiliary",
  127.             head    =   "Rawhide Mask",
  128.             body    =   "Runeist Coat +1"
  129.         })
  130.        
  131.     --Misc Sets--
  132.    
  133.         sets.Enmity = {
  134.             head    =   "Highwing Helm",
  135.             neck    =   "Warder's Charm",
  136.             rear    =   "Cryptic Earring",
  137.             body    =   "Emet Harness +1",
  138.             hands   =   "Futhark Mitons +1",
  139.             back    =   "Evasionist's Cape",
  140.             legs    =   "Eri. Leg Guards +1",
  141.             feet    =   "Erilaz Greaves +1"
  142.         }
  143.        
  144.     --TP Sets--
  145.        
  146.         sets.engaged = {
  147.             ammo    =   "Vanir Battery",
  148.             head    =   "Dampening Tam",
  149.             neck    =   "Asperity Necklace",
  150.             lear    =   "Bladeborn Earring",
  151.             rear    =   "Steelflash Earring",
  152.             body    =   "Thaumas Coat",
  153.             hands   =   "Nomkah. Mittens +1",
  154.             lring   =   "Epona's Ring",
  155.             rring   =   "Petrov Ring",
  156.             back    =   "Bleating Mantle",
  157.             waist   =   "Windbuffet Belt +1",
  158.             legs    =   "Taeon Tights",
  159.             feet    =   "Taeon Boots"
  160.         }
  161.            
  162.         sets.engaged.Acc = set_combine(sets.engaged, {
  163.             --[[ammo    =   "Seeth. Bomblet +1",
  164.             head    =   "Whirlpool Mask",
  165.             lear    =   "Zennaroi Earring",
  166.             body    =   "Manibozho Jerkin",
  167.             hands   =   "Umuthi Gloves",
  168.             lring   =   "Ramuh Ring +1",
  169.             rring   =   "Ramuh Ring +1",
  170.             back    =   "Letalis Mantle",
  171.             waist   =   "Anguinus Belt",]]
  172.         })
  173.            
  174.         sets.engaged.AM = {
  175.             --[[ammo    =   "Ginsen",
  176.             head    =   "Whirlpool Mask",
  177.             neck    =   "Asperity Necklace",
  178.             lear    =   "Bladeborn Earring",
  179.             rear    =   "Steelflash Earring",
  180.             body    =   "Manibozho Jerkin",
  181.             hands   =   "Umuthi Gloves",
  182.             lring   =   "Epona's Ring",
  183.             rring   =   "Mars's Ring",
  184.             back    =   "Letalis Mantle",
  185.             waist   =   "Anguinus Belt",
  186.             legs    =   "Taeon Tights",
  187.             feet    =   "Taeon Boots"]]
  188.         }
  189.        
  190.     --WS Sets--
  191.    
  192.         sets.precast = {}
  193.        
  194.         sets.precast.WS = {
  195.             --[[ammo    =   "Seeth. Bomblet +1",
  196.             head    =   "Highwing Helm",
  197.             neck    =   "Soil Gorget",
  198.             lear    =   "Bladeborn Earring",
  199.             rear    =   "Steelflash Earring",
  200.             body    =   "Manibozho Jerkin",
  201.             hands   =   "Nomkah. Mittens +1",
  202.             lring   =   "Epona's Ring",
  203.             rring   =   "Pyrosoul Ring",
  204.             back    =   "Buquwik Cape",
  205.             waist   =   "Soil Belt",
  206.             legs    =   "Taeon Tights",
  207.             feet    =   "Taeon Boots"]]
  208.         }
  209.            
  210.         sets.precast.WS['Dimidiation'] = {
  211.             ammo    =   "Jukukik Feather",
  212.             head    =   "Dampening Tam",
  213.             neck    =   "Shifting Neck. +1",
  214.             lear    =   "Jupiter's Pearl",
  215.             rear    =   "Jupiter's Pearl",
  216.             body    =   "Dread Jupon",
  217.             hands   =   "Erilaz Gauntlets +1",
  218.             lring   =   "Ramuh Ring +1",
  219.             rring   =   "Ramuh Ring +1",
  220.             back    =   "Kayapa Cape",
  221.             waist   =   "Fotia Belt",
  222.             legs    =   "Samnuha Tights",
  223.             feet    =   "Taeon Boots"
  224.         }
  225.            
  226.         sets.precast.WS['Sanguine Blade'] = {
  227.             ammo    =   "Seeth. Bomblet +1",
  228.             head    =   "Highwing Helm",
  229.             neck    =   "Eddy Necklace",
  230.             lear    =   "Novio Earring",
  231.             rear    =   "Friomisi Earring",
  232.             body    =   "Dread Jupon",
  233.             hands   =   "Leyline Gloves",
  234.             lring   =   "Archon Ring",
  235.             rring   =   "Fenrir Ring +1",
  236.             back    =   "Argocham. Mantle",
  237.             waist   =   "",
  238.             legs    =   "Shneddick Tights +1",
  239.             feet    =   "Manabyss Pigaches"
  240.         }
  241.        
  242.     --Spells--
  243.    
  244.         --Pre Cast--
  245.        
  246.         sets.precast.spell = {
  247.             ammo    =   "",
  248.             head    =   "Rune. Bandeau +1",
  249.             lear    =   "Loquac. Earring",
  250.             body    =   "Dread Jupon",
  251.             hands   =   "Taeon Gloves",
  252.             lring   =   "Prolix Ring",
  253.             legs    =   "Orvail Pants",
  254.             feet    =   "Chelona Boots"
  255.         }
  256.            
  257.         sets.precast['Enhancing Magic'] = set_combine(sets.precast.spell, {
  258.             waist   =   "Siegel Sash",
  259.             legs    =   "Futhark Trousers +1"
  260.         })
  261.            
  262.         sets.precast['Ninjutsu'] = set_combine(sets.precast.spell, {
  263.             neck    =   "Magoraga Beads"
  264.         })
  265.            
  266.         --Mid Cast--
  267.        
  268.         sets.midcast = {}
  269.            
  270.         sets.midcast['Enhancing Magic'] = {
  271.             head    =   "Erilaz Galea +1",
  272.             neck    =   "Colossus's Torque",
  273.             hands   =   "Runeist Mitons +1",
  274.             back    =   "Merciful Cape",
  275.             legs    =   "Futhark Trousers +1"
  276.         }
  277.    
  278.         sets.midcast.Regen = set_combine(sets.midcast['Enhancing Magic'], {
  279.             head    =   "Rune. Bandeau +1"
  280.         })
  281.        
  282.         sets.midcast.Refresh = set_combine(sets.midcast['Enhancing Magic'], {
  283.             head    =   "Erilaz Galea +1"
  284.         })
  285.        
  286.         sets.midcast.Phalanx = set_combine(sets.midcast['Enhancing Magic'], {
  287.             head    =   "Fu. Bandeau +1"
  288.         })
  289.        
  290.         sets.midcast.SpellInterrupt = set_combine(sets.Idle.PDT), {
  291.             ammo    =   "Impatiens",
  292.             neck    =   "Willpower Torque",
  293.             rear    =   "Halasz Earring",
  294.             hands   =   "Rawhide Gloves",
  295.             rring   =   "Evanescence Ring",
  296.             waist   =   "Rumination Sash",
  297.             legs    =   "Carmine Cuisses +1",
  298.             feet    =   "Karasutengu",
  299.         })
  300.            
  301.     --Job Abilites--
  302.    
  303.         sets.precast.JA = {}
  304.        
  305.         sets.precast.JA['Elemental Sforzo'] = set_combine(sets.Enmity, {
  306.             body    =   "Futhark Coat +1"
  307.         })
  308.        
  309.         sets.precast.JA['Swordplay'] = set_combine(sets.Enmity, {
  310.             hands   =   "Futhark Mitons +1"
  311.         })
  312.        
  313.         sets.precast.JA['Vivacious Pulse'] = set_combine(sets.Enmity, {
  314.             head    =   "Erilaz Galea +1"
  315.         })
  316.        
  317.         sets.precast.JA['Lunge'] = set_combine(sets.Enmity, {
  318.             ammo    =   "Seeth. Bomblet +1",
  319.             head    =   "Highwing Helm",
  320.             neck    =   "Eddy Necklace",
  321.             lear    =   "Novio Earring",
  322.             rear    =   "Friomisi Earring",
  323.             body    =   "",
  324.             hands   =   "Leyline Gloves",
  325.             lring   =   "Fenrir Ring +1",
  326.             rring   =   "Fenrir Ring +1",
  327.             back    =   "Argocham. Mantle",
  328.             waist   =   "",
  329.             legs    =   { name="Herculean Trousers", augments={'Mag. Acc.+18 "Mag.Atk.Bns."+18','Mag. Acc.+5','"Mag.Atk.Bns."+8',}},
  330.             feet    =   "Manabyss Pigaches"
  331.         })
  332.    
  333.         sets.precast.JA['Gambit'] = set_combine(sets.Enmity, {
  334.             hands   =   "Runeist Mitons +1"
  335.         })
  336.        
  337.         sets.precast.JA['Rayke'] = set_combine(sets.Enmity, {
  338.             feet    =   "Futhark Boots +1"
  339.         })
  340.        
  341.         sets.precast.JA['Pflug'] = set_combine(sets.Enmity, {
  342.             feet    =   "Runeist Bottes +1"
  343.         })
  344.        
  345.         sets.precast.JA['Valiance'] = set_combine(sets.Enmity, {
  346.             body    =   "Runeist Coat +1",
  347.             legs    =   "Futhark Trousers +1"
  348.         })
  349.        
  350.         sets.precast.JA['Liement'] = set_combine(sets.Enmity, {
  351.             body    =   "Futhark Coat +1"
  352.         })
  353.        
  354.         sets.precast.JA['Battuta'] = set_combine(sets.Enmity, {
  355.             head    =   "Fu. Bandeau +1"
  356.         })
  357.  
  358. end
  359.  
  360. --Precast Core--
  361. function precast(spell, action)
  362.    
  363.     --Magic--
  364.     if spell.action_type == 'Magic' then
  365.         precast_magic(spell)
  366.     end
  367.    
  368.     --Job Ability--
  369.     if spell.type == 'JobAbility' then
  370.         precast_ja(spell)
  371.     end
  372.        
  373.     --Effusion--
  374.     if spell.type == "Effusion" then
  375.         precast_effusion(spell)
  376.     end
  377.            
  378.     --Ward--
  379.     if spell.type == "Ward" then
  380.         precast_ward(spell)    
  381.     end
  382.    
  383.     --Rune Switch Start--
  384.     if spell.type == "Rune" then
  385.         runeLock(spell)
  386.     end
  387.    
  388.     --Weaponskills--
  389.     if spell.type == "WeaponSkill" then
  390.         precast_weaponskill(spell)     
  391.     end
  392.    
  393.     --AutoCancel Ichi--
  394.     if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and
  395.         (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
  396.         cancel_spell()
  397.     end
  398.    
  399.     --Disability Swap--
  400.     if buffactive['terror'] or buffactive['petrification']
  401.         or buffactive['stun'] or buffactive['sleep'] then
  402.         if MDTTrigger == 1 then
  403.             equip(sets.Idle.MDT)
  404.         else
  405.             equip(sets.Idle.PDT)
  406.         end
  407.     end
  408.    
  409.     --Wake Up--
  410.     if buffactive.sleep and player.hp > 100 and player.status == "Engaged" then
  411.         equip(set_combine(sets.Idle.PDT, {head="Frenzy Sallet"}))
  412.     end
  413.    
  414. end
  415.  
  416. --Midcast Core--
  417. function midcast(spell, action)
  418.  
  419.     if spell.action_type == "Magic" then
  420.         midcast_magic(spell)       
  421.     end  
  422.  
  423. end
  424.  
  425. --Aftercast Core--
  426. function aftercast(spell, action)
  427.  
  428.     --Shadow Track--
  429.     if string.find(spell.name,'Utsusemi') and not spell.interrupted then
  430.         if spell.name == 'Utsusemi: Ichi' then
  431.             ShadowType = 'Ichi'
  432.         elseif spell.name == 'Utsusemi: Ni' then
  433.             ShadowType = 'Ni'
  434.         end
  435.     end
  436.  
  437.     --Aftercast Function Trigger--
  438.     if player.status == "Engaged" then
  439.         aftercast_engaged()
  440.     else
  441.         aftercast_idle()
  442.     end
  443.  
  444. end
  445.  
  446. --Status Change Core--
  447. function status_change(new, old)
  448.  
  449.     --Aftercast Function Trigger--
  450.     if player.status == "Engaged" then
  451.         aftercast_engaged()
  452.     else
  453.         aftercast_idle()
  454.     end
  455.  
  456. end
  457.  
  458. --Custom Command Engine--
  459. function self_command(command)
  460.    
  461.     --Rune Repeater--
  462.     if command == 'rune' then
  463.         send_command('input /ja '..runeArray[runeIndex]..' <me>')
  464.     end
  465.    
  466.     --PDT Trigger--
  467.     if command == 'pdt' then       
  468.         if PDTTrigger == 1 then
  469.             add_to_chat(170, 'PDT Toggled - Max Damage')
  470.             PDTTrigger = 0
  471.         else
  472.             add_to_chat(170, 'PDT Toggled - Max PDT')
  473.             PDTTrigger = 1
  474.         end
  475.     end
  476.    
  477.     --MDT Trigger--
  478.     if command == 'mdt' then
  479.         if MDTTrigger == 1 then
  480.             add_to_chat(170, 'MDT Toggled - Max Damage')
  481.             MDTTrigger = 0
  482.         else
  483.             add_to_chat(170, 'MDT Toggled - Max MDT')
  484.             MDTTrigger = 1
  485.         end
  486.     end
  487.    
  488.     --Acc Trigger--
  489.     if command == 'acc' then
  490.         if AccTrigger == 1 then
  491.             add_to_chat(170, 'Acc Toggled - Max Damage')
  492.             AccTrigger = 0
  493.         else
  494.             add_to_chat(170, 'Acc Toggled - Max Acc')
  495.             AccTrigger = 1
  496.         end
  497.     end
  498.    
  499.     --SpellInterrupt Trigger--
  500.     if command == 'spi' then
  501.         if SpellInt == 1 then
  502.             add_to_chat(170, 'Spell Interupt Chance Down')
  503.             SpellInt = 0
  504.         else
  505.             add_to_chat(170, 'Normal Cast')
  506.             SpellInt = 1
  507.         end
  508.     end
  509.    
  510.     --Cap Cape Lock--
  511.     if command == 'cp' then
  512.         if CPTrigger == 1 then
  513.             enable('back')
  514.             add_to_chat(170, 'CP Cape Released')
  515.             CPTrigger = 0
  516.         else
  517.             equip({back="Mecisto. Mantle"})
  518.             disable('back')
  519.             add_to_chat(170, 'CP Cape Locked')
  520.             CPTrigger = 1
  521.         end
  522.     end
  523.    
  524. end
  525.  
  526. --Subfunction for Magic Precast--
  527. function precast_magic(spell, action)
  528.  
  529.     --Ninjutsu--
  530.     if spell.skill == 'Ninjutsu' then
  531.         equip(sets.precast['Ninjutsu'])
  532.        
  533.     --Enhancing--
  534.     elseif spell.skill == 'Enhancing Magic' then
  535.         equip(sets.precast['Enhancing Magic'])
  536.        
  537.     --Default--
  538.     else
  539.         equip(sets.precast.spell)
  540.     end
  541.  
  542. end
  543.  
  544. --Subfunction for Job Ability Precast--
  545. function precast_ja(spell, action)
  546.    
  547.     --2hr Trigger--
  548.     if spell.english == "Elemental Sforzo" then
  549.         equip(sets.precast.JA['Elemental Sforzo'])
  550.        
  551.     --Swordplay Trigger--
  552.     elseif spell.english == "Swordplay" then
  553.         equip(sets.precast.JA['Swordplay'])
  554.        
  555.     --Vpulse Trigger--
  556.     elseif spell.english == "Vivacious Pulse" then
  557.         equip(sets.precast.JA['Vivacious Pulse'])
  558.        
  559.     --Default--
  560.     else   
  561.         equip(sets.Enmity)
  562.     end
  563.  
  564. end
  565.  
  566. --Subfunction for Effusion Precast--
  567. function precast_effusion(spell, action)
  568.    
  569.     --Lunge / Swipe Trigger--
  570.     if spell.english == "Lunge" or "Swipe" then
  571.         equip(sets.precast.JA['Lunge'])
  572.        
  573.     --Gambit Trigger--
  574.     elseif spell.english == "Gambit" then
  575.         equip(sets.precast.JA['Gambit'])
  576.        
  577.     --Rayke Trigger--
  578.     elseif spell.english == "Rayke" then
  579.         equip(sets.precast.JA['Rayke'])
  580.     end
  581.    
  582. end
  583.  
  584. --Subfunction for Ward Precast--
  585. function precast_ward(spell, action)
  586.    
  587.     --Pflug Trigger--
  588.     if spell.english == "Pflug" then
  589.         equip(sets.precast.JA['Pflug'])
  590.        
  591.     --Valiance / Vallation Trigger--
  592.     elseif spell.english == "Valiance" or "Vallation" then
  593.         equip(sets.precast.JA['Valiance'])
  594.        
  595.     --Liement Trigger--
  596.     elseif spell.english =="Liement" then
  597.         equip(sets.precast.JA['Liement'])
  598.        
  599.     --Battuta Trigger--
  600.     elseif spell.english == "Battuta" then
  601.         equip(sets.precast.JA['Battuta'])
  602.     end
  603.    
  604. end
  605.  
  606. --Subfunction for Weapon Skill Precast--
  607. function precast_weaponskill(spell, action)
  608.    
  609.     --Moonshade Trigger--
  610.     if player.tp < 2750 then
  611.    
  612.         --Dimi Moonshade--
  613.         if spell.english == "Dimidiation" then
  614.             equip(set_combine(sets.precast.WS['Dimidiation'], {rear = 'Moonshade Earring'}))
  615.            
  616.         --Default Moonshade--
  617.         else
  618.             equip(set_combine(sets.precast.WS, {rear = 'Moonshade Earring'}))
  619.         end
  620.        
  621.     --Dimidiation--
  622.     elseif spell.english == "Dimidiation" then
  623.         equip(sets.precast.WS['Dimidiation'])
  624.        
  625.     --Sanguine Blade--
  626.     elseif spell.english == "Sanguine Blade" then
  627.         equip(sets.precast.WS['Sanguine Blade'])
  628.        
  629.     --Default--
  630.     else
  631.         equip(sets.precast.WS)
  632.     end
  633.    
  634. end
  635.  
  636. --Subfunction for Midcast Magic--
  637. function midcast_magic(spell, action)
  638.  
  639.     --Cancel Ni Shadows before Ichi--
  640.     if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  641.             send_command('cancel Copy Image')
  642.             send_command('cancel Copy Image (2)')
  643.     end
  644.    
  645.     --MidCast Gear for Enhancing Magic--
  646.     if spell.skill == 'Enhancing Magic' then
  647.        
  648.         --Regen Trigger--
  649.         if string.find(spell.english,'Regen')then
  650.             equip(sets.midcast.Regen)
  651.            
  652.         --Refresh Trigger--
  653.         elseif spell.english == "Refresh" then
  654.             equip(sets.midcast.Refresh)
  655.            
  656.         --Phalanx Trigger--
  657.         elseif spell.english == "Phalanx" then
  658.             equip(sets.midcast.Phalanx)
  659.            
  660.         --Foil Exception--
  661.         elseif spell.english == "Foil" then
  662.             equip(sets.Enmity)
  663.            
  664.         --Default Enhancing--
  665.         else
  666.             equip(sets.midcast['Enhancing Magic'])
  667.         end
  668.        
  669.     --Default--
  670.     else
  671.         equip(sets.Enmity)
  672.     end
  673.    
  674.     if SpellInt == 1 then
  675.         equip(sets.midcast.SpellInterrupt)
  676.     end
  677.  
  678. end
  679.  
  680. --Aftercast Swap while Idle--
  681. function aftercast_idle()
  682.    
  683.     --PDT Swap--
  684.     if PDTTrigger == 1 then
  685.         equip(sets.Idle.PDT)
  686.        
  687.     --MDT Swap--   
  688.     elseif MDTTrigger == 1 then
  689.         equip(sets.Idle.MDT)
  690.        
  691.     --Refresh Idle--
  692.     elseif player.mpp < 95 then
  693.         if player.hpp < 95 then
  694.             if player.mpp < 50 then
  695.                 equip(set_combine(sets.Idle.Regen, set_combine(
  696.                     sets.Idle.Refresh, {waist = "Fucho-no-Obi"})))
  697.             end
  698.             equip(set_combine(sets.Idle.Regen, sets.Idle.Refresh))
  699.         elseif player.mpp < 50 then
  700.             equip(set_combine(sets.Idle.Refresh, {waist = "Fucho-no-Obi"}))
  701.         else
  702.             equip(sets.Idle.Refresh)   
  703.         end
  704.        
  705.     --Regen Idle--
  706.     elseif player.hpp < 95 then
  707.         if world.time >= 6*60 and world.time <= 18*60 then
  708.             equip(set_combine(sets.Idle.Regen, {hands = 'Garden Bangles'}))
  709.         else
  710.             equip(sets.Idle.Regen)
  711.         end
  712.        
  713.     --Default--
  714.     else
  715.         equip(sets.Idle.Standard)
  716.     end    
  717.    
  718. end
  719.  
  720. --Aftercast Swap for TP--
  721. function aftercast_engaged()
  722.    
  723.     --PDT Swap--
  724.     if PDTTrigger == 1  then
  725.         equip(sets.Idle.PDT)
  726.        
  727.     --MDT Swap--
  728.     elseif MDTTrigger == 1 then
  729.         equip(sets.Idle.MDT)
  730.        
  731.     --Acc Swap--
  732.     elseif AccTrigger == 1 then
  733.         equip(sets.engaged.Acc)
  734.        
  735.     --Default--
  736.     else
  737.         equip(sets.engaged)
  738.     end
  739.    
  740.     --Disability Swap--
  741.     if buffactive['terror'] or buffactive['petrification']
  742.         or buffactive['stun'] or buffactive['sleep'] then
  743.         if MDTTrigger == 1 then
  744.             equip(sets.Idle.MDT)
  745.         else
  746.             equip(sets.Idle.PDT)
  747.         end
  748.     end
  749.    
  750.     --Wake Up--
  751.     if buffactive['sleep'] and player.hp > 100 and player.status == "Engaged" then
  752.         equip({head="Frenzy Sallet"})
  753.     end
  754.    
  755. end
  756.  
  757. --Buff Function--
  758. function buff_change(buff,gain)
  759.    
  760.     --Disability Swap--
  761.     if buffactive['terror'] or buffactive['petrification']
  762.         or buffactive['stun'] or buffactive['sleep'] then
  763.         if MDTTrigger == 1 then
  764.             equip(sets.Idle.MDT)
  765.         else
  766.             equip(sets.Idle.PDT)
  767.         end
  768.     end
  769.  
  770.     --Wake Up--
  771.     if buff == "sleep" and player.hp > 100 and player.status == "Engaged" then
  772.         equip({head="Frenzy Sallet"})
  773.     end
  774.    
  775. end
  776.  
  777. --Subjob Change--
  778. function sub_job_change()
  779.     send_command('wait 2.5; input /lockstyleset 003')
  780. end
  781.  
  782. --Rune Switch Function--
  783. function runeLock(spell)
  784.    
  785.     --Rune Switch--
  786.     if(spell.english == "Tellus" and runeIndex ~= 1) then
  787.         runeIndex = 1
  788.         add_to_chat(200,'Tellus Locked -- Earth Damage -- Thunder Resist')
  789.     elseif(spell.english == "Unda" and runeIndex ~= 2) then
  790.         runeIndex = 2
  791.         add_to_chat(200,'Unda Locked -- Water Damage -- Fire Resist')
  792.     elseif(spell.english == "Flabra" and runeIndex ~= 3) then
  793.         runeIndex = 3
  794.         add_to_chat(200,'Flabra Locked -- Wind Damage -- Earth Resist')
  795.     elseif(spell.english == "Ignis" and runeIndex ~= 4) then
  796.         runeIndex = 4
  797.         add_to_chat(200,'Ignis Locked -- Fire Damage -- Ice Resist -- ')
  798.     elseif(spell.english == "Gelus" and runeIndex ~= 5) then
  799.         runeIndex = 5
  800.         add_to_chat(200,'Gelus Locked -- Ice Damage -- Wind Resist')
  801.     elseif(spell.english == "Sulpor" and runeIndex ~= 6) then
  802.         runeIndex = 6
  803.         add_to_chat(200,'Sulpor Locked -- Thunder Damage -- Water Resist -- ')
  804.     elseif(spell.english == "Lux" and runeIndex ~= 7) then
  805.         runeIndex = 7
  806.         add_to_chat(200,'Lux Locked -- Light Damage -- Dark Resist')
  807.     elseif(spell.english == "Tenebrae" and runeIndex ~= 8) then
  808.         runeIndex = 8
  809.         add_to_chat(200,'Tenebrae Locked -- Darkness Damage -- Light Resist')
  810.     end
  811.    
  812. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement