2981a2982,2985 > //declare our function local scope variables > bool onLimitMode = false; > > //if the player is dead they don't get any XP so we will exit the function immediately 2983c2987,2990 < if (!expFromRaise) { --- > > //if a player is not being awarded Experience Points from a Raise there is several things we need to take into consideration > if (!expFromRaise) > { 2984a2992,3002 > conquest::GainInfluencePoints(PChar); > conquest::AddConquestPoints(PChar, exp); > > //TODO: Only add IS if player has Sanction > //TODO: Killing mobs != gaining Zeni > if(PChar->getZone() >= 48 && PChar->getZone() <= 79) > { > PChar->RegionPoints[3] += (exp*0.1f); // 10% > // PChar->RegionPoints[10] += (exp*0.1f); // 10% > PChar->pushPacket(new CConquestPacket(PChar)); > } 2986,2987d3003 < uint16 currentExp = PChar->jobs.exp[PChar->GetMJob()]; < bool onLimitMode = false; 2989c3005 < //Incase player de-levels to 74 on the field --- > //incase player de-levels to 74 on the field 2990a3007 > { 2992c3009 < --- > } 3023,3024c3040 < < --- > 3039,3046c3055,3058 < // Raise exp shouldn't count toward these things, so we have to exclude it. < if (!expFromRaise) { < conquest::GainInfluencePoints(PChar); < conquest::AddConquestPoints(PChar, exp); < < //TODO: Only add IS if player has Saction < //TODO: Killing mobs != gaining Zeni < if(PChar->getZone() >= 48 && PChar->getZone() <= 79) --- > //work through PChar->jobs.exp[PChar->GetMJob()] and level up the character appropriately (aka allow multiple level ups) > while (PChar->jobs.exp[PChar->GetMJob()] >= GetExpNEXTLevel(PChar->jobs.job[PChar->GetMJob()]) && onLimitMode == false) > { > if (PChar->jobs.job[PChar->GetMJob()] == PChar->jobs.genkai) 3048,3050c3060 < PChar->RegionPoints[3] += (exp*0.1f); // 10% < // PChar->RegionPoints[10] += (exp*0.1f); // 10% < PChar->pushPacket(new CConquestPacket(PChar)); --- > PChar->jobs.exp[PChar->GetMJob()] = GetExpNEXTLevel(PChar->jobs.job[PChar->GetMJob()]) - 1; 3052,3053c3062,3065 < } < --- > else > { > PChar->jobs.exp[PChar->GetMJob()] -= GetExpNEXTLevel(PChar->jobs.job[PChar->GetMJob()]); > PChar->jobs.job[PChar->GetMJob()] += 1; 3055,3065c3067,3071 < //player levels up < if ((currentExp + exp) >= GetExpNEXTLevel(PChar->jobs.job[PChar->GetMJob()]) && onLimitMode == false) < { < if (PChar->jobs.job[PChar->GetMJob()] == PChar->jobs.genkai) < { < PChar->jobs.exp[PChar->GetMJob()] = GetExpNEXTLevel(PChar->jobs.job[PChar->GetMJob()]) - 1; < } < else < { < PChar->jobs.exp[PChar->GetMJob()] -= GetExpNEXTLevel(PChar->jobs.job[PChar->GetMJob()]); < PChar->jobs.job[PChar->GetMJob()] += 1; --- > if (PChar->m_LevelRestriction == 0 || > PChar->m_LevelRestriction > PChar->GetMLevel()) > { > PChar->SetMLevel(PChar->jobs.job[PChar->GetMJob()]); > PChar->SetSLevel(PChar->jobs.job[PChar->GetSJob()]); 3067,3086c3073,3086 < if (PChar->m_LevelRestriction == 0 || < PChar->m_LevelRestriction > PChar->GetMLevel()) < { < PChar->SetMLevel(PChar->jobs.job[PChar->GetMJob()]); < PChar->SetSLevel(PChar->jobs.job[PChar->GetSJob()]); < < BuildingCharSkillsTable(PChar); < CalculateStats(PChar); < BuildingCharAbilityTable(PChar); < BuildingCharTraitsTable(PChar); < BuildingCharWeaponSkills(PChar); < } < PChar->UpdateHealth(); < < PChar->health.hp = PChar->GetMaxHP(); < PChar->health.mp = PChar->GetMaxMP(); < < SaveCharStats(PChar); < SaveCharJob(PChar, PChar->GetMJob()); < SaveCharExp(PChar, PChar->GetMJob()); --- > BuildingCharSkillsTable(PChar); > CalculateStats(PChar); > BuildingCharAbilityTable(PChar); > BuildingCharTraitsTable(PChar); > BuildingCharWeaponSkills(PChar); > } > > PChar->UpdateHealth(); > PChar->health.hp = PChar->GetMaxHP(); > PChar->health.mp = PChar->GetMaxMP(); > > SaveCharStats(PChar); > SaveCharJob(PChar, PChar->GetMJob()); > SaveCharExp(PChar, PChar->GetMJob()); 3089,3095c3089,3095 < PChar->pushPacket(new CCharJobsPacket(PChar)); < PChar->pushPacket(new CCharUpdatePacket(PChar)); < PChar->pushPacket(new CCharSkillsPacket(PChar)); < PChar->pushPacket(new CCharAbilitiesPacket(PChar)); < PChar->pushPacket(new CMenuMeritPacket(PChar)); < PChar->pushPacket(new CAutomatonUpdatePacket(PChar)); < PChar->pushPacket(new CCharSyncPacket(PChar)); --- > PChar->pushPacket(new CCharJobsPacket(PChar)); > PChar->pushPacket(new CCharUpdatePacket(PChar)); > PChar->pushPacket(new CCharSkillsPacket(PChar)); > PChar->pushPacket(new CCharAbilitiesPacket(PChar)); > PChar->pushPacket(new CMenuMeritPacket(PChar)); > PChar->pushPacket(new CAutomatonUpdatePacket(PChar)); > PChar->pushPacket(new CCharSyncPacket(PChar)); 3097,3098c3097,3098 < UpdateHealth(PChar); < PChar->loc.zone->PushPacket(PChar, CHAR_INRANGE_SELF, new CMessageDebugPacket(PChar, PMob, PChar->jobs.job[PChar->GetMJob()], 0, 9)); --- > UpdateHealth(PChar); > PChar->loc.zone->PushPacket(PChar, CHAR_INRANGE_SELF, new CMessageDebugPacket(PChar, PMob, PChar->jobs.job[PChar->GetMJob()], 0, 9)); 3101,3102c3101,3102 < } < } --- > } > } 3109c3109 < --- >