More bot raid changes

This commit is contained in:
neckkola
2022-01-15 11:27:50 -04:00
parent 0d009a7a25
commit 37e9d419e6
7 changed files with 1555 additions and 53 deletions
-34
View File
@@ -1,34 +0,0 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef BOTS
#include "bot.h"
#include "bot_raid.h"
#include "object.h"
#include "raids.h"
#include "doors.h"
#include "quest_parser_collection.h"
#include "lua_parser.h"
#include "../common/string_util.h"
#include "../common/say_link.h"
extern volatile bool is_zone_loaded;
extern bool Critical;
#endif
+6 -13
View File
@@ -2300,7 +2300,11 @@ bool Bot::Process()
}
// Bot AI
AI_Process();
Raid* raid = entity_list.GetRaidByBot(this);
if (raid)
AI_Process_Raid();
else
AI_Process();
return true;
}
@@ -2540,12 +2544,10 @@ void Bot::AI_Process()
Client* bot_owner = (GetBotOwner() && GetBotOwner()->IsClient() ? GetBotOwner()->CastToClient() : nullptr);
Group* bot_group = GetGroup();
Raid* bot_raid = entity_list.GetRaidByBot(this);
//#pragma region PRIMARY AI SKIP CHECKS
// Primary reasons for not processing AI
if (!bot_owner || (!bot_group && !bot_raid) || !IsAIControlled()) {
if (!bot_owner || (!bot_group) || !IsAIControlled()) {
return;
}
@@ -2563,15 +2565,6 @@ void Bot::AI_Process()
if (bot_group) {
leash_owner = (bot_group->GetLeader() && bot_group->GetLeader()->IsClient() ? bot_group->GetLeader()->CastToClient() : bot_owner);
}
else if (bot_raid) {
int bot_raid_group = bot_raid->GetGroup(GetName());
if (bot_raid_group > 0) {
leash_owner = bot_raid->GetGroupLeader(bot_raid_group)->CastToClient();
}
else {
leash_owner = bot_raid->GetLeader();
}
}
if (!leash_owner) {
return;
+6 -2
View File
@@ -362,8 +362,6 @@ public:
static std::string RaceIdToString(uint16 raceId);
static bool IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined);
static Bot* GetBotByBotClientOwnerAndBotName(Client* c, std::string botName);
static void ProcessRaidInvite(Bot* invitee, Client* invitor); //Mitch
static void ProcessRaidInvite(Client* invitee, Client* invitor); //Mitch
static void ProcessBotGroupInvite(Client* c, std::string botName);
static void ProcessBotGroupDisband(Client* c, std::string botName);
static void BotOrderCampAll(Client* c);
@@ -381,6 +379,12 @@ public:
static bool CheckDisciplineRecastTimers(Bot *caster, int timer_index);
static uint32 GetDisciplineRemainingTime(Bot *caster, int timer_index);
//Raid methods
void PetAIProcess_Raid();
void AI_Process_Raid();
static void ProcessRaidInvite(Bot* invitee, Client* invitor); //Mitch
static void ProcessRaidInvite(Client* invitee, Client* invitor); //Mitch
static std::list<BotSpell> GetBotSpellsForSpellEffect(Bot* botCaster, int spellEffect);
static std::list<BotSpell> GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster, int spellEffect, SpellTargetType targetType);
static std::list<BotSpell> GetBotSpellsBySpellType(Bot* botCaster, uint32 spellType);
+1530
View File
File diff suppressed because it is too large Load Diff
+5 -4
View File
@@ -16,8 +16,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef BOT_H
#define BOT_H
#ifndef BOT_RAID_H
#define BOT_RAID_H
#ifdef BOTS
@@ -38,9 +38,10 @@
#include <sstream>
extern WorldServer worldserver;
//void Bot::PetAIProcess_Raid();
#endif // BOTS
#endif // BOT_H
#endif // BOT_RAID_H
+7
View File
@@ -31,6 +31,13 @@
bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
// Bot AI
Raid* raid = entity_list.GetRaidByBot(this);
if (raid) {
AI_CastSpell_Raid();
return true;
}
if (!tar) {
return false;
}
+1
View File
@@ -123,6 +123,7 @@ public:
bool IsGroupLeader(const char *who);
bool IsRaidMember(const char *name);
void UpdateLevel(const char *name, int newLevel);
std::vector<RaidMember> GetRaidGroupMembers(uint32 gid);
uint32 GetFreeGroup();
uint8 GroupCount(uint32 gid);