Thread: Game Mechanics: pet agro issue
View Single Post
  #2  
Old 11-23-2009, 11:11 PM
Haynar Haynar is offline
Developer

Haynar's Avatar

Join Date: Oct 2009
Location: West of the Mississippi
Posts: 2,955
Default

A mob fleeing, will return true on the fear check, and it will dump it from aggro checks (or move it to a minimum value of 0). If there is more than one mob on the aggro list, it will take the non-feared mob, no matter how low the HPs of the feared mob.

There is normally code to increase aggro for a mob low on HPs, but since it is fleeing, it will not get applied.

For this to work, we need to change the fear check part of the code to only work with feared clients.

So in hatelist.cpp, function "Mob *HateList::GetTop(Mob *center)"

Change this:

Code:
		if(cur->ent->DivineAura() || cur->ent->IsMezzed() || cur->ent->IsFeared()){
			if(hate == -1)
			{
				top = cur->ent;
				hate = 0;
			}
			iterator.Advance();
			continue;
		}
To this:
Code:
		if(cur->ent->DivineAura() || cur->ent->IsMezzed() || (cur->ent->IsFeared() && cur->ent->IsClient())){
			if(hate == -1)
			{
				top = cur->ent;
				hate = 0;
			}
			iterator.Advance();
			continue;
		}
This will stop it from ignoring the hate list for any mob feared or fleeing, since both return true on the IsFeared().

Then when it gets to the low HP check in the code, it will add 100% aggro on the low HP mob, the way it normally would.

Haynar
Last edited by Haynar; 11-23-2009 at 11:38 PM.. Reason: Edited for clarity
Reply With Quote