void ValidateBlueSpells(CCharEntity* PChar) { CheckSpellLevels(PChar); uint8 maxSetPoints = GetTotalBlueMagicPoints(PChar); uint8 currentPoints = 0; for (int slot = 0; slot < 20; slot++) { if (PChar->m_SetBlueSpells[slot] != 0) { CBlueSpell* PSpell = (CBlueSpell*)spell::GetSpell(PChar->m_SetBlueSpells[slot] + 0x200); if (currentPoints + PSpell->getSetPoints() > maxSetPoints) { SetBlueSpell(PChar, PSpell, slot, false); } else { currentPoints += PSpell->getSetPoints(); } } } CompactSpells(PChar); uint8 maxSlots = GetTotalSlots(PChar); for (int slot = maxSlots; slot < 20; slot++) { if (PChar->m_SetBlueSpells[slot] != 0) { SetBlueSpell(PChar, (CBlueSpell*)spell::GetSpell(PChar->m_SetBlueSpells[slot] + 0x200), slot, false); } } SaveSetSpells(PChar); PChar->status = STATUS_UPDATE; charutils::BuildingCharTraitsTable(PChar); PChar->pushPacket(new CCharJobExtraPacket(PChar, true)); PChar->pushPacket(new CCharJobExtraPacket(PChar, false)); PChar->pushPacket(new CCharStatsPacket(PChar)); charutils::CalculateStats(PChar); PChar->UpdateHealth(); PChar->pushPacket(new CCharHealthPacket(PChar)); }
void ValidateBlueSpells(CCharEntity* PChar) { CheckSpellLevels(PChar); uint8 maxSetPoints = GetTotalBlueMagicPoints(PChar); uint8 currentPoints = 0; for (int slot = 0; slot < 20; slot++) { if (PChar->m_SetBlueSpells[slot] != 0) { CBlueSpell* PSpell = (CBlueSpell*)spell::GetSpell(static_cast<SpellID>(PChar->m_SetBlueSpells[slot] + 0x200)); if (currentPoints + PSpell->getSetPoints() > maxSetPoints) { SetBlueSpell(PChar, PSpell, slot, false); } else { currentPoints += PSpell->getSetPoints(); } } } CompactSpells(PChar); uint8 maxSlots = GetTotalSlots(PChar); for (int slot = maxSlots; slot < 20; slot++) { if (PChar->m_SetBlueSpells[slot] != 0) { SetBlueSpell(PChar, (CBlueSpell*)spell::GetSpell(static_cast<SpellID>(PChar->m_SetBlueSpells[slot] + 0x200)), slot, false); } } SaveSetSpells(PChar); }