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

Development::Bots Forum for bots.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 02-21-2012, 05:39 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

raising this thread from the dead as you are still able to spawn bots while you are in combat (even though they may not be at full health/mana). the current code does not check for aggro on an ungrouped client, nor does it stop client-only groups from spawning bots, as the IsEngaged() check will always return false on a client. patch included.

Code:
Index: bot.cpp
===================================================================
--- bot.cpp	(revision 2103)
+++ bot.cpp	(working copy)
@@ -12369,17 +12369,27 @@
 			}
 		}*/
 
-		if(c->IsGrouped()) {
-			Group *g = entity_list.GetGroupByClient(c);
-			for (int i=0; i<MAX_GROUP_MEMBERS; i++) {
-				if(g && g->members[i] && !g->members[i]->qglobal && (g->members[i]->GetAppearance() != eaDead) && g->members[i]->IsEngaged()) {
-					c->Message(0, "You can't summon bots while you are engaged.");
-					return;
+		// blocks spawn if any group member is engaged
+		Group *g = c->GetGroup();
+		if(g) {
+			for(int i = 0; i < MAX_GROUP_MEMBERS; i++) {
+				// if current group member is invalid or dead
+				if(!g->members[i] || g->members[i]->qglobal || g->members[i]->GetAppearance() == eaDead) {
+					continue;
 				}
-				if(g && g->members[i] && g->members[i]->qglobal) {
+				// if group member is a client and has aggro OR group member is a bot and has populated hate list
+				else if ( ( g->members[i]->IsClient() && g->members[i]->CastToClient()->GetAggroCount() > 0 )
+					 ||   ( g->members[i]->IsBot() && g->members[i]->IsEngaged() ) ) {
+					c->Message(0, "You can't spawn bots while your group is engaged.");
 					return;
 				}
 			}
+		// blocks spawn if ungrouped client has aggro
+		} else {
+			if(c->GetAggroCount() > 0) {
+				c->Message(0, "You can't spawn bots while you are engaged.");
+				return;
+			}
 		}
 
 		Mob* TempBotMob = entity_list.GetMobByBotID(botId);
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 07:46 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