[Bots] Cleanup Bot Spell Functions, reduce reliance on NPC Functions/Attributes (#2495)

* [Bots] Initial Cleanup of Functions, moved Bot Casting out of mob_ai.cpp

* Moved Bots off NPC AI_Spells Struct, and AI_Spells private attribute.

* Formatting Fixes, fixed LogAI entries, Added LogAIModerate Alias

* Add Constants.

* Added Bot DB Struct, fixed some potential casting issues

* Formatting

* Formatting
This commit is contained in:
Aeadoin
2022-10-29 16:38:15 -04:00
committed by GitHub
parent 5708164511
commit bf43bda1e2
11 changed files with 610 additions and 122 deletions
+15 -2
View File
@@ -31,6 +31,7 @@
#include "../common/linked_list.h"
#include "../common/servertalk.h"
#include "../common/say_link.h"
#include "../common/data_verification.h"
#include "client.h"
#include "entity.h"
@@ -42,6 +43,10 @@
#include "water_map.h"
#include "npc_scale_manager.h"
#ifdef BOTS
#include "bot.h"
#endif
#include <cctype>
#include <stdio.h>
#include <string>
@@ -309,8 +314,16 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
AISpellVar.idle_no_sp_recast_max = static_cast<uint32>(RuleI(Spells, AI_IdleNoSpellMaxRecast));
AISpellVar.idle_beneficial_chance = static_cast<uint8> (RuleI(Spells, AI_IdleBeneficialChance));
AI_Init();
AI_Start();
// It's possible for IsBot() to not be set yet during Bot loading, so have to use an alternative to catch Bots
if (!EQ::ValueWithin(npc_type_data->npc_spells_id, EQ::constants::BotSpellIDs::Warrior, EQ::constants::BotSpellIDs::Berserker)) {
AI_Init();
AI_Start();
#ifdef BOTS
} else {
CastToBot()->AI_Bot_Init();
CastToBot()->AI_Bot_Start();
#endif
}
d_melee_texture1 = npc_type_data->d_melee_texture1;
d_melee_texture2 = npc_type_data->d_melee_texture2;