Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #22  
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
 

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 01:02 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