Advertisement
Vamperica

Drk

Mar 29th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.66 KB | None | 0 0
  1.    
  2.  
  3.     -------------------------------------------------------------------------------------------------------------------
  4.     -- Initialization function that defines sets and variables to be used.
  5.     -------------------------------------------------------------------------------------------------------------------
  6.      
  7.     -- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
  8.      
  9.     -- Initialization function for this job file.
  10.     function get_sets()
  11.             -- Load and initialize the include file.
  12.             include('Mote-Include.lua')
  13.     end
  14.      
  15.      
  16.     -- Setup vars that are user-independent.
  17.     function job_setup()
  18.         --state.Buff['Aftermath'] = buffactive['Aftermath: Lv.1'] or
  19.         --buffactive['Aftermath: Lv.2'] or
  20.         --buffactive['Aftermath: Lv.3']
  21.         --or false
  22.         state.Buff['Souleater'] = buffactive['Souleater'] or false
  23.         determine_haste_group()
  24.     end
  25.      
  26.      
  27.     -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  28.     function user_setup()
  29.             -- Options: Override default values
  30.             options.OffenseModes = {'Normal', 'Acc', 'Multi'}
  31.             options.DefenseModes = {'Normal', 'PDT', 'Reraise'}
  32.             options.WeaponskillModes = {'Normal', 'Acc', 'Att', 'Mod'}
  33.             options.CastingModes = {'Normal'}
  34.             options.IdleModes = {'Normal'}
  35.             options.RestingModes = {'Normal'}
  36.             options.PhysicalDefenseModes = {'PDT', 'Reraise'}
  37.             options.MagicalDefenseModes = {'MDT'}
  38.      
  39.             state.Defense.PhysicalMode = 'PDT'
  40.            
  41.             --adjust_engaged_sets()
  42.      
  43.             -- Additional local binds
  44.             send_command('bind ^` input /ja "Hasso" <me>')
  45.             send_command('bind !` input /ja "Seigan" <me>')
  46.      
  47.             select_default_macro_book()
  48.     end
  49.      
  50.     -- Called when this job file is unloaded (eg: job change)
  51.     function file_unload()
  52.             if binds_on_unload then
  53.                     binds_on_unload()
  54.             end
  55.      
  56.             send_command('unbind ^`')
  57.             send_command('unbind !-')
  58.     end
  59.      
  60.            
  61.     -- Define sets and vars used by this job file.
  62.     function init_gear_sets()
  63.             --------------------------------------
  64.             -- Start defining the sets
  65.             --------------------------------------
  66.             -- Precast Sets
  67.             -- Precast sets to enhance JAs
  68.             sets.precast.JA['Diabolic Eye'] = {}
  69.             sets.precast.JA['Arcane Circle'] = {}
  70.             sets.precast.JA['Nether Void'] = {}
  71.             sets.precast.JA['Souleater'] = {}
  72.      
  73.                    
  74.             -- Waltz set (chr and vit)
  75.             sets.precast.Waltz = {}
  76.                    
  77.             -- Don't need any special gear for Healing Waltz.
  78.             sets.precast.Waltz['Healing Waltz'] = {}
  79.            
  80.             -- Fast cast sets for spells
  81.  
  82.         sets.precast.FC = {    head={ name="Carmine Mask +1", augments={'Accuracy+12','DEX+12','MND+20',}},
  83.     hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
  84.     legs="Arjuna Breeches",
  85.     feet="Flam. Gambieras +2",
  86.     neck="Baetyl Pendant",
  87.     left_ear="Loquac. Earring",
  88.     right_ear="Etiolation Earring",
  89.     left_ring="Patricius Ring",
  90.     right_ring="Kishar Ring",
  91.         }
  92.                      
  93.             -- Midcast Sets
  94.             sets.midcast.FastRecast = {
  95.     head={ name="Carmine Mask +1", augments={'Accuracy+12','DEX+12','MND+20',}},
  96.     hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
  97.     legs="Arjuna Breeches",
  98.     feet="Flam. Gambieras +2",
  99.     neck="Baetyl Pendant",
  100.     left_ear="Loquac. Earring",
  101.     right_ear="Etiolation Earring",
  102.     left_ring="Patricius Ring",
  103.     right_ring="Kishar Ring",
  104.             }
  105.                    
  106.             -- Specific spells
  107.             sets.midcast.Utsusemi = {}
  108.      
  109.             sets.midcast.DarkMagic = {}
  110.            
  111.             sets.midcast.EnfeeblingMagic = set_combine(sets.midcast.DarkMagic, {})
  112.            
  113.             sets.midcast['Dread Spikes'] = {}
  114.            
  115.             sets.midcast.Stun = set_combine(sets.midcast.DarkMagic, {})
  116.                    
  117.             sets.midcast.Drain = sets.midcast.DarkMagic
  118.                    
  119.             sets.midcast.Aspir = sets.midcast.Drain
  120.                                            
  121.             -- Weaponskill sets
  122.             -- Default set for any weaponskill that isn't any more specifically defined
  123.             sets.precast.WS = {
  124.     ammo="Knobkierrie",
  125.     head="Flam. Zucchetto +2",
  126.     body="Dagon Breast.",
  127.     hands="Sulev. Gauntlets +2",
  128.     legs="Sulev. Cuisses +2",
  129.     feet="Flam. Gambieras +2",
  130.     neck="Fotia Gorget",
  131.     waist="Fotia Belt",
  132.     left_ear="Brutal Earring",
  133.     right_ear="Suppanomimi",
  134.     left_ring="Regal Ring",
  135.     right_ring="Niqmaddu Ring",
  136.     back="Agema Cape",}
  137.      
  138.             -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
  139.             sets.precast.WS['Catastrophe'] = set_combine(sets.precast.WS, {})
  140.             sets.precast.WS['Catastrophe'].Acc = set_combine(sets.precast.WS.Acc, {})
  141.             sets.precast.WS['Catastrophe'].Mod = set_combine(sets.precast.WS['Catastrophe'], {})
  142.      
  143.             sets.precast.WS['Entropy'] = set_combine(sets.precast.WS, {})
  144.             sets.precast.WS['Entropy'].Acc = set_combine(sets.precast.WS.Acc, {})
  145.             sets.precast.WS['Entropy'].Mod = set_combine(sets.precast.WS['Entropy'], {})
  146.      
  147.             sets.precast.WS['Resolution'] = set_combine(sets.precast.WS, {})
  148.             sets.precast.WS['Resolution'].Acc = set_combine(sets.precast.WS.Acc, {})
  149.             sets.precast.WS['Resolution'].Mod = set_combine(sets.precast.WS['Resolution'], {})
  150.      
  151.      
  152.            
  153.             -- Sets to return to when not performing an action.
  154.            
  155.             -- Resting sets
  156.             sets.resting = {}
  157.            
  158.      
  159.             -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  160.             sets.idle.Town = {legs="Carmine Cuisses +1"}
  161.            
  162.             sets.idle.Field = {legs="Carmine Cuisses +1"}
  163.      
  164.             sets.idle.Weak = {}
  165.            
  166.             -- Defense sets
  167.             sets.defense.PDT = {}
  168.      
  169.             sets.defense.Reraise = {}
  170.      
  171.             sets.defense.MDT = {}
  172.      
  173.             sets.Kiting = {}
  174.      
  175.             sets.Reraise = {}
  176.      
  177.             -- Engaged sets
  178.             sets.engaged = {
  179.         ammo="Ginsen",
  180.         head="Flam. Zucchetto +2",
  181.         body="Dagon Breast.",
  182.         hands="Sulev. Gauntlets +2",
  183.         legs="Sulev. Cuisses +2",
  184.         feet="Flam. Gambieras +2",
  185.         neck="Combatant's Torque",
  186.         waist="Ioskeha Belt +1",
  187.         left_ear="Brutal Earring",
  188.         right_ear="Suppanomimi",
  189.         left_ring="Flamma Ring",
  190.         right_ring="Niqmaddu Ring",
  191.         back="Agema Cape",}
  192.  
  193.             sets.engaged.Acc = set_combine(sets.engaged, {})
  194.             sets.engaged.Multi = set_combine(sets.engaged, {})
  195.             sets.engaged.Reraise = set_combine(sets.engaged, {})
  196.  
  197.             sets.engaged.HighHaste = set_combine(sets.engaged.Multi, {})
  198.  
  199.             sets.engaged.MaxHaste = sets.engaged.HighHaste
  200.             sets.engaged.EmbravaHaste = sets.engaged.HighHaste
  201.    
  202.      
  203.             -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  204.             -- sets if more refined versions aren't defined.
  205.             -- If you create a set with both offense and defense modes, the offense mode should be first.
  206.             -- EG: sets.engaged.Dagger.Accuracy.Evasion
  207.            
  208.             -- Normal melee group
  209.             --sets.engaged.Apocalypse = {}
  210.             --sets.engaged.Apocalypse.Acc = {}
  211.             --sets.engaged.Apocalypse.AM = {}
  212.             --sets.engaged.Apocalypse.Multi = {}
  213.             --sets.engaged.Apocalypse.Multi.PDT = {}
  214.             --sets.engaged.Apocalypse.Multi.Reraise = {}
  215.             --sets.engaged.Apocalypse.PDT = {}
  216.             --sets.engaged.Apocalypse.Acc.PDT = {}
  217.             --sets.engaged.Apocalypse.Reraise = {}
  218.             --sets.engaged.Apocalypse.Acc.Reraise = {}
  219.                    
  220.  
  221.             -- Custom Melee Group
  222.             --sets.engaged['Anahera Scythe'] = {}
  223.  
  224.             --sets.engaged['Anahera Scythe'].Acc = set_combine(sets.engaged['Anahera Scythe'], {})
  225.  
  226.             --sets.engaged['Senbaak Nagan'].Multi = set_combine(sets.engaged['Anahera Scythe'], {})
  227.  
  228.             --sets.engaged['Anahera Scythe'].Multi.PDT = set_combine(sets.engaged['Anahera Scythe'].Multi, {})
  229.  
  230.             --sets.engaged['Anahera Scythe'].Multi.Reraise = set_combine(sets.engaged['Anahera Scythe'].Multi, {})
  231.  
  232.             --sets.engaged['Anahera Scythe'].PDT = set_combine(sets.engaged['Anahera Scythe'], {})
  233.  
  234.             --sets.engaged['Anahera Scythe'].Acc.PDT = set_combine(sets.engaged['Anahera Scythe'].PDT, {})
  235.  
  236.             --sets.engaged['Anahera Scythe'].Acc.Reraise = set_combine(sets.engaged['Anahera Scythe'].Acc, {})
  237.  
  238.             --sets.engaged['Anahera Scythe'].MaxHaste = set_combine(sets.engaged['Anahera Scythe'].Multi, {})
  239.             --sets.engaged['Anahera Scythe'].EmbravaHaste = sets.engaged['Anahera Scythe'].MaxHaste        
  240.             --sets.engaged['Anahera Scythe'].HighHaste = sets.engaged['Anahera Scythe'].MaxHaste           
  241.            
  242.             sets.buff.Souleater = {}
  243.      
  244.     end
  245.      
  246.     -------------------------------------------------------------------------------------------------------------------
  247.     -- Job-specific hooks that are called to process player actions at specific points in time.
  248.     -------------------------------------------------------------------------------------------------------------------
  249.      
  250.  
  251.     -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  252.     -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  253.     function job_precast(spell, action, spellMap, eventArgs)
  254.             if spell.action_type == 'Magic' then
  255.             equip(sets.precast.FC)
  256.             end
  257.     end
  258.      
  259.  
  260.      
  261.      
  262.     -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  263.     function job_midcast(spell, action, spellMap, eventArgs)
  264.             if spell.action_type == 'Magic' then
  265.                 equip(sets.midcast.FastRecast)
  266.             end
  267.     end
  268.      
  269.     -- Run after the default midcast() is done.
  270.     -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  271.     function job_post_midcast(spell, action, spellMap, eventArgs)
  272.             if state.DefenseMode == 'Reraise' or
  273.                     (state.Defense.Active and state.Defense.Type == 'Physical' and state.Defense.PhysicalMode == 'Reraise') then
  274.                     equip(sets.Reraise)
  275.             end
  276.     end
  277.      
  278.     -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  279.   --  function job_aftercast(spell, action, spellMap, eventArgs)
  280.   --      if not spell.interrupted then
  281.   --              if state.Buff[spell.english] ~= nil then
  282.   --                      state.Buff[spell.english] = true
  283.   --              end
  284.   --       end
  285.   --  end
  286.      
  287.     -------------------------------------------------------------------------------------------------------------------
  288.     -- Customization hooks for idle and melee sets, after they've been automatically constructed.
  289.     -------------------------------------------------------------------------------------------------------------------
  290.     -- Modify the default idle set after it was constructed.
  291.     function customize_idle_set(idleSet)
  292.         if state.Buff.Souleater then
  293.             idleSet = set_combine(idleSet, sets.buff.Souleater)
  294.         end
  295.         return idleSet
  296.     end
  297.      
  298.     -- Modify the default melee set after it was constructed.
  299.     function customize_melee_set(meleeSet)
  300.         if state.Buff.Souleater then
  301.             meleeSet = set_combine(meleeSet, sets.buff.Souleater)
  302.         end
  303.         return meleeSet
  304.     end
  305.      
  306.     -------------------------------------------------------------------------------------------------------------------
  307.     -- General hooks for other events.
  308.     -------------------------------------------------------------------------------------------------------------------
  309.      
  310.     -- Called when the player's status changes.
  311.     function job_status_change(newStatus, oldStatus, eventArgs)
  312.      
  313.     end
  314.      
  315.     -- Called when a player gains or loses a buff.
  316.     -- buff == buff gained or lost
  317.     -- gain == true if the buff was gained, false if it was lost.
  318.     function job_buff_change(buff, gain)
  319.         if S{'haste','march','embrava','haste samba'}:contains(buff:lower()) then
  320.             determine_haste_group()
  321.             handle_equipping_gear(player.status)
  322.        -- elseif buff:startswith('Aftermath') then
  323.        --     state.Buff.Aftermath = gain
  324.        --     adjust_melee_groups()
  325.        --     handle_equipping_gear(player.status)
  326.         elseif state.Buff[buff] ~= nil then
  327.             state.Buff[buff] = gain
  328.             handle_equipping_gear(player.status)
  329.         end
  330.  
  331.     end
  332.      
  333.      
  334.     -------------------------------------------------------------------------------------------------------------------
  335.     -- User code that supplements self-commands.
  336.     -------------------------------------------------------------------------------------------------------------------
  337.      
  338.     -- Called by the 'update' self-command, for common needs.
  339.     -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  340. function job_update(cmdParams, eventArgs)
  341.     --adjust_engaged_sets()
  342.     determine_haste_group()
  343. end
  344.  
  345. -------------------------------------------------------------------------------------------------------------------
  346. -- Utility functions specific to this job.
  347. -------------------------------------------------------------------------------------------------------------------
  348.  
  349. --function adjust_engaged_sets()
  350. --  state.CombatWeapon = player.equipment.main
  351. --  adjust_melee_groups()
  352. --end
  353.  
  354. --function adjust_melee_groups()
  355. --  classes.CustomMeleeGroups:clear()
  356. --  if state.Buff.Aftermath then
  357. --      classes.CustomMeleeGroups:append('AM')
  358. --  end
  359. --end
  360.      
  361. function determine_haste_group()
  362.  
  363.     -- This section only applies to LR being up
  364.     --
  365.     -- 1) uncapped delay reduction: 26% gear haste + LR's 25% JA haste
  366.     -- 2) HighHaste - Marches: 16% gear haste with march+3, 14% with march+4, 12% with march+5
  367.     -- 3) EmbravaHaste - embrava: 21% gear haste if sch is naked alt, 17% if it's capped potency
  368.     -- 4) MaxHaste - capped magic haste: 12% gear haste
  369.    
  370.     classes.CustomMeleeGroups:clear()
  371.    
  372.     if buffactive.embrava and (buffactive.march == 2 or (buffactive.march and buffactive.haste)) then
  373.         classes.CustomMeleeGroups:append('MaxHaste')
  374.     elseif buffactive.march == 2 and buffactive.haste then
  375.         classes.CustomMeleeGroups:append('MaxHaste')
  376.     elseif buffactive.embrava and (buffactive.haste or buffactive.march) then
  377.         classes.CustomMeleeGroups:append('EmbravaHaste')
  378.     elseif buffactive.march == 1 and buffactive.haste and buffactive['haste samba'] then
  379.         classes.CustomMeleeGroups:append('HighHaste')
  380.     elseif buffactive.march == 1 and buffactive['Last Resort'] then
  381.         classes.CustomMeleeGroups:append('HighHaste')
  382.     end
  383. end
  384.  
  385. function select_default_macro_book()
  386.         -- Default macro set/book
  387.         if player.sub_job == 'DNC' then
  388.             set_macro_page(6, 2)
  389.         elseif player.sub_job == 'SAM' then
  390.             set_macro_page(6, 4)
  391.         else
  392.             set_macro_page(6, 2)
  393.         end
  394. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement