Advertisement
Guest User

tbd

a guest
Feb 28th, 2014
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.89 KB | None | 0 0
  1.  --[[**********************************************************
  2.     ========== Samurai Yoichinoyumi GearSwap ===========
  3.     Based off of the Ranger gearswap file for Suji.Phoenix.
  4.         Updated by Munenori.Sylph for Active Combat Style shifting.
  5.     Save this file as SAM.lua or Yourname_SAM.lua and place it in:
  6.         Windower4.1\addons\GearSwap\data
  7.      
  8.     **************************************************************]]
  9.     -- Meikyo feet macro --
  10.     -- Sekkanoki tp split macro --
  11.     -- Sengikori SC Opening macro --
  12.     -- PLM send cmds --
  13.     -- Set condensing --
  14.     -- WS Distance Limiter --
  15.    
  16.     -- Configure sets below.
  17.    
  18.     function get_sets(...)
  19.         sets.idle = {}
  20.         sets.idle.standingGK = {
  21.             main = "Tsurumaru",
  22.             sub = "Pole Grip",
  23.             ammo = "Hagneia Stone",
  24.             head = "Lithelimb Cap",
  25.             neck = "Wiglen Gorget",
  26.             lear = "Brachyura Earring",
  27.             rear = "Brutal Earring",
  28.             body = "Kyudogi",
  29.             hands = "Sakonji Kote",
  30.             lring = "Sheltered Ring",
  31.             rring = "Paguroidea Ring",
  32.             back = "Shadow Mantle",
  33.             legs = "Sakonji Haidate",
  34.             waist = "Flume Belt",
  35.             feet = "Danzo Sune-ate"
  36.         }
  37.         sets.idle.standingYoichi = {
  38.             main = "Tsurumaru",
  39.             sub = "Pole Grip",
  40.             range = "Yoichinoyumi",
  41.             ammo = "Tulfaire Arrow",
  42.             head = "Lithelimb Cap",
  43.             neck = "Wiglen Gorget",
  44.             lear = "Brachyura Earring",
  45.             rear = "Brutal Earring",
  46.             body = "Kyudogi",
  47.             hands = "Sakonji Kote",
  48.             lring = "Sheltered Ring",
  49.             rring = "Paguroidea Ring",
  50.             back = "Shadow Mantle",
  51.             legs = "Sakonji Haidate",
  52.             waist = "Flume Belt",
  53.             feet = "Danzo Sune-ate"
  54.         }
  55.         sets.idle.standingPLM = {
  56.             main = "Eminent Lance",
  57.             sub = "Pole Grip",
  58.             range = "Yoichinoyumi",
  59.             ammo = "Tulfaire Arrow",
  60.             head = "Lithelimb Cap",
  61.             neck = "Wiglen Gorget",
  62.             lear = "Brachyura Earring",
  63.             rear = "Brutal Earring",
  64.             body = "Kyudogi",
  65.             hands = "Sakonji Kote",
  66.             lring = "Sheltered Ring",
  67.             rring = "Paguroidea Ring",
  68.             back = "Shadow Mantle",
  69.             legs = "Sakonji Haidate",
  70.             waist = "Flume Belt",
  71.             feet = "Danzo Sune-ate"
  72.         }
  73.        
  74.         sets.pdt = {
  75.             head = "Lithelimb Cap",
  76.             neck = "Twilight torque",
  77.             body = "Wakido Domaru +1",
  78.             hands = "Sakonji Kote",
  79.             lring = "Dark Ring",
  80.             rring = "Dark Ring",
  81.             back = "Mollusca mantle",
  82.             waist = "Flume Belt",
  83.             legs = "Wakido Haidate +1",
  84.             feet = "Sakonji Sune-ate +1"
  85.         }
  86.         sets.mdt = set_combine(sets.pdt, {
  87.             hands = "Wakido Kote +1",
  88.             lear = "Merman's Earring",
  89.             rear = "Merman's Earring",
  90.             lring = "Shadow Ring"
  91.         })
  92.         sets.mdt.GKammo = {
  93.             ammo = "Demonry Stone",
  94.             head = "Lithelimb Cap",
  95.             neck = "Twilight torque",
  96.             lear = "Merman's Earring",
  97.             rear = "Merman's Earring",
  98.             body = "Wakido Domaru +1",
  99.             hands = "Wakido Kote +1",
  100.             lring = "Shadow Ring",
  101.             rring = "Dark Ring",
  102.             back = "Mollusca mantle",
  103.             waist = "Flume Belt",
  104.             legs = "Wakido Haidate +1",
  105.             feet = "Sakonji Sune-ate +1"
  106.             }
  107.         sets.RR = set_combine(sets.pdt, {
  108.             head = "Twilight Helm",
  109.             body = "Twilight Mail",
  110.         })
  111.         sets.regen = {
  112.             head = "Twilight Helm",
  113.             neck = "Wiglen Gorget",
  114.             body = "Kirin's Osode",
  115.             lring = "Sheltered Ring",
  116.             rring = "Paguroidea Ring",
  117.             back = "Shadow Mantle",
  118.             waist = "Flume Belt",
  119.             feet = "Danzo Sune-ate"
  120.         }
  121.        
  122.         sets.tp = {}
  123.         sets.tp.Yoichinoyumi = {}
  124.         sets.tp.Yoichinoyumi.normal_com = {
  125.             main  = "Tsurumaru",
  126.             sub   = "Pole Grip",
  127.             range = "Yoichinoyumi",
  128.             ammo  = "Tulfaire Arrow",
  129.             head  = "Otomi Helm",
  130.             neck  = "Ganesha's Mala",
  131.             lear  = "Steelflash Earring",
  132.             rear  = "Bladeborn earring",
  133.             body  = "Wakido Domaru +1",
  134.             hands = "Wakido Kote +1",
  135.             lring = "K'ayres Ring",
  136.             rring = "Rajas Ring",
  137.             back  = "Atheling Mantle",
  138.             waist = "Windbuffet Belt",
  139.             legs  = "Wakido Haidate +1",
  140.             feet  = "Whirlpool Greaves"
  141.         }
  142.         sets.tp.Yoichinoyumi.ionis_com = {
  143.             main  = "Tsurumaru",
  144.             sub   = "Pole Grip",
  145.             range = "Yoichinoyumi",
  146.             ammo  = "Tulfaire Arrow",
  147.             head  = "Yaoyotl Helm",
  148.             neck  = "Ganesha's Mala",
  149.             lear  = "Steelflash Earring",
  150.             rear  = "Bladeborn earring",
  151.             body  = "Wakido Domaru +1",
  152.             hands = "Wakido Kote +1",
  153.             lring = "K'ayres Ring",
  154.             rring = "Rajas Ring",
  155.             back  = "Takaha Mantle",
  156.             waist = "Cetl Belt",
  157.             legs  = "Wakido Haidate +1",
  158.             feet  = "Sakonji Sune-ate +1"
  159.         }
  160.        
  161.         sets.tp.GK = {}
  162.         sets.tp.GK.normal_com = {
  163.             main  = "Tsurumaru",
  164.             sub   = "Pole Grip",
  165.             ammo  = "Hagneia Stone",
  166.             head  = "Otomi Helm",
  167.             neck  = "Ganesha's Mala",
  168.             lear  = "Steelflash Earring",
  169.             rear  = "Bladeborn earring",
  170.             body  = "Wakido Domaru +1",
  171.             hands = "Wakido Kote +1",
  172.             lring = "K'ayres Ring",
  173.             rring = "Rajas Ring",
  174.             back  = "Atheling Mantle",
  175.             waist = "Windbuffet Belt",
  176.             legs  = "Wakido Haidate +1",
  177.             feet  = "Whirlpool Greaves"
  178.         }
  179.         sets.tp.GK.ionis_com = {
  180.             main  = "Tsurumaru",
  181.             sub   = "Pole Grip",
  182.             ammo  = "Hagneia Stone",
  183.             head  = "Yaoyotl Helm",
  184.             neck  = "Ganesha's Mala",
  185.             lear  = "Steelflash Earring",
  186.             rear  = "Bladeborn earring",
  187.             body  = "Wakido Domaru +1",
  188.             hands = "Wakido Kote +1",
  189.             lring = "K'ayres Ring",
  190.             rring = "Rajas Ring",
  191.             back  = "Takaha Mantle",
  192.             waist = "Cetl Belt",
  193.             legs  = "Wakido Haidate +1",
  194.             feet  = "Sakonji Sune-ate +1"
  195.         }  
  196.        
  197.         sets.tp.PLM = {}
  198.         sets.tp.PLM.normal_com = {
  199.             main  = "Eminent Lance",
  200.             sub   = "Pole Grip",
  201.             range = "Yoichinoyumi",
  202.             ammo  = "Tulfaire Arrow",
  203.             head  = "Otomi Helm",
  204.             neck  = "Ganesha's Mala",
  205.             lear  = "Steelflash Earring",
  206.             rear  = "Bladeborn earring",
  207.             body  = "Wakido Domaru +1",
  208.             hands = "Wakido Kote +1",
  209.             lring = "K'ayres Ring",
  210.             rring = "Rajas Ring",
  211.             back  = "Atheling Mantle",
  212.             waist = "Windbuffet Belt",
  213.             legs  = "Wakido Haidate +1",
  214.             feet  = "Sakonji Sune-ate +1"
  215.         }
  216.         sets.tp.PLM.ionis_com = {
  217.             main  = "Eminent Lance",
  218.             sub   = "Pole Grip",
  219.             range = "Yoichinoyumi",
  220.             ammo  = "Tulfaire Arrow",
  221.             head  = "Yaoyotl Helm",
  222.             neck  = "Ganesha's Mala",
  223.             lear  = "Steelflash Earring",
  224.             rear  = "Bladeborn earring",
  225.             body  = "Wakido Domaru +1",
  226.             hands = "Wakido Kote +1",
  227.             lring = "K'ayres Ring",
  228.             rring = "Rajas Ring",
  229.             back  = "Tahaka Mantle",
  230.             waist = "Cetl Belt",
  231.             legs  = "Wakido Haidate +1",
  232.             feet  = "Sakonji Sune-ate +1"
  233.         }
  234.        
  235.         sets.ws = {}
  236.         sets.ws.namasarrow = {}
  237.         sets.ws.namasarrow.normal_com = {
  238.             head  = "Lithelimb Cap",
  239.             neck  = "Light Gorget",
  240.             lear  = "Flame Pearl",
  241.             rear  = "flame pearl",
  242.             body  = "Phorcys Korazin",
  243.             hands = "Unkai Kote +2",
  244.             lring = "Pyrosoul Ring",
  245.             rring = "Pyrosoul Ring",
  246.             back  = "Buquwik Cape",
  247.             waist = "Light Belt",
  248.             legs  = "Wakido Haidate +1",
  249.             feet  = "Wakido Sune-ate +1"
  250.         }
  251.         sets.ws.namasarrow.ionis_com = sets.ws.namasarrow.normal_com
  252.        
  253.         sets.ws.shoha = {}
  254.         sets.ws.shoha.normal_com = {
  255.             head  = "Otomi Helm",
  256.             neck  = "Ganesha's Mala",
  257.             lear  = "Moonshade Earring",
  258.             rear  = "Brutal Earring",
  259.             body  = "Phorcys Korazin",
  260.             hands = "Mikinaak Gauntlets",
  261.             lring = "Pyrosoul Ring",
  262.             rring = "Pyrosoul Ring",
  263.             back  = "Atheling Mantle",
  264.             waist = "Windbuffet Belt",
  265.             legs  = "Wakido Haidate +1",
  266.             feet  = "Sakonji Sune-ate +1"
  267.         }
  268.         sets.ws.shoha.ionis_com = sets.ws.shoha.normal_com
  269.        
  270.         sets.ws.fudo = {}
  271.         sets.ws.fudo.normal_com = {
  272.             head  = "Otomi Helm",
  273.             neck  = "Light Gorget",
  274.             lear  = "Moonshade Earring",
  275.             rear  = "Brutal Earring",
  276.             body  = "Phorcys Korazin",
  277.             hands = "Mikinaak Gauntlets",
  278.             lring = "Pyrosoul Ring",
  279.             rring = "Pyrosoul Ring",
  280.             back  = "Buquwik Cape",
  281.             waist = "Light Belt",
  282.             legs  = "Wakido Haidate +1",
  283.             feet  = "Sakonji Sune-ate +1"
  284.         }
  285.         sets.ws.fudo.ionis_com = sets.ws.fudo.normal_com
  286.        
  287.         sets.ws.ageha = {}
  288.         sets.ws.ageha.normal_com = {
  289.             head  = "Lithelimb Cap",
  290.             neck  = "Ganesha's Mala",
  291.             lear  = "Moonshade Earring",
  292.             rear  = "Brutal Earring",
  293.             body  = "Phorcys Korazin",
  294.             hands = "Wakido Kote +1",
  295.             lring = "Pyrosoul Ring",
  296.             rring = "Pyrosoul Ring",
  297.             back  = "Buquwik Cape",
  298.             waist = "Windbuffet Belt",
  299.             legs  = "Wakido Haidate +1",
  300.             feet  = "Wakido Sune-ate +1"
  301.         }
  302.         sets.ws.ageha.ionis_com = sets.ws.ageha.normal_com
  303.      
  304.         sets.ws.yuki = {}
  305.         sets.ws.yuki.normal_com = {
  306.             head  = "Otomi Helm",
  307.             neck  = "Ganesha's Mala",
  308.             lear  = "Moonshade Earring",
  309.             rear  = "Brutal Earring",
  310.             body  = "Phorcys Korazin",
  311.             hands = "Mikinaak Gauntlets",
  312.             lring = "Pyrosoul Ring",
  313.             rring = "Pyrosoul Ring",
  314.             back  = "Buquwik Cape",
  315.             waist = "Windbuffet Belt",
  316.             legs  = "Wakido Haidate +1",
  317.             feet  = "Sakonji Sune-ate +1"
  318.         }
  319.         sets.ws.yuki.ionis_com = sets.ws.yuki.normal_com
  320.      
  321.         sets.ws.gekko = {}
  322.         sets.ws.gekko.normal_com = {
  323.             head  = "Otomi Helm",
  324.             neck  = "Ganesha's Mala",
  325.             lear  = "Moonshade Earring",
  326.             rear  = "Brutal Earring",
  327.             body  = "Phorcys Korazin",
  328.             hands = "Mikinaak Gauntlets",
  329.             lring = "Pyrosoul Ring",
  330.             rring = "Pyrosoul Ring",
  331.             back  = "Buquwik Cape",
  332.             waist = "Windbuffet Belt",
  333.             legs  = "Wakido Haidate +1",
  334.             feet  = "Sakonji Sune-ate +1"
  335.         }
  336.         sets.ws.gekko.ionis_com = sets.ws.gekko.normal_com
  337.      
  338.         sets.ws.kasha = {}
  339.         sets.ws.kasha.normal_com = {
  340.             head  = "Otomi Helm",
  341.             neck  = "Light Gorget",
  342.             lear  = "Moonshade Earring",
  343.             rear  = "Brutal Earring",
  344.             body  = "Phorcys Korazin",
  345.             hands = "Mikinaak Gauntlets",
  346.             lring = "Pyrosoul Ring",
  347.             rring = "Pyrosoul Ring",
  348.             back  = "Buquwik Cape",
  349.             waist = "Light Belt",
  350.             legs  = "Wakido Haidate +1",
  351.             feet  = "Sakonji Sune-ate +1"
  352.         }
  353.         sets.ws.kasha.ionis_com = sets.ws.kasha.normal_com
  354.      
  355.         sets.ws.rana = {}
  356.         sets.ws.rana.normal_com = {
  357.             head  = "Otomi Helm",
  358.             neck  = "Ganesha's Mala",
  359.             lear  = "Steelflash Earring",
  360.             rear  = "Bladeborn Earring",
  361.             body  = "Phorcys Korazin",
  362.             hands = "Mikinaak Gauntlets",
  363.             lring = "Pyrosoul Ring",
  364.             rring = "Pyrosoul Ring",
  365.             back  = "Atheling Mantle",
  366.             waist = "Windbuffet Belt",
  367.             legs  = "Wakido Haidate +1",
  368.             feet  = "Mikinaak Greaves"
  369.         }
  370.         sets.ws.rana.ionis_com = sets.ws.rana.normal_com
  371.        
  372.         sets.ws.penta = {}
  373.         sets.ws.penta.normal_com = {
  374.             head  = "Otomi Helm",
  375.             neck  = "Justiciar's Torque",
  376.             lear  = "Steelflash Earring",
  377.             rear  = "Bladeborn Earring",
  378.             body  = "Wakido Domaru +1",
  379.             hands = "Mikinaak Gauntlets",
  380.             lring = "Pyrosoul Ring",
  381.             rring = "Rajas Ring",
  382.             back  = "Atheling Mantle",
  383.             waist = "Prosilio Belt",
  384.             legs  = "Wakido Haidate +1",
  385.             feet  = "Mikinaak Greaves"
  386.         }
  387.         sets.ws.penta.ionis_com = sets.ws.penta.normal_com
  388.        
  389.         sets.ws.sonic = {}
  390.         sets.ws.sonic.normal_com = {
  391.             head  = "Otomi Helm",
  392.             neck  = "Light Gorget",
  393.             lear  = "Flame Pearl",
  394.             rear  = "Flame Pearl",
  395.             body  = "Phorcys Korazin",
  396.             hands = "Mikinaak Gauntlets",
  397.             lring = "Pyrosoul Ring",
  398.             rring = "Rajas Ring",
  399.             back  = "Buquwik Cape",
  400.             waist = "Light Belt",
  401.             legs  = "Wakido Haidate +1",
  402.             feet  = "Sakonji Sune-ate +1"
  403.         }
  404.         sets.ws.sonic.ionis_com = sets.ws.sonic.normal_com
  405.        
  406.         sets.ws.stardiver = {}
  407.         sets.ws.stardiver.normal_com = {
  408.             head  = "Otomi Helm",
  409.             neck  = "Light Gorget",
  410.             lear  = "Steelflash Earring",
  411.             rear  = "Bladeborn Earring",
  412.             body  = "Wakido Domaru +1",
  413.             hands = "Mikinaak Gauntlets",
  414.             lring = "Pyrosoul Ring",
  415.             rring = "Rajas Ring",
  416.             back  = "Atheling Mantle",
  417.             waist = "Light Belt",
  418.             legs  = "Wakido Haidate +1",
  419.             feet  = "Mikinaak Greaves"
  420.         }
  421.         sets.ws.stardiver.ionis_com = sets.ws.stardiver.normal_com
  422.        
  423.         sets.ws.GKammo = {ammo = "Thew Bomblet"}
  424.    
  425.         sets.jobability = {}
  426.         sets.jobability.Meditate = {head = "Wakido Kabuto +1",hands = "Sakonji Kote"}  
  427.         sets.jobability.BladeBash = {hands = "Sakonji Kote"}
  428.         sets.jobability.WardingCircle = {head = "Wakido Kabuto +1"}
  429.         sets.jobability.ThirdEye = {legs = "Sakonji Haidate"}
  430.         sets.jobability.Sekkanoki = {hands = "Unkai Kote +2"}
  431.         sets.jobability.MeikyoShisui = {feet = "Sakonji Sune-ate +1"}
  432.         sets.jobability.Sengikori = {feet = "Unkai Sune-ate +2"}
  433.        
  434.         notice('Samurai Binding Interface:')
  435.         notice('  F9          Cycles Normal or Ionis Up')
  436.         notice('  F9+Alt      Cycles Combat Style')
  437.         notice('  F10         Enables Twilight Lock')
  438.         notice('  `+Ctrl      Enables PDT layer')
  439.         notice('  `+Alt       Enables MDT layer')
  440.         notice('  F11         Enables Full Regen Set')
  441.         notice('  F10+Alt     Reset and clears PDT/MDT.')
  442.         windower.send_command('bind F9 gs c cycle offense')
  443.         windower.send_command('bind !F9 gs c cycle style')
  444.         windower.send_command('bind ^F9 gs c cycle hybrid')
  445.         windower.send_command('bind ^` gs c defense pdt')
  446.         windower.send_command('bind !` gs c defense mdt')
  447.         windower.send_command('bind F10 gs c defense RR')
  448.         windower.send_command('bind F11 gs c defense regen')
  449.         windower.send_command('bind !F10 gs c hardreset')
  450.     end
  451.    
  452.     function notice(msg, color)
  453.         if color == nil then
  454.             color = 158
  455.         end
  456.         windower.add_to_chat(color, msg)
  457.     end
  458.      
  459.     function file_unload()
  460.         windower.send_command('unbind F9')
  461.         windower.send_command('unbind ^F9')
  462.         windower.send_command('unbind !F9')
  463.         windower.send_command('unbind ^`')
  464.         windower.send_command('unbind !`')
  465.         windower.send_command('unbind F10')
  466.         windower.send_command('unbind !F10')
  467.         windower.send_command('unbind F11')
  468.         notice('Unbinding Interface.')
  469.     end
  470.      
  471.     --[[******************************************************************************************]]
  472.     --[[ Configuration variables. More options can be added here and wired into sets accordingly. ]]
  473.      
  474.     local OffenseLevels = T{'normal', 'ionis'}
  475.     local OffenseLevel = OffenseLevels[1]
  476.      
  477.     local CombatStyles = T{'GreatKatana', 'Yoichinoyumi', 'PolearmYoichi'}
  478.     local CombatStyle = CombatStyles[1]
  479.      
  480.     --[[******************************************************************************************]]
  481.     --[[******************************************************************************************]]
  482.      
  483.     local PDTEnabled = false;
  484.     local MDTEnabled = false;
  485.     local RREnabled = false;
  486.     local RegenEnabled = false;
  487.    
  488.    function init_gear_sets()
  489.    print(spell.name)
  490. if CombatStyle == 'PolearmYoichi' then
  491. if spell.name == "Tachi: Shoha" then
  492. send_command('@input /ws "double thrust"')
  493. if spell.name == "Double Thrust" then
  494. equip(sets.ws.doublethrust[OffenseLevel .. '_com'])
  495. end
  496. end
  497. end
  498. end
  499.    
  500.     function precast(spell, action)
  501.       --    if spell.type == "WeaponSkill" then
  502.         --  if player.equipment.ammo == "Hagneia Stone" then
  503.         --      equip(sets.ws.GKammo)
  504.         --  elseif player.equipment.ammo == "Demonry Stone" then
  505.         --      equip(sets.ws.GKammo)
  506.         --  end
  507.         --end
  508.        
  509.     --  if spell.type == "JobAbility" then
  510.        --     if spell.name == "Meditate" then
  511.         -- elseif spell.name == "Blade Bash" then
  512.          --       equip(sets.jobability.BladeBash)
  513.         --  elseif spell.name == "Warding Circle" then
  514.         --      equip(sets.jobability.WardingCircle)
  515.         --  elseif spell.name == "Third Eye" then
  516.          --       equip(sets.jobability.ThirdEye)
  517.         --  elseif spell.name == "Sekkanoki" then
  518.         --      equip(sets.jobability.Sekkanoki)
  519.             --elseif spell.name == "Sengikori" then
  520.                 --equip(sets.jobability.Sengikori)
  521.     --      elseif spell.name == "Meikyo Shisui" then
  522.         --      equip(sets.jobability.MeikyoShisui)
  523.     --  end    
  524.         --if spell.type == "WeaponSkill" then
  525.         --    if spell.name == "Namas Arrow" then
  526.           --      equip(sets.ws.namasarrow[OffenseLevel .. '_com'])
  527.         --  if spell.name == "Tachi: Shoha" then
  528.             --    cancel_spell()
  529.             --  end
  530.         --  end
  531.         --end  
  532.        
  533.         if spell.type == "Weaponskill" then
  534.             if buffactive.sekkanoki then
  535.                 equip(sets.jobability.Sekkanoki)
  536.             elseif buffactive.sengikori then
  537.                 equip(sets.jobability.Sengikori)
  538.             elseif buffactive.MeikyoShisui then
  539.                 equip(sets.jobability.MeikyoShisui)
  540.             end
  541.         end
  542.     end
  543.      
  544.     function update_current_set(status)
  545.         if status == nil then
  546.             status = player.status
  547.         end
  548.        
  549.         local current = nil
  550.         if status == 'Idle' and CombatStyle == 'GreatKatana' then
  551.             current = sets.idle.standingGK
  552.         elseif status == 'Idle' and CombatStyle == 'Yoichinoyumi' then
  553.             current = sets.idle.standingYoichi
  554.         elseif status == 'Idle' and CombatStyle == 'PolearmYoichi' then
  555.             current = sets.idle.standingPLM
  556.         elseif status == 'Engaged' and CombatStyle == 'GreatKatana' then
  557.             current = sets.tp.GK[OffenseLevel .. '_com']
  558.         elseif status == 'Engaged' and CombatStyle == 'Yoichinoyumi' then
  559.             current = sets.tp.Yoichinoyumi[OffenseLevel .. '_com']
  560.         elseif status == 'Engaged' and CombatStyle == 'PolearmYoichi' then
  561.             current = sets.tp.PLM[OffenseLevel .. '_com']
  562.         end
  563.    
  564.         if current then
  565.             if PDTEnabled then
  566.                 current = set_combine(current, sets.pdt)
  567.             elseif MDTEnabled then
  568.                 current = set_combine(current, sets.mdt)
  569.             end
  570.             if MDTEnabled and player.equipment.ammo == "Hagneia Stone" then
  571.                 current = set_combine(current, sets.mdt.GKammo)
  572.             elseif MDTEnabled and player.equipment.ammo == "Thew Bomblet" then
  573.                 current = set_combine(current, sets.mdt.GKammo)
  574.             elseif RREnabled then
  575.                 current = set_combine(current, sets.RR)
  576.             end
  577.             if RegenEnabled then
  578.                 current = set_combine(current, sets.regen)
  579.             end
  580.             equip(current)    
  581.         end
  582.     end
  583.  
  584.     function aftercast(spell,action)
  585.         update_current_set()
  586.     end
  587.      
  588.     function status_change(new,old)
  589.         if status_new == 'Engaged' then
  590.             current = equip(sets.tp)
  591.         elseif status_new == 'Idle' then
  592.             current = equip(sets.idle)
  593.         end
  594.         update_current_set()
  595.         return
  596.     end
  597.      
  598.     function buff_change(status,gain_or_loss)  
  599.         if buff_gain == "Sekkanoki" then
  600.             equip(sets.jobability.Sekkanoki)
  601.         elseif buff_gain == "Third Eye" then
  602.             equip(sets.jobability.ThirdEye)
  603.         elseif buff_gain == "Sekkanoki" then
  604.             equip(sets.jobability.Sekkanoki)
  605.         elseif buff_gain == "Sengikori" then
  606.             equip(sets.jobability.Sengikori)
  607.         elseif buff_gain == "Meikyo Shisui" then
  608.             equip(sets.jobability.MeikyoShisui)
  609.         end
  610.         update_current_set()
  611.     end    
  612.    
  613.     function self_command(command)
  614.         local params = command:psplit('%s')
  615.      
  616.         if params[1] == 'cycle' then
  617.             if params[2] == 'offense' then
  618.                 local next = cycle(OffenseLevels, OffenseLevel)
  619.                 OffenseLevel = OffenseLevels[next]
  620.                 notice('OffenseLevel: ' .. OffenseLevel:ucfirst())
  621.                 update_current_set()
  622.             elseif params[2] == 'style' then
  623.                 local next = cycle(CombatStyles, CombatStyle)
  624.                 CombatStyle = CombatStyles[next]
  625.                 notice('Combat Style: ' .. CombatStyle:ucfirst())
  626.                 update_current_set()
  627.             end
  628.         elseif params[1] == 'reset' then
  629.             update_current_set()
  630.         elseif params[1] == 'hardreset' then
  631.             PDTEnabled = false
  632.             MDTEnabled = false
  633.             RREnabled = false
  634.             RegenEnabled = false
  635.             notice('PDT/MDT/Twilight/Regen Reset.')
  636.             update_current_set()
  637.         elseif params[1] == 'defense' then
  638.             if params[2] == 'pdt' then
  639.                 PDTEnabled = true
  640.                 notice('PDT Up')
  641.                 update_current_set()
  642.             elseif params[2] == 'mdt' then
  643.                 MDTEnabled = true
  644.                 notice('MDT Up')
  645.                 update_current_set()
  646.             elseif params[2] == 'RR' then
  647.                 RREnabled = true
  648.                 notice('Twilight Locked')
  649.                 update_current_set()
  650.              elseif params[2] == 'regen' then
  651.                 RegenEnabled = true
  652.                 notice('Regen')
  653.                 update_current_set()
  654.             end
  655.         end
  656.     end
  657.      
  658.     -- Finds current in possible and returns the index to the
  659.     -- next element in the table, circularly.
  660.     function cycle(possibles, current)
  661.         local c = 0
  662.         for k, v in ipairs(possibles) do
  663.             if v == current then
  664.                 c = k
  665.             end
  666.         end
  667.         return c % #possibles +1
  668.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement