Guest User

Untitled

a guest
Jun 26th, 2015
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.89 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.  
  17. end
  18.  
  19. -------------------------------------------------------------------------------------------------------------------
  20. -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
  21. -------------------------------------------------------------------------------------------------------------------
  22.  
  23. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  24. function user_setup()
  25. state.OffenseMode:options('None', 'Normal')
  26. state.CastingMode:options('Normal', 'Resistant', 'Proc')
  27. state.IdleMode:options('Normal', 'PDT')
  28.  
  29. state.MagicBurst = M(false, 'Magic Burst')
  30.  
  31. lowTierNukes = S{'Stone', 'Water', 'Aero', 'Fire', 'Blizzard', 'Thunder',
  32. 'Stone II', 'Water II', 'Aero II', 'Fire II', 'Blizzard II', 'Thunder II',
  33. 'Stone III', 'Water III', 'Aero III', 'Fire III', 'Blizzard III', 'Thunder III',
  34. 'Stonega', 'Waterga', 'Aeroga', 'Firaga', 'Blizzaga', 'Thundaga',
  35. 'Stonega II', 'Waterga II', 'Aeroga II', 'Firaga II', 'Blizzaga II', 'Thundaga II'}
  36.  
  37. gear.macc_hagondes = {}
  38.  
  39. -- Additional local binds
  40. send_command('bind ^` input /ma Stun <t>')
  41. send_command('bind @` gs c activate MagicBurst')
  42.  
  43. select_default_macro_book()
  44. end
  45.  
  46. -- Called when this job file is unloaded (eg: job change)
  47. function user_unload()
  48. send_command('unbind ^`')
  49. send_command('unbind @`')
  50. end
  51.  
  52.  
  53. -- Define sets and vars used by this job file.
  54. function init_gear_sets()
  55. --------------------------------------
  56. -- Start defining the sets
  57. --------------------------------------
  58.  
  59. ---- Precast Sets ----
  60.  
  61. -- Precast sets to enhance JAs
  62. sets.precast.JA['Mana Wall'] = {feet="Goetia Sabots +2"}
  63.  
  64. sets.precast.JA.Manafont = {body="Sorcerer's Coat +2"}
  65.  
  66. -- equip to maximize HP (for Tarus) and minimize MP loss before using convert
  67. sets.precast.JA.Convert = {}
  68.  
  69.  
  70. -- Fast cast sets for spells
  71.  
  72. sets.precast.FC = {ear2="Loquacious Earring", back="Swith Cape"}
  73.  
  74. sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {hands="Carapacho Cuffs"})
  75.  
  76. sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="Stoicheion Medal"})
  77.  
  78. sets.precast.FC.Cure = set_combine(sets.precast.FC)
  79.  
  80. sets.precast.FC.Curaga = sets.precast.FC.Cure
  81.  
  82. -- Weaponskill sets
  83. -- Default set for any weaponskill that isn't any more specifically defined
  84. sets.precast.WS = {}
  85.  
  86. -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
  87. sets.precast.WS['Vidohunir'] = {}
  88.  
  89.  
  90. ---- Midcast Sets ----
  91.  
  92. sets.midcast.FastRecast = {
  93. ear2="Loquacious Earring", back="Swith Cape"}
  94.  
  95. sets.midcast.Cure = {}
  96.  
  97. sets.midcast.Curaga = sets.midcast.Cure
  98.  
  99. sets.midcast['Enhancing Magic'] = {hands="Carapacho Cuffs"}
  100.  
  101. sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {hands="Carapacho Cuffs"})
  102.  
  103. sets.midcast['Enfeebling Magic'] = {body="wizard's coat"}
  104.  
  105. sets.midcast.ElementalEnfeeble = sets.midcast['Enfeebling Magic']
  106.  
  107. sets.midcast['Dark Magic'] = {legs="wizard's tonban"}
  108.  
  109. sets.midcast.Drain = {legs="wizard's tonban"}
  110.  
  111. sets.midcast.Aspir = sets.midcast.Drain
  112.  
  113. sets.midcast.Stun = sets.precast.FC
  114.  
  115. sets.midcast.BardSong = {}
  116.  
  117.  
  118. -- Elemental Magic sets
  119.  
  120. sets.midcast['Elemental Magic'] = {main="teiwaz", sub="wize strap", ammo="snow sachet", head="wayfarer circlet", neck="stoicheion medal", ear1="hecate's earring", ear2="moldavite earring", body="wayfarer robe", hands="wayfarer cuffs", ring1="shiva ring", ring2="shiva ring", back="goetia mantle", waist="cognition belt", legs="wayfarer slops", feet="wayfarer clogs"}
  121.  
  122. sets.midcast['Elemental Magic'].Resistant = {main="teiwaz", sub="wize strap", ammo="snow sachet", head="wayfarer circlet", neck="stoicheion medal", ear1="hecate's earring", ear2="moldavite earring", body="wayfarer robe", hands="wayfarer cuffs", ring1="shiva ring", ring2="shiva ring", back="goetia mantle", waist="cognition belt", legs="wayfarer slops", feet="wayfarer clogs"}
  123.  
  124. sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'], {sub="Wizzan Grip"})
  125. sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'], {sub="Wizzan Grip"})
  126.  
  127.  
  128. -- Minimal damage gear for procs.
  129. sets.midcast['Elemental Magic'].Proc = {}
  130.  
  131.  
  132.  
  133. -- Sets to return to when not performing an action.
  134.  
  135. -- Resting sets
  136. sets.resting = {main="Chatoyant Staff",body="errant hpl.", neck="beak necklace", ear1="magnetic earring", waist="hierarch belt"}
  137.  
  138.  
  139. -- Idle sets
  140.  
  141. -- Normal refresh idle set
  142. sets.idle = {main="Terra's Staff", body="dalmatica", head="wayfarer circlet", neck="stoicheion medal", ear1="hecate's earring", ear2="moldavite earring", hands="wayfarer cuffs", ring1="shiva ring", ring2="shiva ring", back="goetia mantle", waist="cognition belt", legs="wayfarer slops", feet="wayfarer clogs"}
  143.  
  144. -- Idle mode that keeps PDT gear on, but doesn't prevent normal gear swaps for precast/etc.
  145. sets.idle.PDT = {main="Terra's Staff"}
  146.  
  147. -- Idle mode scopes:
  148. -- Idle mode when weak.
  149. sets.idle.Weak = {}
  150.  
  151. -- Town gear.
  152. sets.idle.Town = {}
  153.  
  154. -- Defense sets
  155.  
  156. sets.defense.PDT = {main="Terra's Staff"}
  157.  
  158. sets.defense.MDT = {}
  159.  
  160. sets.Kiting = {feet="Herald's Gaiters"}
  161.  
  162. sets.latent_refresh = {waist="Fucho-no-obi"}
  163.  
  164. -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  165.  
  166. sets.buff['Mana Wall'] = {feet="Goetia Sabots +2"}
  167.  
  168. sets.magic_burst = {neck="Mizukage-no-Kubikazari", ring1="Sorcerer's Ring"}
  169.  
  170. -- Engaged sets
  171.  
  172. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  173. -- sets if more refined versions aren't defined.
  174. -- If you create a set with both offense and defense modes, the offense mode should be first.
  175. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  176.  
  177. -- Normal melee group
  178. sets.engaged = {}
  179. end
  180.  
  181. -------------------------------------------------------------------------------------------------------------------
  182. -- Job-specific hooks for standard casting events.
  183. -------------------------------------------------------------------------------------------------------------------
  184.  
  185. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  186. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  187. function job_precast(spell, action, spellMap, eventArgs)
  188. if spellMap == 'Cure' or spellMap == 'Curaga' then
  189. gear.default.obi_waist = "Goading Belt"
  190. elseif spell.skill == 'Elemental Magic' then
  191. gear.default.obi_waist = "Sekhmet Corset"
  192. if state.CastingMode.value == 'Proc' then
  193. classes.CustomClass = 'Proc'
  194. end
  195. end
  196. end
  197.  
  198.  
  199. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  200. function job_midcast(spell, action, spellMap, eventArgs)
  201.  
  202. end
  203.  
  204. function job_post_midcast(spell, action, spellMap, eventArgs)
  205. if spell.skill == 'Elemental Magic' then
  206. if state.MagicBurst.value then
  207. equip(sets.magic_burst)
  208. end
  209. if player.hpp < 76 then
  210. equip({ring1="Sorcerer's Ring"})
  211. end
  212. end
  213. end
  214.  
  215. function job_aftercast(spell, action, spellMap, eventArgs)
  216. -- Lock feet after using Mana Wall.
  217. if not spell.interrupted then
  218. if spell.english == 'Mana Wall' then
  219. enable('feet')
  220. equip(sets.buff['Mana Wall'])
  221. disable('feet')
  222. elseif spell.skill == 'Elemental Magic' then
  223. state.MagicBurst:reset()
  224. end
  225. end
  226. end
  227.  
  228. -------------------------------------------------------------------------------------------------------------------
  229. -- Job-specific hooks for non-casting events.
  230. -------------------------------------------------------------------------------------------------------------------
  231.  
  232. -- Called when a player gains or loses a buff.
  233. -- buff == buff gained or lost
  234. -- gain == true if the buff was gained, false if it was lost.
  235. function job_buff_change(buff, gain)
  236. -- Unlock feet when Mana Wall buff is lost.
  237. if buff == "Mana Wall" and not gain then
  238. enable('feet')
  239. handle_equipping_gear(player.status)
  240. end
  241. end
  242.  
  243. -- Handle notifications of general user state change.
  244. function job_state_change(stateField, newValue, oldValue)
  245. if stateField == 'Offense Mode' then
  246. if newValue == 'Normal' then
  247. disable('main','sub','range')
  248. else
  249. enable('main','sub','range')
  250. end
  251. end
  252. end
  253.  
  254.  
  255. -------------------------------------------------------------------------------------------------------------------
  256. -- User code that supplements standard library decisions.
  257. -------------------------------------------------------------------------------------------------------------------
  258.  
  259. -- Custom spell mapping.
  260. function job_get_spell_map(spell, default_spell_map)
  261. if spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble' then
  262. --[[ No real need to differentiate with current gear.
  263. if lowTierNukes:contains(spell.english) then
  264. return 'LowTierNuke'
  265. else
  266. return 'HighTierNuke'
  267. end
  268. --]]
  269. end
  270. end
  271.  
  272. -- Modify the default idle set after it was constructed.
  273. function customize_idle_set(idleSet)
  274. if player.mpp < 51 then
  275. idleSet = set_combine(idleSet, sets.latent_refresh)
  276. end
  277.  
  278. return idleSet
  279. end
  280.  
  281.  
  282. -- Function to display the current relevant user state when doing an update.
  283. function display_current_job_state(eventArgs)
  284. display_current_caster_state()
  285. eventArgs.handled = true
  286. end
  287.  
  288. -------------------------------------------------------------------------------------------------------------------
  289. -- Utility functions specific to this job.
  290. -------------------------------------------------------------------------------------------------------------------
  291.  
  292. -- Select default macro book on initial load or subjob change.
  293. function select_default_macro_book()
  294. set_macro_page(1, 15)
  295. end
Advertisement
Add Comment
Please, Sign In to add comment