forked from m0rg/RKMacros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RKEnchanter.mac
287 lines (230 loc) · 9.23 KB
/
RKEnchanter.mac
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
#include RKBase.inc
#include RKCasterBase.inc
#include RKPetBase.inc
#include RKCrowdControlBase.inc
#Event SpellWoreOff "#*#Your Docility spell has worn off of#*#"
#Event KillPet "#*#kill your pet#*#"
Sub Event_KillPet
/varset ShouldICharm FALSE
/call GroupInvis
/docommand /${ChatCommand} "Not charming until this is dead"
/return
Sub Event_SpellWoreOff
/call ClearMezzedMobArrays
/return
Sub Main
/call Init_RKBase
/call AddToArray "NonCombatSubs" "EnchanterNonCombatSubs"
/call Init_RKPetBase
/call AddToArray "PreTargetAcquisitionSubs" "EnchanterPreCombat"
/call Init_RKCrowdControlBase
/call AddToArray "CombatActionSubs" "EnchanterCombatActions"
/call Init_RKCasterBase
| *** VARIABLE DECLARATIONS
/declare ManaRecursionMode bool outer TRUE
/varset StickFlags loose
/varset SpellMemSlot 11
/varset UpperAggroThreshold 100
/varset MercBurnThreshold 100
/varset InCombatStickToCommander FALSE
/varset MaxTargetDistance 1000
/varset CharmMode TRUE
/varset CharmSpell Enticer's Command Rk. II
/varset CharmSpellLevelCap 104
/varset CCMode TRUE
/if (${Me.ID} == ${Group.MainAssist.ID}) /varset CCMode FALSE
/varset AEMezSpell Perilous Bafflement Rk. III
/varset SingleTargetMez Chaotic Bewildering Rk. II
|/varset SingleTargetMez2 "Stasis"
/varset SingleTargetMezLevelCap 108
/varset AEMezSub EnchanterAEMez
/varset MezSub EnchanterMez
/call AddToArray "InvisModeSubs" "GroupInvis"
/call AddToArray "BurnCombatActionSubs" "EnchanterBurnActions"
/call AddToArray "DefensiveActionSubs" "EnchanterDefensiveActions"
/declare SlowSpell string outer Dreary Deeds
/call AddToArray "DetrimentalSpells" "Mindsunder Rk. II"
/call AddToArray "DetrimentalSpells" "Mindcleave Rk. III"
/call AddToArray "DetrimentalSpells" "Intellectual Appropriation Rk. III"
/call AddToArray "DetrimentalSpells" "Polyrefractive Assault Rk. II"
/call AddToArrayWithUniqueName "NonCombatSelfBuffs" "Enticer's Unity Rk. III" "Polyrefractive Rune Rk. III"
|/call AddToArray "NonCombatSelfBuffs" "Ward of the Enticer Rk. II"
|/call AddToArray "CombatSelfBuffs" "Hastening of Prokev Rk. III"
|/call AddToArray "CombatSelfBuffs" "Voice of Precognition Rk. III"
|/call AddToArray "CombatSelfBuffs" "Shield of the Pellarus Rk. II"
/echo Done initializing macro!
| *** INITIALIZATION
/echo Starting Box Commander - Enchanter Macro
| *** MAIN LOOP
:loop
/call Tick
/goto :loop
/return
Sub EnchanterBurnActions
/if (${Me.Moving}) /return FALSE
/call RKDebuffCast "Decree of Tashan Rk. III" "Decree of Tashan Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/if (${Bool[${Target.Buff}]} && !${Bool[${Target.Slowed}]}) {
/call RKAACast "Dreary Deeds" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
}
/call RKDebuffCast "Mind Storm Rk. III" "Mind Storm Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKDebuffCast "Drown Rk. II" "Drown Rk. II" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKAACast "Illusions of Grandeur" ${CurrentTargetId}
/call RKAACast "Glyph Spray" ${CurrentTargetId}
/if (${TankId} != ${Me.ID}) /call RKAACast "Silent Casting" ${CurrentTargetId}
/call RKAACast "Focus of Arcanum" ${CurrentTargetId}
/call RKAACast "Chromatic Haze" ${CurrentTargetId}
/call RKAACast "Mental Contortion" ${CurrentTargetId}
/call RKAACast "Improved Twincast" ${CurrentTargetId}
/call RKAACast "Reactive Rune" ${CurrentTargetId}
/call RKAACast "Calculated Insanity" ${CurrentTargetId}
/call RKAACast "Illusory Ally" ${CurrentTargetId}
/if (${Target.Type.Equal[NPC]}) {
/call RKCast "Dichotomic Reinforcement" "Dichotomic Reinforcement" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/if (${Target.Named}) {
/call RKDebuffCast "Drown Rk. II" "Drown Rk. II" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
}
}
/return FALSE
Sub EnchanterCombatActions
/if (${Me.Moving}) /return FALSE
/if (!${Me.AltAbility[Glyph of Arcane Secrets II]} && ${Me.AAPoints} > 10) /alt buy 7017
/if (!${Me.Buff[Glyph of Lost Secrets].ID} && ${Me.AltAbility[Glyph of Arcane Secrets II]}) /alt act 7017
/if (${Target.PctHPs} > 60) {
/call RKDebuffCast "Mind Storm Rk. III" "Mind Storm Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
}
/if (${Target.PctHPs} > 70) {
/call RKDebuffCast "Drown Rk. II" "Drown Rk. II" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
}
/if (${Me.XTarget[3].ID} && ${CCMode}) {
/call RKCast "Perilous Bafflement Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKCast "Perilous Bafflement Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKCast "Perilous Bafflement Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
}
/if (${EngageOutOfCombatNPC} || ${Target.Type.Equal[Object]}) {
/call RKCast "Mindsunder Rk. II" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKCast "Mindcleave Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKCast "Polyrefractive Assault Rk. II" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
}
/call RKCast "Mindsunder Rk. II" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKCast "Intellectual Appropriation Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKCast "Mindcleave Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKCast "Intellectual Appropriation Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
/call RKCast "Polyrefractive Assault Rk. II" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
|/if (!${Me.Moving} && ${Me.Pet.Distance} > 100) /call RKAACast "Summon Companion" ${CurrentTargetId}
/if (${Me.AltAbilityReady[Crippling Aurora]}) {
/if (${Me.XTarget[3].ID}) {
/call RKAACast "Crippling Aurora" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
}
}
/call RKAACast "Doppelganger" ${CurrentTargetId}
/call RKAACast "Phantasmal Opponent" ${CurrentTargetId}
|Group mana return:
/call RKAACast "Fundament: Second Spire of Enchantment"
|Spell crit:
|/call RKAACast "Fundament: Third Spire of Enchantment"
/call CheckAuras
/if (${Me.PctMana} < 60) {
/if (${DebugMode}) /echo casting Gather Mana
/call RKAACast "Gather Mana"
/alt act 57
/if (${Macro.Return}) /return FALSE
}
/call RKItemSlotCast chest
/return FALSE
Sub EnchanterPreCombat
/if (${Me.XTarget[3].ID}) /call RKCast "${AEMezSpell}" ${CurrentTargetId}
/if (!${CharmMode} || !${ShouldICharm} || !${Bool[${CharmSpell}]} || !${Bool[${Me.XTarget[1].ID}]}) /return FALSE
|/echo checking potential charm pets
/if (!${Me.Pet.ID}) {
/call GetCharmTarget
/if (${Macro.Return} != 0) {
/declare charmTargetId int local ${Macro.Return}
/call SelectNewTarget ${charmTargetId}
/delay 1s ${Target.ID} == ${charmTargetId}
/echo casting ${CharmSpell} at ${charmTargetId}
/call RKCast "${CharmSpell}" ${charmTargetId}
}
}
/return FALSE
Sub EnchanterDefensiveActions
/if (${TankId} == ${Me.ID} || ${Me.PctHPs} < 100) {
/call RKCast "Enticer's Unity Rk. III" ${CurrentTargetId}
/if (${Macro.Return}) /return FALSE
}
/if (${Me.PctHPs} < 50) /call RKAACast "Rune of Banishment" ${CurrentTargetId}
/if (${Me.XTarget[4].ID}) /call RKAACast "Dimensional Shield" ${CurrentTargetId}
/return FALSE
Sub EnchanterNonCombatSubs
/if (${Bool[${Me.XTarget[3].ID}]}) {
/call RKCast "${AEMezSpell}" ${CurrentTargetId}
}
/call RKAACast "Veil of Mindshadow" ${Me.ID}
/call RKAACast "Eldritch Rune" ${Me.ID}
/call RKAACast "Mind Over Matter" ${Me.ID}
/call CheckAuras
/return FALSE
Sub EnchanterAEMez
/call RKCast "${AEMezSpell}" ${CurrentTargetId}
/return FALSE
/if (${Me.AltAbilityReady[Beam of Slumber]}) {
/echo casting Beam of Slumber at Y: ${AECentroidY} and X: ${AECentroidX}
/call ClearStickTarget
/call FaceAECentroid
/delay 5
/call RKAACast "Beam of Slumber"
/if (${Macro.Return}) /return TRUE
}
/if (FALSE && ${Me.AltAbilityReady[Scintillating Beam]}) {
/echo casting Scintillating Beam at Y: ${AECentroidY} and X: ${AECentroidX}
/call ClearStickTarget
/call FaceAECentroid
/delay 5
/call RKAACast "Scintillating Beam" ${CurrentTargetId}
/if (${Macro.Return}) /return TRUE
}
|/call RKAACast "Beguiler's Banishment" ${ccTargetId}
/return FALSE
Sub EnchanterMez(int ccTargetId)
|/call RKAACast "Beguiler's Directed Banishment" ${ccTargetId}
|/call RKAACast "Stasis" ${ccTargetId}
/return FALSE
Sub CheckAuras
/if (${ManaRecursionMode}) {
/if (!${Bool[${Me.Aura[Mana Reciprocation Aura Rk. II]}]}) {
/call RKMemCast "Mana Reciprocation Aura Rk. II" ${Me.ID}
/if (${Macro.Return}) /return TRUE
}
} else {
/if (!${Bool[${Me.Aura[Twincast Aura]}]}) {
/call RKMemCast "Twincast Aura" ${Me.ID}
/if (${Macro.Return}) /return TRUE
}
}
/if (!${Bool[${Me.Aura[Enticer's Aura Rk. III]}]}) {
/call RKMemCast "Enticer's Aura Rk. III" ${Me.ID}
/if (${Macro.Return}) /return TRUE
}
/return FALSE
Sub GroupInvis
/if (!${Me.Invis}) /call RKAACast "Group Perfected Invisibility"
/return FALSE