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 01-13-2003, 05:17 PM
IASoveraign
Fire Beetle
 
Join Date: Jan 2003
Posts: 5
Default Code: Exp from pet kills and a pointer check

Small changes to attack.cpp.

NPC::Attack
Added a pointer check that keeps the zone from crashing in one instance.

NPC:eath
Adjusted the death code exp to be like eqlive (i.e. gives exp if PC pet gets last hit and you are "killer" but not if last hit was NPC or NPC pet).

Diff against attack.cpp 1.1.1.10
Code:
--- attack.cpp.orig	2003-01-13 20:54:10.000000000 -0600
+++ attack.cpp	2003-01-13 22:48:50.000000000 -0600
@@ -735,6 +735,11 @@
     if (!target)
         SetTarget(other);
 
+	// "other" can be NULL here it seems on the second attack if the first one
+	// killed its target.  -- Soveraign
+	if (!other)
+		return false;
+
     SetAttackTimer();
     if((other->GetHP() <= -11) || (other->IsClient() && other->CastToClient()->dead) || (zone->IsGuildWars() && (CastToNPC()->IsCityController()) || (target->IsNPC() && target->CastToNPC()->IsCityController())))
 	{
@@ -1067,7 +1072,13 @@
 		hate_list.Add(other, damage);
 	}
 	
-	if (killer && killer->IsClient() && other && other->IsClient())
+
+	// Killer gets EXP if mob getting last hit was a PC or a PC's pet. -- Soveraign
+	if ( (killer && killer->IsClient()) && 
+		 ( (other && other->IsClient()) || 
+		   (other && other->IsNPC() && other->GetOwner() && other->GetOwner()->IsClient())
+		 )
+	   )
 	{
 		if (killer->CastToClient()->isgrouped && entity_list.GetGroupByClient(killer->CastToClient()) != 0)
 			entity_list.GetGroupByClient(killer->CastToClient())->SplitExp(level*level*75*3.5f, GetLevel());
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 06:36 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