Based on your existing code it -should- get the mob with the shortest pull path, which would drastically reduce the chance of this occuring in the first place. However, in my pull.mac that I use personally I have it set to return to camp in the event I have an XTarget (be it I gain aggro myself, or the group gains aggro). While not the answer you were looking for I do hope it aquires the same expected results. Alternately, while on your pull path you could have a new radius check for mez/lull targets using ${NearestSpawn[1,npc radius ## Zradius ## noalert # los].Distance} < ${Spell[mezspell].Range} type situation then break out of the loop. and target the same NearestSpawn String, cast the spell.
| --------------------------------------------------------------------------------------------
| SUB: TargetShortest
| --------------------------------------------------------------------------------------------
Sub TargetShortest
/declare PullTargetID int local 0
/declare TargetDistance[20] int local 0
/declare Shortest
/squelch /target clear
/if (!${Me.XTarget[1].ID}) {
/declare i int local 0
/for i 1 to 20
/if (${NearestSpawn[${i},npc noalert 1 radius ${PullRange} zradius ${ZRange}].Name.NotEqual[NULL]}) {
/declare Target${i}ID int local 0
/if (${Navigation.PathExists[id ${NearestSpawn[${i},npc noalert 1 radius ${PullRange} zradius ${ZRange}].ID}]}) {
/varset TargetDistance[${i}] ${Int[${Navigation.PathLength[id ${NearestSpawn[${i},npc noalert 1 radius ${PullRange} zradius ${ZRange}].ID}]}]}
/varset Target${i}ID ${NearestSpawn[${i},npc noalert 1 radius ${PullRange} zradius ${ZRange}].ID}
} else {
/varset TargetDistance[${i}] 500000
}
/if (${i}==1) {
/varset PullTargetID ${Target${i}ID}
/varset Shortest ${TargetDistance[${i}]}
/continue
}
/echo (${TargetDistance[${i}]} < ${Shortest})
/if (${TargetDistance[${i}]} < ${Shortest}) {
/varset PullTargetID ${Target${i}ID}
/varset Shortest ${TargetDistance[${i}]}
/echo Closest Target is now ${Spawn[id ${Target${i}ID}].Name}
}
}
/next i
/target id ${PullTargetID}
/delay 2s ${Target.ID}
/if (!${Target.ID} || !${PullTargetID}) {
/if (${UseMQ2Nav}) {
/call TargetShortest
} else {
/call TargetNPC
}
} else /if (!${Target.Type.Equal[NPC]}) {
/squelch /target clear
/if (${UseMQ2Nav}) {
/call TargetShortest
} else {
/call TargetNPC
}
}
/if (${PullTargetID}) /call ${getMob}
} else /if (!${Target.ID} || ${Target.Type.Equal[corpse]}) {
/target id ${Me.XTarget[1].ID}
/if (!${Target.Type.Equal[corpse]} && !${Target.Type.Equal[NULL]}) {
/delay 2s ${Target.ID}
/echo \arHandling Add, ${Target.Name}
/call ${returnWait}
}
/if (${UseMQ2Nav}) {
/call TargetShortest
} else {
/call TargetNPC
}
}
/return
Above is the code I use for selecting a target.
And below is the code I use to determine if I should stay inside the wait loop while navigating to the target.
:GettingMobNav
/if (${Navigation.Active} && ${Target.ID} && ${Target.Type.Equal[NPC]} && ${Target.Distance} > ${Me.MaxRange} && !${Me.XTarget[1]}) {
/delay 5
/goto :GettingMobNav
While I realize that the wait loop is pretty premitive compared to a macro like KA, I like to keep my situations pretty premitive.
In this case if I get an XTarget then it breaks the wait and moves to the "getMob" sub. You could add the check in that bit where it searches for a spawn within xx radius/zradius based on expected aggro range to allow you to cast the pacify/mez spell.
Alternately you could check ${NearestSpawn[1,npc a;sldkfjas].Heading} and compare it to your heading. While not all inclusive using that method (because the nav path could turn) it would be somewhat helpful to detection. IE: /if (${Math.Calc[${NearestSpawn[1, npc radius 70 zradius 70 noalert #].Heading}-${Me.Heading}]} I'm pretty sure there is an option for range between to check an arc in front of you.
If you're into calculus you could check if the mob is moving, and if so check their speed versus your heading and speed and see if the path will intersect etc.
As far as a way to pass the path's checkpoints from nav, not that I'm aware of.