Chat refactor quests and generic + suggest

This commit is contained in:
antony
2024-08-01 14:13:00 +02:00
parent 79d0f3fd28
commit 142f2ad212
19 changed files with 1855 additions and 304 deletions

View File

@@ -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);
}