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

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2008, 02:44 PM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Quote:
I'm still running the base version of 1129, and I'm able to see my (client) hate list fine.
The change came in Revision 38:

Quote:
==10/03/2008
KLS: Hate list will no longer work for non ai controlloed player characters.
The problem had been that the client was maintaining a hate list that would never be wiped unless the mob on it was killed or the player camped/zoned. This was what was causing feign death to pull zone-wide trains. Since removing the hatelist from players, it's been corrected, though it has had other issues (such as breaking the mob fleeing code; they originally checked the client hatelist to see if there were other mobs with them).

My guess is that that may be what IsEngaged was calling on, and it's no longer there.
Reply With Quote
  #2  
Old 10-14-2008, 03:00 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

attack.cpp Mob::AddToHateList
Code:
	if(IsClient() && !IsAIControlled())
		return;
This is where the hate_list is used for the client... only if the client is charmed and aicontrolled.
Reply With Quote
  #3  
Old 10-14-2008, 05:48 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I think we can set IsEngaged() back to the way it was before and simply add in the whipehatelist code that AndMetal posted to fix the FD issue. The IsEngaged() check being available for clients is just too useful to remove it to fix FD. I am pretty sure that the fix AndMetal posted above will correct it. I will try it out tonight along with my OOC Regen code using the old IsEngaged() check by removing the check that Congdar posted. I think that will resolve some of the issues we are having right now with other code.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 10-15-2008 at 02:24 AM..
Reply With Quote
  #4  
Old 10-15-2008, 05:05 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Finally, by reverting IsEngaged() back to allowing it to work on clients, I was able to get OOC Regen working almost perfectly. The only thing that isn't currently working 100% as intended is the wait timer. And by adding the WhipeHateList() to the FD forget timer, it should fix the issues with FD as well even with IsEngaged() being reverted back. Much thanks for AndMetal, So_1337 and Congdar for figuring that stuff out

zone/attack.cpp in Mob::AddToHateList remove:
Code:
	if(IsClient() && !IsAIControlled())
		return;
zone/client_process.cpp, around line 626, add the RED line
Code:
	// EverHood Feign Death 2 minutes and zone forgets you
	if (forget_timer.Check()) {
		forget_timer.Disable();
		entity_list.ClearZoneFeignAggro(this);
		WhipeHateList(); //wipe the client's hate list
		Message(0,"Your enemies have forgotten you!");
	}
zone/client_process.cpp remove:
Code:
void Client::DoHPRegen() {
	sint32 normal_regen = LevelRegen();
	sint32 item_regen = itembonuses.HPRegen;
	sint32 spell_regen = spellbonuses.HPRegen;
	sint32 total_regen = normal_regen + item_regen + spell_regen;
	total_regen = (total_regen * RuleI(Character, HPRegenMultiplier)) / 100;
	SetHP(GetHP() + total_regen);
	SendHPUpdate();
}

void Client::DoManaRegen() {
	if (GetMana() >= max_mana)
		return;
	int32 level=GetLevel();
	int32 regen = 0;
	if (IsSitting() ||(GetHorseId() != 0)) {		//this should be changed so we dont med while camping, etc...
		if(HasSkill(MEDITATE)) {
			medding = true;
			regen = (((GetSkill(MEDITATE)/10)+(level-(level/4)))/4)+4;
			regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
			CheckIncreaseSkill(MEDITATE, -10);
		}
		else
			regen = 2+spellbonuses.ManaRegen+itembonuses.ManaRegen+(level/5);
	}
	else {
		medding = false;
		regen = 2+spellbonuses.ManaRegen+itembonuses.ManaRegen+(level/5);
	}
	regen += GetAA(aaMentalClarity);
	regen += GetAA(aaBodyAndMindRejuvenation);
	regen = (regen * RuleI(Character, ManaRegenMultiplier)) / 100;
	
	SetMana(GetMana() + regen);
	SendManaUpdatePacket();
}
And replace it with this:
Code:
void Client::DoHPRegen() {
	if(GetHP() < GetMaxHP()) {  //Don't do HP regen if HPs are full
		int32 level=GetLevel();
		int32 oochpregen = 0;
		int8 oocwaittime = oocwaittime++;
		sint32 normal_regen = LevelRegen();
		sint32 item_regen = itembonuses.HPRegen;
		sint32 spell_regen = spellbonuses.HPRegen;
		sint32 total_regen = normal_regen + item_regen + spell_regen;
		if(IsEngaged()) {
			oochpregen = 0;
			oocwaittime = 0;
		} else {
			if(IsCasting() && RuleB(Character, OOCRegenCastCheck)) {
				oochpregen = 0;
				oocwaittime = 0;
			} else {
				if(oocwaittime >= RuleI(Character, OOCRegenWaitTicks)) {
					oochpregen += GetMaxHP() * RuleI(Character, OOCHPRegen) / 100;
					oochpregen -= level / RuleI(Character, MaxLevel) * oochpregen * RuleI(Character, OOCRegenLevelScale) / 100;
					oocwaittime = RuleI(Character, OOCRegenWaitTicks);
				}	
			}
		}
		total_regen = ((total_regen * RuleI(Character, HPRegenMultiplier)) / 100) + oochpregen;
		SetHP(GetHP() + total_regen);
		SendHPUpdate();
	}
}

