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
+18 -7
View File
@@ -2202,14 +2202,25 @@ namespace RoF2
outapp->WriteUInt32(spells::SPELLBOOK_SIZE); // Spellbook slots
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++)
{
outapp->WriteUInt32(emu->spell_book[r]);
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
outapp->WriteUInt32(emu->spell_book[r]);
else
outapp->WriteUInt32(0xFFFFFFFFU);
}
}
// zeroes for the rest of the spellbook slots
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE; r++)
{
outapp->WriteUInt32(0xFFFFFFFFU);
else {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
outapp->WriteUInt32(emu->spell_book[r]);
else
outapp->WriteUInt32(0xFFFFFFFFU);
}
// invalidate the rest of the spellbook slots
for (uint32 r = EQEmu::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
outapp->WriteUInt32(0xFFFFFFFFU);
}
}
outapp->WriteUInt32(spells::SPELL_GEM_COUNT); // Memorised spell slots