Advertisement
Lygre

Mote-Globals.lua

Jul 19th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.73 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Tables and functions for commonly-referenced gear that job files may need, but
  3. -- doesn't belong in the global Mote-Include file since they'd get clobbered on each
  4. -- update.
  5. -- Creates the 'gear' table for reference in other files.
  6. --
  7. -- Note: Function and table definitions should be added to user, but references to
  8. -- the contained tables via functions (such as for the obi function, below) use only
  9. -- the 'gear' table.
  10. -------------------------------------------------------------------------------------------------------------------
  11.  
  12. -------------------------------------------------------------------------------------------------------------------
  13. -- Modify the sets table.  Any gear sets that are added to the sets table need to
  14. -- be defined within this function, because sets isn't available until after the
  15. -- include is complete.  It is called at the end of basic initialization in Mote-Include.
  16. -------------------------------------------------------------------------------------------------------------------
  17.  
  18. function define_global_sets()
  19.     -- Special gear info that may be useful across jobs.
  20.  
  21.     -- Staffs
  22.     gear.Staff = {}
  23.     gear.Staff.HMP = 'Chatoyant Staff'
  24.     gear.Staff.PDT = 'Earth Staff'
  25.    
  26.     -- Dark Rings
  27.     gear.DarkRing = {}
  28.     gear.DarkRing.physical = {name="Dark Ring",augments={'Magic dmg. taken -3%','Spell interruption rate down -5%','Phys. dmg. taken -6%'}}
  29.     gear.DarkRing.magical = {name="Dark Ring", augments={'Magic dmg. taken -6%','Breath dmg. taken -5%'}}
  30.    
  31.     -- Default items for utility gear values.
  32.     gear.default.weaponskill_neck = "Asperity Necklace"
  33.     gear.default.weaponskill_waist = "Caudata Belt"
  34.     gear.default.obi_waist = "Cognition Belt"
  35.     gear.default.obi_back = "Toro Cape"
  36.     gear.default.obi_ring = "Strendu Ring"
  37.     gear.default.fastcast_staff = ""
  38.     gear.default.recast_staff = ""
  39. end
  40.  
  41. -------------------------------------------------------------------------------------------------------------------
  42. -- Functions to set user-specified binds, generally on load and unload.
  43. -- Kept separate from the main include so as to not get clobbered when the main is updated.
  44. -------------------------------------------------------------------------------------------------------------------
  45.  
  46. -- Function to bind GearSwap binds when loading a GS script.
  47. function global_on_load()
  48.     send_command('bind f9 gs c cycle OffenseMode')
  49.     send_command('bind ^f9 gs c cycle HybridMode')
  50.     send_command('bind !f9 gs c cycle RangedMode')
  51.     send_command('bind @f9 gs c cycle WeaponskillMode')
  52.     send_command('bind f10 gs c set DefenseMode Physical')
  53.     send_command('bind ^f10 gs c cycle PhysicalDefenseMode')
  54.     send_command('bind !f10 gs c toggle Kiting')
  55.     send_command('bind f11 gs c set DefenseMode Magical')
  56.     send_command('bind ^f11 gs c cycle CastingMode')
  57.     send_command('bind f12 gs c update user')
  58.     send_command('bind ^f12 gs c cycle IdleMode')
  59.     send_command('bind !f12 gs c reset DefenseMode')
  60.  
  61.     send_command('bind ^- gs c toggle selectnpctargets')
  62.     send_command('bind ^= gs c cycle pctargetmode')
  63. end
  64.  
  65. -- Function to revert binds when unloading.
  66. function global_on_unload()
  67.     send_command('unbind f9')
  68.     send_command('unbind ^f9')
  69.     send_command('unbind !f9')
  70.     send_command('unbind @f9')
  71.     send_command('unbind f10')
  72.     send_command('unbind ^f10')
  73.     send_command('unbind !f10')
  74.     send_command('unbind f11')
  75.     send_command('unbind ^f11')
  76.     send_command('unbind !f11')
  77.     send_command('unbind f12')
  78.     send_command('unbind ^f12')
  79.     send_command('unbind !f12')
  80.  
  81.     send_command('unbind ^-')
  82.     send_command('unbind ^=')
  83. end
  84.  
  85. -------------------------------------------------------------------------------------------------------------------
  86. -- Global event-handling functions.
  87. -------------------------------------------------------------------------------------------------------------------
  88.  
  89. -- Global intercept on precast.
  90. function user_precast(spell, action, spellMap, eventArgs)
  91.     cancel_conflicting_buffs(spell, action, spellMap, eventArgs)
  92.     --refine_waltz(spell, action, spellMap, eventArgs)
  93. end
  94.  
  95. -- Global intercept on midcast.
  96. function user_midcast(spell, action, spellMap, eventArgs)
  97.     -- Default base equipment layer of fast recast.
  98.     if spell.action_type == 'Magic' and sets.midcast and sets.midcast.FastRecast then
  99.         equip(sets.midcast.FastRecast)
  100.     end
  101. end
  102.  
  103. -- Global intercept on buff change.
  104. function user_buff_change(buff, gain, eventArgs)
  105.     -- Create a timer when we gain weakness.  Remove it when weakness is gone.
  106.     if buff:lower() == 'weakness' then
  107.         if gain then
  108.             send_command('timers create "Weakness" 300 up abilities/00255.png')
  109.         else
  110.             send_command('timers delete "Weakness"')
  111.         end
  112.     end
  113. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement