forked from m0rg/RKMacros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRKBase.inc
704 lines (582 loc) · 22.1 KB
/
RKBase.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
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
#include RKEvents.inc
#include RKPullerBase.inc
#include RKCollections.inc
#include RKTargeting.inc
#include RKPositioning.inc
Sub Init_RKBase
/keypress F12
/keypress Num_5
/timestamp off
/declare RKCommander string outer ${Group.Leader.Name}
/declare OverrideCommander bool outer TRUE
/if (${OverrideCommander}) {
/if (!${Group.Leader.Name.Equal[Underbyte]} && !${Group.Leader.Name.Equal[Nerdbait]} && !${Group.Leader.Name.Equal[Terranigma]}) {
/if (${Spawn[pc Bumsnacker].ID}) /varset RKCommander Bumsnacker
/if (!${Bool[${RKCommander}]}) /varset RKCommander ${Me.Name}
}
}
/declare RKCommanderId int outer ${Spawn[pc ${RKCommander}].ID}
/if (${RKCommanderId} == ${Me.ID}) {
/afk off
} else {
/afk I'm on ${RKCommander}
}
/declare TankId int outer ${Group.MainTank.ID}
/declare IsTank bool outer ${If[${TankId} == ${Me.ID},TRUE,FALSE]}
/declare memberIndex int outer 0
/if (!${Group.MainTank.ID}) {
/for memberIndex 0 to ${Group.Members}
/if (${Group.Member[${memberIndex}].Class.Name.Equal[Warrior]} || ${Group.Member[${memberIndex}].Class.Name.Equal[Paladin]} || ${Group.Member[${memberIndex}].Class.Name.Equal[Shadow Knight]}) {
/varset TankId ${Group.Member[${memberIndex}].ID}
}
/next memberIndex
}
/if (${TankId} == 0) /varset TankId ${Me.ID}
/if (!${Bool[${TankId}]} && ${Spawn[Underbyte pc].ID}) /varset TankId ${Spawn[Underbyte pc].ID}
/makecamp off
/if (${IsTank}) {
/log on
} else {
/log off
}
|---------- SYSTEM ----------
/declare MacroPaused bool outer FALSE
/declare DebugMode bool outer FALSE
| 0 = nothing / medding, 1 = follow & prevent action, 2 = set up camp & prevent action, 3 = follow & attack, 4 = set up camp & attack, 5 = manual piloting
/declare BOTMode int outer 3
| 0 = nothing, 1 = standard, 2 = burn, 3 = burn2
/declare MOBMode int outer 1
/declare DefaultMOBMode int outer 1
/declare DynamicArraySize int outer 30
/declare EarlyEscapePreviousTick bool outer TRUE
/declare EarlyEscapePauseDuration int outer 0
/declare CcTargetsInRange int outer
|---------- BEHAVIOR ----------
/declare GlyphMode bool outer FALSE
/declare InCombatStickToCommander bool outer TRUE
/declare HideCorpsesOnAttack bool outer TRUE
/declare SitBetweenCombat bool outer TRUE
/declare IsAutoSitting bool outer FALSE
/declare MarkMainTarget bool outer TRUE
/declare Descending bool outer FALSE
/declare MercBurnThreshold int outer 90
/declare UpperAggroThreshold int outer 95
/declare TargetHpEngagePercentage int outer 200
/declare MaxTargetDistance int outer ${If[${IsTank}, 100, 400]}
/declare MaxMeleeDistance int outer 14
/declare StickTimer timer outer 10
/declare StickDistance string outer 13
/declare StickFlags string outer
/declare MoveTimer timer outer 20
/declare FaceTimer timer outer 20
/declare ShouldBroadcastMed bool outer FALSE
/declare LowManaMed bool outer FALSE
/declare MeddingMessageTimer timer outer 10s
/declare ForageMode bool outer FALSE
/declare KeepAgroOnAdds bool outer FALSE
|---------- PULLING ----------
/declare PullMode bool outer FALSE
/declare SaveNewPullTargets bool outer FALSE
/declare PullTargets[100] string outer
/declare LoSPullTargets[100] string outer
/declare LoSPullRadius int outer 5000
/declare PriorityTargets[100] string outer
/declare PullWithAutoFire bool outer FALSE
/declare PullTargetEvaluationId int outer 0
/declare PullTargetId int outer 0
/declare PullTargetDistance int outer 10000
|---------- POSITION ----------
/declare MobsCentroidX float outer
/declare MobsCentroidY float outer
/declare AECentroidX float outer
/declare AECentroidY float outer
|---------- SYSTEM - COMMUNICATION ----------
/declare IrcConnectionString string outer irc.lavishsoft.com 6667 #Underbyte
|${RKCommander}
/declare ChatCommand string outer fs
/declare ChatChannelName string outer ${RKCommander}
|---------- SYSTEM - TARGETING ----------
/declare CurrentTargetId int outer 0
/declare CurrentStickTargetId int outer 0
|/declare BadTargetIds[100] int outer
|---------- SYSTEM - LIFE CYCLE ----------
/declare InvisModeSubs[${DynamicArraySize}] string outer
/call AddToArray "InvisModeSubs" "CheckCommanderFollow"
/call AddToArray "InvisModeSubs" "CheckInvisModeCombat"
/call AddToArray "InvisModeSubs" "CheckSitting"
/declare NonCombatSubs[${DynamicArraySize}] string outer
/call AddToArray "NonCombatSubs" "CheckSitting"
/call AddToArray "NonCombatSubs" "ForageAndBag"
/call AddToArray "NonCombatSubs" "CheckCommanderFollow"
/declare PreTargetAcquisitionSubs[${DynamicArraySize}] string outer
/call AddToArray "PreTargetAcquisitionSubs" "CheckCommanderFollow"
/declare CombatActionSubs[${DynamicArraySize}] string outer
/call AddToArray "CombatActionSubs" "CheckPosition"
/declare BurnCombatActionSubs[${DynamicArraySize}] string outer
/declare Burn2CombatActionSubs[${DynamicArraySize}] string outer
/declare DefensiveActionSubs[${DynamicArraySize}] string outer
/declare XPEarnedSubs[${DynamicArraySize}] string outer
/declare OutOfCombatMessageTimer timer outer 1s
/declare EngageOutOfCombatNPC bool outer FALSE
|---------- PULLING ----------
/call Init_RKPullerBase
|---------- CHANNELS & CHAT ----------
/call ConfigureChannels
/declare ChatLanguageVerified bool outer FALSE
/hidecorpse always
/echo Done initializing RK Base!
/return
Sub Tick
/if (${DebugMode}) /echo ------------- BEGIN LOOP! -------------
/if (${DebugMode}) /echo ------------- BEGIN LOOP! -------------
/if (${DebugMode}) /echo ------------- BEGIN LOOP! -------------
/if (!${ChatLanguageVerified}) /lang
/doevents
/delay 1
/if (${DebugMode}) /echo tick
/if (${Me.Casting.ID} && !${Me.Class.Name.Equal[Bard]}) /return FALSE
/if (!${Me.Class.Name.Equal[Bard]} && ${TankId} != ${Me.ID} && ${Me.Moving}) /return FALSE
/if (${Window[SpellBookWnd].Open}) /return FALSE
/if (${Bool[${Me.XTarget[1].ID}]} && !${Target.ID}) /target id ${CurrentTargetId}
/if (${EarlyEscapePreviousTick}) /delay ${EarlyEscapePauseDuration}
/if (${MacroPaused} || ${Me.State.Equal[HOVER]}) /return FALSE
/call CheckCommanderAndTank
/if (${Zone.ShortName.Equal[GuildLobby]} && ${BOTMode} != 1) {
/echo You're in the Guild Lobby. Bots are disabled unless BOTMode = 1 (Follow Invis)
/delay 5s
/return TRUE
}
/if (${Spawn[id ${CurrentStickTargetId}].Type.Equal[Corpse]} || (${Target.ID} && ${Target.Type.Equal[PC]} && ${Me.XTarget[1].ID} && ${BOTMode} > 3 && ${BOTMode} != 5)) {
/call ClearStickTarget
/target clear
}
/if (${DebugMode}) /echo tick 2
/if (!${Bool[${CurrentTargetId}]}) /varset CurrentTargetId ${If[${Target.ID},${Target.ID},${Me.ID}]}
/if (${SaveNewPullTargets} && ${Target.ID} && ${Target.PctHPs} < 90 && ${Target.Type.Equal[NPC]}) {
/call TrimName "${Target.CleanName}"
/declare trimmedName string local ${Macro.Return}
/call GetStringArrayIndex "LoSPullTargets" "${trimmedName}"
/if (!${Macro.Return}) {
|/echo Adding ${Target.CleanName} to pull targets
|/call AddToArray "PullTargets" "${trimmedName}"
/if (${DebugMode}) /echo Adding ${Target.CleanName} to LoS pull targets
/call AddToArray "LoSPullTargets" "${trimmedName}"
}
}
|If I'm sticking to a Spawn that's not my target and the thing I'm sticking to is another NPC, I'm going to drop stick.
/if (${CurrentStickTargetId} && ${CurrentStickTargetId} != ${Target.ID} && ${Spawn[id ${CurrentStickTargetId}].Type.Equal[NPC]}) {
/if (${Stick.Active}) /multiline ; /stick off ; /echo stick off 2
}
/if (${DebugMode}) /echo tick 3
/call UpdateMercenaryStance
/if (${DebugMode}) /echo mark - 4
/call EvaluateTargets
/if (${Macro.Return}) /return FALSE
/if (${DebugMode}) /echo tick 4
/call DoCombatRoutine
/if (${DebugMode}) /echo mark - 7
/if (${Target.Type.Equal[PC]} && ${BOTMode} != 1) /target clear
/if (${Macro.Return}) /return TRUE
/if (${DebugMode}) /echo tick 5
/return FALSE
Sub ClearPullTarget
/if (${DebugMode}) /echo clearing pull target
/varset PullTargetId 0
/varset CurrentTargetId 0
/varset PullTargetDistance 10000
/target clear
/return FALSE
Sub EvaluateTargets
/if (${Bool[${Me.XTarget[1].ID}]}) {
/varset LowManaMed FALSE
/call EvaluateAETargets
} else {
/call DoOutOfCombatRoutine
|/if (!${Target.ID} || ${Target.Type.Equal[PC]} || ${EngageOutOfCombatNPC} == FALSE) /return TRUE
| --- IF WE DON'T HAVE ANY MOBS ON XTarget ---
/if (${PullMode}) {
/if (!${Target.ID}) /return FALSE
/if (!${Target.Type.Equal[NPC]}) {
/if (${DebugMode}) /echo target isn't an NPC
/call ClearPullTarget
}
/if (${DebugMode}) /echo Pull mode engaged, engaging ${Target.CleanName}
/if (!${Stick.Active}) /call SetStickTarget ${Target.ID} 10
/if (${Target.Distance} > 40 && ${PullWithAutoFire} && !${Me.AutoFire}) {
/autofire
} else {
/if (${DebugMode}) /echo attacking ${Target.CleanName}
/attack on
}
/if (${Target.Distance} < 40) {
/if (${Target.Z} < (${Me.Z} - 5)) {
/if (!${Descending}) {
/if (${DebugMode}) /echo target: ${Target.Z} < me: ${Me.Z} - Descending
/keypress end hold
/varset Descending TRUE
}
} else {
/if (${Descending}) {
/keypress end
/varset Descending FALSE
}
}
}
|/call CheckTargetDistance ${Target.ID}
/call RKAACast "Banestrike"
} else {
/if (!${Target.ID}) /return TRUE
/if (${Target.Type.Equal[PC]}) /return TRUE
/if (!${EngageOutOfCombatNPC}) /return TRUE
/if (${Target.PctHPs} == 100) {
/if (${OutOfCombatMessageTimer} == 0) {
/varset OutOfCombatMessageTimer 10
/if (${DebugMode}) /echo target's hp are 100%
}
/return TRUE
}
|/if (${BOTMode} != 5 && !${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Object]}) {
| /if (${OutOfCombatMessageTimer} == 0) {
| /varset OutOfCombatMessageTimer 10
| /echo target isn't an NPC
| }
| /return TRUE
|}
/if (!${EngageOutOfCombatNPC} && ${BOTMode} != 5) {
/if (${OutOfCombatMessageTimer} == 0) {
/varset OutOfCombatMessageTimer 10
/if (${DebugMode}) /echo EngageOutOfCombatNPC is FALSE
}
/return TRUE
}
}
}
/return FALSE
Sub CheckCommanderAndTank
/if (${Group.MainTank.ID} && ${Group.MainTank.ID} != ${TankId}) {
/echo Changing main tank from ${Spawn[id ${TankId}].Name} to ${Group.MainTank.Name}
/varset TankId ${Group.MainTank.ID}
}
/if (${Spawn[pc ${RKCommander}].ID} && ${Spawn[pc ${RKCommander}].ID} != ${RKCommanderId}) {
/varset RKCommanderId ${Spawn[pc ${RKCommander}].ID}
}
/if (${DebugMode}) /echo CheckCommanderAndTank 1
/if (${Bool[${RKCommander}]} && !${OverrideCommander}) /return FALSE
/if (${DebugMode}) /echo CheckCommanderAndTank 2
/if (${Group.Leader.ID} && !${Group.Leader.Name.Equal[${RKCommander}]} && !${Me.Name.Equal[${RKCommander}]}) {
/echo Changing commander from ${RKCommander} to ${Group.Leader.Name}
/varset RKCommander ${Group.Leader.Name}
}
/return FALSE
Sub SelectAndMarkTarget
/if (${DebugMode}) /echo Starting targeting sequence
|/call ClearArray "BadTargetIds"
/call GetTarget
/if (!${Macro.Return}) /return FALSE
/if (${DebugMode}) /echo got target
/if (${CurrentTargetId} != ${Macro.Return}) {
/varset CurrentTargetId ${Macro.Return}
/if (${DebugMode}) /echo CurrentTargetId set to ${CurrentTargetId}
}
/if (${Me.GroupMarkNPC[1].ID} && ${Me.GroupMarkNPC[1].ID} == ${CurrentTargetId}) /return FALSE
/if (!${MarkMainTarget} || !${Group} || ${Group.MarkNpc.ID} != ${Me.ID}) /return FALSE
/gmarknpc 1
/return FALSE
Sub DoCombatRoutine
/call ExecuteArrayOfSubs "DefensiveActionSubs"
/if (${DebugMode}) /echo Done with defensives, doing combat routine
/if (${DebugMode}) /echo combat tick 1
/if (${BOTMode} != 5) {
/if (${DebugMode}) /echo doing PreTargetAcquisitionSubs
/call ExecuteArrayOfSubs "PreTargetAcquisitionSubs"
/if (${Macro.Return}) {
/echo Returning early from PreTargetAcquisitionSubs
/return TRUE
}
/call SelectAndMarkTarget
}
/if (${DebugMode}) /echo combat tick 2
/if (${Spawn[id ${CurrentStickTargetId}].Type.Equal[PC]} && ${BOTMode} != 1) {
/call ClearStickTarget
|/stick off
/keypress s
/delay 1
}
/varset EarlyEscapePreviousTick TRUE
/if (!${Target.ID} || !${Me.XTarget[1].ID}) /return FALSE
|/if (!${Target.Type.Equal[NPC]} && !${Target.Type.Equal[Object]}) /return FALSE
/if (${DebugMode}) /echo Selected target ${Target.ID}
/if (${DebugMode}) /echo combat tick 3
/if (${IsTank}) {
/if (${TauntMode} && ${Me.PctAggro} < 100) /doability "Taunt"
} else {
/if (${Me.PctAggro} > ${UpperAggroThreshold}) {
/if (${DebugMode}) /echo Exiting early because of agro
/return FALSE
}
}
/if (${DebugMode}) /echo combat tick 4
/if (${Bool[${Me.XTarget[1].ID}]} || ${Target.ID}) {
/if (!${Bool[${Me.XTarget[1].ID}]} && ${Target.PctHPs} == 100) /return TRUE
/if (${MOBMode} >= 2 || ${Me.XTarget[4].ID}) {
/call ExecuteArrayOfSubs "BurnCombatActionSubs"
/if (${Macro.Return}) /return TRUE
}
/if (${MOBMode} == 3 || ${Me.XTarget[5].ID}) {
/call ExecuteArrayOfSubs "Burn2CombatActionSubs"
/if (${Macro.Return}) /return TRUE
}
/if (${MOBMode} == 1 && ${Target.Named}) /varset MOBMode 2
/call ExecuteArrayOfSubs "CombatActionSubs"
/if (${Macro.Return}) /return TRUE
} else {
/varset MOBMode ${DefaultMOBMode}
}
/if (${DebugMode}) /echo combat tick 5
/varset EarlyEscapePreviousTick FALSE
/return FALSE
Sub DoOutOfCombatRoutine
/if (${DebugMode}) /echo DoOutOfCombatRoutine
/if (${BOTMode} < 3 || (${BOTMode} == 5 && ${Me.Invis})) {
/call ExecuteArrayOfSubs "InvisModeSubs"
/return FALSE
}
/if (${Me.Class.CanCast} && ${Me.PctMana} < 10) {
/varset LowManaMed TRUE
}
/if (${DebugMode}) /echo mark - 2
/if (${LowManaMed}) {
/if (${Stick.Active}) {
/call ClearStickTarget
/if (${DebugMode}) /echo stick off 1
}
/declare doneMedding bool local TRUE
/declare i int local
/for i 0 to ${Group.Members}
/if (${Group.Member[${i}].ID} && !${Group.Member[${i}].Mercenary}) {
/if (${Group.Member[${i}].Class.CanCast} && ${Group.Member[${i}].PctMana} < 99) {
/varset doneMedding FALSE
}
}
/next i
/if (${doneMedding}) {
/varset LowManaMed FALSE
/docommand /${ChatCommand} "full mana, all done"
/sit off
}
}
/if (${LowManaMed} && !(${Me.Sitting} || ${Me.Mount.ID})) {
/if (${Twist}) {
/twist off
/stopcast
}
/if (${MeddingMessageTimer} == 0 && ${ShouldBroadcastMed}) {
/docommand /${ChatCommand} "medding, you should med"
/varset MeddingMessageTimer 10s
}
/sit on
}
/if (${LowManaMed}) /return TRUE
/if (${DebugMode}) /echo mark - 3
/call ExecuteArrayOfSubs "NonCombatSubs"
/return FALSE
Sub FaceAECentroid
/if (${FaceTimer} > 0) {
/if (${DebugMode}) /echo Exiting FaceAECentroid - Timer = ${FaceTimer}
/return FALSE
}
/varset FaceTimer 4
/if (${AECentroidY} == 0 || ${AECentroidX} == 0) {
/call EvaluateAETargets
/if (!${Macro.Return}) /return FALSE
}
/call DistanceToCentroid
|/if (${DebugMode})
/if (${DebugMode}) /echo Facing AE centroid - distance = ${Macro.Return}
/if (${Macro.Return} > 25) /return FALSE
/face fast loc ${AECentroidY}, ${AECentroidX} nolook
/return FALSE
Sub ForageAndBag
/if (!${ForageMode}) /return FALSE
/autoinv
/if (${Me.AbilityReady[Forage]}) {
/doability "Forage"
/delay 2
/autoinv
/delay 2
/autoinv
/autoinv
}
/return FALSE
Sub ConfigureChannels
/if (${DebugMode}) /echo ConfigureChannels
/if (!${Irc}) {
/echo /iconnect ${IrcConnectionString} ${Me.Name}
/iconnect ${IrcConnectionString} ${Me.Name}
/delay 10s ${Irc}
}
/if (${Irc}) {
/varset ChatCommand i say
} else {
/if (${MacroQuest.ChatChannels} == 0) {
/echo Universal chat service is down.
/varset ChatCommand echo
/return FALSE
}
/if (!${MacroQuest.ChatChannel[1].Equal[${ChatChannelName}]}) {
/echo Fixing chat channels - leaving ${MacroQuest.ChatChannels} channels
/declare currentChannel int local
/declare channelsToLeave int local ${MacroQuest.ChatChannels}
/for currentChannel 1 to ${channelsToLeave}
/echo leaving channel ${currentChannel}
/leave 1
/delay 1s
/next currentChannel
/autojoin ${ChatChannelName}, General
/delay 5
/join ${ChatChannelName}, General
}
/varset ChatCommand 1
}
/return FALSE
Sub CheckSitting
/if (${DebugMode}) /echo CheckSitting
/if (!${SitBetweenCombat}) /return FALSE
/if (${BOTMode} != 2 && ${BOTMode} != 4 && ${BOTMode} != 0) /return FALSE
/if (!${Bool[${Me.XTarget[1].ID}]} && !${Me.Mount.ID} && !${Me.Sitting} && !${Me.Moving} && (${Me.PctMana} < 70 || ${Me.PctEndurance} < 60)) {
/sit on
/varset IsAutoSitting TRUE
}
/if (${Me.Sitting} && ${IsAutoSitting} && ${Me.PctMana} >= 99 && ${Me.PctEndurance} >= 99) {
/sit off
/varset IsAutoSitting FALSE
}
/return FALSE
|.. check http://www.macroquest2.com/wiki/index.php/Slot_Names
Sub RKItemSlotCast(string itemSlot)
/declare itemSpell string local ${Me.Inventory[${itemSlot}].Spell}
/if (!${Bool[${itemSpell}]}) {
/echo trying to cast item ${itemSlot} - ${Me.Inventory[${itemSlot}]}, but it doesn't have a clicky
/return FALSE
}
/call WillSelfBuffStack "${itemSpell}"
/if (${Macro.Return}) {
/if (${DebugMode}) /echo cast item "${Me.Inventory[${itemSlot}].Name}"
/cast item "${Me.Inventory[${itemSlot}].Name}"
} else {
/if (${DebugMode}) /echo ${itemSpell} won't stack
}
/return ${Cast.Result.Equal[CAST_SUCCESS]}
Sub RKItemCast(string buffOrSongName, string itemName)
/if (${DebugMode}) /echo RKItemCast ${buffOrSongName} ${itemName}
/if (${Me.Buff[${buffOrSongName}].ID} || ${Me.Song[${buffOrSongName}].ID}) /return FALSE
/call WillSelfBuffStack "${buffOrSongName}"
/if (${Macro.Return}) /cast item "${itemName}"
/return ${Cast.Result.Equal[CAST_SUCCESS]}
Sub WillSelfBuffStack(string spellName)
/if (${DebugMode}) /echo WillSelfBuffStack
/declare i int local
/for i 1 to 42
/if (${Me.Buff[${i}].ID} && !${Spell[${spellName}].WillStack[${Me.Buff[${i}]}]}) {
/if (${DebugMode}) /echo Self buff: ${spellName} will not stack with ${Me.Buff[${i}].Name}
/return FALSE
}
/next i
/if (${DebugMode}) /echo ${spellName} WILL stack
/return TRUE
Sub WillBuffStack(string spellName, int targetId)
/if (${DebugMode}) /echo WillSelfBuffStack
/call TargetSync ${targetId}
/delay 5 ${Bool[${Target.Buff}]}
/declare i int local
/for i 1 to 42
/if (${Target.Buff[${i}].ID} && !${Spell[${spellName}].WillStack[${Target.Buff[${i}]}]}) {
/if (${DebugMode}) /echo Buff: ${spellName} will not stack with ${Target.Buff[${i}].Name} on Target Id: ${targetId}
/return FALSE
}
/next i
/if (${DebugMode}) /echo ${spellName} WILL stack
/return TRUE
Sub UpdateMercenaryStance
/if (${DebugMode}) /echo UpdateMercenaryStance
/if (!${Bool[${Me.Mercenary}]} || ${Me.Mercenary.State.Equal[Suspended]}) /return FALSE
/if (${Me.Mercenary.Class.ClericType}) /return FALSE
/if (${Me.Mercenary.Stance.Equal[Burn]}) {
/if (!${Target.ID} || ${Target.PctHPs} > ${MercBurnThreshold} || ${Me.TargetOfTarget.ID} == ${Me.Mercenary.ID}) {
/stance balanced
}
} else /if (${Me.Mercenary.Stance.Equal[Balanced]}) {
/if (${Target.ID} && ${Target.PctHPs} < ${MercBurnThreshold} && ${Me.TargetOfTarget.ID} != ${Me.Mercenary.ID}) {
/stance burn
}
}
/return FALSE
Sub CheckInvisModeCombat
/if (${DebugMode}) /echo CheckInvisModeCombat
/if (${Bool[${Me.XTarget[1].ID}]}) {
/docommand /${ChatCommand} "followcombat"
/delay 5
/return FALSE
}
/return FALSE
Sub RKAACast(string AAName)
/if (${DebugMode}) /echo RKAACast ${AAName}
/if (${Me.Casting.ID} && !${Me.Class.Name.Equal[Bard]}) /return FALSE
/if (${Me.AltAbilityReady[${AAName}]}) {
/alt act ${AltAbility[${AAName}].ID}
/return FALSE
}
/return FALSE
Sub RKAACast(string AAName, int targetId)
/if (${DebugMode}) /echo RKAACast name: ${AAName} target:${targetId}
/if (${Me.Casting.ID} && !${Me.Class.Name.Equal[Bard]}) /return FALSE
/if (${AltAbility[${AAName}].Spell.SpellType.Equal[Detrimental]} && ${Spawn[id ${targetId}].Type.Equal[PC]}) /return FALSE
/if (${AltAbility[${AAName}].Spell.SpellType.Equal[Beneficial]} && ${Spawn[id ${targetId}].Type.Equal[NPC]}) /return FALSE
/if (${Target.ID} != ${targetId}}) {
/target id ${targetId}
/delay 1s ${Target.ID} == ${targetId}
}
/if (${Me.AltAbilityReady[${AAName}]}) {
/if (!${Target.Buff[${Me.AltAbility[${AAName}].Spell.Name}].ID}) {
/alt activate ${AltAbility[${AAName}].ID}
/return FALSE
}
}
/return FALSE
Sub RKAACast(string AAName, string buffName, int targetId)
/if (${DebugMode}) /echo RKAACast ${AAName} buffName: ${buffName} targetId: ${targetId}
/if (${Me.Casting.ID} && !${Me.Class.Name.Equal[Bard]}) /return FALSE
if (${Me.Buff[${buffName}].ID}) /return FALSE
/if (${Target.ID} != ${targetId}}) {
/target id ${targetId}
/delay 1s ${Target.ID} == ${targetId}
}
/if (${Me.AltAbilityReady[${AAName}]}) {
/alt activate ${AltAbility[${AAName}].ID}
/return FALSE
}
/return FALSE
Sub RKDisc(string discName)
/if (${DebugMode}) /echo RKDisc ${discName}
/if (${Me.Casting.ID} && !${Me.Class.Name.Equal[Bard]}) /return FALSE
/if (!${Me.CombatAbilityReady[${discName}]}) /return FALSE
/if (${Bool[${Me.CombatAbility[${discName}]}]}) {
/if (${Me.CombatAbility[${Me.CombatAbility[${discName}]}].Duration} > 0 && ${Bool[${Me.ActiveDisc}]}) /return FALSE
/if (${DebugMode}) /echo Casting ${Me.CombatAbility[${Me.CombatAbility[${discName}]}].Name}
} else {
/if (${DebugMode}) /echo casting ${discName}, though it's not a CombatAbility
}
/disc ${discName}
/delay 1
/disc ${discName}
/delay 2
/disc ${discName}
/return FALSE
Sub ExecuteBaseDefensiveActions
/return FALSE
Sub DropInvis
/attack on
/delay 5
/attack off
/delay 1s !${Me.Invis}
/return FALSE