Advertisement
OrphenPUP

PUP_Elem_Resist

Nov 25th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.13 KB | None | 0 0
  1. -- Trigger Macro
  2. -- Macro -
  3. -- /console gs c set ResistMagic Resist
  4.  
  5. -------------------------------------------------------------------------------------------------------------------
  6. -- Setup functions for this job. Generally should not be modified.
  7. -------------------------------------------------------------------------------------------------------------------
  8.  
  9. -- Initialization function for this job file.
  10. function get_sets()
  11. mote_include_version = 2
  12.  
  13. -- Load and initialize the include file.
  14. include('Mote-Include.lua')
  15. end
  16.  
  17.  
  18. -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
  19. function job_setup()
  20. -- List of pet weaponskills to check for
  21. petWeaponskills = S{"Slapstick", "Knockout", "Magic Mortar",
  22. "Chimera Ripper", "String Clipper", "Cannibal Blade", "Bone Crusher", "String Shredder",
  23. "Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
  24.  
  25. -- Map automaton heads to combat roles
  26. petModes = {
  27. ['Harlequin Head'] = 'Melee',
  28. ['Sharpshot Head'] = 'Ranged',
  29. ['Valoredge Head'] = 'Tank',
  30. ['Stormwaker Head'] = 'Magic',
  31. ['Soulsoother Head'] = 'Heal',
  32. ['Spiritreaver Head'] = 'Nuke'
  33. }
  34.  
  35. -- Subset of modes that use magic
  36. magicPetModes = S{'Nuke','Heal','Magic'}
  37.  
  38. -- Var to track the current pet mode.
  39. state.PetMode = M{['description']='Pet Mode', 'None', 'Melee', 'Ranged', 'Tank', 'Magic', 'Heal', 'Nuke'}
  40.  
  41. -- Var to track Pet Magic Accuracy
  42. state.ResistMagic = M{['description']='Pet Magic', 'None', 'Resist'}
  43.  
  44.  
  45. end
  46.  
  47. -------------------------------------------------------------------------------------------------------------------
  48. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  49. -------------------------------------------------------------------------------------------------------------------
  50.  
  51. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  52. function user_setup()
  53. state.OffenseMode:options('Normal', 'Acc', 'Fodder')
  54. state.HybridMode:options('Normal', 'DT')
  55. state.WeaponskillMode:options('Normal', 'Acc', 'Fodder')
  56. state.PhysicalDefenseMode:options('PDT', 'Evasion')
  57.  
  58. -- Default maneuvers 1, 2, 3 and 4 for each pet mode.
  59. defaultManeuvers = {
  60. ['Melee'] = {'Fire Maneuver', 'Thunder Maneuver', 'Wind Maneuver', 'Light Maneuver'},
  61. ['Ranged'] = {'Wind Maneuver', 'Fire Maneuver', 'Thunder Maneuver', 'Light Maneuver'},
  62. ['Tank'] = {'Earth Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Wind Maneuver'},
  63. ['Magic'] = {'Ice Maneuver', 'Light Maneuver', 'Dark Maneuver', 'Earth Maneuver'},
  64. ['Heal'] = {'Light Maneuver', 'Dark Maneuver', 'Water Maneuver', 'Earth Maneuver'},
  65. ['Nuke'] = {'Ice Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Earth Maneuver'}
  66. }
  67.  
  68. update_pet_mode()
  69.  
  70. end
  71.  
  72.  
  73. -- Define sets used by this job file.
  74. function init_gear_sets()
  75.  
  76. -- Precast Sets
  77.  
  78. -- Fast cast sets for spells
  79. sets.precast.FC = {}
  80.  
  81. sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {})
  82.  
  83.  
  84. -- Precast sets to enhance JAs
  85. sets.precast.JA['Tactical Switch'] = {}
  86.  
  87. sets.precast.JA['Repair'] = {}
  88.  
  89. sets.precast.JA.Maneuver = {}
  90.  
  91.  
  92.  
  93. -- Waltz set (chr and vit)
  94. sets.precast.Waltz = {}
  95.  
  96. -- Don't need any special gear for Healing Waltz.
  97. sets.precast.Waltz['Healing Waltz'] = {}
  98.  
  99.  
  100. -- Weaponskill sets
  101. -- Default set for any weaponskill that isn't any more specifically defined
  102. sets.precast.WS = {}
  103.  
  104. -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
  105. sets.precast.WS['Stringing Pummel'] = set_combine(sets.precast.WS, {})
  106. sets.precast.WS['Stringing Pummel'].Mod = set_combine(sets.precast.WS['Stringing Pummel'], {})
  107. sets.precast.WS['Victory Smite'] = set_combine(sets.precast.WS, {})
  108. sets.precast.WS['Shijin Spiral'] = set_combine(sets.precast.WS, {})
  109.  
  110.  
  111. -- Midcast Sets
  112.  
  113. sets.midcast.FastRecast = {}
  114.  
  115.  
  116. -- Midcast sets for pet actions
  117. sets.midcast.Pet.Cure = {}
  118.  
  119. sets.midcast.Pet['Elemental Magic'] = {
  120. head="Otronif Mask +1", body="Otro. Harness +1", hands="Otronif Gloves +1",
  121. legs="Otronif Brais +1", feet="Otronif Boots +1"}
  122. sets.midcast.Pet['Elemental Magic'].Resist = {
  123. head="Karagoz Capello +1", body="Kara. Farsetto +1", hands="Karagoz Guanti +1",
  124. legs="Kara. Pantaloni +1", feet="Karagoz Scarpe +1"}
  125.  
  126. sets.midcast.Pet['Enfeebling Magic'] = {}
  127.  
  128.  
  129. sets.midcast.Pet.WeaponSkill = {}
  130.  
  131.  
  132. -- Sets to return to when not performing an action.
  133.  
  134. -- Resting sets
  135. sets.resting = {}
  136.  
  137.  
  138. -- Idle sets
  139.  
  140. sets.idle = {}
  141. sets.idle.Town = set_combine(sets.idle, {})
  142.  
  143. -- Set for idle while pet is out (eg: pet regen gear)
  144. sets.idle.Pet = sets.idle
  145.  
  146. -- Idle sets to wear while pet is engaged
  147. sets.idle.Pet.Engaged = {}
  148. sets.idle.Pet.Engaged.Ranged = set_combine(sets.idle.Pet.Engaged, {})
  149. sets.idle.Pet.Engaged.Nuke = set_combine(sets.idle.Pet.Engaged, {})
  150. sets.idle.Pet.Engaged.Magic = set_combine(sets.idle.Pet.Engaged, {})
  151.  
  152.  
  153. -- Defense sets
  154.  
  155. sets.defense.Evasion = {}
  156. sets.defense.PDT = {}
  157. sets.defense.MDT = {}
  158.  
  159. sets.Kiting = {}
  160.  
  161. -- Engaged sets
  162.  
  163. -- Normal melee group
  164. sets.engaged = {
  165. head="Taeon Chapeau", neck="Sanctity Necklace", ear1="Etiolation Earring",
  166. body="Taeon Tabard", hands="Taeon Gloves", ring1="Kunaji Ring", ring2="Vengeful Ring",
  167. back="Prodigious Mantle", waist="Steppe Sash", legs="Taeon Tights", feet="Taeon Boots"}
  168.  
  169. sets.engaged.Acc = {}
  170. sets.engaged.DT = {}
  171. sets.engaged.Acc.DT = {}
  172. end
  173.  
  174.  
  175. -------------------------------------------------------------------------------------------------------------------
  176. -- Job-specific hooks for standard casting events.
  177. -------------------------------------------------------------------------------------------------------------------
  178.  
  179. -- Called when pet is about to perform an action
  180. function job_pet_midcast(spell, action, spellMap, eventArgs)
  181.  
  182. if spell.skill == 'Elemental Magic' then
  183. if state.ResistMagic.value == 'Resist' then
  184. equip(sets.midcast.Pet['Elemental Magic'].Resist)
  185. else
  186. equip(sets.midcast.Pet['Elemental Magic'])
  187. end
  188. end
  189.  
  190. end
  191.  
  192.  
  193. -------------------------------------------------------------------------------------------------------------------
  194. -- Job-specific hooks for non-casting events.
  195. -------------------------------------------------------------------------------------------------------------------
  196.  
  197. -- Called when a player gains or loses a buff.
  198. -- buff == buff gained or lost
  199. -- gain == true if the buff was gained, false if it was lost.
  200. function job_buff_change(buff, gain)
  201. if buff == 'Wind Maneuver' then
  202. handle_equipping_gear(player.status)
  203. end
  204. end
  205.  
  206. -- Called when a player gains or loses a pet.
  207. -- pet == pet gained or lost
  208. -- gain == true if the pet was gained, false if it was lost.
  209. function job_pet_change(pet, gain)
  210. update_pet_mode()
  211. end
  212.  
  213. -- Called when the pet's status changes.
  214. function job_pet_status_change(newStatus, oldStatus)
  215. if newStatus == 'Engaged' then
  216. display_pet_status()
  217. end
  218. end
  219.  
  220.  
  221. -------------------------------------------------------------------------------------------------------------------
  222. -- User code that supplements standard library decisions.
  223. -------------------------------------------------------------------------------------------------------------------
  224.  
  225. -- Called by the 'update' self-command, for common needs.
  226. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  227. function job_update(cmdParams, eventArgs)
  228. update_pet_mode()
  229. end
  230.  
  231.  
  232. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  233. function display_current_job_state(eventArgs)
  234. display_pet_status()
  235. end
  236.  
  237.  
  238. -------------------------------------------------------------------------------------------------------------------
  239. -- User self-commands.
  240. -------------------------------------------------------------------------------------------------------------------
  241.  
  242. -- Called for custom player commands.
  243. function job_self_command(cmdParams, eventArgs)
  244. if cmdParams[1] == 'maneuver' then
  245. if pet.isvalid then
  246. local man = defaultManeuvers[state.PetMode.value]
  247. if man and tonumber(cmdParams[2]) then
  248. man = man[tonumber(cmdParams[2])]
  249. end
  250.  
  251. if man then
  252. send_command('input /pet "'..man..'" <me>')
  253. end
  254. else
  255. add_to_chat(123,'No valid pet.')
  256. end
  257. end
  258. end
  259.  
  260.  
  261. -------------------------------------------------------------------------------------------------------------------
  262. -- Utility functions specific to this job.
  263. -------------------------------------------------------------------------------------------------------------------
  264.  
  265. -- Get the pet mode value based on the equipped head of the automaton.
  266. -- Returns nil if pet is not valid.
  267. function get_pet_mode()
  268. if pet.isvalid then
  269. return petModes[pet.head] or 'None'
  270. else
  271. return 'None'
  272. end
  273. end
  274.  
  275. -- Update state.PetMode, as well as functions that use it for set determination.
  276. function update_pet_mode()
  277. state.PetMode:set(get_pet_mode())
  278. update_custom_groups()
  279. end
  280.  
  281. -- Update custom groups based on the current pet.
  282. function update_custom_groups()
  283. classes.CustomIdleGroups:clear()
  284. if pet.isvalid then
  285. classes.CustomIdleGroups:append(state.PetMode.value)
  286. end
  287. end
  288.  
  289. -- Display current pet status.
  290. function display_pet_status()
  291. if pet.isvalid then
  292. local petInfoString = pet.name..' ['..pet.head..']: '..tostring(pet.status)..' TP='..tostring(pet.tp)..' HP%='..tostring(pet.hpp)
  293.  
  294. if magicPetModes:contains(state.PetMode.value) then
  295. petInfoString = petInfoString..' MP%='..tostring(pet.mpp)
  296. end
  297.  
  298. add_to_chat(122,petInfoString)
  299. end
  300. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement