-
Notifications
You must be signed in to change notification settings - Fork 15
/
priest_disc.lua
413 lines (359 loc) · 14.7 KB
/
priest_disc.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
-- Created by romain-p
-- see updates on http://github.com/romain-p
if not defined then
defined = true
Configuration = {
-- Common features between classes
Shared = {
SCRIPT_NAME = "Priest Discipline",
-- 2vs2 feature: When target=arena1, automatically focus=arena2 and vice-versa
ARENA_AUTO_FOCUS = true,
-- Bypass feign death, auto re-targeting
FEIGNDEATH_BYPASS = true,
-- Bypass image mirrors, auto re-targeting
MAGE_MIRRORS_BYPASS = true,
-- Fakecast rogue shadow step + kick / Warrior swap stance + pummel / shield equiped (bash)
FAKECAST_INTERRUPTS = true,
-- Check if a caster is really casting on you
REAL_TARGET_CHECK = {
ENABLED = true,
SOUND = true, -- sound alert
TEXT = true -- screen alert
},
-- Enable fakecast for overpower
FAKECAST_OVERPOWER = {
ENABLED = true,
DEBUG = false
},
-- Configure your totem tracker, then use TrackTotems()
TOTEM_TRACKER = {
USE_MELEE = true,
USE_RANGE = RaceSpells.SHOOT,
USE_PET = false,
USE_RANGE_AND_PET_BOTH = false,
USE_SPELLS = false,
AUTO_FACE_DIRECTION = true,
-- put your totem in order to break
TRACKED = {
"Tremor Totem",
"Earthbind Totem",
"Cleansing Totem"
},
-- When you tracked list is broken, put true to kill other totems
-- e.g Flamstrong Totem etc
TRACK_OTHERS = true,
TOTEM_OCCURENCE = "Totem"
},
AUTO_REBUFF = {
ENABLED = true,
FILTERS = {filter_party_health},
-- Define which units to rebuff
UNITS = {player},
-- Define your buffs, sometimes auraId != spellId, be careful
BUFFS = {
{SPELL = PriestSpells.INNER_FIRE, AURA = Auras.INNER_FIRE}
}
},
-- Automatically breaks grounding totem, reflect
INTELLIGENT_BREAKS = {
ENABLED = true,
FILTERS = {filter_party_health},
STOPCASTING = {
ENABLED = true,
--It won't stopcasting if you're casting a spell in the list below
BLACK_LIST = {
PriestSpells.PENANCE,
PriestSpells.FLASH_HEAL,
PriestSpells.BINDING_HEAL,
PriestSpells.MIND_CONTROL,
PriestSpells.HYMN_OF_HOPE,
PriestSpells.DIVINE_HYMN
}
},
SPELL_BREAKER = PriestSpells.MIND_SMOOTHE,
SPELL_LIST = {
WarriorSpells.REFLECT,
ShamanSpells.GROUNDING_TOTEM
},
AURA_LIST = {
Auras.GROUNDING_TOTEM,
Auras.REFLECT,
Auras.PROT_REFLECT
}
},
-- A spell that gonna be casted on stealthed targets
STEALTH_SPOT = {
ENABLED = true,
SPELL_ID = PriestSpells.SWD,
-- used when a stealth rogue near you
SELF_AOE = PriestSpells.HOLY_NOVA
},
-- Dispel list on party
AUTO_FRIENDLY_DISPEL = {
ENABLED = true,
FILTERS = {filter_party_health},
SPELL_ID = PriestSpells.DISPEL_MAGIC,
STOPCASTING = {
ENABLED = true,
--It won't stopcasting if you're casting a spell in the list below
BLACK_LIST = {
PriestSpells.PENANCE,
PriestSpells.MIND_CONTROL,
PriestSpells.HYMN_OF_HOPE,
PriestSpells.DIVINE_HYMN
}
},
AURA_LIST = {
Auras.HOJ,
Auras.REPENTANCE,
Auras.SEDUCTION,
Auras.SEDUCTION2,
Auras.COUNTERSPELL,
Auras.PSYCHIC_SCREAM,
Auras.FEAR,
Auras.COILE,
Auras.SILENCE,
Auras.SHADOWFURY,
Auras.Seduction_1,
Auras.Seduction_2,
Auras.Seduction_3,
Auras.Seduction_4,
Auras.Seduction_5,
Auras.ENTANGLING_ROOT,
Auras.STRANGULATE,
Auras.FREEZING_TRAP,
Auras.FREEZING_ARROW,
Auras.SILENCING_SHOT,
Auras.TURN_EVIL,
Auras.HUNGERING_COLD,
Auras.HUNTER_MARK,
Auras.TRAP_SNAKE,
Auras.CRAB_SNARE,
Auras.ROOT_TOTEM,
Auras.CS_LOCKPET,
Auras.FEAR_AOE_LOCK,
Auras.ROOT_DRUID,
Auras.ROOT_DRUID2,
Auras.FEARIE_FIRE,
Auras.Polymorph_sheep,
Auras.Polymorph_rabbit,
Auras.Polymorph_turtle,
Auras.Polymorph_pig,
Auras.Polymorph_cat,
Auras.Polymorph_subrank1,
Auras.Polymorph_subrank2,
Auras.Polymorph_turkey
}
},
-- Dispel list on world map enemies
AUTO_ENEMY_DISPEL = {
ENABLED = false,
FILTERS = {filter_party_health},
SPELL_ID = PriestSpells.DISPEL_MAGIC,
STOPCASTING = {
ENABLED = true,
--It won't stopcasting if you're casting a spell in the list below
BLACK_LIST = {
PriestSpells.PENANCE,
PriestSpells.MIND_CONTROL,
PriestSpells.HYMN_OF_HOPE,
PriestSpells.DIVINE_HYMN
}
},
AURA_LIST = {}
},
},
-- Auras on enemy to mass dispel
MASS_DISPEL = {
ENABLED = true,
FILTERS = {filter_party_health},
AURA_LIST = {
Auras.DIVINE_SHIELD,
Auras.ICEBLOCK
}
},
-- Spell list to swd when casted on you
SWD_INSTANT_CONTROL = {
ENABLED = true,
SPELL_LIST = {
HunterSpells.SCATTER,
DkSpells.HUNGERING_COLD,
RogueSpells.BLIND,
RogueSpells.GOUGE,
PaladinSpells.REPENTENCE
}
},
-- Spell list to swd when casted on yu
SWD_CASTING_CONTROL = {
ENABLED = true,
PERCENT = 90, -- swd at 90% of the castbar
SPELL_LIST = {
Auras.Seduction_1,
Auras.Seduction_2,
Auras.Seduction_3,
Auras.Seduction_4,
Auras.Seduction_5, Auras.Polymorph_sheep,
Auras.Polymorph_rabbit,
Auras.Polymorph_turtle,
Auras.Polymorph_pig,
Auras.Polymorph_cat,
Auras.Polymorph_subrank1,
Auras.Polymorph_subrank2,
Auras.Polymorph_turkey,
Auras.SEDUCTION,
Auras.SEDUCTION2
}
}
}
RunScript(ReadFile("script/shared.lua"))
-- Hold spells that will be catched to get the real target of a caster
addDangerousSpells(Configuration.SWD_CASTING_CONTROL.SPELL_LIST)
-- Healing rotation for a given friendly unit
function Heal(unit)
if ShouldntCast() then
if CdRemains(PriestSpells.SHIELD, false)
and not HasAura(PriestSpells.SHIELD, unit)
and not HasAura(Auras.WEAKENED_SOUL, unit) then
Cast(PriestSpells.SHIELD, unit, ally)
elseif CdRemains(PriestSpells.PRAYER_OF_MENDING, false)
and not HasAura(Auras.PRAYER_OF_MENDING, unit)
and HealthIsUnder(unit, 80) then
Cast(PriestSpells.PRAYER_OF_MENDING, unit, ally)
elseif not HasAura(PriestSpells.RENEW, unit) then
Cast(PriestSpells.RENEW, unit, ally)
end
do return end
end
if unit == pet then
if UnitExists(party1pet) then
unit = party1pet
elseif UnitExists(party2pet) then
unit = party2pet
end
end
if CdRemains(PriestSpells.SHIELD, false)
and not HasAura(PriestSpells.SHIELD, unit)
and not HasAura(Auras.WEAKENED_SOUL, unit) then
Cast(PriestSpells.SHIELD, unit, ally)
elseif CdRemains(PriestSpells.PRAYER_OF_MENDING, false)
and not HasAura(Auras.PRAYER_OF_MENDING, unit)
and HealthIsUnder(unit, 80) then
Cast(PriestSpells.PRAYER_OF_MENDING, unit, ally)
elseif CdRemains(PriestSpells.PENANCE, false) then
Cast(PriestSpells.PENANCE, unit, ally)
elseif HealthIsUnder(unit, 70)
and not HasAura(PriestSpells.RENEW, unit)
and HasAura(PriestSpells.SHIELD, unit)
and HasAura(Auras.GRACE, unit) then
Cast(PriestSpells.RENEW, unit, ally)
else
local id = PriestSpells.FLASH_HEAL
if HealthIsUnder(player, 80)
and unit ~= player then
id = PriestSpells.BINDING_HEAL
end
Cast(id, unit, ally)
end
end
-- SWD Scatter, Hungering cold, blind, gouge, repentence
ListenSpellsAndThen(Configuration.SWD_INSTANT_CONTROL.SPELL_LIST,
Configuration.SWD_INSTANT_CONTROL.FILTERS,
Configuration.SWD_INSTANT_CONTROL.ENABLED,
function(_, _, _, _, targetName, _, object, _, _, _)
if targetName ~= player_name then return end
Cast(PriestSpells.SWD, object, enemy)
end
)
-- Stopcasting when divine shield pops or
ListenSpellsAndThen(Configuration.MASS_DISPEL.AURA_LIST,
Configuration.MASS_DISPEL.FILTERS,
Configuration.MASS_DISPEL.ENABLED,
function(_, _, _, _, _, _, object, _, _, _)
if object == nil or not CdRemains(PriestSpells.MASS_DISPEL) or GetDistanceBetweenObjects(player, object) > 30 or not InLos(player, object) or not ValidUnit(object, enemy) then return end
StopCasting()
end
)
-- Keep an eye on world objects: md divine shield
KeepEyeOnWorld(Configuration.MASS_DISPEL.AURA_LIST,
Configuration.MASS_DISPEL.FILTERS,
Configuration.MASS_DISPEL.ENABLED,
function(_, object, _, x, y, z)
if GetDistanceBetweenObjects(player, object) <= 30 and InLos(player, object) and
ValidUnit(object, enemy) and CdRemains(PriestSpells.MASS_DISPEL) then
if IsAoEPending() then
CancelPendingSpell()
end
CastSpellByID(PriestSpells.MASS_DISPEL)
ClickPosition(x, y, z)
end
end
)
-- SWD casting controls defined in configuration
PerformCallbackOnCasts(
Configuration.SWD_CASTING_CONTROL.SPELL_LIST,
Configuration.SWD_CASTING_CONTROL.PERCENT,
Configuration.SWD_CASTING_CONTROL.FILTERS,
Configuration.SWD_CASTING_CONTROL.ENABLED,
function(object, _, _, _, _)
if not ValidUnit(object, enemy) then return end
if not IsCastingOnMe(object) or not UnitCastingInfo(object) then return end
if CdRemains(PriestSpells.SWD) then
StopCasting()
end
if not Cast(PriestSpells.SWD, object, enemy) then
-- if the mage isnt in range, lf a closer target
local found
local search = function(potential, _, _, _, _)
if Cast(PriestSpells.SWD, potential, enemy) then
found = potential
return true
end
end
IterateObjects(true, search)
if found ~= nil then
Cast(PriestSpells.SWD, found, enemy)
end
end
end
)
-- Friendly dispel with dispel magic / abolish disease
function Dispel(unit)
for i=1,40 do local name, _, _, _, type, _, _, _, _, _, _ = UnitDebuff(unit, i)
if name ~= nil and type == "Magic" then
if not HasAura(Auras.UNSTABLE_AFFLICTION, unit) and not HasAura(Auras.VAMPIRIC_TOUCH, unit) then
print(name)
Cast(PriestSpells.DISPEL_MAGIC, unit, ally)
do break end
end
end
end
if HasAura(Auras.ABOLISH_DISEASE, unit) then return end
for i=1,40 do local name, _, _, _, type, _, _, _, _, _, _ = UnitDebuff(unit, i)
if name ~= nil and type == "Disease" then
Cast(PriestSpells.ABOLISH_DISEASE, unit, ally)
do break end
end
end
end
-- Dps rotation for a given enemy unit
function Dps(unit)
-- in order, holy, smite, mind blast (if interrupted in holy school)
Cast(PriestSpells.HOLY_FIRE, unit, enemy)
Cast(PriestSpells.SMITE, unit, enemy)
Cast(PriestSpells.MIND_BLAST, unit, enemy)
end
-- Dot a given unit with shadow word: pain + devouring plague
function Dot(unit)
if not HasDot(Auras.DOT_PAIN, unit) then
Cast(PriestSpells.SHADOWORD_PAIN, unit, enemy)
elseif not HasDot(Auras.DOT_PLAGUE, unit) then
Cast(PriestSpells.DEVOURING_PLAGUE, unit, enemy)
end
end
end
if not enabled then
OnEnable()
else
OnDisable()
end
enabled = not enabled