• 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
Resource icon

Release MQ2WorstHurt

Redbot

💻❤️
Moderator
Joined
Oct 15, 2004
RedCents
104,068¢
Pronouns
He/Him
This plugin was made by alynel, paid for by toots.

In short the plugin replaces the forloops to find the worsthurt member of your party, xtar list or pet. You call the TLO with the parameters and it returns a spawns name, which can be manipulated for any usage.

For example, this is all the code I have in my kiss mods to handle all single target healing, and it covers a full xtar list, party members and pets. It is incredibly fast.

Rich (BB code):
/if ((${Spawn[${WorstHurt[both,1,200,TRUE]}].Type.NotEqual[Pet]} && ${Spawn[${WorstHurt[both,1,200,TRUE]}].Type.NotEqual[Corpse]} && ${Spawn[${WorstHurt[both,1,200,TRUE]}].PctHPs} <= ${Math.Calc[${${Spawn[${WorstHurt[both,1,200,TRUE]}].Class.ShortName}Point}*.${tmpHealOverride}]}) || (${Spawn[${WorstHurt[both,1,200,TRUE]}].Type.Equal[Pet]} && ${Spawn[${WorstHurt[both,1,200,TRUE]}].Type.NotEqual[Corpse]} && ${Spawn[${WorstHurt[both,1,200,TRUE]}].PctHPs} <= ${Math.Calc[${PetPoint}*.${tmpHealOverride}]})) {
		/call newSingleHeal "${Spawn[${WorstHurt[both,1,200,TRUE]}].CleanName}" "${Spawn[${WorstHurt[both,1,200,TRUE]}].Type}" ${Spawn[${WorstHurt[both,1,200,TRUE]}].PctHPs} 1 G
	}


Below is the usage.

Code:

Rich (BB code):
${WorstHurt[<group|xtarget|both>,<n>,<radius>,<includePets>]}

It will default to both, n = 1, radius = 999999, and includePets = TRUE. So the following are all the same:

Rich (BB code):
${WorstHurt[both,1,999999,TRUE]}
${WorstHurt[both,1,999999}
${WorstHurt[both,1]}
${WorstHurt[both]}
${WorstHurt}

Parameter ordering can be whatever you like, the more often it'll be changed from the default the further to the left it should be to make the macro lines shorter. If you think you're more likely to want to change includePets than radius, for example, they could be swapped.

It returns a spawn type, so you'll have access to all the usual spawn members. Basically if you can do ${Spawn[whatever].Something}, you can do ${WorstHurt.Something}. Class.ShortName will be fine

Discussion here:
https://www.redguides.com/community/threads/66264-MQ2WorstHurt-discussion
 
Last edited:
This looks sweet. Is this going to be added to the Vanilla compile? If so, any chance you could provide some of your mods in a .inc file?
 
I have a question about the n parameter, just not clear to me. I'm assuming n is list position among the spawns on worsthurt? So if I want a least 3 people below a certain hp before using a group heal I could do ${WorstHurt[both,3,100,FALSE].PctHPs}<70? and bypass checking every group member since position 1 and 2 would already both be at that or below? If that's the case...Awesome, thank you!
 
Take it this is a MQ2NetHeal upgrade?

netheal to me was a nogo as the macro version did a better job, and Netheal would swamp EQBC. But I havent reactivated it since the EQBC upgrades.

How does this plugin handle the annoying "stuck hp" glitch that happens at times, requiring you to target X group member to fix? (which one assumes will get fixed when soandso heals, just curious if it has issues with it is all)

Looks like it would be a nice upgrade, taking some of the load off the macro side of things =)
 
Ihc that should work, but hurtmembers would do that as well. The 3 returns the name of the third worst hurt person of your search. Bth indicates xtar, group, and pets.

Warlock, I've been running it in my macro pretty successfully. However, let me know if you hit any bugs.
 
If the tank is on 20% and a dps is on 15%, will the healer heal the dps first? I like the sound of it being fast but I would want the healer will give priority to the tank. Although if the non tank heals were all fast group heals, I think this would probably be best.
 
