Advertisement
OrphenPUP

PUP_CureEnmity

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