[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
+12 -5
View File
@@ -174,9 +174,9 @@ public:
virtual bool Save();
virtual void Depop();
void CalcBotStats(bool showtext = true);
uint16 BotGetSpells(int spellslot) { return AIspells[spellslot].spellid; }
uint32 BotGetSpellType(int spellslot) { return AIspells[spellslot].type; }
uint16 BotGetSpellPriority(int spellslot) { return AIspells[spellslot].priority; }
uint16 BotGetSpells(int spellslot) { return AIBot_spells[spellslot].spellid; }
uint32 BotGetSpellType(int spellslot) { return AIBot_spells[spellslot].type; }
uint16 BotGetSpellPriority(int spellslot) { return AIBot_spells[spellslot].priority; }
virtual float GetProcChances(float ProcBonus, uint16 hand);
virtual int GetHandToHandDamage(void);
virtual bool TryFinishingBlow(Mob *defender, int64 &damage);
@@ -220,7 +220,6 @@ public:
virtual void AddToHateList(Mob* other, int64 hate = 0, int64 damage = 0, bool iYellForHelp = true, bool bFrenzy = false, bool iBuffTic = false, bool pet_command = false);
virtual void SetTarget(Mob* mob);
virtual void Zone();
std::vector<AISpells_Struct> GetBotSpells() { return AIspells; }
bool IsArcheryRange(Mob* target);
void ChangeBotArcherWeapons(bool isArcher);
void Sit();
@@ -308,6 +307,9 @@ public:
void DoEnduranceRegen(); //This Regenerates endurance
void DoEnduranceUpkeep(); //does the endurance upkeep
bool AI_AddBotSpells(uint32 iDBSpellsID);
void AddSpellToBotList(int16 iPriority, uint16 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust, int8 min_hp, int8 max_hp);
void AI_Bot_Event_SpellCastFinished(bool iCastSucceeded, uint16 slot);
// AI Methods
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes);
virtual bool AI_EngagedCastCheck();
@@ -321,6 +323,10 @@ public:
void SetGuardMode();
void SetHoldMode();
// Bot AI Methods
void AI_Bot_Init();
void AI_Bot_Start(uint32 iMoveDelay = 0);
// Mob AI Virtual Override Methods
virtual void AI_Process();
virtual void AI_Stop();
@@ -637,7 +643,6 @@ private:
// Class Members
uint32 _botID;
uint32 _botOwnerCharacterID;
//uint32 _botSpellID;
bool _spawnStatus;
Mob* _botOwner;
bool _botOrderAttack;
@@ -744,6 +749,8 @@ private:
static uint8 spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND];
};
bool IsSpellInBotList(DBbotspells_Struct* spell_list, uint16 iSpellID);
#endif // BOTS
#endif // BOT_H