Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2010, 08:13 AM
LeftRoad
Sarnak
 
Join Date: Aug 2005
Location: Maine
Posts: 38
Default COMMITTED: /pet who leader fix

"My leader is ."

Not anymore. I know it is mostly flavor but it may be useful on the larger servers.

#1 -- If you have a pet and have nothing targetted, your pet will respond with your name.

#2 -- If you target someone else's pet, whether you have a pet or not, that pet will respond with its leader's name. This works for player, npc, and even bot pets.

#3 -- As an unexpected bonus, using this on a bot will cause it to respond with the person that created them.

client_packet.cpp --- Here's the diff...
Code:
--- client_packet.orig.cpp	2010-01-21 06:49:35.000000000 -0500
+++ client_packet.cpp	2010-01-23 06:30:06.000000000 -0500
@@ -5978,7 +5978,23 @@ void Client::Handle_OP_PetCommands(const
 	char val1[20]={0};
 	PetCommand_Struct* pet = (PetCommand_Struct*) app->pBuffer;
 	Mob* mypet = this->GetPet();
-	if(!mypet) return;
+
+	// Allow other players to ask a pet who their owner is.
+	if(!mypet || pet->command == PET_LEADER) {
+		if(pet->command == PET_LEADER) {
+			if(mypet && this->GetTarget() == NULL) {
+				// If I have a pet and don't have a target, grab my name.
+				mypet->Say_StringID(PET_LEADERIS,this->GetName());
+			} else if(this->GetTarget() != NULL) {
+				// If I have a target, check my target for an owner.
+				mypet = this->GetTarget();
+				if(mypet->GetOwner())
+					mypet->Say_StringID(PET_LEADERIS,mypet->GetOwner()->GetCleanName());
+			}
+		}
+
+		return;
+	}
 
 	if(mypet->GetPetType() == petAnimation && (pet->command != PET_HEALTHREPORT && pet->command != PET_GETLOST) && !GetAA(aaAnimationEmpathy))
 		return;
@@ -6050,10 +6066,6 @@ void Client::Handle_OP_PetCommands(const
 
 		break;
 	}
-	case PET_LEADER: {
-		mypet->Say_StringID(PET_LEADERIS);
-		break;
-	}
 	case PET_GUARDHERE: {
 		if (mypet->IsFeared()) break; //AndMetal: could be exploited like PET_BACKOFF

Last edited by Derision; 01-24-2010 at 08:38 AM.. Reason: Stickied for review
Reply With Quote
  #2  
Old 01-24-2010, 10:40 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

This is in 1158, thanks
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:49 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3