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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 


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:25 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3