Advertisement
Vamperica

PUP

Mar 4th, 2017
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.91 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job.  Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- Initialization function for this job file.
  6. function get_sets()
  7.     mote_include_version = 2
  8.  
  9.     -- Load and initialize the include file.
  10.     include('Mote-Include.lua')
  11. end
  12.  
  13.  
  14. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  15. function job_setup()
  16.     -- List of pet weaponskills to check for
  17.     petWeaponskills = S{"Slapstick", "Knockout", "Magic Mortar",
  18.         "Chimera Ripper", "String Clipper",  "Cannibal Blade", "Bone Crusher", "String Shredder",
  19.         "Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
  20.    
  21.     -- Map automaton heads to combat roles
  22.     petModes = {
  23.         ['Harlequin Head'] = 'Melee',
  24.         ['Sharpshot Head'] = 'Ranged',
  25.         ['Valoredge Head'] = 'Melee',
  26.         ['Stormwaker Head'] = 'Magic',
  27.         ['Soulsoother Head'] = 'Heal',
  28.         ['Spiritreaver Head'] = 'Nuke'
  29.         }
  30.  
  31.     -- Subset of modes that use magic
  32.     magicPetModes = S{'Nuke','Heal','Magic'}
  33.    
  34.     -- Var to track the current pet mode.
  35.     state.PetMode = M{['description']='Pet Mode', 'None', 'Melee', 'Ranged', 'Tank', 'Magic', 'Heal', 'Nuke'}
  36. end
  37.  
  38. -------------------------------------------------------------------------------------------------------------------
  39. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  40. -------------------------------------------------------------------------------------------------------------------
  41.  
  42. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  43. function user_setup()
  44.     state.OffenseMode:options('Normal', 'Acc', 'Fodder')
  45.     state.HybridMode:options('Normal', 'DT')
  46.     state.WeaponskillMode:options('Normal', 'Acc', 'Fodder')
  47.     state.PhysicalDefenseMode:options('PDT', 'Evasion')
  48.  
  49.     -- Default maneuvers 1, 2, 3 and 4 for each pet mode.
  50.     defaultManeuvers = {
  51.         ['Melee'] = {'Fire Maneuver', 'Thunder Maneuver', 'Wind Maneuver', 'Light Maneuver'},
  52.         ['Ranged'] = {'Wind Maneuver', 'Fire Maneuver', 'Thunder Maneuver', 'Light Maneuver'},
  53.         ['Tank'] = {'Earth Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Wind Maneuver'},
  54.         ['Magic'] = {'Ice Maneuver', 'Light Maneuver', 'Dark Maneuver', 'Earth Maneuver'},
  55.         ['Heal'] = {'Light Maneuver', 'Dark Maneuver', 'Water Maneuver', 'Earth Maneuver'},
  56.         ['Nuke'] = {'Ice Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Earth Maneuver'}
  57.     }
  58.  
  59.     update_pet_mode()
  60.     select_default_macro_book()
  61. end
  62.  
  63.  
  64. -- Define sets used by this job file.
  65. function init_gear_sets()
  66.    
  67.     -- Precast Sets
  68.  
  69.     -- Fast cast sets for spells
  70.     sets.precast.FC = {}
  71.  
  72.     sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {})
  73.  
  74.    
  75.     -- Precast sets to enhance JAs
  76.     sets.precast.JA['Overdrive'] = {body="Pitre Tobe +3"}    
  77.  
  78.     sets.precast.JA['Tactical Switch'] = {}
  79.    
  80.     sets.precast.JA['Repair'] = {Ear1="Guignol Earring"}
  81.  
  82.     sets.precast.JA.Maneuver = {
  83. --      main="Midnights",
  84.         neck="Buffoon's Collar",
  85.         body="Karagoz Farsetto",
  86.         hands="Puppetry Dastanas",
  87.         back="Visucius's Mantle",
  88.         head="Rao Kabuto",
  89.         waist="Salire Belt",
  90.         left_ear="Lifestorm Earring",
  91.         right_ear="Mache Earring +1",
  92.         left_ring="Stikini Ring +1",
  93.         right_ring="Stikini Ring +1",
  94.         legs={ name="Samnuha Tights", augments={'STR+10','DEX+10','"Dbl.Atk."+3','"Triple Atk."+3',}},
  95.         feet="Rao Sune-Ate",
  96.         }
  97.  
  98.     -- Waltz set (chr and vit)
  99.     sets.precast.Waltz = {}
  100.        
  101.     -- Don't need any special gear for Healing Waltz.
  102.     sets.precast.Waltz['Healing Waltz'] = {}
  103.  
  104.        
  105.     -- Weaponskill sets
  106.     -- Default set for any weaponskill that isn't any more specifically defined
  107.     sets.precast.WS = {}
  108.  
  109.     -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
  110.     sets.precast.WS['Stringing Pummel'] = set_combine(sets.precast.WS, {})
  111.     sets.precast.WS['Stringing Pummel'].Mod = set_combine(sets.precast.WS['Stringing Pummel'], {})
  112.  
  113.     sets.precast.WS['Victory Smite'] = set_combine(sets.precast.WS, {})
  114.  
  115.     sets.precast.WS['Shijin Spiral'] = set_combine(sets.precast.WS, {})
  116.  
  117.    
  118.     -- Midcast Sets
  119.  
  120.     sets.midcast.FastRecast = {}
  121.        
  122.  
  123.     -- Midcast sets for pet actions
  124.     sets.midcast.Pet.Cure = {}
  125.  
  126.     sets.midcast.Pet['Elemental Magic'] = {}
  127.  
  128.     sets.midcast.Pet.WeaponSkill = {
  129.         head={ name="Taeon Chapeau", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
  130.         body="Pitre Tobe +3",
  131.         hands={ name="Taeon Gloves", augments={'Pet: Accuracy+23 Pet: Rng. Acc.+23','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
  132.         legs={ name="Taeon Tights", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}},
  133.         feet={ name="Taeon Boots", augments={'Pet: Accuracy+24 Pet: Rng. Acc.+24','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
  134.         neck="Shulmanu Collar",
  135.         waist="Klouskap Sash +1",
  136.         left_ear="Domes. Earring",
  137.         right_ear="Enmerkar Earring",
  138.         left_ring={name="Varar Ring +1", bag="Wardrobe"},
  139.         right_ring={name="Varar Ring +1", bag="Wardrobe4"},
  140.         back="Visucius's Mantle"
  141.         }
  142.  
  143.    
  144.     -- Sets to return to when not performing an action.
  145.    
  146.     -- Resting sets
  147.     sets.resting = {}
  148.    
  149.  
  150.     -- Idle sets
  151.  
  152.     sets.idle = {
  153.         main="Ohtas",
  154.         head="Rao Kabuto",
  155.         body="Hiza. Haramaki +2",
  156.         hands="Rao Kote",
  157.         legs="Assiduity Pants +1",
  158.         feet="Hermes' Sandals",
  159.         neck="Sanctity Necklace",
  160.         waist="Isa Belt",
  161.         left_ear="Dawn Earring",
  162.         right_ear="Infused Earring",
  163.         left_ring="Defending Ring",
  164.         right_ring="Stikini Ring +1",
  165.         back="Solemnity Cape",
  166.         }
  167.  
  168.     sets.idle.Town = set_combine(sets.idle, {body="Councilor's Garb"})
  169.  
  170.     -- Set for idle while pet is out (eg: pet regen gear)
  171.     sets.idle.Pet = sets.idle
  172.  
  173.     -- Idle sets to wear while pet is engaged
  174.     sets.idle.Pet.Engaged = {
  175.         main={ name="Ohtas", augments={'Accuracy+70','Pet: Accuracy+70','Pet: Haste+10%',}},
  176.         range="Animator P +1",
  177.         ammo="Automat. Oil +3",
  178.         head={ name="Taeon Chapeau", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
  179.         body="Pitre Tobe +3",
  180.         hands={ name="Taeon Gloves", augments={'Pet: Accuracy+23 Pet: Rng. Acc.+23','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
  181.         legs={ name="Taeon Tights", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}},
  182.         feet={ name="Taeon Boots", augments={'Pet: Accuracy+24 Pet: Rng. Acc.+24','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
  183.         neck="Shulmanu Collar",
  184.         waist="Klouskap Sash +1",
  185.         left_ear="Domes. Earring",
  186.         right_ear="Enmerkar Earring",
  187.         left_ring="Varar Ring +1",
  188.         right_ring="Thurandaut Ring",
  189.         back="Visucius's Mantle"
  190.         }
  191.  
  192.     sets.idle.Pet.Engaged.Ranged = set_combine(sets.idle.Pet.Engaged, {})
  193.  
  194.     sets.idle.Pet.Engaged.Nuke = set_combine(sets.idle.Pet.Engaged, {})
  195.  
  196.     sets.idle.Pet.Engaged.Magic = set_combine(sets.idle.Pet.Engaged, {})
  197.  
  198.  
  199.     -- Defense sets
  200.  
  201.     sets.defense.Evasion = {}
  202.  
  203.     sets.defense.PDT = {
  204.         main="Ohtas",
  205.         head={ name="Rao Kabuto", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  206.         body="Rao Togi +1",
  207.         hands={ name="Rao Kote", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  208.         legs={ name="Taeon Tights", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}},
  209.         feet={ name="Rao Sune-Ate", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  210.         neck="Shepherd's Chain",
  211.         waist="Klouskap Sash +1",
  212.         left_ear="Handler's Earring +1",
  213.         right_ear="Enmerkar Earring",
  214.         left_ring="Thurandaut Ring",
  215.         right_ring={name="Varar Ring +1"},
  216.         back="Visucius's Mantle"
  217. }
  218.  
  219.     sets.defense.MDT = {
  220.         main="Ohtas",
  221.         range="Animator P +1",
  222.         head={ name="Anwig Salade", augments={'Attack+3','Pet: Damage taken -10%','Accuracy+3','Pet: Haste+5',}},
  223.         body="Rao Togi +1",
  224.         hands={ name="Taeon Gloves", augments={'Pet: Accuracy+23 Pet: Rng. Acc.+23','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
  225.         legs={ name="Taeon Tights", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}},
  226.         feet={ name="Taeon Boots", augments={'Pet: Accuracy+24 Pet: Rng. Acc.+24','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
  227.         neck="Shulmanu Collar",
  228.         waist="Klouskap Sash +1",
  229.         left_ear="Domes. Earring",
  230.         right_ear="Enmerkar Earring",
  231.         left_ring="Thurandaut Ring",
  232.         right_ring="Varar Ring +1",
  233.         back={ name="Visucius's Mantle", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Accuracy+20 Attack+20','Pet: Accuracy+10 Pet: Rng. Acc.+10','Pet: Haste+10','System: 1 ID: 1247 Val: 4',}},
  234.         }
  235.  
  236.     sets.Kiting = {feet="Hermes' Sandals"}
  237.  
  238.     -- Engaged sets
  239.  
  240.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  241.     -- sets if more refined versions aren't defined.
  242.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  243.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  244.    
  245.     -- Normal melee group
  246.     sets.engaged = set_combine(sets.idle.Pet.Engaged, {})
  247.  
  248.  
  249.     sets.engaged.Acc = set_combine(sets.Engaged, {})
  250.     sets.engaged.DT = set_combine(sets.Engaged, {})
  251.     sets.engaged.Acc.DT = set_combine(sets.Engaged, {})
  252. end
  253.  
  254.  
  255. -------------------------------------------------------------------------------------------------------------------
  256. -- Job-specific hooks that are called to process player actions at specific points in time.
  257. -------------------------------------------------------------------------------------------------------------------
  258.  
  259. function job_precast(spell, action, spellMap, eventArgs)
  260.  
  261.         if spell.english == 'Deploy' then
  262.             equip(sets.midcast.Pet.WeaponSkill)
  263.         end
  264. end
  265.  
  266. -- function job_post_precast(spell, action, spellMap, eventArgs)
  267.  
  268. --  job_update(cmdParams, eventArgs)
  269.  
  270. -- end
  271.  
  272. -- Called when pet is about to perform an action
  273. function job_pet_precast(spell, action, spellMap, eventArgs)
  274.     if petWeaponskills:contains(spell.english) then
  275.         classes.CustomClass = "Weaponskill"
  276.     end
  277. end
  278.  
  279. -- function job_midcast(spell, action, spellMap, eventArgs)
  280.  
  281. --  job_update(cmdParams, eventArgs)
  282.  
  283. -- end
  284.  
  285. -------------------------------------------------------------------------------------------------------------------
  286. -- Job-specific hooks for standard casting events.
  287. -------------------------------------------------------------------------------------------------------------------
  288.  
  289. -- Called when pet is about to perform an action
  290. function job_pet_midcast(spell, action, spellMap, eventArgs)
  291.     if petWeaponskills:contains(spell.english) then
  292.         classes.CustomClass = "Weaponskill"
  293.     end
  294. end
  295.  
  296.  
  297. -------------------------------------------------------------------------------------------------------------------
  298. -- Job-specific hooks for non-casting events.
  299. -------------------------------------------------------------------------------------------------------------------
  300.  
  301. -- Called when a player gains or loses a buff.
  302. -- buff == buff gained or lost
  303. -- gain == true if the buff was gained, false if it was lost.
  304. function job_buff_change(buff, gain)
  305.     if buff == 'Wind Maneuver' then
  306.         handle_equipping_gear(player.status)
  307.         job_handle_equipping_gear(playerStatus, eventArgs)
  308.     else
  309.         job_update(cmdParams, eventArgs)
  310.         handle_equipping_gear(player.status)
  311.         job_handle_equipping_gear(playerStatus, eventArgs)
  312.     end
  313. end
  314.  
  315. -- Called when a player gains or loses a pet.
  316. -- pet == pet gained or lost
  317. -- gain == true if the pet was gained, false if it was lost.
  318. function job_pet_change(pet, gain)
  319.     update_pet_mode()
  320. end
  321.  
  322. -- Updates gear based on pet status changes.
  323. function job_pet_status_change(newStatus, oldStatus, eventArgs)
  324.         if newStatus == 'Idle' or newStatus == 'Engaged' then
  325.                 handle_equipping_gear(player.status)
  326.                 display_pet_status()
  327.         end
  328. end
  329.  
  330. -------------------------------------------------------------------------------------------------------------------
  331. -- User code that supplements standard library decisions.
  332. -------------------------------------------------------------------------------------------------------------------
  333.  
  334. -- Called by the 'update' self-command, for common needs.
  335. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  336. function job_update(cmdParams, eventArgs)
  337.     update_pet_mode()
  338. end
  339.  
  340.  
  341. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  342. function display_current_job_state(eventArgs)
  343.     display_pet_status()
  344. end
  345.  
  346.  
  347. -------------------------------------------------------------------------------------------------------------------
  348. -- User self-commands.
  349. -------------------------------------------------------------------------------------------------------------------
  350.  
  351. -- Called for custom player commands.
  352. function job_self_command(cmdParams, eventArgs)
  353.     if cmdParams[1] == 'maneuver' then
  354.         if pet.isvalid then
  355.             local man = defaultManeuvers[state.PetMode.value]
  356.             if man and tonumber(cmdParams[2]) then
  357.                 man = man[tonumber(cmdParams[2])]
  358.             end
  359.  
  360.             if man then
  361.                 send_command('input /pet "'..man..'" <me>')
  362.             end
  363.         else
  364.             add_to_chat(123,'No valid pet.')
  365.         end
  366.     end
  367. end
  368.  
  369. -------------------------------------------------------------------------------------------------------------------
  370. -- Utility functions specific to this job.
  371. -------------------------------------------------------------------------------------------------------------------
  372.  
  373.  
  374. -- Get the pet mode value based on the equipped head of the automaton.
  375. -- Returns nil if pet is not valid.
  376. function get_pet_mode()
  377.     if pet.isvalid then
  378.         return petModes[pet.head] or 'None'
  379.     else
  380.         return 'None'
  381.     end
  382. end
  383.  
  384. -- Update state.PetMode, as well as functions that use it for set determination.
  385. function update_pet_mode()
  386.     state.PetMode:set(get_pet_mode())
  387.     update_custom_groups()
  388. end
  389.  
  390. -- Update custom groups based on the current pet.
  391. function update_custom_groups()
  392.     classes.CustomIdleGroups:clear()
  393.     if pet.isvalid then
  394.         classes.CustomIdleGroups:append(state.PetMode.value)
  395.     end
  396. end
  397.  
  398. -- Engage updates
  399.  
  400. function job_handle_equipping_gear(playerStatus, eventArgs)
  401.     classes.CustomMeleeGroups:clear()
  402.     if pet.status=="Engaged" then
  403.         classes.CustomMeleeGroups:append('PetEngaged')
  404.         classes.CustomMeleeGroups:append(state.PetMode.value)
  405.     end
  406. end
  407.  
  408. -- Display current pet status.
  409. function display_pet_status()
  410.     if pet.isvalid then
  411.         local petInfoString = pet.name..' ['..pet.head..']: '..tostring(pet.status)..'  TP='..tostring(pet.tp)..'  HP%='..tostring(pet.hpp)
  412.        
  413.         if magicPetModes:contains(state.PetMode.value) then
  414.             petInfoString = petInfoString..'  MP%='..tostring(pet.mpp)
  415.         end
  416.        
  417.         add_to_chat(122,petInfoString)
  418.     end
  419. end
  420.  
  421. -- Select default macro book on initial load or subjob change.
  422. function select_default_macro_book()
  423.     -- Default macro set/book
  424.     if player.sub_job == 'DNC' then
  425.         set_macro_page(5, 2)
  426.     elseif player.sub_job == 'NIN' then
  427.         set_macro_page(5, 2)
  428.     elseif player.sub_job == 'THF' then
  429.         set_macro_page(5, 2)
  430.     else
  431.         set_macro_page(5, 2)
  432.     end
  433. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement