View Single Post
  #27  
Old 02-28-2017, 01:39 AM
ZombieSoul's Avatar
ZombieSoul
Sarnak
 
Join Date: Jan 2017
Posts: 31
Default Seeing Bot buffs in target window

Not sure if I should keep this thread going, but this bugged me.
This seems like a simple fix, just emulated what they do with mercs
Code:
diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp
index 5411dbf7..143bb381 100644
--- a/zone/client_packet.cpp
+++ b/zone/client_packet.cpp
@@ -13043,7 +13043,11 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
 			}
 			if (GetGM() || RuleB(Spells, AlwaysSendTargetsBuffs) || nt == this || inspect_buffs || (nt->IsClient() && !nt->CastToClient()->GetPVP()) ||
 					(nt->IsPet() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()) ||
-					(nt->IsMerc() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()))
+					(nt->IsMerc() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()) 
+#ifdef BOTS
+					||(nt->IsBot() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP())
+#endif				
+				)
 				nt->SendBuffsToClient(this);
 		}
 		else
buffs are able to be seen when targeting bots, one more thing off my list, now time for bed

EDIT: So since work was slow and for completeness - the following allows you to click buffs off of the bot and the window updates when they are removed or added. Would really like to find a cleaner way to match the entityID to the bot- but this works
Code:
diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp
index 5411dbf7..a2d3a539 100644
--- a/zone/client_packet.cpp
+++ b/zone/client_packet.cpp
@@ -3899,7 +3899,20 @@ void Client::Handle_OP_BuffRemoveRequest(const EQApplicationPacket *app)
 		m = this;
 	else if (brrs->EntityID == GetPetID())
 		m = GetPet();
-
+#ifdef BOTS
+	else if (!m) {
+		std::list<Bot*> BotList = entity_list.GetBotsByBotOwnerCharacterID(CharacterID());
+		for (std::list<Bot*>::iterator itr = BotList.begin(); itr != BotList.end(); ++itr) {
+			Bot* tempBot = *itr;
+			if (tempBot) {
+				if (brrs->EntityID == tempBot->GetID()) {
+					m = tempBot;					
+				}
+			}
+		}
+	}
+#endif
+	
 	if (!m)
 		return;
 
@@ -13043,7 +13056,11 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
 			}
 			if (GetGM() || RuleB(Spells, AlwaysSendTargetsBuffs) || nt == this || inspect_buffs || (nt->IsClient() && !nt->CastToClient()->GetPVP()) ||
 					(nt->IsPet() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()) ||
-					(nt->IsMerc() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()))
+					(nt->IsMerc() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()) 
+#ifdef BOTS
+					||(nt->IsBot() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP())
+#endif				
+				)
 				nt->SendBuffsToClient(this);
 		}
 		else
diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp
index a2841ee8..c6182bfe 100644
--- a/zone/spell_effects.cpp
+++ b/zone/spell_effects.cpp
@@ -4156,7 +4156,11 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
 		SendPetBuffsToClient();
 	}
 	if((IsClient() && !CastToClient()->GetPVP()) || (IsPet() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()) ||
-				(IsMerc() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()))
+				(IsMerc() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP())
+#ifdef BOTS
+				|| (IsBot() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP())
+#endif		
+		)
 	{
 		EQApplicationPacket *outapp = MakeBuffsPacket();
 
diff --git a/zone/spells.cpp b/zone/spells.cpp
index f37f2fc5..08374c85 100644
--- a/zone/spells.cpp
+++ b/zone/spells.cpp
@@ -3291,7 +3291,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
 		SendPetBuffsToClient();
 
 	if((IsClient() && !CastToClient()->GetPVP()) || (IsPet() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()) ||
-				(IsMerc() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()))
+				(IsMerc() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP())
+#ifdef BOTS
+				|| (IsBot() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP())
+#endif	
+		)
 	{
 		EQApplicationPacket *outapp = MakeBuffsPacket();
It probably could use some improvement but all the basics are there, Mercs are most of the way there, and if live lets you click of buffs on mercs would just need to update the entityID check in Client::Handle_OP_BuffRemoveRequest, the rest is already there.

EDIT 2 = I was looking over the code, might want to add a break in that loop? I wasn't thinking of someone having 70+ bots. The more I look at it I want to make a function to check for a bot with the entityID belonging to this client and Keep most of that in bot.cpp

Last edited by ZombieSoul; 02-28-2017 at 01:10 PM.. Reason: More stuff
Reply With Quote