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.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2002, 12:08 PM
Malevolent
Hill Giant
 
Join Date: Mar 2002
Posts: 171
Default Hate decay Timer: How long do you stay irked?

Because it might be handy to be able to set thresholds for how long an individual NPC stays irked at you. Something I always disliked about eq was that some animals should just give up sooner than others. I want a wolf to stick on me for a *long* time, but I want a drunkard to forget about me. This allows you to do that.

Code:
npc.cpp

constructor:
hatedecay_timer = new Timer(30); // low for tests, but each mob could have its own "how long do i stay angry for?" value by passing a variable in place of 30

NPC::Process

	//*****************************************
	//malevolent:hatedecay timer check
	if (hatedecay_timer->Check())
	{
		//disable the timer
		hatedecay_timer->Disable();		

		//remove the target from the list
		
		if (target!=0) //prevents leak
		{			
			entity_list.RemoveFromTargets(this->GetTarget());
			this->RemoveFromHateList(this->CastToMob());
		}
		
		//set the next target up
		SetTarget(hate_list.GetTop());		
		
	}
	//*****************************************


NPC::AddToHateList

	hatedecay_timer->Start(); //reset timer each time hate is added using the value passed in before, don't irk me and I won't bother you


npc.h

protected:
	Timer*  hatedecay_timer;
--MV
Reply With Quote
  #2  
Old 03-28-2002, 06:59 AM
Malevolent
Hill Giant
 
Join Date: Mar 2002
Posts: 171
Default

I should note that you'll need to put in code to move the NPC back to their home (in NPC::Process()) unless you don't mind having them stand and/or remain in their last known position.
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 05:47 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