- Joined
- Dec 10, 2016
- RedCents
- 3,125¢
Hello Everyone! Here is a pretty simple and straight forward macro I made for my ShadowKnight. This is still very much a work in progress. I need to find a better way to head to x,y,z's as it kind of freaks out when leashing sometimes. I will be looking into MQ2AdvPath and see if it has a goto function at some point.
Rich (BB code):
|------------------------------------------------------------|
| TankPull.mac
|
| Last Modified by: TheDroidUrLookingFor
|
| Version: 1.0
|
|------------------------------------------------------------|
#turbo
|------------------------------------------------------------|
| Includes
|------------------------------------------------------------|
#include spell_routines.inc
#define CASTMODE "cast"
|#include MQ2Cast_Spell_Routines.inc
|#define CASTMODE "MQ2Cast"
#include advpath.inc
#include advpath2.inc
|------------------------------------------------------------|
| Events
|------------------------------------------------------------|
|------------------------------------------------------------|
| Defines
|------------------------------------------------------------|
#define CHATMETHOD "/if (${ShowDebug}) /bc"
#define CHATMETHOD1 "/echo"
#define CHATMETHOD2 "/t"
|------------------------------------------------------------|
| Main Rountine
|------------------------------------------------------------|
Sub Main
/call Declares
:MainLoop
/if (!${Me.Standing}) /stand
/if (${Me.Ducking}) /stand
/call KillAllNear
/if (${Math.Distance[${AnchorY},${AnchorX}]}>${AnchorRadius}) /call ReturnToAnchor
/delay 5
/goto :MainLoop
/return
|------------------------------------------------------------|
| End Main Rountine
|------------------------------------------------------------|
|------------------------------------------------------------|
| Declare Rountine
|------------------------------------------------------------|
Sub Declares
|-----------Ranges--------------------------------------------|
/declare AnchorRadius int outer 20
/declare AggroRadius int outer 160
/declare ZAggroRadius int outer 7
/declare AttackAtDistance int outer 20
/declare PullSpell string outer Terror of Narus Rk. II
|-----------Internal------------------------------------------|
/declare icount int outer
/declare AnchorY string outer ${Me.Y}
/declare AnchorX string outer ${Me.X}
/declare AnchorZ string outer ${Me.Z}
/declare AnchorHeading string outer ${Me.Heading.Degrees}
|-----------AdvPath-------------------------------------------|
/call InitAPFVars 1 15 20
|------------------------------------------------------------|
/return
|------------------------------------------------------------|
| End Declare Rountine
|------------------------------------------------------------|
|------------------------------------------------------------|
| Other Rountines
|------------------------------------------------------------|
Sub KillAllNear
:FindTarget
/if (${Math.Distance[${AnchorY},${AnchorX}]}>${AnchorRadius}) /return
/if (${SpawnCount[npc radius ${AggroRadius} zradius ${ZAggroRadius}]} > 0) {
/squelch /target clear
/delay 5 !${Target.ID}
/target ${NearestSpawn[npc radius ${AggroRadius} zradius ${ZAggroRadius}]}
/delay 5 ${Target.ID}
/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<${AggroRadius} && ${Target.LineOfSight}) /goto :LockedOn
/goto :FindTarget
} else {
/return
}
:LockedOn
/if (${Math.Distance[${AnchorY},${AnchorX}]}>${AnchorRadius}) /return
/call CheckAggro
/if (${Target.Type.Equal[NPC]} && ${Target.Distance}>=20 && ${Target.LineOfSight}) /call CASTMODE "${PullSpell}" gem4 6s
/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=${AggroRadius} && ${Stick.Status.Equal[OFF]} && ${Me.Combat} && ${Target.Type.Equal[NPC]} && ${Target.Distance} <= ${AttackAtDistance}) /stick moveback 10
/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=${AggroRadius} && !${Me.Combat} && ${Target.Type.Equal[NPC]} && ${Target.Distance} <= ${AttackAtDistance}) /attack on
/if (!${Target.Type.Equal[NPC]} || !${Target.ID}) /goto :FindTarget
/goto :LockedOn
/return
Sub CheckAggro
/declare i int local 1
/for i 1 to ${Me.XTarget}
/if (${Me.XTarget.PctAggro}<100 && ${Me.XTarget.ID}!=0) /target ${Me.XTarget.ID}
/next i
/return
Sub ReturnToAnchor
CHATMETHOD1 Dist to Anchor: ${Math.Distance[${AnchorY},${AnchorX}]}
CHATMETHOD1 Anchor Radius: (${AnchorRadius})
/if (${Math.Distance[${AnchorY},${AnchorX}]}>${AnchorRadius}) {
CHATMETHOD1 Headed back to Anchor. (${Math.Distance[${AnchorY},${AnchorX}]})
/squelch /stick off
/squelch /call GotoFunction ${AnchorY} ${AnchorX} ${AnchorZ}
:LoopTilThere
/if (${PathingFlag}==1) {
/call AdvPathPoll
/delay 5
/doevents
/goto :LoopTilThere
}
}
/return
|------------------------------------------------------------|
| End Other Rountines
|------------------------------------------------------------|
|------------------------------------------------------------|
| Events
|------------------------------------------------------------|
|------------------------------------------------------------|
| End Events
|------------------------------------------------------------|

