mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-15 18:00:27 +00:00
CMaNGOS Playerbots "lfg" command implemented (#1291)
* CMaNGOS Playerbots "lfg" command implemented * Remove logging, fix warning, add suggestion - Remove LOG_INFO's console clutter, since 'lfg' command is working correctly now. - Warning C26813 fixed for: placeholders["%role"] = (role == BOT_ROLE_TANK ? "tank" : (role == BOT_ROLE_HEALER ? "healer" : "dps")); - Added suggestion to let bots do autogear & maintenance, so players can instantly start their dungeon or raid activities without manually having to configure the playerbots gear. It could save a lot of time. This is up to discussion for playerbots maintainers.
This commit is contained in:
@@ -22,8 +22,7 @@ bool AcceptInvitationAction::Execute(Event event)
|
||||
std::string name;
|
||||
packet >> flag >> name;
|
||||
|
||||
// Player* inviter = ObjectAccessor::FindPlayer(grp->GetLeaderGUID());
|
||||
Player* inviter = ObjectAccessor::FindPlayerByName(name, true);
|
||||
Player* inviter = ObjectAccessor::FindPlayer(grp->GetLeaderGUID());
|
||||
if (!inviter)
|
||||
return false;
|
||||
|
||||
@@ -36,11 +35,17 @@ bool AcceptInvitationAction::Execute(Event event)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bot->isAFK())
|
||||
bot->ToggleAFK();
|
||||
|
||||
WorldPacket p;
|
||||
uint32 roles_mask = 0;
|
||||
p << roles_mask;
|
||||
bot->GetSession()->HandleGroupAcceptOpcode(p);
|
||||
|
||||
if (!bot->GetGroup() || !bot->GetGroup()->IsMember(inviter->GetGUID()))
|
||||
return false;
|
||||
|
||||
if (sRandomPlayerbotMgr->IsRandomBot(bot))
|
||||
botAI->SetMaster(inviter);
|
||||
// else
|
||||
|
||||
Reference in New Issue
Block a user