vm0d

Mote-Globals

Apr 25th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.64 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. -- Modified JUN 17 2018
  11. -------------------------------------------------------------------------------------------------------------------
  12.  
  13. -------------------------------------------------------------------------------------------------------------------
  14. -- Modify the sets table.  Any gear sets that are added to the sets table need to
  15. -- be defined within this function, because sets isn't available until after the
  16. -- include is complete.  It is called at the end of basic initialization in Mote-Include.
  17. -------------------------------------------------------------------------------------------------------------------
  18.  
  19. function define_global_sets()
  20.     -- Special gear info that may be useful across jobs.
  21.  
  22.     -- Staffs
  23.     gear.Staff = {}
  24.     gear.Staff.HMP = ""
  25.     gear.Staff.PDT = ""
  26.    
  27.     -- Dark Rings
  28.     gear.DarkRing = ""
  29.    
  30.     -- Default items for utility gear values.
  31.     gear.default.weaponskill_neck = ""
  32.     gear.default.weaponskill_waist = ""
  33.     gear.default.obi_waist = ""
  34.     gear.default.obi_back = ""
  35.     gear.default.obi_ring = ""
  36.     gear.default.fastcast_staff = ""
  37.     gear.default.recast_staff = ""
  38. end
  39.  
  40. -------------------------------------------------------------------------------------------------------------------
  41. -- Functions to set user-specified binds, generally on load and unload.
  42. -- Kept separate from the main include so as to not get clobbered when the main is updated.
  43. -------------------------------------------------------------------------------------------------------------------
  44.  
  45. -- Function to bind GearSwap binds when loading a GS script.
  46. -- vm0d: I only want to load the binds that I use globally, tagged out those which I define per lua.
  47. function global_on_load()
  48.  
  49.     --send_command('bind !f12 gs c cycle PhysicalDefenseMode')
  50.     --send_command('bind !f12 gs c cycle HybridMode')
  51.     --send_command('bind !f12 gs c cycle OffenseMode')
  52.     --send_command('bind !f9 gs c cycle RangedMode')
  53.     --send_command('bind @f9 gs c cycle WeaponskillMode')
  54.     --send_command('bind ^f11 gs c cycle CastingMode')
  55.     send_command('bind f10 gs c reset DefenseMode')
  56.     send_command('bind ^f10 gs c set DefenseMode Physical')
  57.     send_command('bind !f10 gs c set DefenseMode Magical')
  58.     send_command('bind f11 gs c toggle CP')
  59.     send_command('bind ^f11 gs c toggle Kiting')
  60.     send_command('bind !f11 gs c cycle EquipStop')
  61.     send_command('bind f12 gs c update user')
  62.     send_command('bind ^f12 gs c cycle IdleMode')
  63.  
  64.     --send_command('bind ^- gs c toggle selectnpctargets')
  65.     --send_command('bind ^= gs c cycle pctargetmode')
  66. end
  67.  
  68. -- Function to revert binds when unloading.
  69. function global_on_unload()
  70.     send_command('unbind f9')
  71.     send_command('unbind ^f9')
  72.     send_command('unbind !f9')
  73.     send_command('unbind @f9')
  74.     send_command('unbind f10')
  75.     send_command('unbind ^f10')
  76.     send_command('unbind !f10')
  77.     send_command('unbind f11')
  78.     send_command('unbind ^f11')
  79.     send_command('unbind !f11')
  80.     send_command('unbind f12')
  81.     send_command('unbind ^f12')
  82.     send_command('unbind !f12')
  83.  
  84.     send_command('unbind ^-')
  85.     send_command('unbind ^=')
  86. end
  87.  
  88. -------------------------------------------------------------------------------------------------------------------
  89. -- Global event-handling functions.
  90. -------------------------------------------------------------------------------------------------------------------
  91.  
  92. -- Global intercept on precast.
  93. function user_precast(spell, action, spellMap, eventArgs)
  94.     cancel_conflicting_buffs(spell, action, spellMap, eventArgs)
  95.     refine_waltz(spell, action, spellMap, eventArgs)
  96. end
  97.  
  98. -- Global intercept on midcast.
  99. function user_midcast(spell, action, spellMap, eventArgs)
  100.     -- Default base equipment layer of fast recast.
  101.     if spell.action_type == 'Magic' and sets.midcast and sets.midcast.FastRecast then
  102.         equip(sets.midcast.FastRecast)
  103.     end
  104. end
  105.  
  106. -- Global intercept on buff change.
  107. function user_buff_change(buff, gain, eventArgs)
  108.     -- Create a timer when we gain weakness.  Remove it when weakness is gone.
  109.     if buff:lower() == 'weakness' then
  110.         if gain then
  111.             send_command('timers create "Weakness" 300 up abilities/00255.png')
  112.         else
  113.             send_command('timers delete "Weakness"')
  114.         end
  115.     end
  116. end
Advertisement
Add Comment
Please, Sign In to add comment