Advertisement
R3G1STRY

SCH.lua

Oct 1st, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.33 KB | None | 0 0
  1. function get_sets()
  2.     sets = {}
  3.        
  4.     -- precast sets
  5.     sets.precast_Stun = {               main="Apamajas II",         sub="Arbuda Grip",                                      ammo="Incantor Stone",
  6.                                         head="Zelus Tiara",         neck="Orunmila's Torque",   ear1="Psystorm Earring",    ear2="Lifestorm Earring",
  7.                                         body="Hedera Cotehardie",   hands="Repartie Gloves",    lring="Prolix Ring",        rring="Balrahn's Ring",
  8.                                         back="Swith Cape",          waist="Goading Belt",       legs="Orvail Pants",        feet="Argute Loafers +2"}
  9.    
  10.     sets.precast_StunAccuracy = {       main="Apamajas II",         sub="Arbuda Grip",                                      ammo="Incantor Stone",
  11.                                         head="Zelus Tiara",         neck="Orunmila's Torque",   ear1="Psystorm Earring",    ear2="Lifestorm Earring",
  12.                                         body="Hedera Cotehardie",   hands="Repartie Gloves",    lring="Prolix Ring",        rring="Balrahn's Ring",
  13.                                         back="Swith Cape",          waist="Goading Belt",       legs="Orvail Pants",        feet="Argute Loafers +2"}
  14.    
  15.     sets.precast_FastCast = {           head="Nares Cap",           neck="Orunmila's Torque",
  16.                                                                     hands="Repartie Gloves",    ring1="Prolix Ring",
  17.                                         back="Swith Cape",          waist="Siegel Sash",        legs="Orvail Pants",        feet="Argute Loafers +2"}
  18.                                
  19.     -- midcast sets
  20.     sets.midcast_Nuke = {               main="Chatoyant Staff",     sub="Wizzan Grip",                                      ammo="Erlene's Notebook",
  21.                                         head="Nares Cap",           neck="Saevus Pendant",      ear1="Hecate's Earring",    ear2="Novio Earring",
  22.                                         body="Nares Saio",          hands="Nares Cuffs",        ring1="Icesoul Ring",       ring2="Icesoul Ring",
  23.                                         back="Taubran Cape",        waist="Aswang Sash",        legs="Orvail Pants",        feet="Nares Clogs"}
  24.    
  25.     --[[sets.midcast_NukeAccuracy {         main="Chatoyant Staff",     sub="Wizzan Grip",                                      ammo="Erlene's Notebook",
  26.                                         head="Nares Cap",           neck="Saevus Pendant",      ear1="Hecate's Earring",    ear2="Novio Earring",
  27.                                         body="Nares Saio",          hands="Nares Cuffs",        ring1="Icesoul Ring",       ring2="Icesoul Ring",
  28.                                         back="Taubran Cape",        waist="Aswang Sash",        legs="Orvail Pants",        feet="Nares Clogs"}]]
  29.    
  30.     sets.midcast_Helix = {              main="Chatoyant Staff",     sub="Wizzan Grip",                                      ammo="Erlene's Notebook",
  31.                                         head="Nares Cap",           neck="Saevus Pendant",      ear1="Hecate's Earring",    ear2="Novio Earring",
  32.                                         body="Nares Saio",          hands="Nares Cuffs",        ring1="Icesoul Ring",       ring2="Icesoul Ring",
  33.                                         back="Taubran Cape",        waist="Aswang Sash",        legs="Orvail Pants",        feet="Nares Clogs"}
  34.    
  35.     --[[sets.midcast_HelixAccuracy  {       main="Chatoyant Staff",     sub="Wizzan Grip",                                      ammo="Erlene's Notebook",
  36.                                         head="Nares Cap",           neck="Saevus Pendant",      ear1="Hecate's Earring",    ear2="Novio Earring",
  37.                                         body="Nares Saio",          hands="Nares Cuffs",        ring1="Icesoul Ring",       ring2="Icesoul Ring",
  38.                                         back="Taubran Cape",        waist="Aswang Sash",        legs="Orvail Pants",        feet="Nares Clogs"}]]
  39.                                        
  40.     sets.midcast_DarkMagic = {          main="Chatoyant Staff",     sub="Wizzan Grip",
  41.                                         head="Spurrina Coif",       neck="Weike Torque",        ear1="Psystorm Earring",    ear2="Lifestorm Earring",
  42.                                         body="Nares Saio",          hands="Repartie Gloves",    ring1="Balrahn's Ring",     ring2="Icesoul Ring",
  43.                                         back="Merciful Cape",       waist="Demonry Sash",       legs="Savant's Pants +2",   feet="Orvail Souliers"}
  44.    
  45.     sets.midcast_EnfeeblingINT = {      main="Chatoyant Staff",     sub="Macero Grip",                                      ammo="Savant's Treatise",
  46.                                         head="Spurrina Coif",       neck="Weike Torque",        ear1="Psystorm Earring",    ear2="Lifestorm Earring",
  47.                                         body="Nares Saio",          hands="Repartie Gloves",    ring1="Balrahn's Ring",     ring2="Icesoul Ring",
  48.                                         back="Refraction Cape",     waist="Demonry Sash",       legs="Savant's Pants +2",   feet="Orvail Souliers"}
  49.    
  50.     sets.midcast_EnfeeblingMND = {      main="Chatoyant Staff",     sub="Macero Grip",                                      ammo="Savant's Treatise",
  51.                                         head="Spurrina Coif",       neck="Weike Torque",        ear1="Psystorm Earring",    ear2="Lifestorm Earring",
  52.                                         body="Nares Saio",          hands="Repartie Gloves",    ring1="Balrahn's Ring",     ring2="Aquasoul Ring",
  53.                                         back="Refraction Cape",     waist="Demonry Sash",       legs="Savant's Pants +2",   feet="Orvail Souliers"}
  54.    
  55.     sets.midcast_Cure = {               main="Chatoyant Staff",     sub="Wizzan Grip",                                      ammo="Clarus Stone",
  56.                                         head="Hyksos Khat +1",      neck="Colossus's Torque",   ear1="Beatific Earring",    ear2="Lifestorm Earring",
  57.                                         body="Nefer Kalasiris +1",  hands="Bokwus Gloves",      ring1="Sirona's Ring",      ring2="Ephedra Ring",
  58.                                         back="Oretania's Cape",     waist="Pythia Sash +1",     legs="Nares trews",         feet="Argute Loafers +2"}
  59.    
  60.     sets.midcast_EnhancingMagic = {     main="Chatoyant Staff",     sub="Fulcio Grip",                                      ammo="Savant's Treatise",
  61.                                         head="Savant's Bonnet +2",  neck="Colossus's Torque",
  62.                                         body="Argute Gown +2",      hands="Ayao's Gages",
  63.                                         back="Merciful Cape",       waist="Olympus Sash",       legs="Scholar's Pants",     feet="Nares Clogs"}
  64.    
  65.     sets.midcast_Haste = {                                                                                                  ammo="Incantor Stone",
  66.                                         head="Zelus Tiara",         neck="Orunmila's Torque",  
  67.                                         body="Hedera Cotehardie",   hands="Repartie Gloves",    lring="Prolix Ring",
  68.                                         back="Swith Cape",          waist="Goading Belt",       legs="Orvail Pants",        feet="Argute Loafers +2"}
  69.                                        
  70.     -- aftercast sets                          
  71.     sets.aftercast_Idle = {             main="Owleyes",             sub="Genbu's Shield",                                   ammo="White Tathlum",
  72.                                         head="Spurrina Coif",       neck="Twilight Torque",     ear1="Colossus's Earring",  ear2="Savant's Earring",
  73.                                         body="Bokwus Robe",         hands="Serpentes Cuffs",    ring1="Dark Ring",          ring2="Dark Ring",
  74.                                         back="Umbra Cape",          waist="Slipor Sash",        legs="Nares Trews",         feet="Serpentes Sabots"}
  75.                                    
  76.     -- misc sets
  77.     sets.Resting = {                    main="Chatoyant Staff",     sub="Wizzan Grip",                                      ammo="Clarus Stone",
  78.                                         head="Spurrina Coif",       neck="Eidolon Pendant",     ear1="Colossus's Earring",  ear2="Savant's Earring",
  79.                                         body="Bokwus Robe",         hands="Nares Cuffs",        ring1="Dark Ring",          ring2="Dark Ring",
  80.                                         back="Felicitas Cape",      waist="Austerity Belt",     legs="Nares Trews",         feet="Chelona Boots"}
  81.    
  82.     --[[sets.fireObi = {back='Twilight Cape',lring='Zodiac Ring'}
  83.     sets.EarthObi = {back='Twilight Cape',lring='Zodiac Ring'}
  84.     sets.waterObi = {back='Twilight Cape',lring='Zodiac Ring'}
  85.     sets.windObi = {back='Twilight Cape',lring='Zodiac Ring'}
  86.     sets.iceObi = {back='Twilight Cape',lring='Zodiac Ring'}
  87.     sets.thunderObi = {back='Twilight Cape',lring='Zodiac Ring'}
  88.     sets.lightObi = {back='Twilight Cape',lring='Zodiac Ring'}
  89.     sets.darkObi = {back='Twilight Cape',lring='Zodiac Ring'}]]
  90.    
  91.     -- User defined variables (not sets)
  92.     accuracy = false
  93.     running = false
  94.    
  95.     arts = 'NA'
  96.     useQueue = false
  97.     queue = {}
  98.     queue['1'] = 'none'
  99.     queue['2'] = 'none'
  100.     queue['3']= 'none'
  101.     queueNum = 0
  102.     queueAction = 'none'
  103.     dequeue = false
  104.     stratDelay = 1.5
  105.     debugOn = false
  106. end
  107.  
  108. function precast(spell,action) 
  109.     -- sets variables for arts agnostic stratagem use
  110.     if spell.english == 'Light Arts' then
  111.         arts = 'LA'
  112.     elseif spell.english == 'Dark Arts' then
  113.         arts = 'DA'
  114.     end
  115.    
  116.     -- uses queue strats if queue is on
  117.     if useQueue == true and queueNum > 0 then
  118.         if spell.prefix == '/ma' or spell.prefix == '/magic' then
  119.             queue[tostring(queueNum)] = 'none'
  120.             queueNum = queueNum - 1
  121.             add_to_chat(8, 'Using queue strat: '..queue[tostring(queueNum)])
  122.             send_command('input //lua c gearswap '..queue[tostring(queueNum)]..';wait '..stratDelay..';input /ma '..spell.english..' '..spell.target.raw)
  123.             cancel_spell()
  124.             return
  125.         end
  126.     end
  127.    
  128.     if spell.english == 'Impact' then
  129.         cast_delay(2)
  130.         equip(sets['precast_FastCast'],{body="Twilight Cloak"})
  131.         if not buffactive.elementalseal then
  132.             add_to_chat(8,'--------- Elemental Seal is down ---------')
  133.         end
  134.     elseif spell.english == 'Stun' then
  135.         if accuracy == true then
  136.             equip(sets['precast_StunAccuracy'])
  137.         else
  138.             equip(sets['precast_Stun'])
  139.         end
  140.     elseif spell.english ~= 'Embrava' and action.type == 'Magic' then
  141.         equip(sets['precast_FastCast'])
  142.     end
  143.  
  144.     if (buffactive.alacrity or buffactive.celerity) and world.weather_element == spell.element then
  145.         equip({feet='Argute Loafers +2'})
  146.     end
  147. end
  148.  
  149. function midcast(spell,action)
  150.     if string.find(spell.english,'Cur') and spell.name ~= 'Cursna' then
  151.         --check_weather(spell.element,sets['midcast_Cure'])
  152.         equip(sets['midcast_Cure'])
  153.     elseif spell.skill == "ElementalMagic" then
  154.         if accuracy == true then
  155.             if string.find(spell.english,'helix') then
  156.                 equip(sets['midcast_HelixAccuracy'])
  157.             else
  158.                 check_weather(spell.element,sets['midcast_NukeAccuracy'])
  159.             end
  160.         else
  161.             if string.find(spell.english,'helix') then
  162.                 equip(sets['midcast_Helix'])
  163.             else
  164.                 check_weather(spell.element,sets['midcast_Nuke'])
  165.             end
  166.         end
  167.         if spell.english == 'Impact' then
  168.             local tempset = sets['midcast_NukeAccuracy']
  169.             tempset['body'] = 'Twilight Cloak'
  170.             tempset['head'] = 'empty'
  171.             cast_delay(1.5)
  172.             equip(tempset)
  173.         end
  174.         if buffactive.klimaform and world.weather_element == spell.element then
  175.             equip({feet='Savant\'s Loafers +2'})
  176.         end
  177.     elseif spell.english == 'Stoneskin' then
  178.         equip(sets['midcast_Haste'])
  179.     elseif spell.type == 'EnhancingMagic' then
  180.         if spell.english == 'Embrava' then
  181.             if not buffactive.perpetuance then
  182.                 add_to_chat(8,'--------- Perpetuance is down ---------')
  183.             end
  184.             if not buffactive.accession then
  185.                 add_to_chat(8,'---------- Accession is down ----------')
  186.             end
  187.             if not buffactive.penury then
  188.                 add_to_chat(8,'----------- Penury is down -----------')
  189.             end
  190.         end
  191.         if buffactive.perpetuance then
  192.             equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
  193.         else
  194.             equip(sets['midcast_EnhancingMagic'])
  195.         end
  196.     elseif spell.type == 'EnfeeblingMagic' then
  197.         if string_in_table(spell.english, {'Slow', 'Slow II', 'Paralyze', 'Paralyze II', 'Addle', 'Silence'}) then
  198.             equip(sets['EnfeeblingMND'])
  199.         else
  200.             equip(sets['EnfeeblingINT'])
  201.         end
  202.     end
  203.    
  204.     if spell.english == 'Sneak' then
  205.         send_command('@wait 1.8;cancel 71;')
  206.     end
  207. end
  208.  
  209. function aftercast(spell,action)
  210.     equip(sets['aftercast_Idle'])
  211.     if spell.english == 'Sleep' or spell.english == 'Sleepga' then
  212.         send_command('@wait 55;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
  213.     elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
  214.         send_command('@wait 85;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
  215.     elseif spell.english == 'Break' or spell.english == 'Breakga' then
  216.         send_command('@wait 25;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
  217.     end
  218. end
  219.  
  220. function status_change(new,old)
  221.     if new == 'Resting' then
  222.         equip(sets['Resting'])
  223.     else
  224.         equip(sets['aftercast_Idle'])
  225.     end
  226. end
  227.  
  228. function buff_change(status,gain_or_loss)
  229.     if buffactive['light arts'] or buffactive['addendum: white'] then
  230.         arts = 'LA'
  231.     elseif buffactive['light arts'] or buffactive['addendum: white'] then
  232.         arts = 'DA'
  233.     else
  234.         arts = 'NA'
  235.     end
  236. end
  237.  
  238. function pet_midcast(spell,action)
  239. end
  240.  
  241. function pet_aftercast(spell,action)
  242. end
  243.  
  244. function self_command(command)
  245.     command = string.lower(command)
  246.    
  247.     -- conversion for arts agnostic stratagems - use //gs c <type> to select valid stratagems
  248.     -- valid <type>: addendum, cost, speed, aoe potency, accuracy, enmity, duration, skillchain
  249.     if string_in_table(command, {'addendum', 'cost', 'speed', 'aoe', 'potency', 'accuracy', 'enmity', 'duration', 'skillchain'}) then
  250.         -- Catch any existing arts if the variable hasn't yet been set
  251.         if arts == 'NA' then
  252.             if buffactive['light arts'] or buffactive['addendum: white'] then
  253.                 arts = 'LA'
  254.             elseif buffactive['light arts'] or buffactive['addendum: white'] then
  255.                 arts = 'DA'
  256.             end
  257.         end
  258.         queueAction = command
  259.         if debugOn == true then
  260.             add_to_chat(8, 'useQueue: '..tostring(useQueue)..', queueAction: '..queueAction..', Dequeue: '..tostring(dequeue)..', queueNum: '..queueNum)
  261.         end
  262.         if useQueue == true and queueAction ~= 'none' and dequeue == false and queueNum < 3 then
  263.             queueNum = queueNum + 1
  264.             queue[tostring(queueNum)] = queueAction
  265.             add_to_chat(8, 'Action \''..queueAction..'\' added to queue as #'..queueNum..'.\nCurrent queue: '..queue['1']..', '..queue['2']..', '..queue['3']..'.')
  266.             return
  267.         end
  268.         if dequeue == true and queueNum > 0 then
  269.             queue[tostring(queueNum)] = 'none'
  270.             queueNum = queueNum - 1
  271.             dequeue = false
  272.         end
  273.         if command == 'aoe' then
  274.             if arts == 'LA' then
  275.                 send_command('input /ja "Accession" <me>')
  276.             elseif arts == 'DA' then
  277.                 send_command('input /ja "Manifestation" <me>')
  278.             else
  279.                 add_to_chat(8, 'No valid art currently set.')
  280.             end
  281.         elseif command == 'potency' then
  282.             if arts == 'LA' then
  283.                 send_command('input /ja "Rapture" <me>')
  284.             elseif arts == 'DA' then
  285.                 send_command('input /ja "Ebullience" <me>')
  286.             else
  287.                 add_to_chat(8, 'No valid art currently set.')
  288.             end
  289.         elseif command == 'duration' then
  290.             if arts == 'LA' then
  291.                 send_command('input /ja "Perpetuance" <me>')
  292.             elseif arts == 'DA' then
  293.                 add_to_chat(8, 'No duration stratagem for Dark Arts.')
  294.             else
  295.                 add_to_chat(8, 'No valid art currently set.')
  296.             end
  297.         elseif command == 'cost' then
  298.             if arts == 'LA' then
  299.                 send_command('input /ja "Penury" <me>')
  300.             elseif arts == 'DA' then
  301.                 send_command('input /ja "Parsimony" <me>')
  302.             else
  303.                 add_to_chat(8, 'No valid art currently set.')
  304.             end
  305.         elseif command == 'speed' then
  306.             if arts == 'LA' then
  307.                 send_command('input /ja "Celerity" <me>')
  308.             elseif arts == 'DA' then
  309.                 send_command('input /ja "Alacrity" <me>')
  310.             else
  311.                 add_to_chat(8, 'No valid art currently set.')
  312.             end
  313.         elseif command == 'addendum' then
  314.             if arts == 'LA' then
  315.                 send_command('input /ja "Addendum: White" <me>')
  316.             elseif arts == 'DA' then
  317.                 send_command('input /ja "Addendum: Black" <me>')
  318.             else
  319.                 add_to_chat(8, 'No valid art currently set.')
  320.             end
  321.         elseif command == 'accuracy' then
  322.             if arts == 'LA' then
  323.                 send_command('input /ja "Altruism" <me>')
  324.             elseif arts == 'DA' then
  325.                 send_command('input /ja "Focalization" <me>')
  326.             else
  327.                 add_to_chat(8, 'No valid art currently set.')
  328.             end
  329.         elseif command == 'enmity' then
  330.             if arts == 'LA' then
  331.                 send_command('input /ja "Tranquility" <me>')
  332.             elseif arts == 'DA' then
  333.                 send_command('input /ja "Equanimity" <me>')
  334.             else
  335.                 add_to_chat(8, 'No valid art currently set.')
  336.             end
  337.         elseif command == 'skillchain' then
  338.             if arts == 'LA' then
  339.                 add_to_chat(8, 'No skillchain stratagem for Light Arts.')
  340.             elseif arts == 'DA' then
  341.                 send_command('input /ja "Immanence" <me>')
  342.             else
  343.                 add_to_chat(8, 'No valid art currently set.')
  344.             end
  345.         end
  346.        
  347.     elseif command == 'queue' then
  348.         if useQueue == true then
  349.             useQueue = false
  350.             reset_queue()
  351.             add_to_chat(8, 'Queue: off')
  352.         else
  353.             useQueue = true
  354.             reset_queue()
  355.             add_to_chat(8, 'Queue: on')
  356.         end
  357.    
  358.     elseif command == 'accuracy' then
  359.         if accuracy == false then
  360.             accuracy = true
  361.         else
  362.             accuracy = false
  363.         end
  364.         add_to_chat(8,'Accuracy swaps: '..accuracy)
  365.    
  366.     elseif command == 'running' then
  367.         if running == false then
  368.             sets['aftercast_Idle']['feet'] = 'Serpents Sabots'
  369.             running = true
  370.         else
  371.             sets['aftercast_Idle']['feet'] = 'Herald\'s Gaiters'
  372.             running = false
  373.         end
  374.         add_to_chat(8,'Idle feet: '..sets['aftercast_Idle']['feet'])
  375.        
  376.     elseif command == 'help' then
  377.         write('Registry\'s SCH.lua template user defined commands:')
  378.         write('gs c help: Shows this help message')
  379.         write('gs c accuracy: Toggles nuking/stunning accuracy sets')
  380.         write('gs c running: Toggles idle feet between movement and idle')
  381.         write('gs c <type>: Uses stratagems depending on active arts - valid types listed below')
  382.         write('             addendum, cost, speed, aoe, potency, accuracy, enmity, duration, skillchain')
  383.        
  384.     else
  385.         add_to_chat(8,'Not a valid command - use \'//gs c help\' to find valid user defined commands')
  386.     end
  387. end
  388.  
  389. function check_weather(spell_element,set)
  390.     if spell_element == world.weather_element or spell_element == world.day_element then
  391.         equip(set,sets[string.lower(spell_element)..'Obi'])
  392.     else
  393.         equip(set)
  394.     end
  395. end
  396.  
  397. function reset_queue()
  398.     queueNum = 0
  399.     queue1 = 'none'
  400.     queue2 = 'none'
  401.     queue3 = 'none'
  402. end
  403.  
  404. -- Checks if a string is in a table, case does not matter.
  405. function string_in_table(str, tab)
  406.     str = string.lower(str)
  407.     for i, arg in ipairs(tab) do
  408.         arg = tostring(arg)
  409.         arg = string.lower(arg)
  410.         if arg == str then
  411.             return true
  412.         end
  413.     end
  414.  
  415.     return false
  416. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement