mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-14 09:29:09 +00:00
Chat refactor quests and generic + suggest
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "GuildMgr.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "BroadcastHelper.h"
|
||||
|
||||
bool InviteToGroupAction::Execute(Event event)
|
||||
{
|
||||
@@ -76,6 +77,26 @@ bool InviteNearbyToGroupAction::Execute(Event event)
|
||||
if (sServerFacade->GetDistance2d(bot, player) > sPlayerbotAIConfig->sightDistance)
|
||||
continue;
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
|
||||
if (!botAI->HasActivePlayerMaster())
|
||||
{
|
||||
if (guild && bot->GetGuildId() == player->GetGuildId())
|
||||
{
|
||||
BroadcastHelper::BroadcastGuildGroupOrRaidInvite(botAI, bot, player, group);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::map<std::string, std::string> placeholders;
|
||||
placeholders["%player"] = player->GetName();
|
||||
|
||||
if (group && group->isRaidGroup())
|
||||
bot->Say(BOT_TEXT2("join_raid", placeholders), (bot->GetTeamId() == TEAM_ALLIANCE ? LANG_COMMON : LANG_ORCISH));
|
||||
else
|
||||
bot->Say(BOT_TEXT2("join_group", placeholders), (bot->GetTeamId() == TEAM_ALLIANCE ? LANG_COMMON : LANG_ORCISH));
|
||||
}
|
||||
}
|
||||
|
||||
return Invite(player);
|
||||
}
|
||||
|
||||
@@ -125,6 +146,8 @@ std::vector<Player*> InviteGuildToGroupAction::getGuildMembers()
|
||||
|
||||
bool InviteGuildToGroupAction::Execute(Event event)
|
||||
{
|
||||
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
|
||||
|
||||
for (auto& member : getGuildMembers())
|
||||
{
|
||||
Player* player = member;
|
||||
@@ -165,6 +188,8 @@ bool InviteGuildToGroupAction::Execute(Event event)
|
||||
if (!botAI && sServerFacade->GetDistance2d(bot, player) > sPlayerbotAIConfig->sightDistance)
|
||||
continue;
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
BroadcastHelper::BroadcastGuildGroupOrRaidInvite(botAI, bot, player, group);
|
||||
return Invite(player);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user