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...