[Quest API] Add HasBotSpellEntry() to Perl/Lua. (#2563)

* [Bots] Quest API Check Spell in Bot_Spell_Entries

* Add to luabind and packages

* Change Method to be HasBotSpellEntry, change SpellID to uint16

* Ordering, and removed unused logging
This commit is contained in:
Aeadoin
2022-11-24 22:29:38 -05:00
committed by GitHub
parent 52e1bc943a
commit 45c4fe55f0
5 changed files with 54 additions and 20 deletions
+18
View File
@@ -3185,4 +3185,22 @@ void Bot::AI_Bot_Event_SpellCastFinished(bool iCastSucceeded, uint16 slot) {
}
}
bool Bot::HasBotSpellEntry(uint16 spellid) {
auto* spell_list = content_db.GetBotSpells(GetBotSpellID());
if (!spell_list) {
return false;
}
// Check if Spell ID is found in Bot Spell Entries
for (auto& e : spell_list->entries) {
if (spellid == e.spellid) {
return true;
}
}
return false;
}
#endif