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