void Client::DoManaRegen() {
	if(GetMana() < GetMaxMana()) { //Don't do mana regen if mana is full
		int32 level=GetLevel();
		int32 regen = 0;
		int8 oocwaittime = oocwaittime++;
		int32 oocmanaregen = 0;
		if(IsEngaged()) {
			oocmanaregen = 0;
			oocwaittime = 0;
		} else {
			if(IsCasting() && RuleB(Character, OOCRegenCastCheck)) {
				oocmanaregen = 0;
				oocwaittime = 0;
			} else {
				if(oocwaittime >= RuleI(Character, OOCRegenWaitTicks)) {
					oocmanaregen += GetMaxMana() * RuleI(Character, OOCManaRegen) / 100;
					oocmanaregen -= level / RuleI(Character, MaxLevel) * oocmanaregen * RuleI(Character, OOCRegenLevelScale) / 100;
					oocwaittime = RuleI(Character, OOCRegenWaitTicks);
				}
			}
		}
		if (IsSitting() ||(GetHorseId() != 0)) {		//this should be changed so we dont med while camping, etc...
			if(HasSkill(MEDITATE)) {
				medding = true;
				regen = (((GetSkill(MEDITATE)/10)+(level-(level/4)))/4)+4;
				regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
				CheckIncreaseSkill(MEDITATE, -10);
			}
			else
				regen = 2+spellbonuses.ManaRegen+itembonuses.ManaRegen+(level/5);
		}
		else {
			medding = false;
			regen = 2+spellbonuses.ManaRegen+itembonuses.ManaRegen+(level/5);
		}

		//AAs
		regen += GetAA(aaMentalClarity) 
			+ GetAA(aaBodyAndMindRejuvenation) 
			+ GetAA(aaExpansiveMind);

		regen = ((regen * RuleI(Character, ManaRegenMultiplier)) / 100) + oocmanaregen;
		
		SetMana(GetMana() + regen);
		SendManaUpdatePacket();
	}
}
I have tested this and once I get the wait timer working, I will add it to the SVN so anyone can enable it with the new rules or just leave it disabled as it is by default. It could actually get added as-is, but I don't think the wait timer will be that hard to fix. I am just not sure why the code I have set for it isn't working. It seems that no matter what I set the wait timer rule to, it always starts regen on the first tick after a fight is over.

If anyone knows of a reason why this shouldn't be added, please let me know!

Moved this thread to Development:evelopment since it is nearly final and not really a request anymore.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 10-15-2008 at 01:08 PM..
Reply With Quote
  #5  
Old 10-15-2008, 06:09 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I looked at reverting the change in Mob::AddToHateList when I was looking at fixing the Flee code. I added code to Feign Death, Rogue Escape and Bard Fading Memories to wipe the clients hate list, but I found a problem, so I backed that out.

Depending on timing, you can have a situation where a mob starts to cast an offensive spell on the player, a Rogue hits 'Escape', clears it's hatelist and then the spell still lands on the player and the mob is added back to the player's hate list, even though the mob no longer hates the player.

As I say, it purely depends on the timing of a mob casting and the player hitting Escape, or Fading Memories and probably won't happen often, but it is something to be aware of.
Reply With Quote
  #6  
Old 10-15-2008, 06:28 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

It worked that way on Live too though

I played a rogue on live and using escape while something was casting on you would break hide/sneak and also add you back to their hate list. So unless something has changed since I played, I think that would be perfectly acceptable and intended. I am not sure even with changing how IsEngaged works that a spell being cast on you won't cause aggro after you escape or fade. It should at the very least break your hide/sneak.

Maybe you can put those changes back in unless someone else thinks it should work any differently.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 10-15-2008, 08:53 AM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

on Live it is like that, but is it like that here? if the spell lands after fd or fm it should break fd and fm and add to both mob and client hate lists... i think here it may only add to the clients hate list and not actually break fd and fm.
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 01:12 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