[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
2021-10-01 23:14:56 -04:00
committed by GitHub
parent 92e03dccb9
commit 2f5d360e53
5 changed files with 56 additions and 11 deletions
+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)))