Advertisement
Guest User

WHM_Crystalchan.lua

a guest
Apr 7th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.68 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(4, 14)
  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="Winged Wand", ammo="Impatiens",
  57. head="Nahtirah Hat",neck="Orison Locket",ear2="Loquacious Earring",
  58. body="Anhur Robe",hands="Gendewitha Gages +1",ring1="Prolix Ring",
  59. back="Ogapepo Cape",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots +1"}
  60.  
  61. sets.precast.FC.EnhancingMagic = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  62.  
  63. sets.precast.FC.HealingMagic = set_combine(sets.precast.FC, {legs="Orison Pantaloons +2"})
  64.  
  65. sets.precast.FC.StatusRemoval = sets.precast.FC.HealingMagic, {main="Yagrush"})
  66.  
  67. sets.precast.FC.Cure = set_combine(sets.precast.FC.HealingMagic, {sub="Sors Shield", body="Heka's Kalasiris"})
  68.  
  69. sets.precast.FC.Curaga = sets.precast.FC.Cure
  70.  
  71. -- Precast sets to enhance JAs
  72. sets.precast.JA.Benediction = {body="Piety Briault +1"}
  73.  
  74. -- Waltz set (chr and vit)
  75. sets.precast.Waltz = {
  76. head="Nahtirah Hat",ear1="Roundel Earring",
  77. body="Vanir Cotehardie",hands="Yaoyotl Gloves",
  78. back="Refraction Cape",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
  79.  
  80.  
  81. -- Weaponskill sets
  82.  
  83. -- Default set for any weaponskill that isn't any more specifically defined
  84. gear.default.weaponskill_neck = "Asperity Necklace"
  85. gear.default.weaponskill_waist = ""
  86. sets.precast.WS = {
  87. head="Nahtirah Hat",neck=gear.ElementalGorget,ear1="Bladeborn Earring",ear2="Steelflash Earring",
  88. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
  89. back="Refraction Cape",waist=gear.ElementalBelt,legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
  90.  
  91. sets.precast.WS['Flash Nova'] = {
  92. head="Nahtirah Hat",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
  93. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Rajas Ring",ring2="Strendu Ring",
  94. back="Toro Cape",waist="Thunder Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
  95.  
  96.  
  97. -- Midcast Sets
  98.  
  99. sets.midcast.FastRecast = {main="Winged Wand", sub="Genbu's Shield", ammo="Clarus Stone",
  100. head="Artsieq Hat",ear2="Loquacious Earring",
  101. body="Hedera Cotehardie",hands="Theophany Mitts +1",ring1="Prolix Ring",
  102. back="Swith Cape +1",waist="Witful Belt",legs="Theurgist's Slacks",feet="Chelona Boots +1"}
  103.  
  104. -- Cure sets
  105. gear.default.obi_waist = "Goading Belt"
  106. gear.default.obi_back = "Mending Cape"
  107.  
  108. sets.midcast.CureSolace = {main="Tamaxchi",sub="Sors Shield",ammo="Psilomene",
  109. head="Gendewitha Caubeen",neck="Lasaia Pendant",ear1="Lifestorm Earring",ear2="Novia Earring",
  110. body="Orison Bliaud +2",hands="Theophany Mitts +1",ring1="Haoma's Ring",ring2="Sirona's Ring",
  111. back="Mending Cape",waist="Pythia Sash +1",legs="Orison Pantaloons +2",feet="Piety Duckbills +1"}
  112.  
  113. sets.midcast.Cure = {main="Tamaxchi",sub="Sors Shield",ammo="Psilomene",
  114. head="Gendewitha Caubeen",neck="Lasaia Pendant",ear1="Lifestorm Earring",ear2="Novia Earring",
  115. body="Orison Bliaud +2",hands="Theophany Mitts +1",ring1="Haoma's Ring",ring2="Sirona's Ring",
  116. back="Mending Cape",waist="Pythia Sash +1",legs="Orison Pantaloons +2",feet="Piety Duckbills +1"}
  117.  
  118. sets.midcast.Curaga = {main="Tamaxchi",sub="Genbu's Shield",ammo="Incantor Stone",
  119. head="Gendewitha Caubeen",neck="Orison Locket",ear1="Lifestorm Earring",ear2="Loquacious Earring",
  120. body="Vanir Cotehardie",hands="Theophany Mitts",ring1="Prolix Ring",ring2="Sirona's Ring",
  121. back="Orison Cape",waist=gear.ElementalObi,legs="Orison Pantaloons +2",feet="Piety Duckbills"}
  122.  
  123. sets.midcast.CureMelee = {
  124. head="Gendewitha Caubeen",neck="Lasaia Pendant",ear1="Lifestorm Earring",ear2="Novia Earring",
  125. body="Orison Bliaud +2",hands="Theophany Mitts +1",ring1="Haoma's Ring",ring2="Sirona's Ring",
  126. back="Mending Cape",waist="Pythia Sash +1",legs="Orison Pantaloons +2",feet="Piety Duckbills +1"}
  127.  
  128. sets.midcast.Cursna = {main="Yagrush",sub="Genbu's Shield",
  129. head="Nahtirah Hat",neck="Malison Medallion",
  130. body="Orison Bliaud +2",hands="Gendewitha Gloves +1",ring1="Haoma's Ring",ring2="Haoma's Ring",
  131. back="Mending Cape",waist="Witful Belt",legs="Theophany Pantaloons +1",feet="Gendewitha Galoshes"}
  132.  
  133. sets.midcast.StatusRemoval = {main="Yagrush",sub="Genbu's Shield",ammo="Clarus Stone",
  134. head="Nahtirah Hat",ear1="Gifted Earring",ear2="Loquacious Earring",
  135. body="Vanir Cotehardie",hands="Theophany Mitts +1",ring1="Prolix Ring",
  136. back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Piety Duckbills +1"}
  137.  
  138.  
  139. sets.midcast.EnhancingMagic = {main="Beneficus",sub="Genbu's Shield",
  140. head="Nahtirah Hat",neck="Colossus's Torque",
  141. body="Anhur Robe",hands="Theophany Mitts +1",ear1="Gifted earring",ear2="Augmenting Earring",
  142. back="Merciful Cape",waist="Olympus Sash",legs="Piety Pantaloons +1",feet="Orison Duckbills +2"}
  143.  
  144. sets.midcast.Stoneskin = {
  145. head="Nahtirah Hat",neck="Orunmila's Torque",ear2="Loquacious Earring",
  146. body="Vanir Cotehardie",hands="Theophany Mitts +1",
  147. back="Swith Cape +1",waist="Siegel Sash",legs="Theurgist's Slacks",feet="Piety Duckbills +1"}
  148.  
  149. sets.midcast.Auspice = {hands="Dynasty Mitts",feet="Orison Duckbills +2"}
  150.  
  151. sets.midcast.BarElement = {main="Beneficus",sub="Genbu's Shield",
  152. head="Orison Cap +2",neck="Colossus's Torque",
  153. body="Orison Bliaud +2",hands="Orison Mitts +2",
  154. back="Mending Cape",waist="Olympus Sash",legs="Piety Pantaloons",feet="Orison Duckbills +2"}
  155.  
  156. sets.midcast.Regen = {main="Bolelabunga",sub="Genbu's Shield",
  157. head="Marduk's Tiara",
  158. body="Piety Briault +1",hands="Orison Mitts +2",
  159. legs="Theophany Pantaloons +1"}
  160.  
  161. sets.midcast.Protectra = {feet="Piety Duckbills"}
  162.  
  163. sets.midcast.Shellra = {legs="Piety Pantaloons"}
  164.  
  165.  
  166. sets.midcast.DivineMagic = {main="Bolelabunga",sub="Genbu's Shield",
  167. head="Nahtirah Hat",neck="Colossus's Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  168. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring2="Sangoma Ring",
  169. back=gear.ElementalCape,waist=gear.ElementalObi,legs="Theophany Pantaloons",feet="Orison Duckbills +2"}
  170.  
  171. sets.midcast.DarkMagic = {main="Bolelabunga", sub="Genbu's Shield",
  172. head="Nahtirah Hat",neck="Aesir Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  173. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Sangoma Ring",
  174. back="Refraction Cape",waist="Demonry Sash",legs="Bokwus Slops",feet="Bokwus Boots"}
  175.  
  176. -- Custom spell classes
  177. sets.midcast.MndEnfeebles = {main="Bolelabunga", sub="Genbu's Shield",
  178. head="Nahtirah Hat",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  179. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Aquasoul Ring",ring2="Sangoma Ring",
  180. back="Refraction Cape",waist="Demonry Sash",legs="Bokwus Slops",feet="Bokwus Boots"}
  181.  
  182. sets.midcast.IntEnfeebles = {main="Bolelabunga", sub="Genbu's Shield",
  183. head="Nahtirah Hat",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  184. body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Icesoul Ring",ring2="Sangoma Ring",
  185. back="Refraction Cape",waist="Demonry Sash",legs="Bokwus Slops",feet="Bokwus Boots"}
  186.  
  187.  
  188. -- Sets to return to when not performing an action.
  189.  
  190. -- Resting sets
  191. sets.resting = {main=gear.Staff.HMP,
  192. body="Gendewitha Bliaut",hands="Serpentes Cuffs",
  193. waist="Austerity Belt",legs="Nares Trews",feet="Chelona Boots +1"}
  194.  
  195.  
  196. -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  197. sets.idle = {main="Bolelabunga", sub="Genbu's Shield",ammo="Sihirik",
  198. head="Gendewitha Caubeen +1",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  199. body="Gendewitha Bilaut +1",hands="Gendewitha Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  200. back="Umbra Cape",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
  201.  
  202. sets.idle.PDT = {main="Bolelabunga", sub="Genbu's Shield",ammo="Sihirik",
  203. head="Gendewitha Caubeen +1",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  204. body="Gendewitha Bilaut +1",hands="Gendewitha Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  205. back="Umbra Cape",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
  206.  
  207. sets.idle.Town = {main="Bolelabunga", sub="Genbu's Shield",ammo="Sihirik",
  208. head="Gendewitha Caubeen +1",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  209. body="Gendewitha Bilaut +1",hands="Gendewitha Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  210. back="Umbra Cape",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
  211.  
  212. sets.idle.Weak = {main="Bolelabunga", sub="Genbu's Shield",ammo="Sihirik",
  213. head="Gendewitha Caubeen +1",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  214. body="Gendewitha Bilaut +1",hands="Gendewitha Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  215. back="Umbra Cape",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
  216.  
  217. -- Defense sets
  218.  
  219. sets.defense.PDT = {main="Bolelabunga", sub="Genbu's Shield",ammo="Sihirik",
  220. head="Gendewitha Caubeen +1",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  221. body="Gendewitha Bilaut +1",hands="Gendewitha Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  222. back="Umbra Cape",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
  223.  
  224. sets.defense.MDT = {main="Bolelabunga", sub="Genbu's Shield",ammo="Sihirik",
  225. head="Gendewitha Caubeen +1",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
  226. body="Gendewitha Bilaut +1",hands="Gendewitha Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  227. back="Umbra Cape",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
  228.  
  229. sets.Kiting = {feet="Herald's Gaiters"}
  230.  
  231. -- Engaged sets
  232.  
  233. -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
  234. -- sets if more refined versions aren't defined.
  235. -- If you create a set with both offense and defense modes, the offense mode should be first.
  236. -- EG: sets.engaged.Dagger.Accuracy.Evasion
  237.  
  238. -- Basic set for if no TP weapon is defined.
  239. sets.engaged = {
  240. head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  241. body="Vanir Cotehardie",hands="Dynasty Mitts",ring1="Rajas Ring",ring2="K'ayres Ring",
  242. back="Umbra Cape",waist="Goading Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
  243.  
  244.  
  245. -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  246. sets.buff['Divine Caress'] = {hands="Orison Mitts +2",back="Mending Cape"}
  247. end
  248.  
  249. -------------------------------------------------------------------------------------------------------------------
  250. -- Job-specific hooks that are called to process player actions at specific points in time.
  251. -------------------------------------------------------------------------------------------------------------------
  252.  
  253. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  254. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  255. function job_precast(spell, action, spellMap, eventArgs)
  256. classes.CustomClass = get_spell_class(spell, action, spellMap)
  257.  
  258. if spell.english == "Paralyna" and buffactive.Paralyzed then
  259. -- no gear swaps if we're paralyzed, to avoid blinking while trying to remove it.
  260. eventArgs.handled = true
  261. end
  262.  
  263. function precast(spell)
  264. if not buffactive['Light Arts'] and
  265. if spell.english == 'Cure VI' then
  266. elseif player.mp < 227 then
  267. cancel_spell()
  268. send_command('input /ma "Cure V" '..spell.target.name)
  269. end
  270. if spell.english == 'Cure V' then
  271. elseif player.mp < 135 then
  272. cancel_spell()
  273. send_command('input /ma "Cure IV" '..spell.target.name)
  274. end
  275. if spell.english == 'Cure IV' then
  276. elseif player.mp < 88 then
  277. cancel_spell()
  278. send_command('input /ma "Cure III" '..spell.target.name)
  279. end
  280. if spell.english == 'Cure III' then
  281. elseif player.mp < 46 then
  282. cancel_spell()
  283. send_command('input /ma "Cure II" '..spell.target.name)
  284. end
  285. if player.mp < 24 then
  286. cancel_spell()
  287. add_to_chat(122,'"'..spell.name..'" canceled. Insufficient MP ('..tostring(player.mp)..')')
  288. end
  289. end
  290. end
  291. function precast(spell)
  292. if buffactive['Light Arts'] and
  293. if not buffactive'Penury' then
  294. if spell.english == 'Cure VI' then
  295. elseif player.mp < 205 then
  296. cancel_spell()
  297. send_command('input /ma "Cure V" '..spell.target.name)
  298. end
  299. if spell.english == 'Cure V' then
  300. elseif player.mp < 122 then
  301. cancel_spell()
  302. send_command('input /ma "Cure IV" '..spell.target.name)
  303. end
  304. if spell.english == 'Cure IV' then
  305. elseif player.mp < 80 then
  306. cancel_spell()
  307. send_command('input /ma "Cure III" '..spell.target.name)
  308. end
  309. if spell.english == 'Cure III' then
  310. elseif player.mp < 42 then
  311. cancel_spell()
  312. send_command('input /ma "Cure II" '..spell.target.name)
  313. end
  314. if player.mp < 24 then
  315. cancel_spell()
  316. add_to_chat(122,'"'..spell.name..'" canceled. Insufficient MP ('..tostring(player.mp)..')')
  317. end
  318. end
  319. end
  320. function precast(spell)
  321. if buffactive['Light Arts'] and
  322. if buffactive'Penury' then
  323. if spell.english == 'Cure VI' then
  324. elseif player.mp < 114 then
  325. cancel_spell()
  326. send_command('input /ma "Cure V" '..spell.target.name)
  327. end
  328. if spell.english == 'Cure V' then
  329. elseif player.mp < 68 then
  330. cancel_spell()
  331. send_command('input /ma "Cure IV" '..spell.target.name)
  332. end
  333. if spell.english == 'Cure IV' then
  334. elseif player.mp < 44 then
  335. cancel_spell()
  336. send_command('input /ma "Cure III" '..spell.target.name)
  337. end
  338. if spell.english == 'Cure III' then
  339. elseif player.mp < 23 then
  340. cancel_spell()
  341. send_command('input /ma "Cure II" '..spell.target.name)
  342. end
  343. if player.mp < 12 then
  344. cancel_spell()
  345. add_to_chat(122,'"'..spell.name..'" canceled. Insufficient MP ('..tostring(player.mp)..')')
  346. end
  347. end
  348. end
  349.  
  350.  
  351. if spell.skill == 'HealingMagic' then
  352. gear.default.obi_back = "Mending Cape"
  353. else
  354. gear.default.obi_back = "Toro Cape"
  355. end
  356. end
  357.  
  358.  
  359. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  360. function job_midcast(spell, action, spellMap, eventArgs)
  361. if spell.action_type == 'Magic' then
  362. -- Default base equipment layer of fast recast.
  363. equip(sets.midcast.FastRecast)
  364. end
  365. end
  366.  
  367.  
  368. function job_post_midcast(spell, action, spellMap, eventArgs)
  369. -- Apply Divine Caress boosting items as highest priority over other gear, if applicable.
  370. if spellMap == 'StatusRemoval' and buffactive['Divine Caress'] then
  371. equip(sets.buff['Divine Caress'])
  372. end
  373. end
  374.  
  375.  
  376. -- Return true if we handled the aftercast work. Otherwise it will fall back
  377. -- to the general aftercast() code in Mote-Include.
  378. function job_aftercast(spell, action, spellMap, eventArgs)
  379. if not spell.interrupted then
  380. if state.Buff[spell.name] ~= nil then
  381. state.Buff[spell.name] = true
  382. elseif spell.name == "Afflatus Misery" then
  383. state.Buff['Afflatus Solace'] = false
  384. end
  385. end
  386. end
  387.  
  388.  
  389. -------------------------------------------------------------------------------------------------------------------
  390. -- Customization hooks for idle and melee sets, after they've been automatically constructed.
  391. -------------------------------------------------------------------------------------------------------------------
  392.  
  393. function customize_idle_set(idleSet)
  394. return idleSet
  395. end
  396.  
  397.  
  398. -------------------------------------------------------------------------------------------------------------------
  399. -- General hooks for other events.
  400. -------------------------------------------------------------------------------------------------------------------
  401.  
  402. -- Called when a player gains or loses a buff.
  403. -- buff == buff gained or lost
  404. -- gain == true if the buff was gained, false if it was lost.
  405. function job_buff_change(buff, gain)
  406. if state.Buff[buff] ~= nil then
  407. state.Buff[buff] = gain
  408. end
  409. end
  410.  
  411.  
  412. -------------------------------------------------------------------------------------------------------------------
  413. -- User code that supplements self-commands.
  414. -------------------------------------------------------------------------------------------------------------------
  415.  
  416. -- Called by the 'update' self-command.
  417. function job_update(cmdParams, eventArgs)
  418. if cmdParams[1] == 'user' and not areas.Cities:contains(world.area) then
  419. local needsArts =
  420. player.sub_job:lower() == 'sch' and
  421. not buffactive['Light Arts'] and
  422. not buffactive['Addendum: White'] and
  423. not buffactive['Dark Arts'] and
  424. not buffactive['Addendum: Black']
  425.  
  426. if not buffactive['Afflatus Solace'] and not buffactive['Afflatus Misery'] then
  427. if needsArts then
  428. send_command('@input /ja "Afflatus Solace" <me>;wait 1.2;input /ja "Light Arts" <me>')
  429. else
  430. send_command('@input /ja "Afflatus Solace" <me>')
  431. end
  432. end
  433. end
  434. end
  435.  
  436.  
  437. -- Handle notifications of general user state change.
  438. function job_state_change(stateField, newValue)
  439. if stateField == 'OffenseMode' then
  440. if newValue == 'Normal' then
  441. disable('main','sub')
  442. else
  443. enable('main','sub')
  444. end
  445. elseif stateField == 'Reset' then
  446. if state.OffenseMode == 'None' then
  447. enable('main','sub')
  448. end
  449. end
  450. end
  451.  
  452.  
  453. -- Function to display the current relevant user state when doing an update.
  454. -- Return true if display was handled, and you don't want the default info shown.
  455. function display_current_job_state(eventArgs)
  456. local defenseString = ''
  457. if state.Defense.Active then
  458. local defMode = state.Defense.PhysicalMode
  459. if state.Defense.Type == 'Magical' then
  460. defMode = state.Defense.MagicalMode
  461. end
  462.  
  463. defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
  464. end
  465.  
  466. local meleeString = ''
  467. if state.OffenseMode == 'Normal' then
  468. meleeString = 'Melee: Weapons locked, '
  469. end
  470.  
  471. add_to_chat(122,'Casting ['..state.CastingMode..'], '..meleeString..'Idle ['..state.IdleMode..'], '..defenseString..
  472. 'Kiting: '..on_off_names[state.Kiting])
  473.  
  474. eventArgs.handled = true
  475. end
  476.  
  477. -------------------------------------------------------------------------------------------------------------------
  478. -- Utility functions specific to this job.
  479. -------------------------------------------------------------------------------------------------------------------
  480.  
  481. function get_spell_class(spell, action, spellMap)
  482. local spellclass
  483.  
  484. if spell.action_type == 'Magic' then
  485. if spell.skill == "EnfeeblingMagic" then
  486. if spell.type == "WhiteMagic" then
  487. spellclass = "MndEnfeebles"
  488. else
  489. spellclass = "IntEnfeebles"
  490. end
  491. else
  492. if (spellMap == 'Cure' or spellMap == "Curaga") and player.status == 'Engaged' then
  493. spellclass = "CureMelee"
  494. elseif spellMap == 'Cure' and state.Buff['Afflatus Solace'] then
  495. spellclass = "CureSolace"
  496. end
  497. end
  498. end
  499.  
  500. return spellclass
  501. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement