-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha2.mac
2118 lines (1305 loc) · 42.6 KB
/
a2.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
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
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#turbo 40
#include Ninjadvloota2.inc
#include a2.inc
#include Leet.inc
#include spell_routines.inc
#event TargetOoR "#*#Your target is too far away, get closer!#*#"
#event TargetOoR "#*#You cannot see your target.#*#"
#event MobDeath "#*#You have slain #1#!"
#Event GotHitDmg "#1#YOU for#*#points of damage."
#Event GotHit "#1# tries to #*# YOU, but #*#"
#Event LockedObj "#*#You cannot open #1#,#*#"
#event Hit "#*#YOU #*# #1# for #*# points of damage."
#Event GainSoloExp "#*#You gain experience!!"
#Event ArrowSwap "#*#Error: Ammo: type 21 != 27, you have the wrong type of ammo!#*#"
#Event LdonCountMob "#*#Population : #1#"
#Event LdonReset "#*#A loud scream fills the cavern#*#A little stronger than before"
|Hail after warp. Helps with resyncing after warp
#define hailIt 1
|#of inventory slots free to trigger a sell
#define FreeInventorySlots 7
|CombatArc is used to calculate arc to keep mobs in. Value is doubled ex. 45 results in a 90deg arc
#define CombatHalfArc 45
sub Main
/if (${Ini[a2.ini,a2,Version].Length}==0) /call CreateIni
/if (!${Plugin[mq2cast].Name.Length}) /plugin mq2cast
/call SetupAdvLootVars
/call AddAlerts
/echo a2
|Pet heal
/declare PetHealPct int outer 50 | set to 0 to disable pet heals
/declare PetHeal string outer Revival of Leetness 1
|How long before mob is stuck? in seconds|
/if (${Plugin[mq2netbots].Name.Length}>0) {
/if (!${NetBots.Enabled}) /netbots on
/if (!${NetBots.Listen}) /netbots grab=on
/if (!${NetBots.Output}) /netbots send=on
}
/declare pcRadiusAvoid int outer 30
/declare JumpTime int outer 10
|Alerts are defined in the A2.Inc. Will not kill mobs on alert list 1, have to go to the auto.inc to add alerts. Alerts are cleared when logging.|
/declare KillZone int outer ${Zone.ID}
/declare lx int outer
/declare AntiDrogaMobs int outer 0
/declare AntiDrogaBotAvoidRange int outer 100
/declare AntiDrogaMobLevel int outer 105
/declare DrogaInstanceTier int outer 0
/declare DrogaInstanceLinks[10] string outer
/declare DrogaTimer timer outer
/declare IsLdon int outer 0
/declare WaitingOnRespawn timer outer 0
/declare MeleeHitLastTimer timer outer 0
/declare MeleeGotHitLastTimer timer outer 0
/declare MeleeGotMissedLastTimer timer outer 0
/declare InstanceReSpawning int outer 0
/declare InstanceNumResets int outer 0
/declare InstanceCurrentMobCount int outer 0
/declare InstanceMaxMobCount int outer 0
/declare InstanceNumKills int outer 0
/declare InstanceAvgLvl float outer 0
/call CheckLdon
/if (${IsLdon}) {
/echo In LDON!
/declare LdonBoss string outer ${Ini[a2.ini,Ldons,Bosses]}
/alert clear 33
/alert add 33 npc first of
/alert add 33 npc second of
/alert add 33 npc third of
/alert add 33 npc fourth of
/alert add 33 npc fifth of
/alert add 33 npc sixth of
/alert add 33 npc seventh of
/alert add 33 npc eighth of
/alert add 33 npc ninth of
/alert add 33 npc tenth of
/alert add 33 npc eleventh of
/alert add 33 npc twelfth of
/alert add 33 npc thirteenth of
/alert add 33 npc fourteenth of
/alert add 33 npc fifteenth of
|a2.ini a2 ${Me.Name} ${Me.ID}|${Zone.ID}|${InstanceAvgLvl}|${InstanceCurrentMobCount}|${InstanceMaxMobCount}|${InstanceNumKills}|${InstanceNumResets}
/declare tempINI string local ${Ini[a2.ini,a2,${Me.Name}]}
/if (${tempINI.Arg[1,|].Equal[${Me.ID}]} && ${tempINI.Arg[2,|].Equal[${Zone.ID}]}) {
/echo Reloading Instance Variables
/varset InstanceAvgLvl ${tempINI.Arg[3,|]}
/varset InstanceCurrentMobCount ${tempINI.Arg[4,|]}
/varset InstanceMaxMobCount ${tempINI.Arg[5,|]}
/varset InstanceNumKills ${tempINI.Arg[6,|]}
/varset InstanceNumResets ${tempINI.Arg[7,|]}
/echo AvgLvl:${InstanceAvgLvl} NumKills:${InstanceNumKills} NumReset:${InstanceNumResets}
}
}
/declare ReclaimInvOpenOnce int outer 0
|How many levels below or above you want to kill|
/declare MinLVL int outer 85
/declare MaxLVL int outer 125
/declare DeathCounter int outer 0
/declare ZoneIDStarted int outer ${Zone.ID}
/declare OoRRetargetTimer timer outer
|Calculated as the macro runs and your level changes|
/declare TargMin int outer
/declare TargMax int outer
/declare MeleeTimeOutDuration string outer
/if (${Ini[a2.ini,${Zone.ShortName},MeleeTimeOut].Length}>0) {
/varset MeleeTimeOutDuration ${Ini[a2.ini,${Zone.ShortName},MeleeTimeOut]}
/echo MeleeTimeOutDuration Set to ${MeleeTimeOutDuration} from a2.ini [${Zone.ShortName}]
}
/if (${MeleeTimeOutDuration.Length}==0 && ${Ini[a2.ini,a2,MeleeTimeOut].Length}>0) {
/varset MeleeTimeOutDuration ${Ini[a2.ini,a2,MeleeTimeOut]}
/echo MeleeTimeOutDuration Set to ${MeleeTimeOutDuration} from a2.ini [a2]
}
/if (${MeleeTimeOutDuration.Length}==0) {
/ini a2.ini a2 MeleeTimeOut 45s
/varset MeleeTimeOutDuration 45s
}
/declare spamTimer timer outer
|How far and how high to target|
/declare MaxRad int outer 2000
/declare MaxZ int outer 500
|Radius for add control|
/declare MaxRad2 int outer 30
/declare MaxZ2 int outer 50
/declare regExpDone int outer 0
|Defined priority of mobs to kill|
/declare Mob1 string outer
/declare Mob2 string outer
/declare Mob3 string outer
/declare Mob4 string outer
/declare Mob5 string outer
/declare MobCount int outer 5
/declare mo int outer
/declare npcID int outer
/declare KillMob string outer
/hidec looted
/autoinv
/melee on
/declare JumpTimer timer outer
/declare CastTimer timer outer
/declare CeleTimer timer outer
/declare DivineTimer timer outer
/declare EpicTimer timer outer
/declare SpawnTimer timer outer
/declare RageTimer timer outer
/declare FuryTimer timer outer
/declare ChestTimer timer outer
/declare BeepTimer timer outer
/declare WaitTimer timer outer
/declare AlertTimer timer outer
/declare HealHot timer outer
/declare HealDir timer outer
/declare FadeCount int outer
|DoLoot turns looting on or off|
/declare DoLoot int outer 1
/declare DoBardEpicBuff int outer 1
|Can define the parameters here, will override anything declared|
|Have to be in order, /mac auto 1 trakanon, will not work. /mac auto 1 5000 trakanon, will prioritize trak in radius of 5000, and turn on looting. If not defined will default to values set above||
/if (${Defined[Param0]}) /varset DoLoot ${Param0}
/if (${DoLoot}==2) {
/echo Looting nameds only!
/declare namedMobsToLoot[10] int outer
}
/if (${Defined[Param1]}) /varset MaxRad ${Param1}
/declare parmLoop int local
|/if (${Defined[Param2]}) /varset Mob1 ${Param2}
|/if (${Defined[Param3]}) /varset Mob2 ${Param3}
|/if (${Defined[Param4]}) /varset Mob3 ${Param4}
|/if (${Defined[Param5]}) /varset Mob4 ${Param5}
|/if (${Defined[Param6]}) /varset Mob5 ${Param6}
/for parmLoop 2 to 6
/if (${Param${parmLoop}.Length}>0) {
/if (${Param${parmLoop}.Find[droga]}) {
/echo Setting zone started to Droga
/varset ZoneIDStarted 81
/varset KillZone 81
/if (${Param${parmLoop}.Length}>5) {
/if (!${Defined[DrogaSelectedInstanceTier]}) /declare DrogaSelectedInstanceTier int outer 0
/varset DrogaSelectedInstanceTier ${Param${parmLoop}.Mid[6,2]}
}
/echo ZoneIDStarted:${ZoneIDStarted}
/next parmLoop
}
/if (${Param${parmLoop}.Equal[com]}) {
/varset ZoneIDStarted 90
/varset KillZone 90
/next parmLoop
}
/varset Mob${Int[${Math.Calc[${parmLoop}-1]}]} ${Param${parmLoop}}
|/echo ${Mob${Int[${Math.Calc[${parmLoop}-1]}]}}
}
/next parmLoop
|Just draws a circle on the map with the kill radius|
/mapfilter castradius ${MaxRad}
|Chest Buffs|
/declare DoCritBuff int outer 0
/declare DoBlades int outer 0
|If you want looting off, but turned on when you kill a named, LootNamed turns looting on for named mobs only, overrides DoLoot|
/declare LootNamed int outer 0
/if (${DoLoot} && !${LootNamed}) /echo Looting on for all.
/if (${LootNamed}) /echo Looting on for named mobs only.
/if (!${DoLoot} && !${LootNamed}) /echo Looting off for all.
/if (${DoCritBuff}) /echo Crit Buff is on.
/if (!${DoCritBuff}) /echo Crit Buff is off.
/if (!${DoBlades}) /echo Bladestorm is off.
/if (${DoBlades}) /echo Bladestorm is on.
/call BuffCheck
/squelch /target clear
/varset AlertTimer 7m
/if ( ${Zone.ID}==81) /call SetDrogaLevel
/if (${Window[InventoryWindow].Child[AltCurr_PointList].Items}==0 ) {
/if (!${Window[InventoryWindow].Open}) /nomodkey /keypress i
/delay 10s ${Window[InventoryWindow].Open}
/notify InventoryWindow IW_Subwindows tabselect 5
/delay 3s ${Window[InventoryWindow].Child[AltCurr_PointList].Items}
/notify InventoryWindow IW_Subwindows tabselect 1
/windowstate InventoryWindow
}
:startpoint
/call ZoneCheck
/doevents
/if (${Target.Name.Equal[${Me.Name}]}) {
/echo Me
/squelch /target clear
/goto :startpoint
}
/if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
/vardata npcID Target.ID
/if (${Target.Distance}>30) {
/squelch /warp t
/delay 2
}
/squelch /tar clear
/delay 5
/target ID ${npcID} range ${TargMin} ${TargMax}
/face fast nolook
/stick 7 moveback
/delay 3
/call combat
}
/if (${Target.ID} && ${Target.Type.Equal[PC]}) {
/echo PC
/squelch /target clear
}
/doevents
:wait
/if (${SpawnCount[NPCCorpse range ${TargMin} ${TargMax}]}>30) {
/hidec all
/hidec looted
}
/if (!${AlertTimer}) {
/call AddAlerts
/varset AlertTimer 7m
|/delay 2s
}
/doevents
/call Buffcheck
/call Zonecheck
| Override SAD targeting to assist group...
/if (${Zone.ID}==403 || ${Zone.ID}==405 || ${Zone.ID}==406) {
|Ok we are in a sad Zone.
/if (${Plugin[mq2netbots].Name.Length}>0) {
/for lx 1 to ${Math.Calc[${NetBots.Client.Count[ ]}+1]}
/if (${NetBots[${NetBots.Client.Arg[${lx}, ]}].InZone}) {
/if (${Spawn[${NetBots[${NetBots.Client.Arg[${lx}, ]}].TargetID}].Name.Left[2].Equal[##]}) {
/echo ${NetBots.Client.Arg[${lx}, ]} has engaged a BOSS!!...
/varset npcID ${NetBots.Client.Arg[${lx}, ].TargetID}
/goto :KillMob
}
}
/next lx
}
}
/varset TargMin ${Math.Calc[${Me.Level}-${MinLVL}]}
/if (${TargMin}<0) /varset TargMin 1
/varset TargMax ${Math.Calc[${Me.Level}+${MaxLVL}]}
/for mo 1 to ${MobCount}
/if (${SpawnCount[npc ${Mob${mo}} radius ${MaxRad} zradius ${MaxZ} targetable noalert 1 range ${TargMin} ${TargMax}]}<1) {
/echo No ${Mob${mo}}
/if (${mo}==${MobCount}) {
/echo ${mo}
/echo Waiting on spawns, level range ${TargMin} to ${TargMax}.
/if (!${WaitingOnRespawn} && (${Zone.ID}==81 || ${Zone.ID}==90)) {
/varset WaitingOnRespawn 3m
/echo Set Respawn Timer to 3min.
}
/echo ${Zone.ID}
/varset FadeCount 0
/if (${Zone.ID} != 457) /squelch /warp succor
/if (${Zone.ID} == 457) /squelch /warp loc -1159 1021 44.9
/varset WaitTimer 3s
/doevents
/goto :Waiting
}
/next mo
}
| // Target Selection ..
/if (${SpawnCount[npc ${Mob${mo}} radius ${MaxRad} zradius ${MaxZ} targetable noalert 1 range ${TargMin} ${TargMax} ]}>=1) {
/vardata npcID NearestSpawn[npc ${Mob${mo}} radius ${MaxRad} zradius ${MaxZ} targetable noalert 1 range ${TargMin} ${TargMax} ].ID
/if ( ${Zone.ID}==81) {
/if (${SpawnCount[pc notid ${Me.ID}]}>0) {
/vardata npcID Spawn[id ${npcID}].NearestSpawn[${Math.Calc[1+${Math.Rand[5]}]},npc ${Mob${mo}} radius ${MaxRad} zradius ${MaxZ} targetable noalert 1 range ${TargMin} ${TargMax} ].ID
}
|//droga boss check
/call CheckDrogaBosses
/if ( ${Macro.Return} > 0) /varset npcID ${Macro.Return}
|/call AvoidDrogaAntiBot
|/if ( ${Macro.Return} > 0) /varset npcID ${Macro.Return}
/if (${AntiDrogaMobs}) {
/call LeaveDrogaInstance
|/echo LEAVE ENTERED!
}
}
/call AvoidPCPlayer
/if (${Macro.Return}>0) /varset npcID ${Macro.Return}
/call GetTargetFromXTarget
/if (${Macro.Return}>0) /varset npcID ${Macro.Return}
/goto :KillMob
}
:KillMob
/if (${npcID}==0) /goto :startpoint
/echo KillMob ${Spawn[id ${npcID}].CleanName} id:${npcID}
/squelch /warp loc ${Math.Calc[${Spawn[id ${npcID}].Y}-3]} ${Math.Calc[${Spawn[id ${npcID}].X}-3]} ${Spawn[id ${npcID}].Z}
/delay 1s ${Spawn[id ${npcID}].Distance}<9
/target id ${npcID} range ${TargMin} ${TargMax}
/if ( hailIt) /hail
/if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
/echo moving back
/stick 12 moveback
/delay 2
/call combat
}
/goto :startpoint
:Waiting
/if (!${AlertTimer}) {
/call AddAlerts
/varset AlertTimer 7m
/delay 2s
}
/call ZoneCheck
/if (${Target.Type.Equal[NPC]}) /goto :startpoint
/for mo 1 to ${MobCount}
/if (${SpawnCount[npc ${Mob${mo}} radius ${MaxRad} zradius ${MaxZ} targetable noalert 1 range ${TargMin} ${TargMax}]}) /goto :startpoint
/next mo
/stand
/if (${IsLdon} ) {
/if (${SpawnCount[object box]}>0 || ${SpawnCount[object barrel noalert 1]}>0 || ${SpawnCount[chest barrel noalert 1]}>0 ) {
/echo Killing object no mobs up!
/call KillObject
/goto :Waiting
}
/if (${Me.Name.Equal[Eclin]} && ${SpawnCount[npc Killer Wasp]}>0) {
/call WriteLdonStat "Zone:${Zone.ShortName} NumRespawns:${InstanceNumResets} AvgLvl:${InstanceAvgLvl} NumMobs:${InstanceMaxMobCount} Kills:${InstanceNumKills}"
/call SummonGearPet
/endm
}
}
/if (${InstanceReSpawning}) {
/echo Instance respawn #${InstanceNumResets} AvgMobLevel:${InstanceAvgLvl} MaxNumMobs:${InstanceMaxMobCount}
/varset InstanceReSpawning 0
/echo Starting Wait for respawn!
/call WaitForInstanceSpawn2
/echo Respawn DONE!
/if (${IsLdon} && ${SpawnCount[npc alert 33]}>0) {
/call FoundLdonEndBoss
}
/goto :startpoint
}
/delay 10s ${Target.ID}
/if ((${Zone.ID}==81 || ${Zone.ID}==90) && !${WaitingOnRespawn}) {
/echo No Respawn in 3m! Resetting zone...
|/itemnotify powersource rightmouseup
/delay 3s
}
/goto :Waiting
/return
Sub FoundLdonEndBoss
/echo Ldon SuperBoss!! ..: ${Spawn[npc alert 33].CleanName} :..
/beep
/beep
|/beep
/squelch /warp s
/call PullLdonBoss ${Spawn[npc alert 33].ID}
/return
Sub PullLdonBoss(bossID)
/if (${Me.Pet.ID}) /pet leave
/squelch /warp s
/delay 5
/squelch /warp s
/declare xloc int local ${Me.X}
/declare yloc int local ${Me.Y}
/declare zloc int local ${Me.Z}
/declare petItem string local ${FindItem[godly companions]}
/declare petTimer timer local 0
/if (${petItem.Length}>0) /echo PetItem: ${petItem}
|first check valid boss
/if (${LdonBoss.Find[/${Spawn[${bossID}].CleanName}/]}) {
/echo Valid Boss!
}
/squelch /warp loc ${Spawn[${bossID}].Y} ${Spawn[${bossID}].X} ${Spawn[${bossID}].Z}
/delay 3
/target id ${bossID}
/delay 1
/call HaveAggroOf ${bossID}
:AggroLoop
/if (${Me.Class.ShortName.Equal[RNG]} && !${Me.AutoFire}) {
/autofire on
/stick 20 moveback
}
/if (!${Me.Class.ShortName.Equal[RNG]} && !${Me.Combat}) {
/attack on
/pet attack
/stick 2 moveback
}
/if (${Target.ID}!= ${bossID}) /target id ${bossID}
/if (${petItem.Length}>0 && !${Me.Pet.ID} && !${petTimer} ) {
/call ClickItem "${petItem}"
/varset petTimer 1s
}
/if (${Me.Pet.ID} && !${petTimer}) {
/pet attack
/varset petTimer 1s
}
/call HaveAggroOf ${bossID}
/if (!${Macro.Return}) /goto :AggroLoop
/echo we have Boss Aggro!
/attack off
/stick off
/squelch /warp s
/squelch /warp s
:waitForBoss
/if (${Me.Pet.ID}) {
/pet leave
/delay 5
}
/if (${Spawn[${bossID}].Distance}>20) /goto :waitForBoss
/echo Boss is here
/varset MeleeHitLastTimer ${MeleeTimeOutDuration}
/varset MeleeGotHitLastTimer 10s
/varset MeleeGotMissedLastTimer 10s
/return
Sub HaveAggroOf(mobID)
/for lx 1 to 13
/if (${Me.XTarget[${lx}].ID}==${mobID}) /return TRUE
/next lx
/return FALSE
Sub WaitForInstanceSpawn2
/declare bailOutTimer timer local 30s
:dlyLoop
/call AverageLvlOfMobs
/if ( ${SpawnCount[npc]} > 40 && ${Macro.Return}>=${Math.Calc[${InstanceAvgLvl}-10]}) {
/varset InstanceAvgLvl 0
/return
}
/delay 1
/if (!${bailOutTimer}) /return
/goto :dlyLoop
/return
Sub AverageLvlOfMobs
|/echo Avg.....
/declare tempSum float local
/declare count int local ${If[${SpawnCount[npc]}>60,60,${SpawnCount[npc]}]}
|/for lx 1 to ${SpawnCount[npc]}
/for lx 1 to ${count}
/varset tempSum ${Math.Calc[${tempSum}+${NearestSpawn[${lx},npc].Level}]}
/next lx
/return ${Math.Calc[${tempSum}/${count}]}
Sub KillObject
/declare tarID int local
/if (${SpawnCount[object box noalert 1]} && ${SpawnCount[object barrel noalert 1]}) {
/varset tarID ${If[${Math.Rand[2]},${Spawn[object box noalert 1].ID},${Spawn[object barrel noalert 1].ID}]}
} else {
/if (${SpawnCount[object box noalert 1]}) /varset tarID ${Spawn[object box noalert 1].ID}
/if (${SpawnCount[object barrel noalert 1]}) /varset tarID ${Spawn[object barrel noalert 1].ID}
/if (${SpawnCount[chest barrel noalert 1]}) /varset tarID ${Spawn[chest barrel noalert 1].ID}
}
/if (${tarID} && (${Spawn[${tarID}].Type.Equal[object]} || ${Spawn[${tarID}].Type.Equal[chest]})) {
/squelch /warp loc ${Spawn[${tarID}].Y} ${Spawn[${tarID}].X} ${Spawn[${tarID}].Z}
/delay 5
/target id ${tarID}
/delay 5
/open
/delay 5
/doevents
}
/return
Sub Combat
/echo Combat Start!
/varset MeleeHitLastTimer ${MeleeTimeOutDuration}
/varset MeleeGotHitLastTimer 10s
/varset MeleeGotMissedLastTimer 10s
:kill_outer
/varset JumpTimer ${JumpTime}s
/if (${IsLdon} && ${SpawnCount[npc alert 33]}>0) {
/call FoundLdonEndBoss
}
/call Zonecheck
/doevents
/if (${Corpse.Open}) {
/nomodkey /notify LootWnd LW_DoneButton leftmouseup
/delay 1s !${Corpse.Open}
}
:have_target
/call ZoneCheck
/doevents
/if (${Target.ID}) {
/if (${Target.Type.Equal[Corpse]}) {
/echo Corpse
/target clear
}
/if ((${Zone.ID}==403 ||${Zone.ID}==405 || ${Zone.ID}==406) && ${Target.CleanName.Length}==0) /tar npc noalert 1 next
/if (${Target.CleanName.Equal[a steadfast servant]}) {
/target clear
}
/if (${Target.ID} && ${Target.Type.Equal[PC]}) {
/echo PC
/squelch /target clear
}
/if ( ${DoLoot}==2 ) {
/if (${Target.Named} || ${Target.Name.Left[1].Equal[#]}) /call CheckNamedList
/if (${IsLdon} && ${LdonBoss.Find[/${Target.CleanName.Arg[1, ]}/]}) {
/call CheckNamedList
}
}
/if (!${Me.Standing}) /stand
/if (${Target.ID} && !${Stick.Status.Equal[ON]}) {
/stick 7 moveback
/face fast nolook
}
/if (${WaitingOnRespawn}>0) /varset WaitingOnRespawn 0
/if (!${Me.Class.ShortName.Equal[RNG]} && ${Target.ID} && ${Target.Distance}<76 && !${Me.Combat} && !${Melee.Enrage} && ${Melee.Status.NotEqual[ESCAPING]}) {
/face fast nolook
/attack on
/pet attack
}
/if (${Me.Class.ShortName.Equal[RNG]} && ${Target.ID} && ${Target.Distance}<76 && !${Me.AutoFire} && !${Melee.Enrage} && ${Melee.Status.NotEqual[ESCAPING]}) {
/face fast nolook
/stick 20 moveback
/autofire on
}
/if (!${JumpTimer} && ${Zone.ID} == 457) {
/echo here
/warp loc ${Math.Calc[${Me.Y}+25]} ${Math.Calc[${Me.X}+25]} ${Math.Calc[${Me.Z}+100]}
/varset JumpTimer 10s
}
/if ( ${IsLdon} && ${Target.ID}) {
|Ldon Trap mob if we only have one aggro mob sit down and let it kill it self.
/call CheckXTarget
|/echo ${Macro.Return} && !${MeleeGotHitLastTimer} && ${MeleeGotMissedLastTimer}
/if (${Macro.Return}==1 && !${MeleeGotHitLastTimer} && ${MeleeGotMissedLastTimer} && ${Target.PctHPs}>=98 ) {
/echo Ldon DS kill..
/attack off
/stick off
/sit
/delay 5
/delay 5s !${Target.ID} || ${Me.Standing}
}
/if (${Macro.Return}==1 && ${Target.ID}>0 && ${Target.CleanName.Length}==0 && ${Me.Combat}) {
/for lx 1 to 3
/if (${Me.XTarget[${lx}].ID}==${Target.ID}) {
/echo Ldon DS1 kill..
/attack off
/stick off
/sit
/delay 5
/delay 5s !${Target.ID} || ${Me.Standing}
}
/next lx
}
/if (${Macro.Return}>1 && ${Target.ID}>0 && ${Target.CleanName.Length}==0) {
/for lx 1 to 13
/if ( ${Me.XTarget[${lx}].ID} > 0 && !${Spawn[id ${Me.XTarget[${lx}].ID}].Type.Equal[Untargetable]} && ${Spawn[id ${Me.XTarget[${lx}].ID}].Type.Equal[NPC]}) {
/if ( ${Target.ID}!= ${Me.XTarget[${lx}].ID}) {
/target id ${Me.XTarget[${lx}].ID}
/varset lx 14
}
}
/next lx
}
/if (${Macro.Return}>1 && !${MeleeGotHitLastTimer} && ${MeleeGotMissedLastTimer} && ${Target.PctHPs}>=99 ) {
| Change to another Target
/for lx 1 to 13
/if ( ${Me.XTarget[${lx}].ID} > 0 && !${Spawn[id ${Me.XTarget[${lx}].ID}].Type.Equal[Untargetable]} && ${Spawn[id ${Me.XTarget[${lx}].ID}].Type.Equal[NPC]}) {
/if ( ${Target.ID}!= ${Me.XTarget[${lx}].ID}) {
/target id ${Me.XTarget[${lx}].ID}
/varset lx 14
}
}
/next lx
}
|**
/if (${Macro.Return}==1 && !${MeleeGotHitLastTimer} && ${MeleeGotMissedLastTimer} && ${MeleeHitLastTimer}<=350 && !${Melee.Enrage}) {
/echo Ldon DS kill..
/attack off
/combat off
/stick off
/sit
/delay 5
/delay 5s !${Target.ID} || ${Me.Standing}
}
**|