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)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 06-21-2006, 01:56 PM
unicorn97211
Sarnak
 
Join Date: May 2006
Posts: 37
Default Unified Diff

Code:
--- C:\Code\EQEmu800\zone\attack.cpp	Wed Jun 07 18:29:26 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\attack.cpp	Sun Jun 18 10:30:31 2006
@@ -1727,10 +1727,14 @@
 	
 	if (other == myowner)
 		return;
-	if (owner) { // Other has a pet, add him and it
+	if (owner) { // Other is a pet, add him and it
 		hate_list.Add(other, hate, 0, bFrenzy, !iBuffTic);
+		// EverHood 6/12/06
+		// Can't add a feigned owner to hate list
+		if(!owner->CastToClient()->GetFeigned()){
 		hate_list.Add(owner, 1, damage, false, !iBuffTic);
 	}
+	}
 	else { // Other has no pet, add other
 		hate_list.Add(other, hate, damage, false, !iBuffTic);
 	}
@@ -1741,8 +1745,9 @@
 			myowner->hate_list.Add(other, 1, 0, bFrenzy);
 	}
 	if (!wasengaged) { 
-		if(IsNPC() && other->CastToClient())
+		if(IsNPC() && other->CastToClient()){
 			parse->Event(EVENT_AGGRO, this->GetNPCTypeID(), 0, CastToNPC(), other); 
+		}
 		AI_Event_Engaged(other, iYellForHelp); 
 		adverrorinfo = 8293;
 	}
@@ -2068,9 +2073,21 @@
 		else
 			hate = damage; // normal aggro for everything else
 		
-		mlog(COMBAT__HITS, "Generating hate %d towards %s", hate, attacker->GetName());
-		// now add done damage to the hate list
+		// EverHood 6/12/06
+		if(attacker->IsClient()){
+			// check if attacker is feigned
+			if(attacker->CastToClient()->GetFeigned()){
+				hate = -1; // no hate for feigned attackers
+			}
+		}
+		
+		if(hate != -1){
+			// attacker generated some hate so 
+			// add damage done by attacker to the hate list
+			// mlog(COMBAT__HITS, "Generating %d hate towards %s", hate, attacker->GetName());
 		AddToHateList(attacker, hate, damage, true, false, iBuffTic);
+		}
+
 	}
     
 	if(damage > 0) {
--- C:\Code\EQEmu800\zone\client.cpp	Fri May 12 19:35:58 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\client.cpp	Sun Jun 18 03:11:40 2006
@@ -143,6 +143,8 @@
 	ooc_timer(1000),
 	shield_timer(500),
 	fishing_timer(8000),
+	// EverHood 6/16/06
+	forget_timer(120000),
 #ifdef REVERSE_AGGRO
 	scanarea_timer(AIClientScanarea_delay),
 #endif
@@ -1763,13 +1765,25 @@
 }
 
 void Client::SetFeigned(bool in_feigned) {
+	feigned=in_feigned;
 	if (in_feigned)
 	{
+// EverHood 6/12/06
+// Live doesn't kill pets when owner feigns anymore
+// Hasn't since mobs quit agroing pets.
+// If you're worried necros will Feign and let pet solo
+// mobs turn this on in Features.h.
+// *Note: If a necro pet can solo an xp bearing mob while owner is FD
+//		  that mob needs it's stats bumped.
+#ifdef KILL_PET_ON_FEIGN
 		SetPet(0);
+#endif
 		SetHorseId(0);
 		entity_list.ClearFeignAggro(this);
+		forget_timer.Start(120000);
+	}else{
+		forget_timer.Disable();
 	}
-	feigned=in_feigned;
  }
 
 void Client::LogMerchant(Client* player, Mob* merchant, Merchant_Sell_Struct* mp, const Item_Struct* item, bool buying)
--- C:\Code\EQEmu800\zone\client.h	Wed Jun 07 18:29:26 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\client.h	Mon Jun 19 14:52:37 2006
@@ -512,7 +512,11 @@
 	inline void	SetBecomeNPCLevel(int8 level) { npclevel = level; }
 	bool	LootToStack(uint32 itemid);
 	void	SetFeigned(bool in_feigned);
