Extended server spellbook entries to RoF2 standard and added per-client restriction of spell id max

This commit is contained in:
Uleat
2019-01-24 03:53:41 -05:00
parent 2d5f0dce42
commit 4658ad676f
17 changed files with 205 additions and 49 deletions
+2 -4
View File
@@ -5053,7 +5053,7 @@ void Client::UnscribeSpell(int slot, bool update_client)
m_pp.spell_book[slot] = 0xFFFFFFFF;
database.DeleteCharacterSpell(this->CharacterID(), m_pp.spell_book[slot], slot);
if(update_client)
if(update_client && slot < EQEmu::spells::DynamicLookup(ClientVersion(), GetGM())->SpellbookSize)
{
auto outapp = new EQApplicationPacket(OP_DeleteSpell, sizeof(DeleteSpell_Struct));
DeleteSpell_Struct* del = (DeleteSpell_Struct*)outapp->pBuffer;
@@ -5066,9 +5066,7 @@ void Client::UnscribeSpell(int slot, bool update_client)
void Client::UnscribeSpellAll(bool update_client)
{
int i;
for(i = 0; i < EQEmu::spells::SPELLBOOK_SIZE; i++)
for(int i = 0; i < EQEmu::spells::SPELLBOOK_SIZE; i++)
{
if(m_pp.spell_book[i] != 0xFFFFFFFF)
UnscribeSpell(i, update_client);