This is what I have in mine. May not function 100% for you, depending on how your source has been altered, but hope it helps.
Code:
public bool AddExp(ulong Amount, bool CountMisc)
{
Ready = false;
if (RBCount < 1)
Amount /= 3;
if (CountMisc && !EPot)
Exp += (ulong)(Amount * DataBase.ExpRate * AddExpPc * (Convert.ToDouble(Potency) / 100 + 1));
else if (EPot)
Exp += (ulong)((Amount * DataBase.ExpRate * AddExpPc * (Convert.ToDouble(Potency) / 100 + 1)) * 2);
else
if (EPot)
{
Exp *= 2;
}
Exp += Amount;
if (EPotRate == true)
Exp += (ulong)((double)Amount * (double)DataBase.ExpRate * (double)AddExpPc * (Convert.ToDouble(Potency) / 100 + 1));
bool Leveled = false;
if (Exp > DataBase.NeededXP(Level) && Level < 135)
{
Leveled = true;
while (Exp > DataBase.NeededXP(Level) && Level < 135)
{
Exp -= DataBase.NeededXP(Level);
Level++;
if (RBCount > 0)
{
StatP += 3;
MyClient.SendPacket(General.MyPackets.Vital(UID, 11, StatP));
}
if (Level == 3)
{
if (Job < 16 && Job > 9)
LearnSkill(1110, 0);
if (Job < 16 && Job > 9 || Job < 26 && Job > 19)
LearnSkill(1015, 0);
if (Job < 26 && Job > 19)
LearnSkill(1025, 0);
}
}
}
if (Leveled)
{
if (MyGuild != null)
MyGuild.Refresh(this);
if (RBCount < 1)
DataBase.GetStats(this);
GetEquipStats(1, true);
GetEquipStats(2, true);
GetEquipStats(3, true);
GetEquipStats(4, true);
GetEquipStats(5, true);
GetEquipStats(6, true);
GetEquipStats(8, true);
MaxHP = BaseMaxHP();
MaxMP = BaseMaxMP();
MinAtk = Str;
MaxAtk = Str;
Potency = Level;
GetEquipStats(1, false);
GetEquipStats(2, false);
GetEquipStats(3, false);
GetEquipStats(4, false);
GetEquipStats(5, false);
GetEquipStats(6, false);
GetEquipStats(8, false);
CurHP = MaxHP;
CurMP = MaxMP;
if (Level >= 120)
StatP += 3;
MyClient.SendPacket(General.MyPackets.Vital((long)UID, 13, Level));
MyClient.SendPacket(General.MyPackets.Vital((long)UID, 16, Str));
MyClient.SendPacket(General.MyPackets.Vital((long)UID, 17, Agi));
MyClient.SendPacket(General.MyPackets.Vital((long)UID, 15, Vit));
MyClient.SendPacket(General.MyPackets.Vital((long)UID, 14, Spi));
MyClient.SendPacket(General.MyPackets.Vital((long)UID, 0, CurHP));
MyClient.SendPacket(General.MyPackets.Vital(UID, 11, StatP));
World.LevelUp(this);
}
MyClient.SendPacket(General.MyPackets.Vital((long)UID, 5, Exp));
Ready = true;
if (Leveled)
return true;
else
return false;
}
Edit: Yes, I did the minor fix that most people never noticed or tried to fix... I made it so characters gain 3 Att points every level after 120.