[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
+13
View File
@@ -68,6 +68,18 @@ struct AISpells_Struct {
int8 max_hp; // >0 won't cast if HP is above
};
struct BotSpells_Struct {
uint32 type; // 0 = never, must be one (and only one) of the defined values
int16 spellid; // <= 0 = no spell
int16 manacost; // -1 = use spdat, -2 = no cast time
uint32 time_cancast; // when we can cast this spell next
int32 recast_delay;
int16 priority;
int16 resist_adjust;
int16 min_hp; // >0 won't cast if HP is below
int16 max_hp; // >0 won't cast if HP is above
};
struct AISpellsEffects_Struct {
uint16 spelleffectid;
int32 base_value;
@@ -585,6 +597,7 @@ protected:
uint32* pDontCastBefore_casting_spell;
std::vector<AISpells_Struct> AIspells;
std::vector<BotSpells_Struct> AIBot_spells; //Will eventually be moved to Bot Class once Bots are no longer reliant on NPC constructor
bool HasAISpell;
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates = false);
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);