-	inline bool    GetFeigned()	{ return(GetAppearance() != eaDead ? false : feigned); }
+	// EverHood 6/16/06
+	/// this cures timing issues cuz dead animation isn't done but server side feigning is?
+	inline bool    GetFeigned()	{return(feigned); }
+
+	//inline bool    GetFeigned()	{ return(GetAppearance() != eaDead ? false : feigned); }
 	EQStreamInterface* Connection() { return eqs; }
 #ifdef PACKET_PROFILER
 	void DumpPacketProfile() { if(eqs) eqs->DumpPacketProfile(); }
@@ -768,11 +772,13 @@
 	Timer	ooc_timer;
 	Timer	shield_timer;
 	Timer	fishing_timer;
+	// EverHood 6/16/06
+	// our 2 min everybody forgets you timer
+	Timer	forget_timer;
 #ifdef REVERSE_AGGRO
 	Timer	scanarea_timer;
 #endif
 	Timer	tribute_timer;
-	
 #ifdef PACKET_UPDATE_MANAGER
 	UpdateManager update_manager;
 #endif
--- C:\Code\EQEmu800\zone\client_process.cpp	Mon Apr 17 06:59:14 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\client_process.cpp	Sun Jun 18 02:07:29 2006
@@ -534,8 +534,11 @@
 	//At this point, we are still connected, everything important has taken
 	//place, now check to see if anybody wants to aggro us.
 	if(ret && scanarea_timer.Check()) {
+		// Everhood 6/15/06 - only check prox agro if we are not feigned
+		if(!feigned){
 		entity_list.CheckClientAggro(this);
 	}
+	}
 #endif	
 	
 	if (client_state != CLIENT_LINKDEAD && (client_state == CLIENT_ERROR || client_state == DISCONNECTED || client_state == CLIENT_KICKED || !eqs->CheckState(ESTABLISHED))) {
@@ -576,7 +579,12 @@
 		}
 		OnDisconnect(true);
 	}
-	
+	// EverHood Feign Death 2 minutes and zone forgets you
+	if (forget_timer.Check()) {
+		forget_timer.Disable();
+		entity_list.ClearZoneFeignAggro(this);
+		Message(0,"Your enemies have forgotten your aggressions.");
+	}
 	
 	return ret;
 }
--- C:\Code\EQEmu800\zone\entity.cpp	Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\entity.cpp	Sun Jun 18 09:54:40 2006
@@ -2475,8 +2475,24 @@
 		{
 			iterator.GetData()->CastToNPC()->RemoveFromHateList(targ);
 			if (iterator.GetData()->CastToMob()->GetLevel() >= 35)
-				iterator.GetData()->CastToNPC()->SetFeignMemory(targ->CastToMob()->GetName());
+				// EverHood 6/14/06
+				// the mob that hated us is 35+ so 3 outta 5 chance 
+				// he adds us to its feign memory
+				if(((float)rand()/RAND_MAX)*100 < 40){
+					iterator.GetData()->CastToNPC()->AddFeignMemory(targ->CastToClient());
 		}
+		}
+		iterator.Advance();
+	}
+}
+// EverHood 6/17/06
+void EntityList::ClearZoneFeignAggro(Client* targ)
+{
+	LinkedListIterator<NPC*> iterator(npc_list);
+	iterator.Reset();
+	while(iterator.MoreElements())
+	{
+		iterator.GetData()->RemoveFromFeignMemory(targ);
 		iterator.Advance();
 	}
 }
--- C:\Code\EQEmu800\zone\entity.h	Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\entity.h	Sun Jun 18 02:07:29 2006
@@ -251,6 +251,8 @@
 
     void    Process();
 	void	ClearFeignAggro(Mob* targ);
+	// Everhood 6/17/06
+	void	ClearZoneFeignAggro(Client* targ);
 	
 	bool	Fighting(Mob* targ);
 	void    RemoveFromHateLists(Mob* mob, bool settoone = false);
--- C:\Code\EQEmu800\zone\MobAI.cpp	Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\MobAI.cpp	Sun Jun 18 13:33:22 2006
@@ -942,6 +942,10 @@
 					SetAppearance(eaStanding, false);
 					SetMoving(false);
 					SendPosition();
+					// EverHood - wipe feign memory since we reached our first waypoint
+					if(cur_wp==1){
+						ClearFeignMemory();
+					}
 				} 
 				else
 				{	// not at waypoint yet, so keep moving
@@ -969,6 +973,8 @@
      {
 		if(moved) {
 			mlog(AI__WAYPOINTS, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z);
+			// EverHood 6/18/06
+			ClearFeignMemory();
 			moved=false;
 			SetMoving(false);
 			SendPosition();
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 03:53 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