-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhm.lua
177 lines (149 loc) · 7.05 KB
/
whm.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
-- Initialization function for this job file.
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
end
-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
state.Buff['Afflatus Solace'] = buffactive['Afflatus Solace'] or false
state.Buff['Afflatus Misery'] = buffactive['Afflatus Misery'] or false
state.Buff['Aurorastorm'] = buffactive['Aurorastorm'] or false
aoe_cure = S{'Curaga', 'Curaga II', 'Curaga III', 'Curaga IV', 'Curaga V', 'Cura', 'Cura II', 'Cura III'}
end
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.OffenseMode:options('None', 'Normal')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT')
select_default_macro_book()
end
-- Define sets and vars used by this job file.
function init_gear_sets()
include('gearsets/WHM/Main.lua')
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
if spell.name == 'Dispelga' then
equip(sets.precast.FC.Dispelga)
end
if spell.english == "Paralyna" and buffactive.Paralyzed then
-- no gear swaps if we're paralyzed, to avoid blinking while trying to remove it.
eventArgs.handled = true
end
if spell.skill == 'Healing Magic' then
gear.default.obi_back = "Twilight Cape"
else
gear.default.obi_back = Alaunus.MND
end
end
function job_post_precast(spell, action, spellMap, eventArgs)
if spell.name == 'Dispelga' then
equip(sets.precast.FC.Dispelga)
end
end
function job_post_midcast(spell, action, spellMap, eventArgs)
-- Apply Divine Caress boosting items as highest priority over other gear, if applicable.
if spellMap == 'StatusRemoval' and buffactive['Divine Caress'] then
equip(sets.buff['Divine Caress'])
end
if spell.english == "Dispelga" then
equip(sets.midcast.Dispelga)
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'Normal' then
disable('main','sub','range')
else
enable('main','sub','range')
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Custom spell mapping. Detects weather/effects for specific cure equipment.
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
-- AOE Cures
if default_spell_map == 'Curaga' then
if player.status == 'Engaged' then
return "CureMelee"
elseif (state.Buff['Aurorastorm'] or world.weather_element == 'Light' or world.day_element == 'Light') then
return "CuragaAura"
else
return "CuragaNormal"
end
end
-- Single Target Cures
if (default_spell_map == 'Cure' or default_spell_map == 'Curaga') and player.status == 'Engaged' then
return "CureMelee"
elseif default_spell_map == 'Cure' and state.Buff['Afflatus Solace'] and (state.Buff['Aurorastorm'] or world.weather_element == 'Light' or world.day_element == 'Light') then
return "CureAuraSolace"
elseif default_spell_map == 'Cure' and not state.Buff['Afflatus Solace'] and (state.Buff['Aurorastorm'] or world.weather_element == 'Light' or world.day_element == 'Light') then
return "CureAura"
elseif default_spell_map == 'Cure' and state.Buff['Afflatus Solace'] then
return "CureSolace"
elseif default_spell_map == 'Cure' and not state.Buff['Afflatus Solace'] then
return "CureNormal"
elseif spell.skill == "Enfeebling Magic" then
if spell.type == "WhiteMagic" then
return "MndEnfeebles"
else
return "IntEnfeebles"
end
end
end
end
function customize_idle_set(idleSet)
if player.mpp < 51 then
idleSet = set_combine(idleSet, sets.latent_refresh)
end
return idleSet
end
-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
if cmdParams[1] == 'user' and not areas.Cities:contains(world.area) then
local needsArts =
player.sub_job:lower() == 'sch' and
not buffactive['Light Arts'] and
not buffactive['Addendum: White'] and
not buffactive['Dark Arts'] and
not buffactive['Addendum: Black']
if not buffactive['Afflatus Solace'] and not buffactive['Afflatus Misery'] then
if needsArts then
send_command('@input /ja "Afflatus Solace" <me>;wait 1.2;input /ja "Light Arts" <me>')
else
send_command('@input /ja "Afflatus Solace" <me>')
end
end
end
end
-- Function to display the current relevant user state when doing an update.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
set_macro_page(1, 4)
end