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
+20 -1
View File
@@ -1156,7 +1156,26 @@ namespace SoF
OUT(WIS);
OUT(face);
// OUT(unknown02264[47]);
OUT_array(spell_book, spells::SPELLBOOK_SIZE);
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)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
}
else {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[128]);
OUT_array(mem_spells, spells::SPELL_GEM_COUNT);
// OUT(unknown04396[32]);