mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-26 15:37:16 +00:00
[Bots] Move BotGroupSay to Pet Response (#4171)
* [Bots] Move BotGroupSay messages to PetResponse filter to reduce spam * Cleanup raid checks * Group cleanup
This commit is contained in:
+45
-5
@@ -7646,12 +7646,52 @@ void Bot::BotGroupSay(Mob *speaker, const char *msg, ...) {
|
|||||||
va_start(ap, msg);
|
va_start(ap, msg);
|
||||||
vsnprintf(buf, 1000, msg, ap);
|
vsnprintf(buf, 1000, msg, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
if (speaker->HasGroup()) {
|
|
||||||
|
if (speaker->IsRaidGrouped()) {
|
||||||
|
Raid* r = entity_list.GetRaidByBotName(speaker->GetName());
|
||||||
|
if (r) {
|
||||||
|
for (const auto& m : r->members) {
|
||||||
|
if (m.member && !m.is_bot) {
|
||||||
|
m.member->FilteredMessageString(
|
||||||
|
speaker,
|
||||||
|
Chat::PetResponse,
|
||||||
|
FilterSocials,
|
||||||
|
GENERIC_SAY,
|
||||||
|
speaker->GetCleanName(),
|
||||||
|
buf
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (speaker->HasGroup()) {
|
||||||
Group* g = speaker->GetGroup();
|
Group* g = speaker->GetGroup();
|
||||||
if (g)
|
if (g) {
|
||||||
g->GroupMessage(speaker->CastToMob(), Language::CommonTongue, Language::MaxValue, buf);
|
for (auto& m : g->members) {
|
||||||
} else
|
if (m && !m->IsBot()) {
|
||||||
speaker->Say("%s", buf);
|
m->FilteredMessageString(
|
||||||
|
speaker,
|
||||||
|
Chat::PetResponse,
|
||||||
|
FilterSocials,
|
||||||
|
GENERIC_SAY,
|
||||||
|
speaker->GetCleanName(),
|
||||||
|
buf
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//speaker->Say("%s", buf);
|
||||||
|
speaker->GetOwner()->FilteredMessageString(
|
||||||
|
speaker,
|
||||||
|
Chat::PetResponse,
|
||||||
|
FilterSocials,
|
||||||
|
GENERIC_SAY,
|
||||||
|
speaker->GetCleanName(),
|
||||||
|
buf
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Bot::UseDiscipline(uint32 spell_id, uint32 target) {
|
bool Bot::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||||
|
|||||||
Reference in New Issue
Block a user