diff --git a/zone/bot.cpp b/zone/bot.cpp index 99621dd0a..21066bb60 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -626,14 +626,14 @@ void Bot::ChangeBotRangedWeapons(bool isRanged) { BotAddEquipItem(EQ::invslot::slotPrimary, GetBotItemBySlot(EQ::invslot::slotPrimary)); BotAddEquipItem(EQ::invslot::slotSecondary, GetBotItemBySlot(EQ::invslot::slotSecondary)); SetAttackTimer(); - RaidGroupSay(this, "My blade is ready"); + RaidGroupSay("My blade is ready"); } else { BotRemoveEquipItem(EQ::invslot::slotPrimary); BotRemoveEquipItem(EQ::invslot::slotSecondary); BotAddEquipItem(EQ::invslot::slotAmmo, GetBotItemBySlot(EQ::invslot::slotAmmo)); BotAddEquipItem(EQ::invslot::slotSecondary, GetBotItemBySlot(EQ::invslot::slotRange)); SetAttackTimer(); - RaidGroupSay(this, "My blades are sheathed"); + RaidGroupSay("My blades are sheathed"); } } @@ -1937,7 +1937,7 @@ bool Bot::BotRangedAttack(Mob* other, bool can_double_attack) { if (!ammo || ammo_item->GetCharges() < 1) { if (!GetCombatRoundForAlerts()) { SetCombatRoundForAlerts(); - RaidGroupSay(this, "I do not have any ammo!"); + RaidGroupSay("I do not have any ammo!"); } } return false; @@ -2965,11 +2965,11 @@ bool Bot::TryEvade(Mob* tar) { } if (zone->random.Int(0, 260) < (int)GetSkill(EQ::skills::SkillHide)) { - RaidGroupSay(this, "I have momentarily ducked away from the main combat."); + RaidGroupSay("I have momentarily ducked away from the main combat."); RogueEvade(tar); } else { - RaidGroupSay(this, "My attempts at ducking clear of combat fail."); + RaidGroupSay("My attempts at ducking clear of combat fail."); } //SendAppearancePacket(AT_Invis, Invisibility::Visible); @@ -3008,11 +3008,11 @@ bool Bot::TryEvade(Mob* tar) { if (zone->random.Real(0, 160) > totalfeign) { //SendAppearancePacket(AT_Anim, ANIM_DEATH); - RaidGroupSay(this, "I have fallen to the ground."); + RaidGroupSay("I have fallen to the ground."); SetFeigned(false); } else { - RaidGroupSay(this, "I have successfully feigned my death."); + RaidGroupSay("I have successfully feigned my death."); SetFeigned(true); //SendAppearancePacket(AT_Anim, ANIM_DEATH); } @@ -3543,7 +3543,6 @@ void Bot::BotPullerProcess(Client* bot_owner, Raid* raid) { raid->RaidSay(msg.c_str(), GetCleanName(), 0, 100); } else { RaidGroupSay( - this, fmt::format( "Pulling {}.", pull_target->GetCleanName() @@ -5318,7 +5317,6 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { if (IsTaunting() && target->IsNPC() && taunt_time) { if (GetTarget() && GetTarget()->GetHateTop() && GetTarget()->GetHateTop() != this) { RaidGroupSay( - this, fmt::format( "Taunting {}.", target->GetCleanName() @@ -6254,7 +6252,6 @@ bool Bot::DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, EQ::spel if (isMainGroupMGB && (GetClass() != Class::Bard)) { RaidGroupSay( - this, fmt::format( "Casting {} as a Mass Group Buff.", spells[spell_id].name @@ -7905,10 +7902,10 @@ void Bot::SetDefaultBotStance() { _botStance = GetClass() == Class::Warrior ? Stance::Aggressive : Stance::Balanced; } -void Bot::RaidGroupSay(Mob* speaker, const char* msg, ...) { +void Bot::RaidGroupSay(const char* msg, ...) { if ( - speaker->CastToBot()->GetTempSpellType() != UINT16_MAX && - !speaker->CastToBot()->GetSpellTypeAnnounceCast(speaker->CastToBot()->GetTempSpellType()) + GetTempSpellType() != UINT16_MAX && + !GetSpellTypeAnnounceCast(GetTempSpellType()) ) { return; } @@ -7919,57 +7916,32 @@ void Bot::RaidGroupSay(Mob* speaker, const char* msg, ...) { vsnprintf(buf, 1000, msg, ap); va_end(ap); - if (speaker->IsRaidGrouped()) { - Raid* r = speaker->CastToBot()->GetStoredRaid(); + if (IsRaidGrouped()) { + Raid* r = GetStoredRaid() ? GetStoredRaid() : GetRaid(); 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 - ); + if (m.member && m.member->IsClient()) { + m.member->FilteredMessageString(this,Chat::PetResponse,FilterSocials,GENERIC_SAY,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 if (HasGroup()) { + for (auto& m : GetGroup()->members) { + if (m && m->IsClient()) { + m->FilteredMessageString(this,Chat::PetResponse,FilterSocials,GENERIC_SAY,GetCleanName(),buf); } } - } } - else { - speaker->GetOwner()->FilteredMessageString( - speaker, - Chat::PetResponse, - FilterSocials, - GENERIC_SAY, - speaker->GetCleanName(), - buf - ); + else if (GetOwner()) { + GetOwner()->FilteredMessageString(this,Chat::PetResponse,FilterSocials,GENERIC_SAY,GetCleanName(),buf); } } bool Bot::UseDiscipline(uint32 spell_id, uint32 target) { if (!IsValidSpell(spell_id)) { - RaidGroupSay(this, "Not a valid spell."); + RaidGroupSay("Not a valid spell."); return false; } @@ -9398,7 +9370,6 @@ void Bot::DoItemClick(const EQ::ItemData *item, uint16 slot_id) SetIsUsingItemClick(true); RaidGroupSay( - this, fmt::format( "Attempting to cast [{}] on {}.", spells[item->Click.Effect].name, @@ -11312,7 +11283,6 @@ bool Bot::AttemptAACastSpell(Mob* tar, uint16 spell_id, AA::Rank* rank) { if (IsCasting()) { RaidGroupSay( - this, fmt::format( "Interrupting {}. I have been commanded to try to cast an AA - {} on {}.", CastingSpellID() ? spells[CastingSpellID()].name : "my spell", @@ -11326,7 +11296,6 @@ bool Bot::AttemptAACastSpell(Mob* tar, uint16 spell_id, AA::Rank* rank) { if (CastSpell(spell_id, tar->GetID())) { RaidGroupSay( - this, fmt::format( "Casting an AA - {} on {}.", GetSpellName(spell_id), @@ -11429,7 +11398,6 @@ bool Bot::AttemptForcedCastSpell(Mob* tar, uint16 spell_id, bool is_disc) { if (IsCasting()) { RaidGroupSay( - this, fmt::format( "Interrupting {}. I have been commanded to try to cast {} on {}.", CastingSpellID() ? spells[CastingSpellID()].name : "my spell", @@ -11445,7 +11413,6 @@ bool Bot::AttemptForcedCastSpell(Mob* tar, uint16 spell_id, bool is_disc) { } RaidGroupSay( - this, fmt::format( "Casting {} on {}.", GetSpellName(spell_id), diff --git a/zone/bot.h b/zone/bot.h index 1523a2174..b5e53e713 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -778,7 +778,7 @@ public: // Static Bot Group Methods static bool AddBotToGroup(Bot* bot, Group* group); static bool RemoveBotFromGroup(Bot* bot, Group* group); - static void RaidGroupSay(Mob *speaker, const char *msg, ...); + void RaidGroupSay(const char *msg, ...); // "GET" Class Methods uint32 GetBotID() const { return _botID; } diff --git a/zone/bot_commands/bot.cpp b/zone/bot_commands/bot.cpp index c779aec88..3a6f57104 100644 --- a/zone/bot_commands/bot.cpp +++ b/zone/bot_commands/bot.cpp @@ -1133,7 +1133,7 @@ void bot_command_spawn(Client *c, const Seperator *sep) } if (!silent_tell && c->GetBotOption(Client::booSpawnMessageSay)) { - Bot::RaidGroupSay(my_bot, bot_spawn_message[message_index].c_str()); + my_bot->RaidGroupSay(bot_spawn_message[message_index].c_str()); } else if (!silent_tell && c->GetBotOption(Client::booSpawnMessageTell)) { my_bot->OwnerMessage(bot_spawn_message[message_index]); diff --git a/zone/bot_commands/cast.cpp b/zone/bot_commands/cast.cpp index 6ac5119fb..f2f812caa 100644 --- a/zone/bot_commands/cast.cpp +++ b/zone/bot_commands/cast.cpp @@ -502,7 +502,6 @@ void bot_command_cast(Client* c, const Seperator* sep) if (IsBotSpellTypeDetrimental(spell_type) && !bot_iter->IsAttackAllowed(new_tar)) { bot_iter->RaidGroupSay( - bot_iter, fmt::format( "I cannot attack [{}].", new_tar->GetCleanName() diff --git a/zone/bot_commands/depart.cpp b/zone/bot_commands/depart.cpp index c9deda5ad..9fb954758 100644 --- a/zone/bot_commands/depart.cpp +++ b/zone/bot_commands/depart.cpp @@ -171,8 +171,7 @@ void bot_command_depart(Client* c, const Seperator* sep) } } - Bot::RaidGroupSay( - bot_iter, + bot_iter->RaidGroupSay( fmt::format( "I can port you to {}.", Saylink::Silent( @@ -207,8 +206,7 @@ void bot_command_depart(Client* c, const Seperator* sep) } if (bot_iter->IsCommandedSpell() && bot_iter->IsCasting()) { - Bot::RaidGroupSay( - bot_iter, + bot_iter->RaidGroupSay( fmt::format( "Interrupting {}. I have been commanded to try to cast a [{}] spell, {} on {}.", bot_iter->CastingSpellID() ? spells[bot_iter->CastingSpellID()].name : "my spell", @@ -229,8 +227,7 @@ void bot_command_depart(Client* c, const Seperator* sep) bot_iter->SetCastedSpellType(BotSpellTypes::Teleport); } - Bot::RaidGroupSay( - bot_iter, + bot_iter->RaidGroupSay( fmt::format( "Casting {} [{}] on {}.", GetSpellName(itr->SpellId), diff --git a/zone/bot_commands/guard.cpp b/zone/bot_commands/guard.cpp index 808de155d..3138914ee 100644 --- a/zone/bot_commands/guard.cpp +++ b/zone/bot_commands/guard.cpp @@ -47,8 +47,7 @@ void bot_command_guard(Client *c, const Seperator *sep) } if (sbl.size() == 1) { - Bot::RaidGroupSay( - sbl.front(), + sbl.front()->RaidGroupSay( fmt::format( "{}uarding this position.", clear ? "No longer g" : "G" diff --git a/zone/bot_commands/hold.cpp b/zone/bot_commands/hold.cpp index 56ca1f5a8..4d79fcce7 100644 --- a/zone/bot_commands/hold.cpp +++ b/zone/bot_commands/hold.cpp @@ -47,8 +47,7 @@ void bot_command_hold(Client *c, const Seperator *sep) } if (sbl.size() == 1) { - Bot::RaidGroupSay( - sbl.front(), + sbl.front()->RaidGroupSay( fmt::format( "{}olding my attacks.", clear ? "No longer h" : "H" diff --git a/zone/bot_commands/pet.cpp b/zone/bot_commands/pet.cpp index 712b55118..679f004b5 100644 --- a/zone/bot_commands/pet.cpp +++ b/zone/bot_commands/pet.cpp @@ -74,7 +74,7 @@ void bot_command_pet_remove(Client *c, const Seperator *sep) if (bot_iter->IsBotCharmer()) { bot_iter->SetBotCharmer(false); if (sbl.size() == 1) - Bot::RaidGroupSay(bot_iter, "Using a summoned pet"); + bot_iter->RaidGroupSay("Using a summoned pet"); ++summoned_pet; continue; } @@ -86,7 +86,7 @@ void bot_command_pet_remove(Client *c, const Seperator *sep) } bot_iter->SetBotCharmer(true); if (sbl.size() == 1) - Bot::RaidGroupSay(bot_iter, "Available for Charming"); + bot_iter->RaidGroupSay("Available for Charming"); ++charmed_pet; } diff --git a/zone/bot_commands/pick_lock.cpp b/zone/bot_commands/pick_lock.cpp index f368087e2..7815833ee 100644 --- a/zone/bot_commands/pick_lock.cpp +++ b/zone/bot_commands/pick_lock.cpp @@ -24,7 +24,7 @@ void bot_command_pick_lock(Client *c, const Seperator *sep) Bot* my_bot = sbl.front(); my_bot->InterruptSpell(); - Bot::RaidGroupSay(my_bot, "Attempting to pick the lock."); + my_bot->RaidGroupSay("Attempting to pick the lock."); std::list door_list; entity_list.GetDoorsList(door_list); @@ -51,7 +51,7 @@ void bot_command_pick_lock(Client *c, const Seperator *sep) ++open_count; } else { - Bot::RaidGroupSay(my_bot, "I am not skilled enough for this lock."); + my_bot->RaidGroupSay("I am not skilled enough for this lock."); } } c->Message(Chat::White, "%i door%s attempted - %i door%s successful", door_count, ((door_count != 1) ? ("s") : ("")), open_count, ((open_count != 1) ? ("s") : (""))); diff --git a/zone/bot_commands/taunt.cpp b/zone/bot_commands/taunt.cpp index 149664690..51449cddc 100644 --- a/zone/bot_commands/taunt.cpp +++ b/zone/bot_commands/taunt.cpp @@ -130,8 +130,7 @@ void bot_command_taunt(Client* c, const Seperator* sep) bot_iter->SetTaunting(taunt_state); - Bot::RaidGroupSay( - bot_iter, + bot_iter->RaidGroupSay( fmt::format( "I am {} taunting.", bot_iter->IsTaunting() ? "now" : "no longer" @@ -154,8 +153,7 @@ void bot_command_taunt(Client* c, const Seperator* sep) bot_iter->GetPet()->CastToNPC()->SetTaunting(taunt_state); - Bot::RaidGroupSay( - bot_iter, + bot_iter->RaidGroupSay( fmt::format( "My Pet is {} taunting.", bot_iter->GetPet()->CastToNPC()->IsTaunting() ? "now" : "no longer" diff --git a/zone/bot_commands/track.cpp b/zone/bot_commands/track.cpp index 5c62f3a1d..18a21679a 100644 --- a/zone/bot_commands/track.cpp +++ b/zone/bot_commands/track.cpp @@ -67,6 +67,6 @@ void bot_command_track(Client *c, const Seperator *sep) } my_bot->InterruptSpell(); - Bot::RaidGroupSay(my_bot, tracking_msg.c_str()); + my_bot->RaidGroupSay(tracking_msg.c_str()); entity_list.ShowSpawnWindow(c, (c->GetLevel() * base_distance), track_named); } diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 2da63d90c..56db39352 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -229,7 +229,6 @@ bool Bot::AICastSpell(Mob* tar, uint8 chance, uint16 spell_type, uint16 sub_targ if (IsCommandedSpell() && IsCasting()) { RaidGroupSay( - this, fmt::format( "Interrupting {}. I have been commanded to try to cast a [{}] spell, {} on {}.", CastingSpellID() ? spells[CastingSpellID()].name : "my spell", @@ -255,7 +254,6 @@ bool Bot::AICastSpell(Mob* tar, uint8 chance, uint16 spell_type, uint16 sub_targ } RaidGroupSay( - this, fmt::format( "Casting {} [{}] on {}.", GetSpellName(s.SpellId), @@ -302,7 +300,6 @@ bool Bot::BotCastMez(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spel } RaidGroupSay( - this, fmt::format( "Casting {} [{}] on {}.", GetSpellName(s.SpellId), @@ -343,7 +340,6 @@ bool Bot::BotCastCure(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spe } RaidGroupSay( - this, fmt::format( "Curing the group with {}.", GetSpellName(bot_spell.SpellId) @@ -356,7 +352,6 @@ bool Bot::BotCastCure(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spe } RaidGroupSay( - this, fmt::format( "Curing {} with {}.", (tar == this ? "myself" : tar->GetCleanName()), @@ -410,7 +405,6 @@ bool Bot::BotCastPet(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spel SetCastedSpellType(spell_type); RaidGroupSay( - this, fmt::format( "Summoning a pet [{}].", GetSpellName(bot_spell.SpellId) @@ -466,7 +460,6 @@ bool Bot::BotCastNuke(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spe SetCastedSpellType(spell_type); RaidGroupSay( - this, fmt::format( "Casting {} [{}] on {}.", GetSpellName(s.SpellId), @@ -484,7 +477,6 @@ bool Bot::BotCastNuke(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spe SetCastedSpellType(spell_type); RaidGroupSay( - this, fmt::format( "Casting {} [{}] on {}.", GetSpellName(bot_spell.SpellId), @@ -518,7 +510,6 @@ bool Bot::BotCastHeal(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spe } RaidGroupSay( - this, fmt::format( "Healing the group with {} [{}].", GetSpellName(bot_spell.SpellId), @@ -535,7 +526,6 @@ bool Bot::BotCastHeal(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spe } RaidGroupSay( - this, fmt::format( "Healing {} with {} [{}].", (tar == this ? "myself" : tar->GetCleanName()), @@ -888,7 +878,6 @@ bool Bot::AIHealRotation(Mob* tar, bool useFastHeals) { if (castedSpell) { RaidGroupSay( - this, fmt::format( "Casting {} on {}, please stay in range!", spells[botSpell.SpellId].name, diff --git a/zone/lua_bot.cpp b/zone/lua_bot.cpp index dc1742fee..c3ee8445a 100644 --- a/zone/lua_bot.cpp +++ b/zone/lua_bot.cpp @@ -661,7 +661,7 @@ void Lua_Bot::DeleteBot() { void Lua_Bot::RaidGroupSay(const char* message) { Lua_Safe_Call_Void(); - self->RaidGroupSay(self, message); + self->RaidGroupSay(message); } luabind::scope lua_register_bot() { diff --git a/zone/perl_bot.cpp b/zone/perl_bot.cpp index b4aaee545..a298e4eab 100644 --- a/zone/perl_bot.cpp +++ b/zone/perl_bot.cpp @@ -617,7 +617,7 @@ void Perl_Bot_DeleteBot(Bot* self) // @categories Script Utility void Perl_Bot_RaidGroupSay(Bot* self, const char* message) // @categories Script Utility { - self->RaidGroupSay(self, message); + self->RaidGroupSay(message); } void perl_register_bot() diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 71eec7255..4ce6bd150 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -734,7 +734,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) { if (!bot_piercer || bot_piercer->ItemType != EQ::item::ItemType1HPiercing) { if (!bot->GetCombatRoundForAlerts()) { bot->SetCombatRoundForAlerts(); - bot->RaidGroupSay(this, "I can't backstab with this weapon!"); + bot->RaidGroupSay("I can't backstab with this weapon!"); } return; }