-
Notifications
You must be signed in to change notification settings - Fork 0
/
p3_autodispell.inc
executable file
·63 lines (43 loc) · 1.55 KB
/
p3_autodispell.inc
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
SUB p3_autodispell_init() {
/declare autoDispellEnabled bool outer FALSE
/declare autoDispellCheckDelay int outer 10
/declare autoDispellSpell string outer -
/varset autoDispellEnabled ${getBotIniOption[Misc.AutoDispellEnabled,${autoDispellEnabled}]}
/varset autoDispellCheckDelay ${getBotIniOption[Misc.AutoDispellCheckDelay,${autoDispellCheckDelay}]}
/varset autoDispellSpell ${getBotIniOption[Misc.AutoDispellSpell,${autoDispellSpell}]}
/declare autoDispellCheckTimer timer outer 0
/RETURN
}
SUB autodispellMaintenance() {
/if (${autoDispellEnabled}==TRUE && ${autoDispellCheckTimer}==0) {
/call checkAutoDispell
/varset autoDispellCheckTimer ${autoDispellCheckDelay}
/if (${Macro.Return}==TRUE) /RETURN RESET
}
/RETURN
}
SUB checkAutoDispell() {
/if (${assistSpawnID}==0) /return
/if (${targetHasBeneficial[]}==TRUE) {
/if (${isCastReady[${autoDispellSpell}]}==FALSE) /RETURN
|/if (${Cast.Ready[${autoDispellSpell}]}==FALSE) /RETURN
/invoke (${cq.Append[CAST;SPELL=${autoDispellSpell};TARGETID=${assistSpawnID};]})
/RETURN TRUE
}
/RETURN
}
SUB targetHasBeneficial() {
| FOR SOME REASON NOT TARGETTING ANYTHING?
/if (${Target.ID}==NULL) /return
/if (${assistSpawnID}==0) /return
/if (${Target.BuffsPopulated}==FALSE) /return
/declare i int local
/declare hasDispellable bool local FALSE
/for i 1 to ${Target.BuffCount}
/if (${Target.Buff[${i}].Beneficial}==TRUE && ${Target.Buff[${i}].Name.Upper.Find[MITIGATION OF THE MIGHTY]}==NULL) {
/return TRUE
|/varset hasDispellable TRUE
}
/next i
/return FALSE
}