• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - Does MQ2 provide state BEING HIT vs aggro pct?

AmericanNero

Seasoned veteran member
Joined
Oct 13, 2020
RedCents
4,709¢
Ive been poring over whatever docs I can find on mq2 (YES I am rtfm as best I can), and don't see a state var that indicates a group member / spawn is being hit, whether it be spell or melee, and by what. E.g. MA monitoring whether other group member being hit, then able to change target to gain agro.
 
No expert on MQ2 here. But I have some idea of what you are trying to do. While I suppose some form of event could be used to monitor for hits, it seems like an odd way to do it.

Not exactly what you were looking for, but my thought would be to cycle through all spawns on XTarget. For each NPC spawn, check its target. If the target is not yourself then the mob has aggro on someone else. As to what to do about it, that would depend on a number of things - how far away? is it mezzed? do you have an AoE aggro ability?
 
mq2melee has ${Melee.XTaggro} This will report true if you have aggro on everything on xtarget or false if you do not i believe. If you dont use mq2melee you can do it in a macro yourself using ${Me.XTarget[1].PctAggro} and cycle through all 13 slots. While this does not tell you someone is getting hit it does tell you that your tank does not have aggro on everything so if someone is getting hit its likely from something on xtarget that's not 100% on you.
 
Took me a few days to see how its done. KA establishes event GotHit which triggers when eq messages like ...bashes you .... are seen. This results in a message "I got hit by >>${AttackingMob}<< ID: ${AttackingMobID}". The basics are there in KA for a tank / offtank to switch targets to taunt it. Since the KA clients are asynchronous, a message could be broadcast via EQBC to pick up the loose mob. Progress!
 
The following modifications to kissassist did what I needed. It allows the MA and offtank to corral any loose mobs as long as the caller is connected to eqbc.

1) Add a new bind:

[CODE title="New Bind"]#bind GetLooseMob /getloosemob[/CODE]

2) At the end of Sub Event_GotHit, find the final } and replace only that with (dont overwrite the last two lines):

[CODE title="Modification to Event_GotHiT"]
} else {

/varset MyTargetID 0

/varset MyTargetName

/if (${Target.ID}) /squelch /target clear

/varset WaitTimer 0s

/varset AttackingMobID ${NearestSpawn[npc radius 39 targetable "${AttackingMob}"].ID}

/if (${Spawn[${AttackingMobID}].ID}) {

/moveto dist 10

/call Broadcast y "Mob >>${AttackingMob}<< (${AttackingMobID}) attacking me! "

/bcga //getloosemob ${AttackingMobID}

}

}
[/CODE]

3) And finally, add sub:

[CODE title="New Sub Bind_GetLooseMob"]
| ----------------------------------------------------------------------------

| SUB: Event GetLooseMob - Written by American Nero

| Considerations 1: MA changes target, unless on a named

| 2: MA changes target and stays on target

| Not implemented 3: MA changes target and then after an interval goes back to previous target

| 4: OT changes target and stays on target

| Not implemented 5: OT changes target and then after an interval goes back to previous target

| ----------------------------------------------------------------------------

Sub Bind_GetLooseMob(AttackingMobID)

/if (!${AttackingMobID}) /return



/if (!${IAmMA} || !${Role.NotEqual[offtank]}) /return

/if (${Target.ID}==${AttackingMobID}) /return

/if (${Target.Named} && ${IAmMA}) /return



/declare PrevTargetID int local

/declare PrevTargetName string local

/declare PrevAggroTargetID2 int local



/varset PrevTargetID ${MyTargetID}

/varset PrevTargetName ${MyTargetName}

/varset PrevAggroTargetID2 ${AggroTargetID2}



/varset AggroTargetID2 ${AttackingMobID}

/squelch /target id ${AttackingMobID}

/delay 10 ${Target.ID}==${AttackingMobID}

/varset MyTargetID ${Target.ID}

/varset MyTargetName ${Target.CleanName}

/if (${Me.Pet.ID} && ${Math.Distance[${Target.Y},${Target.X}:${Me.Pet.Y},${Me.Pet.X}]}<=${PetAttackRange}) /pet attack



|Sanity check... should I go back to previous target?

/if (${Target.Mezzed.ID} || (${Spawn[${MyTargetID}].Type.Equal[Corpse]} || !${Spawn[${MyTargetID}].ID})) {

/varset AggroTargetID2 ${PrevAggroTargetID2}

/squelch /target id ${PrevTargetID}

/delay 10 ${Target.ID}==${PrevTargetID}

/varset MyTargetID ${Target.ID}

/varset MyTargetName ${Target.CleanName}

/if (${Me.Pet.ID} && ${Math.Distance[${Target.Y},${Target.X}:${Me.Pet.Y},${Me.Pet.X}]}<=${PetAttackRange}) /pet attack

/return

}



/call BroadCast y "Grabbed mob >>${Spawn[${AttackingMobID}].Name}<< (${Spawn[${AttackingMobID}].ID}) "

/return[/CODE]
 
Last edited:
Interesting code, for an interesting situation.


