-
Notifications
You must be signed in to change notification settings - Fork 1
/
ldon_guild.mac
1617 lines (1357 loc) · 50.6 KB
/
ldon_guild.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
|**
----------------------------
LDON_GUILD.mac
----------------------------
This macro will request an zone start based LDON, accept it, and enter it
Proceed to complete it, and exit. Re-request.
Note: will load/unload other group members macros on enter/exit.
Requries NO Active Hacks unless stuck (warp)
Requires MQ2Nav Support
Usage:
MMC: /mac ldon_guild dgga gsay butcher TRUE TRUE
MIRA: /mac ldon_guild dgga gsay everfrost TRUE TRUE
TAK: /mac ldon_guild dgga gsay nro TRUE TRUE
GUK: /mac ldon_guild dgga gsay sro TRUE TRUE
RUJ: /mac ldon_guild dgga gsay ecommons TRUE TRUE
______________________________________________
REVISION HISTORY
09.24.2017 xiris INITIAL REVISION
09.26.2017 xiris MODIFIED to use an ini to define all mission criteria based on starting zone (butcher,everfrost,etc)
09.30.2017 xiris Random code clean up
06.18.2020 xiris Commented and cleaned up. Again.
12.08.2021 xiris Aligned the puller part of the macro with bot_pull updates using MQ2Nav
12.27.2021 xiris Changed completion routine to use Origin to go back to lobby instead of dealing with shitty trying to get to zone out
01.19.2022 xiris Added support for mq2doors due to takish-hiz having retarded door mechanics
Added support to stop and ask for buffs in lobby since we run through anyway
03.04.2022 xiris Added support for MQ2AdvPath pathing for NRO as test for turning off mq2nav after lobby magus
to NRO zone in.
03.06.22 xiris Added support for high requesting high risk missions (bln_highRisk)
03.28.23 xiris Split this file from regular LDON since donor hall allows fast travel
Donor hall trivialized the movement to the LDON entrance, etc so culled some code
05.15.23 xiris Added checks for being pushed out of navigable areas, will warp to point if there is an issue
10.12.23 xiris Added support for running this from guildhall in donor mode (using magus to get to thundercrest => ldon guys)
______________________________________________
REQUIRED PLUGINS
mq2cast
mq2eqbc
mq2debuffs
mq2doors
mq2moveutils
mq2nav
mq2piggyzone
mq2mmoreachit
______________________
REQUIRED INCLUDES
xiris_common/spell_routines.inc
xiris_common/xiris_common.inc
**|
#include xiris_common/xiris_common.inc
#Turbo 120
#define INI_ldonInfo xiris_common/xiris_ldon_definitions.ini
#EVENT RageOff "#*#is no longer enraged#*#"
#EVENT RageOn "#*#has become ENRAGED#*#"
#EVENT Zoned "You have entered#*#"
#EVENT Zoned "LOADING, PLEASE WAIT..."
#EVENT NoLOS "#*#you cannot see your target#*#"
#EVENT TooClose "#*#your target is too close#*#"
#EVENT NavStuck "#*#Could not find path to destination#*#"
#EVENT NavStuck "#*#Could not locate starting point on navmesh#*#"
#EVENT UILocked "#*#You can't use that command right now#*#"
Sub Main(string _channel, string _announce, string _theme, bool _useDownFlags, bool _highRisk)
/delay 5
|-- initialize common xbot variables
/call xbot_initialize ${Me.Name}
|-- initialize variables specific to this macro
/call variant_initialize ${_channel} ${_announce} ${_theme} ${_useDownFlags} ${_highRisk}
|-- report status
/delay 10
/echo \agLDON Runner \aw>> @\ao${_channel} \aw>> \agTheme: \ao${_theme} \aw>> \agAdventure Request: \ao${adventureGiver}
|-- Build Alert List
/call setAlerts
|**
----------------------------
Setup Loop
----------------------------
Set up the current LDON based on the start zone shortName.
butcher|everfrost|nro|sro|ecommons
----------------------------
**|
:SetupLoop
/echo Main:SetupLoop
|-- check that the group is in zone
/call chkGroup
|-- request the LDON, kicking off the zoning to start logic
| this will move entire group into LDON instance
| requestLDON-> zoneLDON -> setupTask
|-- if already in the dungeon, you probably restarted it manually since something else fucked up. Skip task requesting...
/if (${Zone.ShortName.NotEqual[thundercrest]} && ${Zone.ShortName.NotEqual[guildhall]} && ${Zone.ShortName.NotEqual[guildlobby]}) {
/echo \aoNot in Start Zone, maybe in adventure already?
/call resumeLDON
} else {
|-- remove yourself from any adventures that might be lingering
/echo \awKilling any previous LDON adventure that is active \ao${inMission} ${haveMission}
/if (${Window[ConfirmationDialogbox].Open}) {
/squelch /${cmdChannel} /notify ConfirmationDialogbox CD_Yes_Button leftmouseup
/varset inMission FALSE
/varset haveMission FALSE
/delay 10
}
| I have no LDON mission, request
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[You are not currently assigned]}) {
/echo \agCalling requestLDON
/varset inMission FALSE
/varset haveMission FALSE
/call requestLDON
} else {
| I had a LDON mission, killing it
/squelch /${cmdChannel} /notify AdventureRequestWnd AdvRqst_RequestButton leftmouseup
/varset inMission FALSE
/varset haveMission FALSE
/delay 10
/goto :SetupLoop
}
/delay 5s
| double check that I have one cause this fucks up now and then on this server
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[You are not currently assigned]}) {
/echo \arYou are not currently assigned...\ao Trying Again
/goto :SetupLoop
}
/if (${haveMission}) /call zoneLDON
/doevents
/if (!${inMission} || !${haveMission}) /goto :SetupLoop
}
|**
----------------------------
Mission Loop
----------------------------
Checks Completion
Runs the bot_pull.mac functionality
----------------------------
**|
:MissionStart
/echo Main:MissionStart
|-- set up any melee buffs/delay and then go to camp inside the LDON zone;
/call chkGroup
/delay 5s
/varset int_currentCamp 1
/if (${bln_hasSHM}) {
/docommand /${announceChannel} doShrink
/delay 10s
} else /if (${bln_hasBST}) {
/docommand /${announceChannel} doShrink
/delay 30s
}
/call moveCamp ${int_currentCamp}
:MissionLoop
/echo Main:MissionLoop
/if (${MacroQuest.GameState.Equal[CHARSELECT]} || ${MacroQuest.GameState.Equal[PRECHARSELECT]} ) /end
/if (${Me.Casting.ID} && ${Me.Hovering}||${Window[tradewnd].Open}||${Window[lootwnd].Open}) /goto :mainLoop
/doevents
|-- utility checking
/call chkUtils
/call chkDownshits
|-- reset variables, and make sure I am in the zone still and in mission
/call setRSTVars
/call chkZone
/if (${Macro.Return.Equal[LOBBY]}) {
/dgt We seem to have gotten fucked up and are now in the lobby at ${Time.Time24}
/dgt Resetting everything and going again
/call OriginToGuildHall
/call ResetAtGuildHall
/delay 10s
/call chkGroup
/goto :SetupLoop
}
|-- check to see if I've finished the mission yet
/if (!${inMission} || !${haveMission}) /goto :SetupLoop
/if (${SpawnCount[NPC radius 100]} == 0 && ${Zone.ShortName.NotEqual[${str_startZone}]}) /call chkLDONCompletion
/if (${Zone.ShortName.Equal[${str_startZone}]} || (!${inMission} || !${haveMission})) /goto :SetupLoop
|-- reset group to camp spot (leash) if its empty
/if (${SpawnCount[npc radius ${int_campRadius} zradius 25]} == 0) {
/call resetCamp
/docommand /${announceChannel} RefreshXTarget
}
|-- UI lock check
/if (${bln_UILocked}) {
/echo \arUI Locked!\agZoning to clear
/call clearUILock
}
|-- target hunter
/attack off
/call getTarget
/if (${Target.Distance} > 20) /call pullTarget
/call killTarget
/varcalc int_killCount ${int_killCount}+1
/varcalc int_totalKills ${int_totalKills}+1
|-- am I still in mission?
/if (${inMission}) /goto :MissionLoop
|-- adventure is over, start the setup of another, ad infinitem!
/goto :SetupLoop
/return
Sub resumeLDON
/call setupTask
/call setGroupCommands
/call setEntranceVars
/varset str_startZone thundercrest
/varset haveMission TRUE
/varset inMission TRUE
/varset ldonType Mob Count
/return
Sub requestLDON
/echo \aorequestLDON \ag:inMission\ao${inMission} \ag:haveMission\ao${haveMission}
/if (${inMission}) /return
/if (${haveMission}) /return
/echo \awrequestLDON in zone \ao${zoneRequest} \awcurrently in: \ao${Zone.ShortName}
|-- this is anachronistic if we are phasing out piggyzon
:ThundercrestStart
/if (${Zone.ShortName.NotEqual[thundercrest]}) {
/if (${Zone.ShortName.Equal[guildhall]}) {
/echo \aoIn guildhall, moving to \awThundercrest
/call zoneByMagus thundercrest
/goto :ThundercrestStart
} else {
/echo \arI don't know where we are!
/echo Not in Thundercrest, not sure why. Ending
/end
}
}
/echo \agIn Thundercrest
/declare requestCount int local 1
|-- Get Adventure Loop, request the adventure from the giver.
:GetAdventure
/echo \a-w Getting adventure from ${adventureGiver} ${Time.Time24}
/call TrueTarget ${Spawn[npc ${adventureGiver}].ID}
/echo \a-w Path to \ag${adventureGiver}\aw? \ag${Navigation.PathExists[spawn ${adventureGiver}]}
| Navigate to Adventurer
/if (${Navigation.PathExists[spawn ${adventureGiver}]}) {
/docommand /${cmdChannel} /navigate spawn ${adventureGiver}
/delay 10
} else {
/docommand /${cmdChannelExcludingMe} /target id ${Spawn[npc ${adventureGiver}].ID}
/docommand /${cmdChannel} /warp target
}
:GetAdventureNavLoop
/echo \a-w Navigating to \ag${adventureGiver}
/if (${Navigation.Active}) {
/delay 20
/goto :GetAdventureNavLoop
}
/delay 20
:GetAdventureClick
/echo \a-w Requesting Adventure
/face fast
/delay 10
/click right target
/delay 20
/click right target
|-- set the difficulty to Hard (defaulted to no)
/if (${bln_highRisk}) {
/echo \a-w Requesting a High Risk Mission
/notify AdventureRequestWnd AdvRqst_RiskCombobox listselect ${Window[AdventureRequestWnd].Child[AdvRqst_RiskCombobox].List[High]}
}
|-- set the type to Kill examples: Note EqTitan code fix as of 1/1/22 allows for chain requesting missions
| The only mission that will be required is the mob count since its the default.
| ${Window[AdventureRequestWnd].Child[AdvRqst_typeCombobox].List[Single Boss]}
| ${Window[AdventureRequestWnd].Child[AdvRqst_typeCombobox].List[Mob count]}
/delay 10
/call setCamp
/varset ldonType NOAVAIL
|-- First choice: Mob Count, see if this mission is available
/if (${Window[AdventureRequestWnd].Child[AdvRqst_typeCombobox].List[Mob count]} > 0) {
/notify AdventureRequestWnd AdvRqst_typeCombobox listselect ${Window[AdventureRequestWnd].Child[AdvRqst_typeCombobox].List[Mob count]}
/delay 10
/notify AdventureRequestWnd AdvRqst_RequestButton leftmouseup
/delay 2s
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[The number of adventures returned was zero]}) {
/echo \a-w Adventure type: "Mob Count" unavailable.
} else {
/echo \a-w Adventure type: "Mob Count" accepted.
/varset ldonType Mob Count
/goto :Accept
}
}
/if (${zoneRequest.Equal[sro]}) {
/echo \a-w GUK LDON can only do the kill count, since GukA for boss mob is un-navigable
/goto :TryAgain
}
|-- have to close window and try again now apparently.
:GetAdventure2
/keypress esc
/keypress esc
/keypress esc
/echo Getting adventure2 from ${adventureGiver} ${Time.Time24}
/call TrueTarget ${Spawn[NPC ${adventureGiver}].ID}
/face fast
/click right target
/delay 2s
|-- Second choice: Single Boss, see if this mission is available
/if (${Window[AdventureRequestWnd].Child[AdvRqst_typeCombobox].List[Single Boss]} > 0) {
/notify AdventureRequestWnd AdvRqst_typeCombobox listselect ${Window[AdventureRequestWnd].Child[AdvRqst_typeCombobox].List[Single Boss]}
/delay 10
/notify AdventureRequestWnd AdvRqst_RequestButton leftmouseup
/delay 2s
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[The number of adventures returned was zero]}) {
/echo \a-w Adventure type: "Single Boss" unavailable.
} else {
/echo \a-w Adventure type: "Single Boss" accepted.
/varset ldonType Single Boss
/goto :Accept
}
}
/delay 2s
/echo ldonType: ${ldonType}
|-- No satisfactory type is available, go back to :GetAdventure
/if (${ldonType.Equal[NOAVAIL]} || ${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[You are not currently assigned]}) {
:TryAgain
/echo (${requestCount}) No satisafactory Adventure type available, delaying for 1m. ${Time.Time24}
/delay 1m
/varcalc requestCount ${requestCount}+1
/goto :GetAdventure
}
|-- Found one, Accept the mission and start the zoning loop.
:Accept
/delay 10
|-- Set the variables that define which zone we are headed to.
| note we no longer need to do this since donor hall handles this crap
|/call setEntranceVars
|-- Accept the task
/notify AdventureRequestWnd AdvRqst_AcceptButton leftmouseup
/varset haveMission TRUE
/delay 3s
/return
Sub setEntranceVars
|-- determine the entrance for the mission you received
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[unearthed grave in Lesser Faydark]}) /varset ldonEntrance unearthed_grave
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[crypt in Lesser Faydark]}) /varset ldonEntrance crypt
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[glimmering portal]}) /varset ldonEntrance glimmering
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[snowy mine]}) /varset ldonEntrance snowy_mine
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[quicksand pit]}) /varset ldonEntrance quicksand_pit
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[through a cave in Southern Ro]}) /varset ldonEntrance sro_cave
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[through a barricaded door in Upper Guk]}) /varset ldonEntrance barricaded_door
/if (${Window[AdventureRequestWnd].Child[AdvRqst_NPCText].Text.Find[through a rotting tree trunk in Innothule]}) /varset ldonEntrance rotting_tree
/echo setting ${ldonEntrance}
|-- pull information determined by entrance from INI file (waypoint, doortarget and starting zone)
/varset wpIN ${Ini[INI_ldonInfo,${ldonEntrance},wpIN]}
/varset dtIN ${Ini[INI_ldonInfo,${ldonEntrance},dtIN]}
/varset zoneStart ${Ini[INI_ldonInfo,${ldonEntrance},zoneStart]}
/echo setting ${ldonEntrance} entrance vars --> ${zoneStart} ${wpIN} ${dtIN}
/return
|**
----------------------------
zoneLDON
----------------------------
Zones everyone to the LDON start zone, and once in the start zone
runs everyone to the LDON zone entrance, and clicks the door
----------------------------
**|
Sub zoneLDON
/declare waitForAllInLDON int local 0
| So much easier with Donor Hall insta porting
/call TrueTarget ${Spawn[npc ${adventureGiver}].ID}
/delay 60
/say Ready
/delay 100
|-- loop to wait for everyone to zone in
:ZoneIntoLDONInstanceWait
/varcalc waitForAllInLDON ${waitForAllInLDON}+1
/echo \a-w Waiting for all to zone into LDON
/delay 100
/if (${waitForAllInLDON} > 12) /call killMacro "Group failed to zone into at ${wpIN}"
/if (${Group.AnyoneMissing}) /goto :ZoneIntoLDONInstanceWait
|-- Setup the task with INI Data
/varset inMission TRUE
/echo \ag DONE \awwith zoneLDON
/call setupTask
/return
Sub killMacro(reason)
/echo Something failed [${reason}] at ${Time.Time24}
/docommand /${cmdChannel} /end
/return
|**
----------------------------
setupTask
----------------------------
Sets up the mission parameters once inside the LDON mission zone
----------------------------
**|
Sub setupTask
/echo \aoSetupTask inMission:\ag${inMission} \aohaveMission:\ag${haveMission} \agzoneMission:\ag${Zone.ShortName}
/varset zoneMission ${Zone.ShortName}
|-- pulling zone data from INI
/varset dtOUT ${Ini[INI_ldonInfo,${zoneMission},dtOUT]}
/varset killTarget ${Ini[INI_ldonInfo,${zoneMission},killTarget,NULL]}
/varset int_campCount ${Ini[INI_ldonInfo,${zoneMission},campCount,6]}
/varset int_maxRadius ${Ini[INI_ldonInfo,${zoneMission},pullDist,350]}
/varset int_xOUT ${Ini[INI_ldonInfo,${zoneMission},xOUT,0]}
/varset int_yOUT ${Ini[INI_ldonInfo,${zoneMission},yOUT,0]}
/varset int_zOUT ${Ini[INI_ldonInfo,${zoneMission},zOUT,${Me.Z}]}
|-- If we are killboss type mission we need to add killboss to list 2
/if (${killTarget.NotEqual[NULL]}) /squelch /alert add 2 npc ${killTarget}
/echo \a-w------------
/echo \aoSetting \ag${zoneMission} \aozone vars:
/echo \awdtOUT: \ag${dtOUT}\aw, killTarget: \ag${killTarget}\aw, int_campCount \ag${int_campCount}
/echo \awint_maxRadius: \ag${int_maxRadius}\aw, int_xOUT: \ag${int_xOUT}\aw, int_yOUT: \ag${int_yOUT}\aw, int_zOUT: \ag${int_zOUT}
/echo \a-w------------
/delay 10
|-- Turn off the fucking doors
/docommand /${cmdChannel} /toggledoors on
|-- Tell rest of group to load their normal macroset;
/echo In ${Zone.Name}, setting up bot_loader and delaying 5s
/docommand /${cmdChannelExcludingMe} /mac bot_loader ${Me.Name} Mluian NULL 70
/delay 5s
|-- set up group variables, change here based on group makeup;
/call setGroupCommands
/return
Sub zoneByMagus(string _zoneToRequest)
/g Using Magus to zone ${_zoneToRequest}
/docommand /${cmdChannel} /tar npc magus
/delay 10
/docommand /${cmdChannel} /nav target
:magusNavWait
/delay 10
/if (${Nav.Active}) /goto :magusNavWait
/delay 5s
|-- open up the magus's merchant window which fixes the rando desynch
/docommand /${cmdChannel} /click right target
/delay 10
/docommand /${cmdChannel} /keypress esc
/delay 10
/docommand /${cmdChannel} /tar npc magus
/delay 10
/docommand /${cmdChannel} /say ${_zoneToRequest}
:magusZoneWait
/echo \a-w Waiting to be in ${_zoneToRequest}
/if (!${Zone.ShortName.NotEqual[${_zoneToRequest}]}) {
/delay 40
/goto :magusZoneWait
}
/delay 15s
/return
Sub MoveToBindFromOrigin
/docommand /${cmdChannel} /toggledoors on
/docommand /${cmdChannel} /nav spawn trans
:translocate_rund
/delay 20
/if (${Navigation.Active}) /goto :translocate_run
/delay 5s
:translocate_ask
/docommand /${cmdChannel} /tar trans
/delay 5s
/say East. Always... into the East.
/delay 30s
/return
Sub RequestRessurection
/docommand /${cmdChannel} /nav spawn utility
:summoner_run
/delay 20
/if (${Navigation.Active}) /goto :summoner_run
:summoner_ask
/tar utility
/delay 10
/hail
/say summon
/delay 50
/tar utility
/delay 50
/say resurrect
/echo \aoRequested Resurrection \awDelaying:\ag45s
/delay 45s
/return
Sub RequestRaidBuffs
/g Requesting Raid Buffs
/docommand /${cmdChannel} /toggledoors on
/docommand /${cmdChannel} /nav wp magus
:raid_run
/delay 20
/if (${Navigation.Active}) /goto :raid_run
:raid_ask
/dgt docharbuffs ${Me.Name}
/delay 30s
/return
Sub RequestLobbyBuffs
/g Requesting Lobby Buffs
|-- Phanti Buffs
:phanti_tar
/docommand /${cmdChannel} /tar npc phanti
/docommand /${cmdChannel} /nav target
:phanti_run
/delay 20
/if (${Navigation.Active}) /goto :phanti_run
:phanti_ask
/delay 20
/docommand /${cmdChannel} /say haste
/delay 10
/docommand /${cmdChannel} /say kei
/delay 20
|-- Firiona Vie Buffs
:firi_tar
/docommand /${cmdChannel} /tar npc firi
/docommand /${cmdChannel} /nav target
:firi_run
/delay 20
/if (${Navigation.Active}) /goto :firi_run
:firi_ask
/delay 20
/docommand /${cmdChannel} /say virtue
/delay 20
|-- Fuzzy Buffs
:fuzzy_tar
/docommand /${cmdChannel} /tar npc fuzzy
/docommand /${cmdChannel} /nav target
:fuzzy_run
/delay 20
/if (${Navigation.Active}) /goto :fuzzy_run
:fuzzy_ask
/delay 20
/docommand /${cmdChannel} /say ds
/delay 10
/docommand /${cmdChannel} /say regen
/delay 20
|-- Run to Magus
:magus_tar
/docommand /${cmdChannel} /tar npc magus
/docommand /${cmdChannel} /nav target
:magus_run
/delay 20
/if (${Navigation.Active}) /goto :magus_run
/return
Sub chkZone
/if (${Zone.ShortName.NotEqual[${str_startZone}]}) {
/if (${Zone.ShortName.Equal[${Me.BoundLocation[0]}]}) {
/docommand /${announceChannel} I died! GTFO! ${Time.Time24}/
/delay 5s
/return LOBBY
}
}
/return
Sub OriginToGuildHall
/declare originAttempt int local 0
/declare i int local 1
:OriginDelay
/if (${Me.AltAbilityTimer[Origin]} == 0) {
:OriginAttempt
/if (${Zone.ShortName.NotEqual[${Me.BoundLocation[0]}]}) {
/varcalc originAttempt ${originAttempt} + 1
|-- tell each group member that isn't a bard to cast origin, bard add origin to queue
/for i 0 to ${Group}
/if (${Group.Member[${i}].Class.ShortName.Equal[BRD]}) /dex ${Group.Member[${i}]} /casting "Origin" alt
/if (${Group.Member[${i}].Class.ShortName.NotEqual[BRD]}) /dex ${Group.Member[${i}]} /casting "Origin" alt
/next i
/casting origin alt
/delay 60s
/goto :OriginAttempt
} else {
/return
}
} else {
/echo Origin not Ready, delaying 1m ${Time.Time24}
/delay 1m
/goto :OriginDelay
}
/return
Sub ResetAtGuildHall
/if (${Zone.ShortName.Equal[${Me.BoundLocation[0]}]}) {
|/call MoveToBindFromOrigin
/call RequestRessurection
/call RequestRaidBuffs
|/call RequestLobbyBuffs
|/call zoneByMagus ${zoneMagus}
} else {
/g Not at guildhall, can't reset here, something went wrong at ${Time.Time24}
/return
}
/return
Sub setCamp
/echo Setting camp at camp${int_currentCamp} out of ${int_campCount}
/varset D1X ${Me.X}
/varset D1Y ${Me.Y}
/varset D1Z ${Me.Z}
/delay 1s
/return
|-- Moves the current camp to n+1
| If we cannot navigate (probably in a wall or geometry)
| We will warp back to the current camp and then continue.
Sub moveCamp(int _campNumber)
/declare prevCamp int local 1
/varcalc prevCamp ${_campNumber}-1
/echo \aoMoving to Camp \ag${_campNumber}
/if (${Navigation.PathExists[wp camp${_campNumber}]}) {
/nav wp camp${_campNumber}
/delay 5s
/docommand /${cmdChannel} /nav wp camp${_campNumber}
/delay 60s !${Navigation.Active}
} else {
/call clearNavStuck
}
:resume
/call setCamp
/return
Sub setRSTVars
/varset bln_validTGT FALSE
/varset bln_TGTDead TRUE
/varset bln_TGTLocal FALSE
/alert clear 3
/target clear
/return
Sub setTGTAlert
/echo setTGTAlert ${Target.ID} ${Target.Name}
/alert add 3 id ${Target.ID}
/keypress esc
/return
|**
----------------------------
getTarget
----------------------------
Checks to see if there are any mobs within camp, if so, it targets them indiscriminately
otherwise, it attempts to target a NPC that does not fall in the alert list
Calls chkTargetValid once a target has been found, if that returns as valid, it continues
----------------------------
**|
Sub getTarget
/echo getTarget
/if (${Me.Sitting}) /sit off
/if (${Zone.ShortName.Equal[${zoneRequest}]}) /return
:acquireLoop
/call setRSTVars
/squelch /target clear
/call chkLDONCompletion
/if (!${inMission} || !${haveMission}) /return
|----------USE THIS FOR HUNTER (ALERT 2) and IGNORE ALERT 1, 3 --------
/if (${SpawnCount[npc radius ${int_campRadius} zradius 25]} > 0) {
/echo NPC in camp, killing
/target npc range ${int_minTLevel} ${int_maxTLevel} radius ${int_maxRadius} noalert 1
/delay 5
} else /if (${SpawnCount[npc alert 2 radius ${int_alert2Radius} range ${int_minTLevel} ${int_maxTLevel}]} > 0) {
/echo NPC on alert 2 is up, killing
/target npc alert 2
/delay 5
} else /if (${SpawnCount[npc alert 2 radius ${int_alert2Radius} range ${int_minTLevel} ${int_maxTLevel}]} == 0 && ${SpawnCount[npc noalert 1]} > 0) {
/echo No NPCs on the alert 2 list are up, trying random NPC
/target npc range ${int_minTLevel} ${int_maxTLevel} radius ${int_maxRadius} noalert 1
/delay 5
} else {
/echo no NPCs around, delaying 1m
/delay 1m
/goto :AcquireLoop
}
/if (${Target.ID} && (${Target.Distance} <= ${int_campRadius})) {
|--if it is close, its valid;
/varset bln_validTGT TRUE
} else {
|--check the target
/if (${Target.ID}) /call chkTargetValid
}
|--restart
/if (!${bln_validTGT}) {
|-- if there is more than 1 camp in our dataset, we can start walking through the camps
/if (${int_campCount} > 1) {
/echo Checking on moving the camp
:MoveCamp
/if (${int_currentCamp} < ${int_campCount}) {
/varcalc int_currentCamp ${int_currentCamp} + 1
} else {
/varcalc int_currentCamp ${int_currentCamp} - 1
}
/echo Moving Camp to ${int_currentCamp}
/call moveCamp ${int_currentCamp}
/delay 10
} else {
/echo no valid target delaying 5s
/delay 5s
}
/goto :acquireLoop
}
|--target is valid, continue
/varset int_targetID ${Target.ID}
/varset bln_TGTDead FALSE
/varset int_distTGT ${Int[${Target.Distance}]}
/echo \awAcquired \ag${Target.Name} \awat range \ag${Int[${Target.Distance}]} \awkilled: (\ag${int_killCount}\aw)
/return
|**
----------------------------
chkTargetValid
----------------------------
Checks to see if the current target passes the criteria
If it is a valid target, bln_validTGT is assigned TRUE
Returns to getTarget
----------------------------
**|
Sub chkTargetValid
/echo chkTargetValid ${Target.Name}
/if (${Target.Type.NotEqual[NPC]}) /return
|--check to see if its a corpse
/if (${Target.Name.Find['s_corpse]}) {
/echo \arINVALID \awTarget is a corpse!
/call setTGTAlert
/return
}
|--check if there is a path to the target
/if (!${Navigation.PathExists[target]}) {
/echo \arINVALID \awNo Path to Target
/call setTGTAlert
/return
}
|--check my target is the apropriate level
/if ((${Target.ID}) && (${Target.Level} < ${int_minTLevel})) {
/echo \arINVALID \awTarget too low of a level
/call setTGTAlert
/return
}
/if (${Target.Underwater}) {
/echo \arINVALID \awTarget is underwater
/call setTGTAlert
/return
}
|--check my target is the above the apropriate z-radius floor
/if ((${Target.ID}) && ${Int[${Target.Z}]}<${int_minZHeight}) {
/echo \arINVALID \awTarget below z floor
/call setTGTAlert
/return
}
|--check my target is the above the apropriate z-radius ceiling
/if ((${Target.ID}) &&${Int[${Target.Z}]}>${int_maxZHeight}) {
/echo \arINVALID \awTarget below z ceiling
/call setTGTAlert
/return
}
/varset bln_validTGT TRUE
/return
|**
----------------------------
pullTarget
----------------------------
Checks to see if we need to pull target, if so, then we initiate the pulling mechanism
and then once aggro is established, drags the mob back to camp to be killed
Calls AggroTarget
Calls makecamp return
Returns to mainLoop if a valid pull has been achieved
----------------------------
**|
Sub pullTarget
/echo pullTarget ${bln_validTGT}
/declare campDist int local
/declare dist int local
|--check to see if we have a valid target, or skip
/declare attempt int local 0
:pullLoop
/if (!${bln_validTGT}) /goto :return
/if (!${Target.ID}) /goto :return
/if (${Target.Type.NotEqual[NPC]}) /goto :return
/if (${Target.Name.Find['s_corpse]}) /goto :return
| Start the pull by running to the target
:RunningToTarget
/if (${Navigation.PathExists[target]}) {
/if (!${Navigation.Active}) /navigate target
/delay 15
} else {
/call clearNavStuck
/goto :RunningToTarget
}
| Target in LOS, and in distance, going to aggrocheck
/if (${Target.LineOfSight} && ${Target.Distance3D} < ${int_castDistance}) {
/echo \a-w Target in LOS, and in distance, going to aggrocheck
/goto :AggroCheck
}
| Target has me as aggrod, and in range, going to returnWithPull
/if (${Me.TargetOfTarget.Name.Equal[${Me.Name}]} && (${Target.Distance3D} < ${int_castDistance})) {
/echo \a-w Target has me as aggrod, and in range, going to returnWithPull
/goto :ReturnWithPull
}
| Too many attempts, returnwithpull
/if (${attempt} > 10) {
/echo \a-w Too many attempts, returnwithpull
/alert add 1 "${Target.ID}"
/target clear
/goto :ReturnWithPull
}
/if (!${Target.ID}) /goto :return
|-- check to see if I have aggro
:AggroCheck
/if (!${Me.TargetOfTarget.ID} && ((${Me.XTarget} <= ${int_maxPullCount}))) {
:AggroDistCheck
| Am I close enough to aggro?
/if (${Target.Distance3D} > 200) /goto :RunningToTarget
/if ((${Target.Distance} < ${int_castDistance}) && ${Target.LineOfSight}) {
| I am close enough, call aggro sub.
/echo \ao Attempting to Aggro Target
/call AggroTarget
/varcalc attempt ${attempt} + 1
/echo \aoAggro Attempt return ${Macro.Return}
/if (${Macro.Return.Equal[FAILED]}) /goto :AggroCheck
/if (${Me.TargetOfTarget.Name.Equal[${Me.Name}]}) /goto :ReturnWithPull
/if (${Macro.Return.Equal[NOLOS]}) /goto :RunningToTarget
/if (${Macro.Return.Equal[CAST_FIZZLE]}) /goto :AggroCheck
/if (${Macro.Return.Equal[NOTARGET]}) /goto :return
/if (${Macro.Return.Equal[NOMANA]}) /goto :RunningToTarget
/if (${Macro.Return.Equal[SUCCESS]}) {
/doevents NoLoS
/if (${bln_noLOS}) {
/varset bln_noLOS FALSE
/goto :RunningToTarget
} else {
/goto :ReturnWithPull
}
}
} else {
/goto :RunningToTarget
}
} else {
| I have aggro, returning to camp
:ReturnWithPull
/echo \agReturning to Camp with \ay${Me.XTarget}+ \agmobs.
/if (${Navigation.PathExists[waypoint camp${int_currentCamp} ]}) {
/navigate waypoint camp${int_currentCamp}
} else {
/call clearNavStuck
}
/goto :ReturnLoop
:ReturnLoop
/delay 10
/varcalc dist ${Math.Distance[${Me.Y},${Me.X},${Me.Z}:${D1Y},${D1X},${D1Z}]}
/if (${dist} < ${pulltocamp}) /nav stop
/if (${Navigation.Active}) /goto :ReturnLoop
}
:return
/return
Sub AggroTarget
/if (${Navigation.Active}) /navigate stop
/declare ret string local FAILED
:TargetAggroCheck
/if (!${Target.ID}) {
/varset ret NOTARGET
} else /if (!${Target.LineOfSight}) {
/varset ret NOLOS
} else /if (${Me.TargetOfTarget.Name.Equal[${Me.Name}]}) {
/varset ret SUCCESS
} else {
| Need to aggro the mob somehow
:AttemptAggro
/if (${strPullType.Equal[RANGED]}) {
/face fast
/delay 5
/ranged
/doevents TooClose
|-- Sometimes if we aren't spell casting and using range weapons we might be too close, and cannot hit them with it.
/if (${bln_tooClose}) {
/echo Too Close! Handling
/if (${Me.Class.ShortName.Equal[PAL]}) /call MQ2Cast "${spell_pull}" ${spell_pullGem} 2s
/if (${Me.Class.ShortName.Equal[WAR]}) /call chk_warProvoke "${war_ca_hate_1}"
/delay 1
/if (${Me.AbilityReady[Taunt]}) /doability Taunt
/varset bln_tooClose FALSE
/goto :TargetAggroCheck
}
/delay 10
/goto :TargetAggroCheck
} else {
/if (${Me.PctMana} > 10) {
/call chkSpellMemorized "${spell_pull}" TRUE ${spell_pullGem}
/echo \awReady?\ag${Me.SpellReady[${spell_pull}]} \awCasting \ag"${spell_pull}" \ap${spell_pullGem} \aw2s
/call MQ2Cast "${spell_pull}" ${spell_pullGem} 2s
/doevents NoLOS