[Quest API] Add UntrainDiscBySpellID(spell_id, update_client) to Perl/Lua. (#1565)

- Add $client->UntrainDiscBySpellID(spell_id, update_client) to Perl.
- Add client:UntrainDiscBySpellID(spell_id, update_client) to Lua.
This commit is contained in:
Kinglykrab authored and GitHub committed 2021-10-01 22:14:56 -05:00
1 parent 92e03dccb9
commit 2f5d360e53
5 files changed
+56 -11

No files matched your search

+10
View File
@@ -5335,6 +5335,16 @@ void Client::UntrainDiscAll(bool update_client)
}
}
void Client::UntrainDiscBySpellID(uint16 spell_id, bool update_client)
{
for (int slot = 0; slot < MAX_PP_DISCIPLINES; slot++) {
if (m_pp.disciplines.values[slot] == spell_id) {
UntrainDisc(slot, update_client);
return;
}
}
}
int Client::GetNextAvailableSpellBookSlot(int starting_slot) {
for (int i = starting_slot; i < EQ::spells::SPELLBOOK_SIZE; i++) { //using starting_slot should help speed this up when we're iterating through a bunch of spells
if (!IsValidSpell(GetSpellByBookSlot(i)))