diff --git a/zone/bot.h b/zone/bot.h index ffb50fe87..df8361bab 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -387,7 +387,7 @@ public: static void ProcessRaidInvite(Bot* invitee, Client* invitor); //Mitch static void ProcessRaidInvite(Client* invitee, Client* invitor); //Mitch uint8 GetNumberNeedingHealedInRaidGroup(uint8 hpr, bool includePets); //Mitch - inline void SetDirtyAutoHaters() { m_dirtyautohaters = true; } + inline void SetDirtyAutoHaters() { m_dirtyautohaters = true; } //Mitch static std::list GetBotSpellsForSpellEffect(Bot* botCaster, int spellEffect); static std::list GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster, int spellEffect, SpellTargetType targetType); diff --git a/zone/bot_raid.cpp b/zone/bot_raid.cpp index 167652d6a..0e0450a1e 100644 --- a/zone/bot_raid.cpp +++ b/zone/bot_raid.cpp @@ -231,6 +231,7 @@ void Bot::AI_Process_Raid() if (NOT_HOLDING && NOT_PASSIVE) { auto attack_target = bot_owner->GetTarget(); + if (attack_target) { InterruptSpell(); diff --git a/zone/client.cpp b/zone/client.cpp index 0dfd55dfd..7a34a142a 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -812,7 +812,7 @@ void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req, CLIENT_CO // todo: save packets for later use AddPacket(app, ack_req); } - else if (eqs && !IsBot()) //Mitch added the BoTcheck for a fail safe on trying to send a packet to a BoT! + else if (eqs) // && !IsBot()) //Mitch added the BoTcheck for a fail safe on trying to send a packet to a BoT! { eqs->QueuePacket(app, ack_req); } @@ -826,7 +826,7 @@ void Client::FastQueuePacket(EQApplicationPacket** app, bool ack_req, CLIENT_CON return; } else { - if(eqs && !IsBot()) //Mitch added + if(eqs) // && !IsBot()) //Mitch added eqs->FastQueuePacket((EQApplicationPacket **)app, ack_req); else if (app && (*app)) delete *app; diff --git a/zone/raids.cpp b/zone/raids.cpp index 116f55b65..27b6635b5 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -1120,10 +1120,7 @@ void Raid::SendRaidAddAll(const char *who) { for (int x = 0; x < MAX_RAID_MEMBERS; x++) { - if (strcmp(members[x].membername, who) == 0 ) //Mitch add IsBot - //if (!members[x].member->IsBot() || - // strcmp(members[x].membername, who) == 0 || - // (members[x].SentToBotOwner && members[x].member->GetOwnerID() != entity_list.GetClientByName(who)->CharacterID())) //Mitch add IsBot + if (strcmp(members[x].membername, who) == 0 ) { auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidAddMember_Struct)); RaidAddMember_Struct* ram = (RaidAddMember_Struct*)outapp->pBuffer; @@ -1249,10 +1246,13 @@ void Raid::SendBulkRaid(Client *to) { if(!to) return; + + if (IsRaidMemberBot(to)) + return; for(int x = 0; x < MAX_RAID_MEMBERS; x++) { - if(strlen(members[x].membername) > 0 && (strcmp(members[x].membername, to->GetName()) != 0)) //don't send ourself + if(members[x].member && strlen(members[x].membername) > 0 && (strcmp(members[x].membername, to->GetName()) != 0)) //don't send ourself { SendRaidAdd(members[x].membername, to); } @@ -1263,7 +1263,7 @@ void Raid::QueuePacket(const EQApplicationPacket *app, bool ack_req) { for(int x = 0; x < MAX_RAID_MEMBERS; x++) { - if(members[x].member && !members[x].member->IsBot()) + if(members[x].member && !IsRaidMemberBot(members[x].member)) { members[x].member->QueuePacket(app, ack_req); } @@ -1272,6 +1272,9 @@ void Raid::QueuePacket(const EQApplicationPacket *app, bool ack_req) void Raid::SendMakeLeaderPacket(const char *who) //30 { + if (entity_list.GetBotByBotName(who) && IsRaidMemberBot(entity_list.GetBotByBotName(who)->CastToClient())) + return; + auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidLeadershipUpdate_Struct)); RaidLeadershipUpdate_Struct *rg = (RaidLeadershipUpdate_Struct*)outapp->pBuffer; rg->action = raidMakeLeader; @@ -1287,6 +1290,9 @@ void Raid::SendMakeLeaderPacketTo(const char *who, Client *to) if(!to) return; + if (IsRaidMemberBot(to)) + return; + auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidLeadershipUpdate_Struct)); RaidLeadershipUpdate_Struct *rg = (RaidLeadershipUpdate_Struct*)outapp->pBuffer; rg->action = raidMakeLeader; @@ -1317,6 +1323,9 @@ void Raid::SendGroupUpdate(Client *to) if(!to) return; + if (IsRaidMemberBot(to)) + return; + auto outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupUpdate2_Struct)); GroupUpdate2_Struct* gu = (GroupUpdate2_Struct*)outapp->pBuffer; gu->action = groupActUpdate; @@ -1434,7 +1443,7 @@ void Raid::SendRaidUnlockTo(Client *c) void Raid::SendGroupDisband(Client *to) { - if(!to) + if(!to || IsRaidMemberBot(to)) return; auto outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupUpdate_Struct)); @@ -1505,6 +1514,9 @@ void Raid::SendRaidMOTDToWorld() void Raid::SendGroupLeadershipAA(Client *c, uint32 gid) { + if (IsRaidMemberBot(c)) + return; + auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidLeadershipUpdate_Struct)); RaidLeadershipUpdate_Struct *rlaa = (RaidLeadershipUpdate_Struct *)outapp->pBuffer; rlaa->action = raidSetLeaderAbilities; @@ -1520,14 +1532,14 @@ void Raid::SendGroupLeadershipAA(Client *c, uint32 gid) void Raid::SendGroupLeadershipAA(uint32 gid) { for (uint32 i = 0; i < MAX_RAID_MEMBERS; i++) - if (members[i].member && members[i].GroupNumber == gid) + if (members[i].member && members[i].GroupNumber == gid && !IsRaidMemberBot(members[i].member)) SendGroupLeadershipAA(members[i].member, gid); } void Raid::SendAllRaidLeadershipAA() { for (uint32 i = 0; i < MAX_RAID_MEMBERS; i++) - if (members[i].member) + if (members[i].member && !IsRaidMemberBot(members[i].member)) SendGroupLeadershipAA(members[i].member, members[i].GroupNumber); } @@ -1927,9 +1939,14 @@ void Raid::CheckGroupMentor(uint32 group_id, Client *c) void Raid::SetDirtyAutoHaters() { for (int i = 0; i < MAX_RAID_MEMBERS; ++i) - if (members[i].member && members[i].member->CastToBot()->GetBotID() == 0) + if (members[i].member && IsRaidMemberBot(members[i].member)) + { + members[i].member->CastToBot()->SetDirtyAutoHaters(); + } + else if (members[i].member && members[i].member->CastToClient()->IsClient()) + { members[i].member->SetDirtyAutoHaters(); - + } } void Raid::QueueClients(Mob *sender, const EQApplicationPacket *app, bool ack_required /*= true*/, bool ignore_sender /*= true*/, float distance /*= 0*/, bool group_only /*= true*/) { @@ -1948,6 +1965,9 @@ void Raid::QueueClients(Mob *sender, const EQApplicationPacket *app, bool ack_re if (!members[i].member->IsClient()) continue; + if (IsRaidMemberBot(members[i].member)) + continue; + if (ignore_sender && members[i].member == sender) continue;