Improved ${Target.Named} exlusion list.

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

Chatwiththisname
a lesser mummy
a lesser mummy
Posts: 51
Joined: Sat Oct 16, 2004 8:09 pm
Location: Texas

Improved ${Target.Named} exlusion list.

Post by Chatwiththisname » Sun Oct 14, 2018 9:24 am

So I've been brainstorming a little bit about our Named variances and have started testing something new to try and weed out creatures that aren't valid targets in a typical scenario.

I noticed that a lot of creatures are considered named mobs that also have a "surname" or "Lastname" which is viewed differently for NPC's than it is for PC's.

However, my test cases have been rather limited at this point. Lemme explain how this works differently from a PC to an NPC

A player's surname or last name is their appropriated name assigned using the /surname command and appears as a last name on the character. With an NPC their surname or lastname appears -below- their name and is typically used to identify them as a Quest NPC, Merchant, or other sort of special tag. One of the more common places that you can find NPC's like this is in Crescent Reach's town, where below their name it will say "(Quest 1+)" or something else to that extent.

Recently I was writing a plugin that is still in early stages of development and I wanted to try and weed out any creatures I could that wouldn't be a valid combat target and I decided to exclude any NPC with a surname in my SearchSpawn function with a simple

Code: Select all

if (strlen(pSpawn->Lastname)) continue;
in my for loop.

Testing this in the tutorial zone I found that it automatically excluded all NPC's in the starting area with the exception of Flutterwing because all of the NPC's had a surname. Which of course greatly reduced the amount of NPC's my plugin chose as a target to attack, which prevented me from running around and adding them to my alert list for ignores.

Mostly I'm wondering if anyone knows of any NPC's that are legitimate targets which have a surname so I know if this will be a beneficial thing to exclude, or if it can be potentially hazardous down the line. My plugin would still react to aggro from something with a surname, but it wouldn't pick one as a target when I don't have aggro.

This could also be used as an added option to exclude an NPC from Named npc's if it turns out this is true 100% of the time. That way it could reduce the amount of false positives we get when checking for ${Target.Named} In macros or plugins.

Named is Member 87 of MQ2SpawnType.


Which as I understand it is determined by EQLIB_API BOOL IsNamed(PSPAWNINFO pSpawn);

The definition of IsNamed can be found in MQ2Utilities.cpp starting at line 5590 and ending at line 5650.

There's a bunch of individual if statements to determine if it should return false or not, adding this one may improve it's accuracy.

Thoughts or opinions on the question are welcome. Thanks

CWTN

SwiftyMUSE
Developer
Developer
Posts: 1205
Joined: Tue Sep 23, 2003 10:52 pm

Re: Improved ${Target.Named} exlusion list.

Post by SwiftyMUSE » Wed Dec 12, 2018 6:38 pm

I'm working on this. I have a version that we can release after a short time to get over the patch after the patch after the release syndrome. It would default to the OLD (current) exclusion criteria, but could be turned on if you wanted it.
PayPal: Donate to SwiftyMUSE
Bitcoin: 1LuQ6YcEAWxF3fm9yWMiro4K582je7364V
Krono: PM me

dont_know_at_all wrote:Gee, if only there was a way to correctly report a crash...

Chatwiththisname
a lesser mummy
a lesser mummy
Posts: 51
Joined: Sat Oct 16, 2004 8:09 pm
Location: Texas

Re: Improved ${Target.Named} exlusion list.

Post by Chatwiththisname » Wed Dec 12, 2018 10:11 pm

Sounds good to me. Though testing has been limited for the sake of developing my plugin, as of now I haven't encounter a valid target with a surname. Looking forward to seeing it added as an option.