mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[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:
+15
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user