Looks like BOTs are working

This commit is contained in:
neckkola
2022-01-24 23:05:17 -04:00
parent c9b8127236
commit 3098acdc95
2 changed files with 15 additions and 7 deletions
+12 -4
View File
@@ -6989,9 +6989,9 @@ void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app)
#ifdef BOTS
else if (Invitee->IsBot()) {
Client* inviter = entity_list.GetClientByName(gis->inviter_name);
Bot* invitee = entity_list.GetBotByBotName(gis->invitee_name);
//Bot* invitee = entity_list.GetBotByBotName(gis->invitee_name);
if (inviter->IsRaidGrouped())
Bot::ProcessRaidInvite(invitee, inviter);
Bot::ProcessRaidInvite(Invitee->CastToBot(), inviter);
else
Bot::ProcessBotGroupInvite(this, std::string(Invitee->GetName()));
}
@@ -11779,10 +11779,11 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
}
// If any of the bots are a group leader then re-create the botgroup on disband, dropping any clients
for (auto bot_iter : raid_members_bots) {
if (bot_iter && raid->IsGroupLeader(bot_iter->GetName()))
if (bot_iter && raid->IsRaidMember(bot_iter->GetName()) && raid->IsGroupLeader(bot_iter->GetName()))
{
// Remove the entire BOT group in this case
uint32 gid = raid->GetGroup(bot_iter->GetName());
std::vector<RaidMember> r_group_members = raid->GetRaidGroupMembers(gid);
Group* group_inst = new Group(bot_iter);
entity_list.AddGroup(group_inst);
@@ -11791,11 +11792,16 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
for (auto member_iter : r_group_members) {
if (!member_iter.member->IsClient() && strcmp(member_iter.membername, bot_iter->GetName()) == 0)
bot_iter->SetFollowID(owner_id);
else
Bot::AddBotToGroup(member_iter.member->CastToBot(), group_inst);
raid->RemoveMember(bot_iter->GetName());
}
}
else if (bot_iter && raid->IsRaidMember(bot_iter->GetName()))
{
raid->RemoveMember(bot_iter->GetName());
}
}
}
else if (b_to_disband)
@@ -11823,6 +11829,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
raid->RemoveMember(member_iter.member->CastToBot()->GetName());
}
}
break;
}
else if (gid <12 && raid->GetGroupLeader(gid)->IsBot())
{
@@ -11878,7 +11885,8 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
}
//r->SendRaidGroupRemove(ri->leader_name, grp);
raid->GroupUpdate(group);// break
//}
if (!raid->RaidCount())
raid->DisbandRaid();
}
break;
}
+3 -3
View File
@@ -261,10 +261,10 @@ void Raid::RemoveMember(const char *characterName)
Bot* bot = entity_list.GetBotByBotName(characterName);
if (bot) {
bot->SetFollowID(bot->GetOwner()->GetID());
bot->SetGrouped(0);
bot->SetFollowID(bot->GetOwner()->CastToClient()->GetID());
bot->SetGrouped(false);
bot->SetTarget(nullptr);
bot->SetRaidGrouped(0);
bot->SetRaidGrouped(false);
}
#endif