You've had some adventures and encountered a scenario and looking to resolve it yourself.
I applaud your efforts and enthusiasm to get stuck in and wrestle with code! Great stuff! :D




I would like to make one line of observation for you.
[CODE title="Get Loose Mob codes for KA " highlight="10"]} else {
/varset MyTargetID 0
/varset MyTargetName
/if (${Target.ID}) /squelch /target clear
/varset WaitTimer 0s
/varset AttackingMobID ${NearestSpawn[npc radius 39 targetable "${AttackingMob}"].ID}
/if (${Spawn[${AttackingMobID}].ID}) {
/moveto dist 10
/call Broadcast y "Mob >>${AttackingMob}<< (${AttackingMobID}) attacking me! "
/bca //getloosemob ${AttackingMobID}
}
}[/CODE]

Are you really wanting to broadcast to everyone connected to the EQBCS to run that code, /getloosemob ${AttackingMobID} ?
For a group only instruction (exclude yourself), its /bcg
For all connected (exclude yourself), as you've used its /bca
Both calls to include yourself have an additional 'a', i.e. /bcga /bcaa.


I mention the importance of this as there are members in the community that run more than a group on a computer and perhaps are doing things concurrently in different zones.

e.g. Another group doing KA activities away from where your protagonist is fighting a loose mob, they will be given instruction to randomly engage some innocent mob.
Accepting the new code has some opening fail fasts in there (great to see!), so only the tank will consider these new orders.


Looking more at the next bit of code, from the view of a tank in a random 2nd+ group.

[CODE title="more codes" highlight="2"]/varset AggroTargetID2 ${AttackingMobID}
/squelch /target id ${AttackingMobID}
/delay 10 ${Target.ID}==${AttackingMobID}
/varset MyTargetID ${Target.ID}
/varset MyTargetName ${Target.CleanName}
/if (${Me.Pet.ID} && ${Math.Distance[${Target.Y},${Target.X}:${Me.Pet.Y},${Me.Pet.X}]}<=${PetAttackRange}) /pet attack

|Sanity check... should I go back to previous target?[/CODE]


If the 2nd group is in the same zone but another camp spot, their tank will have just become very interested in the 1st groups mobs, at least by targeting it, regardless of distance.

If the 2nd group tank is in a different zone, that instruction to target could be giving an ID,
  • it might not exist as a valid ID.
  • it could be something from anywhere in the zone,
    • A nearby guard?
    • A target 1000s of feet away?






Stepping further away, I've read over the code a couple more times from a high level to try and grasp a feel for the problem you're trying to battle.

It feels that the flow is of the ilk; there has been an aggro problem detected, as mob is playing whack-a-groupie. The tank is directed to abandon wacking on it's current (trash) mob and focus on the new one to gain aggro.

Perhaps the group has no active CC in the party and so keeping aggro towards the tank, away from healer (working overtime) and the dps.
But then what if there is a CC, a couple partially chewed up mobs now exist. Many KA rules for mez say don't do it if go below a certain percentage so the CC won't try and lock down extra mobs.

If the scenario were considered some fresh spawns appear in an ongoing fight. It's a race condition of the KA codes, does the CC or Tank react first. I feel the CC is on the back foot having to react, target and cast mez successfully to get in their first and negate the tank engaging.
The CC may now be considering options what to do with the initial mob the tank has just switched away from. It's hp may be high enough for a mez to be attempted, but it may be loaded with dots.



This idea of loose mobs, it feels a right pickle onion, the more I think about it, and peel back layers of scenarios, the game of chess, what if this, then this happens.


As players we know if we have a CC awake and should be doing things.
Similar we know that if aggro wanders, we can click targets, taunt or cast non-damage hate raising spells and click back where we were, repeating as necessary. This allowing the CC to step in if they can. DPS not switching target.
Or go more drastic action and move to the target and go wack-a-mob on it instead (perhaps some mez immune mobs arrive, and the CC is screaming!) and the DPS do switch, perhaps or finish chopping down that first one.
We can arbitrate the risk of hp damage, multiple mobs on the tank versus one or two wild for a little time, can it be handled by the groupie rather than risk over damage the healer can't cope with on the tank.

There are likely more options than fingers n toes to count on of possible scenarios.
I feel its a big task to try and code to handle it with a view of covering most scenarios.




Regards and Best Wishes
 
I agree with your assessment. Thank you! I noticed the missing "g", should have been bcga. The challenge with these asynchronous mq macro threads is all about decisions and timing. I play with a variety of characters, and depending on whether I know I'm going into areas with lots of mezzable adds, I use my enchanter. Otherwise I can use my shaman. Even with an enchanter present, CC is regularly broken. If I had to put a guess on it, I think the DPSInterval is where I'd look.

One thought- If there was a mez class, with >1 mob, then there could be a temporary increase to dpsinterval (aside from taunts and non-dot debuff). Also, in my own playing, I will have mobs coming in, and the first thing I do is mez and immediately slow, so that if a mob does break, its effect is mitigated.
 
Question - Does MQ2 provide state BEING HIT vs aggro pct?

Users who are viewing this thread

Back
Top
Cart