Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-16-2003, 02:39 AM
Armanthuz
Sarnak
 
Join Date: Apr 2003
Posts: 72
Default fixed aggro and z-radius bug from 5/5 CVS compile

from module zone/mobai.cpp

starts at line 201


Code:
Mob* EntityList::AICheckCloseArrgo(Mob* sender, float iArrgoRange, float iAssistRange) {
	if (sender->GetPrimaryFaction() == 0)
		return 0; // well, if we dont have a faction set, we're gonna be indiff to everybody
    LinkedListIterator<Entity*> iterator(list);
	iterator.Reset();
	int8 RandRoll = rand()%100;
	float dist,distZ;
	int leveldif;
    while(iterator.MoreElements()) {
		if (iterator.GetData()->IsMob() && !iterator.GetData()->IsCorpse() && iterator.GetData() != sender) {
			Mob* mob = iterator.GetData()->CastToMob();
			FACTION_VALUE fv = FACTION_INDIFFERENT;
			fv = mob->GetFactionCon(sender);
			dist = mob->Dist(sender);
			distZ = sender->GetZ()-mob->GetZ();
			leveldif = mob->GetLevel() - sender->GetLevel();
			if (leveldif < 0){
				leveldif=0;
			}
			if (fv <= FACTION_AMIABLE
				&& mob->IsEngaged()
				&& mob->GetTarget()
				&& dist <= (iAssistRange-leveldif)
				&& (mob->GetINT() <= 100 || mob->GetTarget()->GetLevelCon(sender->GetLevel()) != CON_GREEN)
				&& sender->Dist(mob->GetTarget()) <= (iAssistRange * 2)
				) {
				return mob->GetTarget();
			}
			else if (
				!(mob->IsClient() && mob->CastToClient()->GetGM())
				&& mob->InZone()
				&& (fv == FACTION_SCOWLS || (fv == FACTION_THREATENLY && RandRoll < THREATENLY_ARRGO_CHANCE))
				&& !mob->IsInvisible() 
				&& dist <= (iArrgoRange - leveldif)
				&& (distZ > -10 && distZ < 10)
				&& (sender->GetINT() <= 75 || mob->GetLevelCon(sender->GetLevel()) != CON_GREEN)
				) {
				return mob;
			}			
		}
		iterator.Advance();
	}
	return 0;
}


I also reduced all aggroradius on mobs to 65 from 85. I feel this is a good compromise given that you cant do LOS checks and chain aggro gets silly otherwise....
Reply With Quote
 

Thread Tools
Display Modes

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