Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-12-2008, 05:38 AM
greggg230
Fire Beetle
 
Join Date: Jun 2008
Location: Vegas
Posts: 17
Default Aggro LOS fix (maybe..?)

I've just started playing around with the emulator a few days ago, and the only glaring bug I've noticed is that NPCs don't assist one another properly. No NPC will assist a MOB unless they have LOS on you--this is easily exploitable, obviously, and makes pulling mobs almost trivial.

I looked around in the code, and the solution seemed pretty obvious.

In aggro.cpp in the function EntityList::AIYellForHelp , a block of code checks for LOS in the following way:
Code:
if(useprimfaction || sender->GetReverseFactionCon(mob) <= FACTION_AMIABLE )
				{
					//attacking someone on same faction, or a friend
					//Father Nitwit:  make sure we can see them.
					if(mob->CheckLosFN(attacker)) {
#if (EQDEBUG>=5) 
						LogFile->write(EQEMuLog::Debug, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", 
						sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ()));
#endif
						mob->AddToHateList(attacker, 1, 0, false);
					}
				}
The change is really easy. Just change if(mob->CheckLosFN(attacker)) to if(mob->CheckLosFN(sender)). That way, MOBs will assist each other whether or not they have LOS, but still with the restriction that they have LOS with either the MOB you aggroed or a MOB assisting that MOB.

I've tested it out a decent amount and things seem to be working fine. The only reason I can imagine the code would be like this intentionally is that the LOS function is expensive, but changing it this way shouldn't normally create a ton more work for the processor; my server showed no signs of slowdown or stress as a result in admittedly limited testing.
Reply With Quote
  #2  
Old 06-12-2008, 09:41 AM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

I'd like to see this on a relatively populated server where more than one player/group is aggroing stuff within the same range. That may be why it was tied to the aggroing party (hackhackhack).

Though I agree, I think this fix is nice and more in tune with how things should be. Nice work. TGC, anyone?
Reply With Quote
  #3  
Old 06-12-2008, 12:18 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Aye, I'll merge it on TGC next reboot
Reply With Quote
  #4  
Old 06-12-2008, 01:39 PM
eq4me
Hill Giant
 
Join Date: Jul 2006
Posts: 166
Default

I always thought that LOS had something to do with aggro range. For example you could pull the single mob near the ladder from the Ghoul Suppliers room in LGuk when you aggroed him as soon as you saw him while climbing up said ladder. Climb to high and the whole room would come. But maybe something has changed since then.
Reply With Quote
  #5  
Old 06-12-2008, 03:55 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

I'm not sure if this is a good thing. If you want to link mobs, you should use the perl way to do it instead of a world wide change like this.
Reply With Quote
  #6  
Old 06-12-2008, 04:09 PM
greggg230
Fire Beetle
 
Join Date: Jun 2008
Location: Vegas
Posts: 17
Default

Quote:
Originally Posted by Congdar View Post
I'm not sure if this is a good thing. If you want to link mobs, you should use the perl way to do it instead of a world wide change like this.
I'm not sure I understand. This should be a world-wide change, as this is how MOBs should always act.

This has nothing to do with MOBs being linked in the sense that was implemented in Velious and later.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:53 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3