mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-27 10:32:26 +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:
parent
6f883566f6
commit
fef5108b0d
54
zone/bot.cpp
54
zone/bot.cpp
@ -7640,18 +7640,58 @@ void Bot::SetDefaultBotStance() {
|
|||||||
_botStance = defaultStance;
|
_botStance = defaultStance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::BotGroupSay(Mob *speaker, const char *msg, ...) {
|
void Bot::BotGroupSay(Mob* speaker, const char* msg, ...) {
|
||||||
char buf[1000];
|
char buf[1000];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
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()) {
|
|
||||||
Group *g = speaker->GetGroup();
|
if (speaker->IsRaidGrouped()) {
|
||||||
if (g)
|
Raid* r = entity_list.GetRaidByBotName(speaker->GetName());
|
||||||
g->GroupMessage(speaker->CastToMob(), Language::CommonTongue, Language::MaxValue, buf);
|
if (r) {
|
||||||
} else
|
for (const auto& m : r->members) {
|
||||||
speaker->Say("%s", buf);
|
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();
|
||||||
|
if (g) {
|
||||||
|
for (auto& m : g->members) {
|
||||||
|
if (m && !m->IsBot()) {
|
||||||
|
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) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user