It will return the lowest hp person, but you can control healing the tank first in the macro. The plugin doesn't actually do any healing, it just replaces the checkhealth type for loops in macros.
For example, I use this in my kiss mods for my cleric (this is what the cleric checks during combat). So I always check the cleric and MTs health before checking any other classes health.

Rich (BB code):
/if (${Spawn[${MainAssist}].Type.NotEqual[Corpse]} && ${Spawn[${MainAssist}].PctHPs} <= ${Math.Calc[${${MainAssistClass}Point}*.${tmpHealOverride}]}) {
		|/call newSingleHeal "${MainAssist}" "${MainAssistType}" ${Spawn[${MainAssist} ${MainAssistType}].PctHPs} 6 G
		/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
				/call BroadCast ${IRCOn} ${EQBCOn} o "${HealSpell} for >>${Spawn[${SHealName} ${SHealType}].CleanName} << cast on ${Spawn[${MyTargetID}].CleanName}"
				/return
		}
	} else /if (${AutoRezOn} && !${Spawn[${MainAssist} ${MainAssistType}].ID} && ${Select[${MainAssistType},Mercenary,Pet]}==0) {
		/call CastWhat "${AutoRezWith}" ${Spawn[${MainAssist}'s corpse].ID}
	} else /if (${Select[${Me.Class.ShortName},BST,CLR,SHM,DRU,PAL]} && ${Group} && ${Group.Injured[80]} > 1) {
		/call DoGroupHealStuff ${Group.AvgHPs}
	} else /if (${Spawn[${WorstHurt[both,1,200,TRUE]}].PctHPs} <= ${Math.Calc[${${Spawn[${WorstHurt[both,1,200,TRUE]}].Class.ShortName}Point}*.${tmpHealOverride}]}) {
		/call SingleHeal "${Spawn[${WorstHurt[both,1,200,TRUE]}].CleanName}" "${Spawn[${WorstHurt[both,1,200,TRUE]}].Type}" ${Spawn[${WorstHurt[both,1,200,TRUE]}].PctHPs} 1 G
		|(${Group.Member[${i}].Distance}<=200&& ${Group.Member[${i}].PctHPs}<100 && !${Group.Member[${i}].Hovering} && ${Group.Member[${i}].Type.NotEqual[Corpse]})
	} else {
		/if (${CuresOn}) /call CheckCures   
		/if (${CombatStart} && (${Spawn[${MyTargetID}].Type.NotEqual[Corpse]} || ${Spawn[${MyTargetID}].ID} || !${Me.Feigning})) {
			/if (${DPSOn} && (!${Role.Equal[puller]} || !${ChainPull})) /call newcombatcast
		}
	}
 
That's awesome, it is exactly what a good cleric should do. Tank and self preservation first, then keep others alive. Thanks for this.
 
Okay I like anything that will keep my fluffy tank up 8) .. I am not great at this program yet and I try not to play with it too much cause I don't understand all the programming side and how all the stuff works. so when I click select all on redbots script what folder do I put it in as to make it work?? Thanks
 
Probably not for you quite yet. That is just a snipet of code I use in some of my macros. It will not run on its own.
 
would you be so kind as to add it to the discussion here so I can load it up and try please.
 
Does this conflict with KA/IHCcleric/ if i'm running those macros or just helps them? What about MQ2Heal2 if that is loaded as well (turned off while running KA/IHC).
 
Seems when you put a pet on Xtarget list, and then the TLO ${WorstHurt[xtarget,1,999999,TRUE]} seems somehow borked.

It will only returns yourself or a pc instead of the pet name.

@alynel @toots
 
k, So poking this with a stick briefly since someone brought it to my attention.

For XTarget's
1556641217825.png

using SPECIFIC_PC identifier.

Below is the list of options to choose from. So you have MY_PET and MY_PET_TARGET, but doesn't appear to be anything specific to PCPET
1556641264454.png

With that said, you're saying that adding the pet to the XTarget references the PC (owner of the pet? or the result is random?)

Sadly this is about where my understanding hits a hard stop.

I look at the AddSpawn function, which doesn't even -really- look like a function the way I'm used to seeing them.

1556644043630.png
1556644069923.png

So what I'm gathering from this is that a multimap which holds two values (a pair) one of which is a float, and another which is a PSPAWNINFO), is defined and called spawns

then when the auto AddSpawn = bleh bleh bleh lamda function (least that's what we called it in java when you created a function like that, not sure what it'd be called in C++) is called, it does the above things.

Based on how I'm reading that function:
make sure a valid PSPAWNINFO and the distance of the pSpawn is within the radius defined, if not leave the function without doing anything (base case)
Loop through the existing spawns in the list and make sure it doesn't already contain the pSpawn we're trying to pass it. if it does leave the function without doing anything (base case)
Some fancy stuff specific to users who are using the builder?? Didn't even bother reading it since we don't have that defined.
Define an MQ2VARPTR called varPtr and initialize to null.
Define an MQ2TYPEVAR called ret and initialize it to null.
assign the value of the parameter pSpawn to the varPtr variable
Sanity checks - get the pSpawnType member Type from the pSpawn (varPtr) and put it's value in ret var and if it's not valid OR a comparison of strings is not the same (it's not a Pet) and it's not a PC leave without doing anything else.
another sanity check - make sure it has some health - if not leave without doing anything......but if it does have health add the health of the mob as the float and the pSpawn itself as a paired list to spawns
then, if I want to include pets. I want to get the pSpawnType's member "Pet" of the varPtr (pSpawn) and set it's return value into ret variable
and if the ret value is NOT PetSpawn (meaning if there is a pet according to the comment)
then set the varPtr as the ret variable's value (Snippet of code for Pet member below)
1556645005025.png

So at this point it would have either assigned it the address of PetSpawn with PetSpawn.Name being set to "NO PET" or it would have got the pSpawn->PetID So if it was actually a pet, then ret would have been set to the PetID (meaning it wouldn't be &PetSpawn)

Now the varPtr.Ptr is an ID (assuming it was a pet) <~This could be the issue??
So we now check to see there is no type, or if the type is not a pet, then we want to stop and leave the function now.

otherwise if the pet has health (PctHPs) then put the health in the ret.
now we want to insert the spawn into Spawns.insert as a pair of the ret variable (their health?) and the varPtr.ptr as the PSAPWNINFO....but wait a minute....isn't the varPtr.Ptr the Pet's ID and no longer it's PSPAWNINFO??


I have pretty limited knowledge of the TLO's (which is why none are currently available in MQ2BerZerker and I only managed to squeeze like 1 or two into MQ2Farmtest. But the two issues I see is that it's always adding every spawn that has health on line 124, and that it appears as if the "if includepets" block of code has a flaw in it (least it prevents it from being added twice?)
But either way if has a Type and the type is either PC or PET and it has health....then it should add it anyway on line 124.

Your guess is good as mine :-(
Just know that I did give a good look over, I'm just not fluent in this area of things to have spotted the issue you're reporting.
 
Redbot updated MQ2WorstHurt with a new update entry:

Backport Changes

  • Backported Knightly's Next Updates for MQ2WorstHurt
  • Adjusted for-loop to work on Rizlonaand added TODO comment for later updates
  • Adjusted some C-Style castings
  • (Knightly) Removed builder ifdef
  • (Knightly) removed auto where appropriate
  • (Knightly) adjusted some of the C-Style castings
  • (Knightly) adjusted to ensure we don't dereference null-pointers
  • (Knightly) removed magic number for for-loop

[URL...

Read the rest of this update entry...
 
Hello Mr. Knightly, I would like something like this to help DPS classes target the lowest health mob in the extended target window. I believe this plugin only does healable players/pets? Any recommendation for the DPS side of the house?

Thanks
 
Release MQ2WorstHurt

Users who are viewing this thread

Back
Top
Cart