[Character] Convert Delete/Load/Save of Character Spells to Repositories (#3842)

* [Character] Convert Delete/Load/Save of Character Spells to Repositories

- Converts `DeleteCharacterSpell`, `LoadCharacterSpellBook`, and `SaveCharacterSpell` to repositories.

* Update zonedb.cpp
This commit is contained in:
Alex King
2024-01-07 00:12:40 -05:00
committed by GitHub
parent bc4bebb4a9
commit eb5eb0ca30
5 changed files with 112 additions and 36 deletions
+3 -3
View File
@@ -5771,7 +5771,7 @@ void Client::Handle_OP_DeleteSpell(const EQApplicationPacket *app)
if (m_pp.spell_book[dss->spell_slot] != SPELLBOOK_UNKNOWN) {
m_pp.spell_book[dss->spell_slot] = SPELLBOOK_UNKNOWN;
database.DeleteCharacterSpell(CharacterID(), m_pp.spell_book[dss->spell_slot], dss->spell_slot);
database.DeleteCharacterSpell(CharacterID(), dss->spell_slot);
dss->success = 1;
}
else
@@ -14550,10 +14550,10 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app)
/* Save Spell Swaps */
if (!database.SaveCharacterSpell(CharacterID(), m_pp.spell_book[swapspell->from_slot], swapspell->from_slot)) {
database.DeleteCharacterSpell(CharacterID(), m_pp.spell_book[swapspell->from_slot], swapspell->from_slot);
database.DeleteCharacterSpell(CharacterID(), swapspell->from_slot);
}
if (!database.SaveCharacterSpell(CharacterID(), swapspelltemp, swapspell->to_slot)) {
database.DeleteCharacterSpell(CharacterID(), swapspelltemp, swapspell->to_slot);
database.DeleteCharacterSpell(CharacterID(), swapspell->to_slot);
}
QueuePacket(app);