Quote:
Originally Posted by Wolfy.
Fak im stuck, i don't know what kind of check to add here:
Code:
public void AddProfExp(ushort Wep, uint Amount)
{
if (Profs.Contains(Wep))
{
Prof P = (Prof)Profs[Wep];
if (P.Lvl < 20)
{
Profs.Remove(Wep);
Amount *= World.ProfExpRate;
P.Exp += Amount;
if (P.Exp >= Database.ProfExp[P.Lvl])
{
P.Lvl++;
P.Exp = 0;
MyClient.LocalMessage(2000, "Your proficiency level has increased.");
}
Profs.Add(Wep, P);
MyClient.AddSend(Packets.Prof(P));
}
}
|
I would add a static list containing all the valid prof's based off their item group (first 3 digits).
I suppose you could also put it into a database table, but I see no need to spend the resources checking that table constantly considering those prof's should never change.
So it would be static id / 1000 (I have access to source now xD)
Then simply check if it is valid, then proceed.
And judging from your code below, it won't add a prof if they don't already have it?