mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-27 16:37:17 +00:00
Cleanup of bot raid work and inclusion of bot_raid in cmake
This commit is contained in:
@@ -27,7 +27,9 @@ public:
|
|||||||
int isgroupleader;
|
int isgroupleader;
|
||||||
int israidleader;
|
int israidleader;
|
||||||
int islooter;
|
int islooter;
|
||||||
|
#ifdef BOTS
|
||||||
int isbot;
|
int isbot;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
@@ -47,7 +49,9 @@ public:
|
|||||||
"isgroupleader",
|
"isgroupleader",
|
||||||
"israidleader",
|
"israidleader",
|
||||||
"islooter",
|
"islooter",
|
||||||
|
#ifdef BOTS
|
||||||
"isbot",
|
"isbot",
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +96,9 @@ public:
|
|||||||
entry.isgroupleader = 0;
|
entry.isgroupleader = 0;
|
||||||
entry.israidleader = 0;
|
entry.israidleader = 0;
|
||||||
entry.islooter = 0;
|
entry.islooter = 0;
|
||||||
|
#ifdef BOTS
|
||||||
entry.isbot = 0;
|
entry.isbot = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
@@ -137,7 +143,9 @@ public:
|
|||||||
entry.isgroupleader = atoi(row[6]);
|
entry.isgroupleader = atoi(row[6]);
|
||||||
entry.israidleader = atoi(row[7]);
|
entry.israidleader = atoi(row[7]);
|
||||||
entry.islooter = atoi(row[8]);
|
entry.islooter = atoi(row[8]);
|
||||||
|
#ifdef BOTS
|
||||||
entry.isbot = atoi(row[9]);
|
entry.isbot = atoi(row[9]);
|
||||||
|
#endif
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
@@ -180,7 +188,9 @@ public:
|
|||||||
update_values.push_back(columns[6] + " = " + std::to_string(raid_members_entry.isgroupleader));
|
update_values.push_back(columns[6] + " = " + std::to_string(raid_members_entry.isgroupleader));
|
||||||
update_values.push_back(columns[7] + " = " + std::to_string(raid_members_entry.israidleader));
|
update_values.push_back(columns[7] + " = " + std::to_string(raid_members_entry.israidleader));
|
||||||
update_values.push_back(columns[8] + " = " + std::to_string(raid_members_entry.islooter));
|
update_values.push_back(columns[8] + " = " + std::to_string(raid_members_entry.islooter));
|
||||||
update_values.push_back(columns[9] + " = " + std::to_string(raid_members_entry.isbot)); //Mitch
|
#ifdef BOTS
|
||||||
|
update_values.push_back(columns[9] + " = " + std::to_string(raid_members_entry.isbot));
|
||||||
|
#endif
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -211,8 +221,9 @@ public:
|
|||||||
insert_values.push_back(std::to_string(raid_members_entry.isgroupleader));
|
insert_values.push_back(std::to_string(raid_members_entry.isgroupleader));
|
||||||
insert_values.push_back(std::to_string(raid_members_entry.israidleader));
|
insert_values.push_back(std::to_string(raid_members_entry.israidleader));
|
||||||
insert_values.push_back(std::to_string(raid_members_entry.islooter));
|
insert_values.push_back(std::to_string(raid_members_entry.islooter));
|
||||||
|
#ifdef BOTS
|
||||||
insert_values.push_back(std::to_string(raid_members_entry.isbot));
|
insert_values.push_back(std::to_string(raid_members_entry.isbot));
|
||||||
|
#endif
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{} VALUES ({})",
|
"{} VALUES ({})",
|
||||||
@@ -250,8 +261,9 @@ public:
|
|||||||
insert_values.push_back(std::to_string(raid_members_entry.isgroupleader));
|
insert_values.push_back(std::to_string(raid_members_entry.isgroupleader));
|
||||||
insert_values.push_back(std::to_string(raid_members_entry.israidleader));
|
insert_values.push_back(std::to_string(raid_members_entry.israidleader));
|
||||||
insert_values.push_back(std::to_string(raid_members_entry.islooter));
|
insert_values.push_back(std::to_string(raid_members_entry.islooter));
|
||||||
|
#ifdef BOTS
|
||||||
insert_values.push_back(std::to_string(raid_members_entry.isbot));
|
insert_values.push_back(std::to_string(raid_members_entry.isbot));
|
||||||
|
#endif
|
||||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,8 +305,9 @@ public:
|
|||||||
entry.isgroupleader = atoi(row[6]);
|
entry.isgroupleader = atoi(row[6]);
|
||||||
entry.israidleader = atoi(row[7]);
|
entry.israidleader = atoi(row[7]);
|
||||||
entry.islooter = atoi(row[8]);
|
entry.islooter = atoi(row[8]);
|
||||||
|
#ifdef BOTS
|
||||||
entry.isbot = atoi(row[9]);
|
entry.isbot = atoi(row[9]);
|
||||||
|
#endif
|
||||||
all_entries.push_back(entry);
|
all_entries.push_back(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,8 +340,9 @@ public:
|
|||||||
entry.isgroupleader = atoi(row[6]);
|
entry.isgroupleader = atoi(row[6]);
|
||||||
entry.israidleader = atoi(row[7]);
|
entry.israidleader = atoi(row[7]);
|
||||||
entry.islooter = atoi(row[8]);
|
entry.islooter = atoi(row[8]);
|
||||||
|
#ifdef BOTS
|
||||||
entry.isbot = atoi(row[9]);
|
entry.isbot = atoi(row[9]);
|
||||||
|
#endif
|
||||||
all_entries.push_back(entry);
|
all_entries.push_back(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ SET(zone_sources
|
|||||||
beacon.cpp
|
beacon.cpp
|
||||||
bonuses.cpp
|
bonuses.cpp
|
||||||
bot.cpp
|
bot.cpp
|
||||||
|
bot_raid.cpp
|
||||||
bot_command.cpp
|
bot_command.cpp
|
||||||
bot_database.cpp
|
bot_database.cpp
|
||||||
botspellsai.cpp
|
botspellsai.cpp
|
||||||
|
|||||||
+3
-10
@@ -8370,9 +8370,8 @@ Bot* Bot::GetBotByBotClientOwnerAndBotName(Client* c, std::string botName) {
|
|||||||
|
|
||||||
void Bot::ProcessBotGroupInvite(Client* c, std::string botName) {
|
void Bot::ProcessBotGroupInvite(Client* c, std::string botName) {
|
||||||
if(c) {
|
if(c) {
|
||||||
// Bot* invitedBot = GetBotByBotClientOwnerAndBotName(entity_list.GetBotByBotName(botName)->GetOwner()->CastToClient(), botName);
|
|
||||||
Bot* invitedBot = GetBotByBotClientOwnerAndBotName(c, botName);
|
Bot* invitedBot = GetBotByBotClientOwnerAndBotName(c, botName);
|
||||||
//Mitch changed entity from c
|
|
||||||
if(invitedBot && !invitedBot->HasGroup()) {
|
if(invitedBot && !invitedBot->HasGroup()) {
|
||||||
if(!c->IsGrouped()) {
|
if(!c->IsGrouped()) {
|
||||||
Group *g = new Group(c);
|
Group *g = new Group(c);
|
||||||
@@ -10402,8 +10401,7 @@ void Bot::ProcessRaidInvite(Bot* invitee, Client* invitor) {
|
|||||||
raid->SendRaidCreate(c);
|
raid->SendRaidCreate(c);
|
||||||
raid->AddMember(c, 0, true, true, true);
|
raid->AddMember(c, 0, true, true, true);
|
||||||
raid->SendMakeLeaderPacketTo(raid->leadername, c);
|
raid->SendMakeLeaderPacketTo(raid->leadername, c);
|
||||||
//raid->SetGroupLeader(c->GetName()); //Mitch Jan 18
|
|
||||||
//raid->GroupUpdate(0, true);
|
|
||||||
if (raid->IsLocked()) {
|
if (raid->IsLocked()) {
|
||||||
raid->SendRaidLockTo(c);
|
raid->SendRaidLockTo(c);
|
||||||
}
|
}
|
||||||
@@ -10479,13 +10477,8 @@ void Bot::ProcessRaidInvite(Bot* invitee, Client* invitor) {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Third, no group so add the single client
|
//Third, no group so add the single client
|
||||||
//raid->SendRaidCreate(invitee);
|
|
||||||
//raid->SendMakeLeaderPacketTo(raid->leadername, invitee);
|
|
||||||
raid->AddBot(invitee);
|
raid->AddBot(invitee);
|
||||||
// raid->SendBulkRaid(invitee);
|
|
||||||
//if (raid->IsLocked()) {
|
|
||||||
// raid->SendRaidLockTo(invitee);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+4
-4
@@ -382,10 +382,10 @@ public:
|
|||||||
void PetAIProcess_Raid();
|
void PetAIProcess_Raid();
|
||||||
void AI_Process_Raid();
|
void AI_Process_Raid();
|
||||||
bool AICastSpell_Raid(Mob* tar, uint8 iChance, uint32 iSpellTypes);
|
bool AICastSpell_Raid(Mob* tar, uint8 iChance, uint32 iSpellTypes);
|
||||||
static void ProcessRaidInvite(Bot* invitee, Client* invitor); //Mitch
|
static void ProcessRaidInvite(Bot* invitee, Client* invitor);
|
||||||
static void ProcessRaidInvite(Client* invitee, Client* invitor); //Mitch
|
static void ProcessRaidInvite(Client* invitee, Client* invitor);
|
||||||
uint8 GetNumberNeedingHealedInRaidGroup(uint8 hpr, bool includePets); //Mitch
|
uint8 GetNumberNeedingHealedInRaidGroup(uint8 hpr, bool includePets);
|
||||||
inline void SetDirtyAutoHaters() { m_dirtyautohaters = true; } //Mitch
|
inline void SetDirtyAutoHaters() { m_dirtyautohaters = true; }
|
||||||
|
|
||||||
static std::list<BotSpell> GetBotSpellsForSpellEffect(Bot* botCaster, int spellEffect);
|
static std::list<BotSpell> GetBotSpellsForSpellEffect(Bot* botCaster, int spellEffect);
|
||||||
static std::list<BotSpell> GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster, int spellEffect, SpellTargetType targetType);
|
static std::list<BotSpell> GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster, int spellEffect, SpellTargetType targetType);
|
||||||
|
|||||||
+2
-2
@@ -804,7 +804,7 @@ void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req, CLIENT_CO
|
|||||||
// todo: save packets for later use
|
// todo: save packets for later use
|
||||||
AddPacket(app, ack_req);
|
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)
|
||||||
{
|
{
|
||||||
eqs->QueuePacket(app, ack_req);
|
eqs->QueuePacket(app, ack_req);
|
||||||
}
|
}
|
||||||
@@ -818,7 +818,7 @@ void Client::FastQueuePacket(EQApplicationPacket** app, bool ack_req, CLIENT_CON
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(eqs) // && !IsBot()) //Mitch added
|
if(eqs)
|
||||||
eqs->FastQueuePacket((EQApplicationPacket **)app, ack_req);
|
eqs->FastQueuePacket((EQApplicationPacket **)app, ack_req);
|
||||||
else if (app && (*app))
|
else if (app && (*app))
|
||||||
delete *app;
|
delete *app;
|
||||||
|
|||||||
@@ -11455,7 +11455,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
|
|||||||
case RaidCommandInviteIntoExisting:
|
case RaidCommandInviteIntoExisting:
|
||||||
case RaidCommandInvite: {
|
case RaidCommandInvite: {
|
||||||
|
|
||||||
#ifdef BOTS //Mitch
|
#ifdef BOTS
|
||||||
|
|
||||||
Bot* player_to_invite = nullptr;
|
Bot* player_to_invite = nullptr;
|
||||||
Client* player_to_invite_owner = nullptr;
|
Client* player_to_invite_owner = nullptr;
|
||||||
@@ -11532,7 +11532,9 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef BOTS
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
case RaidCommandAcceptInvite: {
|
case RaidCommandAcceptInvite: {
|
||||||
Client* player_accepting_invite = entity_list.GetClientByName(raid_command_packet->player_name);
|
Client* player_accepting_invite = entity_list.GetClientByName(raid_command_packet->player_name);
|
||||||
@@ -11581,7 +11583,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
|
|||||||
Bot::ProcessRaidInvite(invitee, invitor); //two clients with one or both having groups with bots
|
Bot::ProcessRaidInvite(invitee, invitor); //two clients with one or both having groups with bots
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (invitee->IsBot())
|
else if (invitee && invitee->IsBot())
|
||||||
{
|
{
|
||||||
Bot::ProcessRaidInvite(b, player_accepting_invite); //client inviting a bot
|
Bot::ProcessRaidInvite(b, player_accepting_invite); //client inviting a bot
|
||||||
break;
|
break;
|
||||||
@@ -11859,13 +11861,15 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
|
|||||||
Raid* raid = entity_list.GetRaidByClient(this);
|
Raid* raid = entity_list.GetRaidByClient(this);
|
||||||
Client* c_to_disband = entity_list.GetClientByName(raid_command_packet->leader_name);
|
Client* c_to_disband = entity_list.GetClientByName(raid_command_packet->leader_name);
|
||||||
Client* c_doing_disband = entity_list.GetClientByName(raid_command_packet->player_name);
|
Client* c_doing_disband = entity_list.GetClientByName(raid_command_packet->player_name);
|
||||||
|
#ifdef BOTS
|
||||||
Bot* b_to_disband = entity_list.GetBotByBotName(raid_command_packet->leader_name);
|
Bot* b_to_disband = entity_list.GetBotByBotName(raid_command_packet->leader_name);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (raid) {
|
if (raid) {
|
||||||
uint32 group = raid->GetGroup(raid_command_packet->leader_name);
|
uint32 group = raid->GetGroup(raid_command_packet->leader_name);
|
||||||
|
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
//Mitch added to remove all bots if the Bot_Owner is removed from the Raid
|
//Added to remove all bots if the Bot_Owner is removed from the Raid
|
||||||
//Does not camp the Bots, just removes from the raid
|
//Does not camp the Bots, just removes from the raid
|
||||||
std::vector<Bot*> raid_members_bots;
|
std::vector<Bot*> raid_members_bots;
|
||||||
if (c_to_disband)
|
if (c_to_disband)
|
||||||
@@ -11917,8 +11921,6 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
|
|||||||
if (raid->IsGroupLeader(b_to_disband->GetName()))
|
if (raid->IsGroupLeader(b_to_disband->GetName()))
|
||||||
{
|
{
|
||||||
// Remove the entire BOT group in this case
|
// Remove the entire BOT group in this case
|
||||||
//uint32 gid = raid->GetGroup(b_to_disband->GetName());
|
|
||||||
//std::vector<RaidMember> r_group_members = raid->GetRaidGroupMembers(gid);
|
|
||||||
Group* group_inst = new Group(b_to_disband);
|
Group* group_inst = new Group(b_to_disband);
|
||||||
entity_list.AddGroup(group_inst);
|
entity_list.AddGroup(group_inst);
|
||||||
database.SetGroupID(b_to_disband->GetCleanName(), group_inst->GetID(), b_to_disband->GetBotID());
|
database.SetGroupID(b_to_disband->GetCleanName(), group_inst->GetID(), b_to_disband->GetBotID());
|
||||||
|
|||||||
+4
-2
@@ -2112,7 +2112,7 @@ Raid* EntityList::GetRaidByClient(Client* client)
|
|||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
#ifdef BOTS
|
||||||
Raid* EntityList::GetRaidByBotName(const char* name)
|
Raid* EntityList::GetRaidByBotName(const char* name)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2134,7 +2134,9 @@ Raid* EntityList::GetRaidByBotName(const char* name)
|
|||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BOTS
|
||||||
Raid* EntityList::GetRaidByBot(Bot* bot)
|
Raid* EntityList::GetRaidByBot(Bot* bot)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2152,7 +2154,7 @@ Raid* EntityList::GetRaidByBot(Bot* bot)
|
|||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
Raid *EntityList::GetRaidByMob(Mob *mob)
|
Raid *EntityList::GetRaidByMob(Mob *mob)
|
||||||
|
|||||||
+5
-1
@@ -1097,7 +1097,11 @@ void Raid::SplitExp(uint32 exp, Mob* other) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (unsigned int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
for (unsigned int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||||
if (members[x].member != nullptr && members[x].member->CastToBot()->GetBotID() == 0) // If Group Member is Client
|
#ifdef BOTS
|
||||||
|
if (members[x].member != nullptr && !members[x].IsBot) // If Group Member is Client
|
||||||
|
#else
|
||||||
|
if (members[x].member != nullptr) // If Group Member is Client
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
Client *cmember = members[x].member;
|
Client *cmember = members[x].member;
|
||||||
// add exp + exp cap
|
// add exp + exp cap
|
||||||
|
|||||||
+1
-4
@@ -1248,10 +1248,7 @@ void Group::VerifyGroup() {
|
|||||||
members[i] = nullptr;
|
members[i] = nullptr;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//if (them == nullptr && members[i] == nullptr) { //fixes a group bug with bots Mitch added Jan 1 2022
|
|
||||||
// membername[i][0] = '\0';
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
|
|
||||||
if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good.
|
if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good.
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
|
|||||||
+1
-1
@@ -3855,7 +3855,7 @@ void Mob::QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::O
|
|||||||
|
|
||||||
const char *Mob::GetCleanName()
|
const char *Mob::GetCleanName()
|
||||||
{
|
{
|
||||||
if (clean_name != NULL && !strlen(clean_name)) { //extra check added for crash condition. Mitch
|
if (!strlen(clean_name)) {
|
||||||
CleanMobName(GetName(), clean_name);
|
CleanMobName(GetName(), clean_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+79
-76
@@ -24,7 +24,7 @@
|
|||||||
#include "groups.h"
|
#include "groups.h"
|
||||||
#include "mob.h"
|
#include "mob.h"
|
||||||
#include "raids.h"
|
#include "raids.h"
|
||||||
#include "bot.h" //Mitch
|
#include "bot.h"
|
||||||
|
|
||||||
#include "worldserver.h"
|
#include "worldserver.h"
|
||||||
|
|
||||||
@@ -96,12 +96,21 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo
|
|||||||
if(!c)
|
if(!c)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef BOTS
|
||||||
std::string query = StringFormat("INSERT INTO raid_members SET raidid = %lu, charid = %lu, "
|
std::string query = StringFormat("INSERT INTO raid_members SET raidid = %lu, charid = %lu, "
|
||||||
"groupid = %lu, _class = %d, level = %d, name = '%s', "
|
"groupid = %lu, _class = %d, level = %d, name = '%s', "
|
||||||
"isgroupleader = %d, israidleader = %d, islooter = %d, isbot = 0",
|
"isgroupleader = %d, israidleader = %d, islooter = %d, isbot = 0",
|
||||||
(unsigned long)GetID(), (unsigned long)c->CharacterID(),
|
(unsigned long)GetID(), (unsigned long)c->CharacterID(),
|
||||||
(unsigned long)group, c->GetClass(), c->GetLevel(),
|
(unsigned long)group, c->GetClass(), c->GetLevel(),
|
||||||
c->GetName(), groupleader, rleader, looter);
|
c->GetName(), groupleader, rleader, looter);
|
||||||
|
#else
|
||||||
|
std::string query = StringFormat("INSERT INTO raid_members SET raidid = %lu, charid = %lu, "
|
||||||
|
"groupid = %lu, _class = %d, level = %d, name = '%s', "
|
||||||
|
"isgroupleader = %d, israidleader = %d, islooter = %d",
|
||||||
|
(unsigned long)GetID(), (unsigned long)c->CharacterID(),
|
||||||
|
(unsigned long)group, c->GetClass(), c->GetLevel(),
|
||||||
|
c->GetName(), groupleader, rleader, looter);
|
||||||
|
#endif
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
|
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
@@ -171,7 +180,8 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo
|
|||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
//Mitch
|
|
||||||
|
#ifdef BOTS
|
||||||
void Raid::AddBot(Bot* b, uint32 group, bool rleader, bool groupleader, bool looter) {
|
void Raid::AddBot(Bot* b, uint32 group, bool rleader, bool groupleader, bool looter) {
|
||||||
if (!b)
|
if (!b)
|
||||||
return;
|
return;
|
||||||
@@ -190,17 +200,6 @@ void Raid::AddBot(Bot* b, uint32 group, bool rleader, bool groupleader, bool loo
|
|||||||
|
|
||||||
LearnMembers();
|
LearnMembers();
|
||||||
VerifyRaid();
|
VerifyRaid();
|
||||||
// Bots are being invited and cannot be the raid leader
|
|
||||||
// if (rleader) {
|
|
||||||
// database.SetRaidGroupLeaderInfo(RAID_GROUPLESS, GetID());
|
|
||||||
// UpdateRaidAAs();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Bots can be group leaders, though they do not have GroupAA
|
|
||||||
// if (group != RAID_GROUPLESS && groupleader) {
|
|
||||||
// database.SetRaidGroupLeaderInfo(group, GetID());
|
|
||||||
// UpdateGroupAAs(group); //Mitch Jan 22
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (group < 12) //Jan22
|
if (group < 12) //Jan22
|
||||||
GroupUpdate(group); //Jan22
|
GroupUpdate(group); //Jan22
|
||||||
@@ -210,36 +209,7 @@ void Raid::AddBot(Bot* b, uint32 group, bool rleader, bool groupleader, bool loo
|
|||||||
|
|
||||||
b->SetRaidGrouped(true);
|
b->SetRaidGrouped(true);
|
||||||
b->p_raid_instance = this;
|
b->p_raid_instance = this;
|
||||||
//SendRaidMOTD(b->GetOwner()->CastToClient());
|
|
||||||
|
|
||||||
// Mitch What to do here?
|
|
||||||
// xtarget shit ..........
|
|
||||||
//if (group == RAID_GROUPLESS) {
|
|
||||||
// if (rleader) {
|
|
||||||
// GetXTargetAutoMgr()->merge(*c->GetXTargetAutoMgr());
|
|
||||||
// c->GetXTargetAutoMgr()->clear();
|
|
||||||
// c->SetXTargetAutoMgr(GetXTargetAutoMgr());
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// if (!c->GetXTargetAutoMgr()->empty()) {
|
|
||||||
// GetXTargetAutoMgr()->merge(*c->GetXTargetAutoMgr());
|
|
||||||
// c->GetXTargetAutoMgr()->clear();
|
|
||||||
// c->RemoveAutoXTargets();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// c->SetXTargetAutoMgr(GetXTargetAutoMgr());
|
|
||||||
|
|
||||||
// if (!c->GetXTargetAutoMgr()->empty())
|
|
||||||
// c->SetDirtyAutoHaters();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
// Raid* raid_update = nullptr;
|
|
||||||
// raid_update = b->GetOwner()->GetRaid();
|
|
||||||
// if (raid_update) {
|
|
||||||
// raid_update->SendHPManaEndPacketsTo(b->GetOwner()->CastToClient());
|
|
||||||
// raid_update->SendHPManaEndPacketsFrom(b->GetOwner()->CastToClient());
|
|
||||||
// }
|
|
||||||
|
|
||||||
auto pack = new ServerPacket(ServerOP_RaidAdd, sizeof(ServerRaidGeneralAction_Struct));
|
auto pack = new ServerPacket(ServerOP_RaidAdd, sizeof(ServerRaidGeneralAction_Struct));
|
||||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||||
@@ -250,6 +220,7 @@ void Raid::AddBot(Bot* b, uint32 group, bool rleader, bool groupleader, bool loo
|
|||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void Raid::RemoveMember(const char *characterName)
|
void Raid::RemoveMember(const char *characterName)
|
||||||
@@ -1063,7 +1034,7 @@ void Raid::SendRaidAdd(const char *who, Client *to)
|
|||||||
|
|
||||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||||
{
|
{
|
||||||
if(strcmp(members[x].membername, who) == 0)// || !members[x].SentToBotOwner) //Mitch
|
if(strcmp(members[x].membername, who) == 0)
|
||||||
{
|
{
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidAddMember_Struct));
|
||||||
RaidAddMember_Struct *ram = (RaidAddMember_Struct*)outapp->pBuffer;
|
RaidAddMember_Struct *ram = (RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
@@ -1212,8 +1183,10 @@ void Raid::SendBulkRaid(Client *to)
|
|||||||
if(!to)
|
if(!to)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef BOTS
|
||||||
if (members[GetPlayerIndex(to)].IsBot)
|
if (members[GetPlayerIndex(to)].IsBot)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||||
{
|
{
|
||||||
@@ -1228,7 +1201,11 @@ void Raid::QueuePacket(const EQApplicationPacket *app, bool ack_req)
|
|||||||
{
|
{
|
||||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||||
{
|
{
|
||||||
|
#ifdef BOTS
|
||||||
if(members[x].member && !members[x].IsBot)
|
if(members[x].member && !members[x].IsBot)
|
||||||
|
#else
|
||||||
|
if(members[x].member)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
members[x].member->QueuePacket(app, ack_req);
|
members[x].member->QueuePacket(app, ack_req);
|
||||||
}
|
}
|
||||||
@@ -1238,9 +1215,10 @@ void Raid::QueuePacket(const EQApplicationPacket *app, bool ack_req)
|
|||||||
void Raid::SendMakeLeaderPacket(const char *who) //30
|
void Raid::SendMakeLeaderPacket(const char *who) //30
|
||||||
{
|
{
|
||||||
|
|
||||||
//if (entity_list.GetBotByBotName(who) && IsRaidMemberBot(entity_list.GetBotByBotName(who)->CastToClient()))
|
#ifdef BOTS
|
||||||
if (entity_list.GetBotByBotName(who) && members[GetPlayerIndex(who)].IsBot)
|
if (entity_list.GetBotByBotName(who) && members[GetPlayerIndex(who)].IsBot)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidLeadershipUpdate_Struct));
|
||||||
RaidLeadershipUpdate_Struct *rg = (RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
RaidLeadershipUpdate_Struct *rg = (RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
@@ -1257,8 +1235,10 @@ void Raid::SendMakeLeaderPacketTo(const char *who, Client *to)
|
|||||||
if(!to)
|
if(!to)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef BOTS
|
||||||
if (members[GetPlayerIndex(who)].IsBot)
|
if (members[GetPlayerIndex(who)].IsBot)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidLeadershipUpdate_Struct));
|
||||||
RaidLeadershipUpdate_Struct *rg = (RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
RaidLeadershipUpdate_Struct *rg = (RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
@@ -1290,8 +1270,10 @@ void Raid::SendGroupUpdate(Client *to)
|
|||||||
if(!to)
|
if(!to)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef BOTS
|
||||||
if (members[GetPlayerIndex(to)].IsBot)
|
if (members[GetPlayerIndex(to)].IsBot)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupUpdate2_Struct));
|
auto outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupUpdate2_Struct));
|
||||||
GroupUpdate2_Struct* gu = (GroupUpdate2_Struct*)outapp->pBuffer;
|
GroupUpdate2_Struct* gu = (GroupUpdate2_Struct*)outapp->pBuffer;
|
||||||
@@ -1481,8 +1463,10 @@ void Raid::SendRaidMOTDToWorld()
|
|||||||
|
|
||||||
void Raid::SendGroupLeadershipAA(Client *c, uint32 gid)
|
void Raid::SendGroupLeadershipAA(Client *c, uint32 gid)
|
||||||
{
|
{
|
||||||
|
#ifdef BOTS
|
||||||
if (members[GetPlayerIndex(c)].IsBot)
|
if (members[GetPlayerIndex(c)].IsBot)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidLeadershipUpdate_Struct));
|
||||||
RaidLeadershipUpdate_Struct *rlaa = (RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
RaidLeadershipUpdate_Struct *rlaa = (RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
||||||
@@ -1499,45 +1483,25 @@ void Raid::SendGroupLeadershipAA(Client *c, uint32 gid)
|
|||||||
void Raid::SendGroupLeadershipAA(uint32 gid)
|
void Raid::SendGroupLeadershipAA(uint32 gid)
|
||||||
{
|
{
|
||||||
for (uint32 i = 0; i < MAX_RAID_MEMBERS; i++)
|
for (uint32 i = 0; i < MAX_RAID_MEMBERS; i++)
|
||||||
|
#ifdef BOTS
|
||||||
if (members[i].member && members[i].GroupNumber == gid && !members[i].IsBot)
|
if (members[i].member && members[i].GroupNumber == gid && !members[i].IsBot)
|
||||||
|
#else
|
||||||
|
if (members[i].member && members[i].GroupNumber == gid)
|
||||||
|
#endif
|
||||||
SendGroupLeadershipAA(members[i].member, gid);
|
SendGroupLeadershipAA(members[i].member, gid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Raid::SendAllRaidLeadershipAA()
|
void Raid::SendAllRaidLeadershipAA()
|
||||||
{
|
{
|
||||||
for (uint32 i = 0; i < MAX_RAID_MEMBERS; i++)
|
for (uint32 i = 0; i < MAX_RAID_MEMBERS; i++)
|
||||||
|
#ifdef BOTS
|
||||||
if (members[i].member && !members[i].IsBot)
|
if (members[i].member && !members[i].IsBot)
|
||||||
|
#else
|
||||||
|
if (members[i].member)
|
||||||
|
#endif
|
||||||
SendGroupLeadershipAA(members[i].member, members[i].GroupNumber);
|
SendGroupLeadershipAA(members[i].member, members[i].GroupNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Raid::IsRaidMemberBot(Client* client)
|
|
||||||
{
|
|
||||||
std::string query = StringFormat("SELECT mob_type FROM vw_bot_character_mobs WHERE name = '%s' LIMIT 1",
|
|
||||||
client->GetCleanName());
|
|
||||||
auto results = database.QueryDatabase(query);
|
|
||||||
|
|
||||||
if (!results.Success())
|
|
||||||
return true; //return true to avoid sending a packet to a non-existant client as a failsafe
|
|
||||||
|
|
||||||
if (results.RowCount() == 0) {
|
|
||||||
LogError(
|
|
||||||
"Error getting B/C info for character name [{}] for IsRaidMemberBot. Error [{}]",
|
|
||||||
client->GetCleanName(),
|
|
||||||
results.ErrorMessage().c_str()
|
|
||||||
);
|
|
||||||
return true;//return true to avoid sending a packet to a non-existant client as a failsafe
|
|
||||||
}
|
|
||||||
|
|
||||||
auto row = results.begin();
|
|
||||||
const char* c = "C";
|
|
||||||
const char* b = "B";
|
|
||||||
if (strcmp(row[0], c) == 0) {
|
|
||||||
return false; // client is a client
|
|
||||||
}
|
|
||||||
else if (strcmp(row[0], b) == 0) {
|
|
||||||
return true; // client is actually a bot
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Raid::LockRaid(bool lockFlag)
|
void Raid::LockRaid(bool lockFlag)
|
||||||
{
|
{
|
||||||
@@ -1604,10 +1568,17 @@ bool Raid::LearnMembers()
|
|||||||
{
|
{
|
||||||
memset(members, 0, (sizeof(RaidMember)*MAX_RAID_MEMBERS));
|
memset(members, 0, (sizeof(RaidMember)*MAX_RAID_MEMBERS));
|
||||||
|
|
||||||
|
#ifdef BOTS
|
||||||
std::string query = StringFormat("SELECT name, groupid, _class, level, "
|
std::string query = StringFormat("SELECT name, groupid, _class, level, "
|
||||||
"isgroupleader, israidleader, islooter, isbot "
|
"isgroupleader, israidleader, islooter, isbot "
|
||||||
"FROM raid_members WHERE raidid = %lu",
|
"FROM raid_members WHERE raidid = %lu",
|
||||||
(unsigned long)GetID());
|
(unsigned long)GetID());
|
||||||
|
#else
|
||||||
|
std::string query = StringFormat("SELECT name, groupid, _class, level, "
|
||||||
|
"isgroupleader, israidleader, islooter "
|
||||||
|
"FROM raid_members WHERE raidid = %lu",
|
||||||
|
(unsigned long)GetID());
|
||||||
|
#endif
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
return false;
|
return false;
|
||||||
@@ -1636,7 +1607,9 @@ bool Raid::LearnMembers()
|
|||||||
members[index].IsGroupLeader = atoi(row[4]);
|
members[index].IsGroupLeader = atoi(row[4]);
|
||||||
members[index].IsRaidLeader = atoi(row[5]);
|
members[index].IsRaidLeader = atoi(row[5]);
|
||||||
members[index].IsLooter = atoi(row[6]);
|
members[index].IsLooter = atoi(row[6]);
|
||||||
members[index].IsBot = atoi(row[7]); //Mitch
|
#ifdef BOTS
|
||||||
|
members[index].IsBot = atoi(row[7]);
|
||||||
|
#endif
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1653,21 +1626,28 @@ void Raid::VerifyRaid()
|
|||||||
else{
|
else{
|
||||||
Client *c = entity_list.GetClientByName(members[x].membername);
|
Client *c = entity_list.GetClientByName(members[x].membername);
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
Bot* b = entity_list.GetBotByBotName(members[x].membername); //Mitch
|
Bot* b = entity_list.GetBotByBotName(members[x].membername);
|
||||||
#endif
|
#endif
|
||||||
if(c){
|
if(c){
|
||||||
members[x].member = c;
|
members[x].member = c;
|
||||||
|
#ifdef BOTS
|
||||||
members[x].IsBot = false;
|
members[x].IsBot = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
else if(b){
|
else if(b){
|
||||||
members[x].member = b->CastToClient(); //Raid requires client* we are forcing it here to be a BOT
|
//Raid requires client* we are forcing it here to be a BOT. Care is needed here as any client function that
|
||||||
|
//does not exist within the Bot Class will likely corrupt memory for the member object. Good practice to test the IsBot
|
||||||
|
//attribute before calling a client function or casting to client.
|
||||||
|
members[x].member = b->CastToClient();
|
||||||
members[x].IsBot = true; //Used to identify those members who are Bots
|
members[x].IsBot = true; //Used to identify those members who are Bots
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
members[x].member = nullptr;
|
members[x].member = nullptr;
|
||||||
|
#ifdef BOTS
|
||||||
members[x].IsBot = false;
|
members[x].IsBot = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(members[x].IsRaidLeader){
|
if(members[x].IsRaidLeader){
|
||||||
@@ -1720,7 +1700,11 @@ void Raid::SendHPManaEndPacketsTo(Client *client)
|
|||||||
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
||||||
|
|
||||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
for(int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||||
|
#ifdef BOTS
|
||||||
if(members[x].member && !members[x].IsBot) {
|
if(members[x].member && !members[x].IsBot) {
|
||||||
|
#else
|
||||||
|
if (members[x].member) {
|
||||||
|
#endif
|
||||||
if((members[x].member != client) && (members[x].GroupNumber == group_id)) {
|
if((members[x].member != client) && (members[x].GroupNumber == group_id)) {
|
||||||
|
|
||||||
members[x].member->CreateHPPacket(&hp_packet);
|
members[x].member->CreateHPPacket(&hp_packet);
|
||||||
@@ -1762,7 +1746,11 @@ void Raid::SendHPManaEndPacketsFrom(Mob *mob)
|
|||||||
mob->CreateHPPacket(&hpapp);
|
mob->CreateHPPacket(&hpapp);
|
||||||
|
|
||||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
for(int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||||
|
#ifdef BOTS
|
||||||
if(members[x].member && !members[x].IsBot) {
|
if(members[x].member && !members[x].IsBot) {
|
||||||
|
#else
|
||||||
|
if (members[x].member) {
|
||||||
|
#endif
|
||||||
if(!mob->IsClient() || ((members[x].member != mob->CastToClient()) && (members[x].GroupNumber == group_id))) {
|
if(!mob->IsClient() || ((members[x].member != mob->CastToClient()) && (members[x].GroupNumber == group_id))) {
|
||||||
members[x].member->QueuePacket(&hpapp, false);
|
members[x].member->QueuePacket(&hpapp, false);
|
||||||
if (members[x].member->ClientVersion() >= EQ::versions::ClientVersion::SoD) {
|
if (members[x].member->ClientVersion() >= EQ::versions::ClientVersion::SoD) {
|
||||||
@@ -1795,7 +1783,11 @@ void Raid::SendManaPacketFrom(Mob *mob)
|
|||||||
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
||||||
|
|
||||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
for (int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||||
|
#ifdef BOTS
|
||||||
if (members[x].member && !members[x].IsBot) {
|
if (members[x].member && !members[x].IsBot) {
|
||||||
|
#else
|
||||||
|
if (members[x].member) {
|
||||||
|
#endif
|
||||||
if (!mob->IsClient() || ((members[x].member != mob->CastToClient()) && (members[x].GroupNumber == group_id))) {
|
if (!mob->IsClient() || ((members[x].member != mob->CastToClient()) && (members[x].GroupNumber == group_id))) {
|
||||||
if (members[x].member->ClientVersion() >= EQ::versions::ClientVersion::SoD) {
|
if (members[x].member->ClientVersion() >= EQ::versions::ClientVersion::SoD) {
|
||||||
outapp.SetOpcode(OP_MobManaUpdate);
|
outapp.SetOpcode(OP_MobManaUpdate);
|
||||||
@@ -1822,7 +1814,11 @@ void Raid::SendEndurancePacketFrom(Mob *mob)
|
|||||||
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
||||||
|
|
||||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
for (int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||||
|
#ifdef BTOS
|
||||||
if (members[x].member && !members[x].IsBot) {
|
if (members[x].member && !members[x].IsBot) {
|
||||||
|
#else
|
||||||
|
if (members[x].member) {
|
||||||
|
#endif
|
||||||
if (!mob->IsClient() || ((members[x].member != mob->CastToClient()) && (members[x].GroupNumber == group_id))) {
|
if (!mob->IsClient() || ((members[x].member != mob->CastToClient()) && (members[x].GroupNumber == group_id))) {
|
||||||
if (members[x].member->ClientVersion() >= EQ::versions::ClientVersion::SoD) {
|
if (members[x].member->ClientVersion() >= EQ::versions::ClientVersion::SoD) {
|
||||||
outapp.SetOpcode(OP_MobEnduranceUpdate);
|
outapp.SetOpcode(OP_MobEnduranceUpdate);
|
||||||
@@ -1929,11 +1925,15 @@ void Raid::CheckGroupMentor(uint32 group_id, Client *c)
|
|||||||
void Raid::SetDirtyAutoHaters()
|
void Raid::SetDirtyAutoHaters()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_RAID_MEMBERS; ++i)
|
for (int i = 0; i < MAX_RAID_MEMBERS; ++i)
|
||||||
|
#ifdef BOTS
|
||||||
if (members[i].member && members[i].IsBot)
|
if (members[i].member && members[i].IsBot)
|
||||||
{
|
{
|
||||||
members[i].member->CastToBot()->SetDirtyAutoHaters();
|
members[i].member->CastToBot()->SetDirtyAutoHaters();
|
||||||
}
|
}
|
||||||
else if (members[i].member && !members[i].IsBot)
|
else if (members[i].member && !members[i].IsBot)
|
||||||
|
#else
|
||||||
|
if (members[i].member)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
members[i].member->SetDirtyAutoHaters();
|
members[i].member->SetDirtyAutoHaters();
|
||||||
}
|
}
|
||||||
@@ -1955,9 +1955,10 @@ void Raid::QueueClients(Mob *sender, const EQApplicationPacket *app, bool ack_re
|
|||||||
if (!members[i].member->IsClient())
|
if (!members[i].member->IsClient())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#ifdef BOTS
|
||||||
if (members[i].IsBot)
|
if (members[i].IsBot)
|
||||||
continue;
|
continue;
|
||||||
|
#endif
|
||||||
if (ignore_sender && members[i].member == sender)
|
if (ignore_sender && members[i].member == sender)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -2020,6 +2021,7 @@ bool Raid::DoesAnyMemberHaveExpeditionLockout(
|
|||||||
return Expedition::HasLockoutByCharacterName(raid_member.membername, expedition_name, event_name);
|
return Expedition::HasLockoutByCharacterName(raid_member.membername, expedition_name, event_name);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
#ifdef BOTS
|
||||||
Mob* Raid::GetRaidMainAssistOneByName(const char* name)
|
Mob* Raid::GetRaidMainAssistOneByName(const char* name)
|
||||||
{
|
{
|
||||||
Raid* raid = entity_list.GetRaidByBotName(name);
|
Raid* raid = entity_list.GetRaidByBotName(name);
|
||||||
@@ -2032,3 +2034,4 @@ Mob* Raid::GetRaidMainAssistOneByName(const char* name)
|
|||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
+4
-11
@@ -90,13 +90,7 @@ struct RaidMember{
|
|||||||
bool IsLooter;
|
bool IsLooter;
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
bool IsBot = false;
|
bool IsBot = false;
|
||||||
bool IsGroupHealer;
|
bool IsRaidMainAssistOne = false;
|
||||||
bool IsRaidSlower;
|
|
||||||
bool IsRaidMainAssistOne;
|
|
||||||
bool IsRaidMainAssistTwo;
|
|
||||||
bool IsRaidMainTank;
|
|
||||||
bool IsRaidOffTankOne;
|
|
||||||
bool IsRaidOffTankTwo;
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -123,10 +117,9 @@ public:
|
|||||||
|
|
||||||
void AddMember(Client *c, uint32 group = 0xFFFFFFFF, bool rleader=false, bool groupleader=false, bool looter=false);
|
void AddMember(Client *c, uint32 group = 0xFFFFFFFF, bool rleader=false, bool groupleader=false, bool looter=false);
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
void AddBot(Bot* b, uint32 group = 0xFFFFFFFF, bool rleader=false, bool groupleader=false, bool looter=false); //Mitch
|
void AddBot(Bot* b, uint32 group = 0xFFFFFFFF, bool rleader=false, bool groupleader=false, bool looter=false);
|
||||||
void RaidBotGroupSay(Bot* b, uint8 language, uint8 lang_skill, const char* msg, ...); //Mitch
|
void RaidBotGroupSay(Bot* b, uint8 language, uint8 lang_skill, const char* msg, ...); //Not yet implemented
|
||||||
static Mob* GetRaidMainAssistOneByName(const char* name);
|
Mob* GetRaidMainAssistOneByName(const char* name);
|
||||||
bool IsRaidMemberBot(Client* client);
|
|
||||||
#endif
|
#endif
|
||||||
void RemoveMember(const char *c);
|
void RemoveMember(const char *c);
|
||||||
void DisbandRaid();
|
void DisbandRaid();
|
||||||
|
|||||||
Reference in New Issue
Block a user