Advertisement
Guest User

Untitled

a guest
Jun 5th, 2014
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.55 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Initialization function that defines sets and variables to be used.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
  6.  
  7. -- Initialization function for this job file.
  8. function get_sets()
  9. -- Load and initialize the include file.
  10. include('Mote-Include.lua')
  11. end
  12.  
  13. -- Setup vars that are user-independent.
  14. function job_setup()
  15. state.Buff['Afflatus Solace'] = buffactive['afflatus solace'] or false
  16. end
  17.  
  18.  
  19. -- Setup vars that are user-dependent. Can override this function in a sidecar file.
  20. function user_setup()
  21. -- Options: Override default values
  22. options.OffenseModes = {'None', 'Normal'}
  23. options.DefenseModes = {'Normal'}
  24. options.WeaponskillModes = {'Normal'}
  25. options.CastingModes = {'Normal', 'Resistant', 'Dire'}
  26. options.IdleModes = {'Normal', 'PDT'}
  27. options.RestingModes = {'Normal'}
  28. options.PhysicalDefenseModes = {'PDT'}
  29. options.MagicalDefenseModes = {'MDT'}
  30.  
  31. state.Defense.PhysicalMode = 'PDT'
  32. state.OffenseMode = 'None'
  33.  
  34.  
  35. -- Default macro set/book
  36. set_macro_page(1, 1)
  37. end
  38.  
  39. -- Called when this job file is unloaded (eg: job change)
  40. function file_unload()
  41. if binds_on_unload then
  42. binds_on_unload()
  43. end
  44. end
  45.  
  46.  
  47. -- Define sets and vars used by this job file.
  48. function init_gear_sets()
  49. --------------------------------------
  50. -- Start defining the sets
  51. --------------------------------------
  52.  
  53. -- Precast Sets
  54.  
  55. -- Fast cast sets for spells
  56. sets.precast.FC = {main="Arka IV",sub="Curatio Grip",ammo="Incantor Stone",head="Nahtirah Hat",neck="Orison Locket",ear1="Loquacious Earring",hands="Gendewitha Gages",back="Swith Cape",legs="Orison Pantaloons +2",ear2="Magnetic earring"}
  57.  
  58. sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  59.  
  60. sets.precast.FC['Healing Magic'] = set_combine(sets.precast.FC, {legs="Orison Pantaloons +2"})
  61.  
  62. sets.precast.FC.StatusRemoval = sets.precast.FC['Healing Magic']
  63.  
  64. sets.precast.FC.Cure = set_combine(sets.precast.FC['Healing Magic'], {main="Arka IV",sub="Curato Grip",ammo="Incantor Stone"})
  65.  
  66. sets.precast.FC.Curaga = sets.precast.FC.Cure
  67.  
  68. -- Precast sets to enhance JAs
  69. sets.precast.JA.Benediction = {body="Piety Briault"}
  70.  
  71. -- Weaponskill sets
  72.  
  73. -- Default set for any weaponskill that isn't any more specifically defined
  74. gear.default.weaponskill_neck = "Asperity Necklace"
  75. gear.default.weaponskill_waist = "Cetl Belt"
  76. sets.precast.WS = {head="Espial cap",neck="Breeze Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",body="Sublime Breastplate",hands="Espial bracers",ring1="Rajas Ring",ring2="K'ayres Ring",back="Blithe mantle",waist="Cetl Belt",legs="Espial hose",feet="Espial socks"}
  77.  
  78. -- Midcast Sets
  79.  
  80. sets.midcast.FastRecast = {main="Arka IV",sub="Curatio Grip",head="Nahtirah Hat",ear2="Loquacious Earring",back="Swith Cape",waist="Goading Belt",feet="Gendewitha Galoshes"}
  81.  
  82. -- Cure sets
  83. gear.default.obi_waist = "Witful Belt"
  84. gear.default.obi_back = "Gwyddion's Cape"
  85.  
  86. sets.midcast.Cure = {main="Arka IV",sub="Curatio Grip",ammo="Incantor Stone",head="Theophany Cap",neck="Orison Locket",ear1="Lifestorm Earring",ear2="Magnetic Earring",body="Theophany Briault",hands="Theophany Mitts",ring1="Ephedra Ring",ring2="Sirona's Ring",back="Gwyddion's Cape",waist="Witful Belt",legs="Orison Pantaloons +2",feet="Piety Duckbills"}
  87.  
  88. sets.midcast.Curaga = {main="Arka IV",sub="Curatio Grip",ammo="Incantor Stone",head="Theophany Cap",neck="Orison Locket",ear1="Lifestorm Earring",ear2="Magnetic Earring",body="Heka's Kalasiris",hands="Theophany Mitts",ring1="Ephedra Ring",ring2="Sirona's Ring",back="Gwyddion's Cape",waist="Witful Belt",legs="Orison Pantaloons +2",feet="Piety Duckbills"}
  89.  
  90. sets.midcast.CureMelee = {main="Arka IV",sub="Curatio Grip",ammo="Incantor Stone",head="Theophany Cap",neck="Orison Locket",ear1="Lifestorm Earring",ear2="Magnetic Earring",body="Theophany Briault",hands="Bokwus Gloves",ring1="Ephedra Ring",ring2="Sirona's Ring",back="Gwyddion's Cape",waist="Witful Belt",legs="Orison Pantaloons +2",feet="Piety Duckbills"}
  91.  
  92. sets.midcast.Cursna = {legs="Theophany pantaloons",feet="Gendewitha Galoshes",back="Mending cape",ear2="Magnetic earring"}
  93.  
  94. sets.midcast.StatusRemoval = {
  95. head="Orison Cap +2",legs="Orison Pantaloons +2"}
  96.  
  97. -- 110 total Enhancing Magic Skill; caps even without Light Arts
  98. sets.midcast['Enhancing Magic'] = {main="Beneficus",ear2="Magnetic earring",body="Theophany Briault",legs="Piety Pantaloons", feet="Orison Duckbills +2"}
  99.  
  100. sets.midcast.Stoneskin = {ear2="Magnetic earring",waist="Siegel Sash"}
  101.  
  102. sets.midcast.Auspice = {feet="Orison Duckbills +2"}
  103.  
  104. sets.midcast.BarElement = {main="Beneficus",ear2="Magnetic earring",legs="Piety Pantaloons", feet="Orison Duckbills +2"}
  105.  
  106. sets.midcast.Regen = {head="Marduk's Tiara +1",ear2="Magnetic earring",body="Piety Briault",hands="Orison Mitts +2",legs="Theophany Pantaloons"}
  107.  
  108. sets.midcast.Protectra = {feet="Piety Duckbills"}
  109.  
  110. sets.midcast.Shellra = {legs="Piety Pantaloons"}
  111.  
  112.  
  113. -- Custom spell classes
  114. sets.midcast.MndEnfeebles = {sub="Mephitis Grip",head="Theophany Cap",neck="Enfeebling Torque",ear1="Loquac. Earring",hands="Bokwus Gloves",legs="Piety Pantaloons",ear2="Magnetic earring",feet="Uk'uxkaj Boots"}
  115.  
  116. -- Sets to return to when not performing an action.
  117.  
  118. -- Resting sets
  119. sets.resting = {main="Dark Staff",body="Piety Briault",hands="Tethyan Cuffs",feet="Avocat Pigaches"}
  120.  
  121.  
  122. -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  123. sets.idle = {main="Arka IV",sub="Curatio Grip",body="Piety Briault",ear1="Moonshade Earring"}
  124.  
  125. -- Defense sets
  126.  
  127. sets.defense.PDT = {}
  128.  
  129. sets.defense.MDT = {}
  130.  
  131. -- Engaged sets
  132.  
  133. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  134. -- sets if more refined versions aren't defined.
  135. -- If you create a set with both offense and defense modes, the offense mode should be first.
  136. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  137.  
  138. -- Basic set for if no TP weapon is defined.
  139. sets.engaged = {main="Mjollnir",sub="Sors shield",body="Sublime Breastplate",neck="Asperity Necklace",waist="Cetl Belt",legs="Espial Hose",hands="Espial Bracers",ear1="Bladeborn Earring",ear2="Steelflash Earring",feet="Espial Socks",ring1="Rajas ring",ring2="K'ayres ring",head="Espial Cap",back="Blithe Mantle"}
  140.  
  141.  
  142. -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  143. sets.buff['Divine Caress'] = {hands="Orison Mitts +2",back="Mending Cape"}
  144. end
  145.  
  146. -------------------------------------------------------------------------------------------------------------------
  147. -- Job-specific hooks that are called to process player actions at specific points in time.
  148. -------------------------------------------------------------------------------------------------------------------
  149.  
  150. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  151. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  152. function job_precast(spell, action, spellMap, eventArgs)
  153. if spell.english == "Paralyna" and buffactive.Paralyzed then
  154. -- no gear swaps if we're paralyzed, to avoid blinking while trying to remove it.
  155. eventArgs.handled = true
  156. end
  157. end
  158.  
  159.  
  160. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  161. function job_midcast(spell, action, spellMap, eventArgs)
  162. if spell.action_type == 'Magic' then
  163. -- Default base equipment layer of fast recast.
  164. equip(sets.midcast.FastRecast)
  165. end
  166. end
  167.  
  168.  
  169. function job_post_midcast(spell, action, spellMap, eventArgs)
  170. -- Apply Divine Caress boosting items as highest priority over other gear, if applicable.
  171. if spellMap == 'StatusRemoval' and buffactive['Divine Caress'] then
  172. equip(sets.buff['Divine Caress'])
  173. end
  174. end
  175.  
  176.  
  177. -- Return true if we handled the aftercast work. Otherwise it will fall back
  178. -- to the general aftercast() code in Mote-Include.
  179. function job_aftercast(spell, action, spellMap, eventArgs)
  180. if not spell.interrupted then
  181. if state.Buff[spell.name] ~= nil then
  182. state.Buff[spell.name] = true
  183. elseif spell.name == "Afflatus Misery" then
  184. state.Buff['Afflatus Solace'] = false
  185. end
  186. end
  187. end
  188.  
  189.  
  190. -------------------------------------------------------------------------------------------------------------------
  191. -- Customization hooks for idle and melee sets, after they've been automatically constructed.
  192. -------------------------------------------------------------------------------------------------------------------
  193.  
  194. -- Custom spell mapping.
  195. function job_get_spell_map(spell, default_spell_map)
  196. if spell.action_type == 'Magic' then
  197. if (default_spell_map == 'Cure' or default_spell_map == 'Curaga') and player.status == 'Engaged' then
  198. return "CureMelee"
  199. elseif default_spell_map == 'Cure' and state.Buff['Afflatus Solace'] then
  200. return "CureSolace"
  201. elseif spell.skill == "Enfeebling Magic" then
  202. if spell.type == "WhiteMagic" then
  203. return "MndEnfeebles"
  204. else
  205. return "IntEnfeebles"
  206. end
  207. end
  208. end
  209. end
  210.  
  211.  
  212. -------------------------------------------------------------------------------------------------------------------
  213. -- General hooks for other events.
  214. -------------------------------------------------------------------------------------------------------------------
  215.  
  216. -- Called when a player gains or loses a buff.
  217. -- buff == buff gained or lost
  218. -- gain == true if the buff was gained, false if it was lost.
  219. function job_buff_change(buff, gain)
  220. if state.Buff[buff] ~= nil then
  221. state.Buff[buff] = gain
  222. end
  223. end
  224.  
  225.  
  226. -------------------------------------------------------------------------------------------------------------------
  227. -- User code that supplements self-commands.
  228. -------------------------------------------------------------------------------------------------------------------
  229.  
  230. -- Called by the 'update' self-command.
  231. function job_update(cmdParams, eventArgs)
  232. if cmdParams[1] == 'user' and not areas.Cities:contains(world.area) then
  233. local needsArts =
  234. player.sub_job:lower() == 'sch' and
  235. not buffactive['Light Arts'] and
  236. not buffactive['Addendum: White'] and
  237. not buffactive['Dark Arts'] and
  238. not buffactive['Addendum: Black']
  239.  
  240. if not buffactive['Afflatus Solace'] and not buffactive['Afflatus Misery'] then
  241. if needsArts then
  242. send_command('@input /ja "Afflatus Solace" <me>;wait 1.2;input /ja "Light Arts" <me>')
  243. else
  244. send_command('@input /ja "Afflatus Solace" <me>')
  245. end
  246. end
  247. end
  248. end
  249.  
  250.  
  251. -- Handle notifications of general user state change.
  252. function job_state_change(stateField, newValue)
  253. if stateField == 'OffenseMode' then
  254. if newValue == 'Normal' then
  255. disable('main','sub')
  256. else
  257. enable('main','sub')
  258. end
  259. elseif stateField == 'Reset' then
  260. if state.OffenseMode == 'None' then
  261. enable('main','sub')
  262. end
  263. end
  264. end
  265.  
  266.  
  267. -- Function to display the current relevant user state when doing an update.
  268. -- Return true if display was handled, and you don't want the default info shown.
  269. function display_current_job_state(eventArgs)
  270. local defenseString = ''
  271. if state.Defense.Active then
  272. local defMode = state.Defense.PhysicalMode
  273. if state.Defense.Type == 'Magical' then
  274. defMode = state.Defense.MagicalMode
  275. end
  276.  
  277. defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
  278. end
  279.  
  280. local meleeString = ''
  281. if state.OffenseMode == 'Normal' then
  282. meleeString = 'Melee: Weapons locked, '
  283. end
  284.  
  285. eventArgs.handled = true
  286. end
  287.  
  288. -------------------------------------------------------------------------------------------------------------------
  289. -- Utility functions specific to this job.
  290. -------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement