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

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2010, 12:42 PM
ArkR
Fire Beetle
 
Join Date: Mar 2010
Posts: 15
Default Bot Zerg control...

It would be great to have a way to limit Bot zerging. Lots of ways to go about it but maybe something like this. You can summon another bot or group so long as the number you are trying to summon is <= X. Each bot you summon reduces X by 1. X refreshes by having 1 added to it every Y seconds until it is at the cap again. You could just keep track of the last summon time, X at that time, and the clock at that time so that the calculation is only required to be done on demand. Would be a bonus if you re-summoning a bot that is already up didn't decrement the counter. Thoughts , other ideas for ways to go about this?
Reply With Quote
  #2  
Old 03-25-2010, 08:50 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

There are already rules in place that allow you to limit the number of bots you can create and limit the amount of bots you can have summoned. Is this what you are asking about?
Reply With Quote
  #3  
Old 03-26-2010, 07:48 AM
ArkR
Fire Beetle
 
Join Date: Mar 2010
Posts: 15
Default

Those two are both great features but the problem even with those in place is that there is nothing I am aware of to prevent spamming your bot groups up ad nasueum and tossing them at a raid boss. It trivializes many encounters.
Reply With Quote
  #4  
Old 03-26-2010, 10:09 AM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

I added a check at one time that said you can't summon bots while you have aggro. This meant you couldn't do what you are describing. This is no longer working?
Reply With Quote
  #5  
Old 03-26-2010, 12:58 PM
ArkR
Fire Beetle
 
Join Date: Mar 2010
Posts: 15
Default

It's partially working right now. Here is the behavior I'm seeing,
#bot botgroup Load (group designation) => is completely unrestricted
#bot spawn (name) => works until mob is physically attacked, can cast unlimited spells damaging mob and not get flagged as engaged

I observed behavior as a Shadow Knight using the precompiled 1180 and now the latest svn I just compiled to.

Thanks for the great work on bots btw!
Reply With Quote
  #6  
Old 05-18-2010, 07:16 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Lightbulb

I've been able to consistently camp and spawn bots while I have aggro, effectively CHealing them in an instant. It makes things such as dealing with huge trains in Fear incredibly easy, as long as there are no casters.

To stop zerging with the #bot spawn command, try replacing this block

Code:
          /*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;
                }
                if(g && g->members[i] && g->members[i]->qglobal) {
                   return;
                }
             }
          }*/
with this block

Code:
          // Blocks spawn if any group member is engaged.
          Group *g = c->GetGroup();
          if(g){ // Client is grouped.
             for(int i = 0; i < MAX_GROUP_MEMBERS; i++) { // Check each group member.
                // Group member is in zone & ((is a client & has mob aggro) or (is a bot & has a populated hate list)).
                if(g->members[i] != NULL && ((g->members[i]->IsClient() && g->members[i]->CastToClient()->GetAggroCount() > 0) || (g->members[i]->IsBot() && g->members[i]->CastToBot()->IsEngaged()))) {
                   c->Message(0, "You can't spawn bots while your group is engaged.");
                   return;
                }
             }
          } else { // Client is not grouped.
             if(c->GetAggroCount() > 0) { // Client has mob aggro.
                c->Message(0, "You can't spawn bots while you are engaged.");
                return;
             }
          }
in zone/bot.cpp

You should also be able to insert the same block directly after this line

Code:
if(!strcasecmp(sep->arg[1], "botgroup") && !strcasecmp(sep->arg[2], "load")) {
in the same file to kill zerging using the #bot botgroup load command.

NOTES:

I'm still learning C++ and I've only spent a couple of days looking at the code, so this might not be the most efficient way of dealing with the situation. I'm not entirely sure if the issue was with checking IsEngaged() on a client instead of looking at GetAggroCount(), but it seems to work correctly now.

I'm sure there are ways I could have cleaned it up a bit (Do I need CastToMoB() and CastToClient? Do I need to use > 0 after GetAggroCount()? Do I need to use != NULL after g->members[i]?), but I haven't had any sleep...
Reply With Quote
  #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
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 06:20 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3