Quote:
Originally Posted by m e n a
Here's a [Only registered and activated users can see links. Click Here To Register...]
and here's attached file below credits goes to F i n c h i
|
That program is not working for me either, and if I read the comments on that post it seems that i'm not the only one. Could you chek ur private messages please, I sended you one.
Thanks
This is my experience code, can anyone see what the problem might be?
Code:
#region Experience
public void IncreaseExp(uint Amount, bool isTeamExp, bool EXPBall)
{
if (Level < 137 && LvlCap > Level || LvlCap == 0)
{
//Scale per level
if (Reborns >= 2) Amount = Amount / 2;
if (Job >= 130 && Job <= 135 && Loc.Map != 1039) Amount *= 2;
if (!EXPBall)
{
if (Level >= 130) Amount = (uint)(Amount * EqStats.GemExtraExp);
else if (Level >= 120 && Level <= 129) Amount = (uint)((Amount / 10) * EqStats.GemExtraExp);
else if (Level >= 110 && Level <= 119) Amount = (uint)((Amount / 6) * EqStats.GemExtraExp);
else if (Level >= 100 && Level <= 109) Amount = (uint)((Amount / 5) * EqStats.GemExtraExp);
else if (Level >= 90 && Level <= 99) Amount = (uint)((Amount / 4) * EqStats.GemExtraExp);
else if (Level >= 31 && Level <= 89) Amount = (uint)((Amount / 3) * EqStats.GemExtraExp);
else if (Level <= 30) Amount = (uint)((Amount / 2) * EqStats.GemExtraExp);
if (World.KOBoard[0].Name == Name) Amount *= 1;//If you want to add bonus exp for KO board
if (DoubleExp) Amount *= 3;
Amount *= Program.EXPEvent;
if (BlessingLasts > 0) Amount = (uint)((double)Amount * 1.2);
if (MyGuild != null && MyGuild.Wins > 0) Amount = (uint)((double)Amount * 1.2);
if (MyGuild != null)
{
if (MyGuild.Fund >= 1 && MyGuild.Fund < 5000000) Amount = (uint)((double)Amount * 1.01);
if (MyGuild.Fund >= 5000000 && MyGuild.Fund < 10000000) Amount = (uint)((double)Amount * 1.05);
if (MyGuild.Fund >= 10000000 && MyGuild.Fund < 15000000) Amount = (uint)((double)Amount * 1.1);
if (MyGuild.Fund >= 15000000 && MyGuild.Fund < 20000000) Amount = (uint)((double)Amount * 1.15);
if (MyGuild.Fund >= 20000000 && MyGuild.Fund < 25000000) Amount = (uint)((double)Amount * 1.2);
if (MyGuild.Fund >= 25000000 && MyGuild.Fund < 30000000) Amount = (uint)((double)Amount * 1.25);
if (MyGuild.Fund >= 30000000 && MyGuild.Fund < 35000000) Amount = (uint)((double)Amount * 1.3);
if (MyGuild.Fund >= 35000000 && MyGuild.Fund < 40000000) Amount = (uint)((double)Amount * 1.35);
if (MyGuild.Fund >= 40000000 && MyGuild.Fund < 45000000) Amount = (uint)((double)Amount * 1.4);
if (MyGuild.Fund >= 45000000 && MyGuild.Fund < 50000000) Amount = (uint)((double)Amount * 1.45);
if (MyGuild.Fund >= 50000000 && MyGuild.Fund < 55000000) Amount = (uint)((double)Amount * 1.5);
if (MyGuild.Fund >= 55000000 && MyGuild.Fund < 60000000) Amount = (uint)((double)Amount * 1.55);
if (MyGuild.Fund >= 60000000 && MyGuild.Fund < 65000000) Amount = (uint)((double)Amount * 1.6);
if (MyGuild.Fund >= 65000000 && MyGuild.Fund < 70000000) Amount = (uint)((double)Amount * 1.65);
if (MyGuild.Fund >= 70000000 && MyGuild.Fund < 75000000) Amount = (uint)((double)Amount * 1.7);
if (MyGuild.Fund >= 75000000 && MyGuild.Fund < 80000000) Amount = (uint)((double)Amount * 1.75);
if (MyGuild.Fund >= 80000000 && MyGuild.Fund < 85000000) Amount = (uint)((double)Amount * 1.8);
if (MyGuild.Fund >= 85000000 && MyGuild.Fund < 90000000) Amount = (uint)((double)Amount * 1.85);
if (MyGuild.Fund >= 90000000 && MyGuild.Fund < 95000000) Amount = (uint)((double)Amount * 1.9);
if (MyGuild.Fund >= 95000000 && MyGuild.Fund < 100000000) Amount = (uint)((double)Amount * 1.95);
if (MyGuild.Fund >= 100000000 && MyGuild.Fund < 125000000) Amount *= 2;
if (MyGuild.Fund >= 125000000 && MyGuild.Fund < 150000000) Amount = (uint)((double)Amount * 2.5);
if (MyGuild.Fund >= 150000000 && MyGuild.Fund < 175000000) Amount *= 3;
if (MyGuild.Fund >= 175000000 && MyGuild.Fund < 200000000) Amount = (uint)((double)Amount * 3.4);
if (MyGuild.Fund >= 200000000) Amount = (uint)((double)Amount * 3.8);
}
bool noobexp = false;
bool marrieexp = false;
#region checkmyteam for extras
if (MyTeam != null && isTeamExp)
{
foreach (Character C in MyTeam.Members)
{
if (C != null)
{
if (EntityID != C.EntityID)
{
if (Level > C.Level + 20)
noobexp = true;
if (C.Spouse == C.Name)
marrieexp = true;
}
}
}
}
#endregion
if (noobexp) Amount *= 2;
if (marrieexp) Amount *= 2;
#region Experience points Messages
if (!noobexp && !marrieexp && isTeamExp && Loc.Map != 1039)
MyClient.LocalMessage(2005, Amount + " team experience points gained.");
else if (noobexp && !marrieexp && isTeamExp && Loc.Map != 1039)
MyClient.LocalMessage(2005, "You gained " + Amount + " team experience points with additional rewarding experience points due to low level teammates.");
else if (!noobexp && marrieexp && isTeamExp && Loc.Map != 1039)
MyClient.LocalMessage(2005, "You gained " + Amount + " team experience points with additional rewarding experience points due to marriage teammates.");
else if (noobexp && !marrieexp && isTeamExp && Loc.Map != 1039)
MyClient.LocalMessage(2005, "You gained " + Amount + " team experience points with additional rewarding experience points due to low level and marriage teammates.");
#endregion
}
ulong CurExp = Experience;
byte CurLevel = Level;
CurExp += Amount;
while (CurLevel < 137 && CurExp > Database.LevelExp[CurLevel])
{
CurExp -= Database.LevelExp[CurLevel];
CurLevel++;
PacketHandling.NPCDialog.Levels++;
Database.SaveCharacter(this, MyClient.AuthInfo.Account);
LastSave = DateTime.Now;
if (CurLevel == 15) MyClient.LocalMessage(2005, "You are Level 15. If you haven't already, you should visit the Promotion Center in Twin City!");
if (CurLevel == 40) MyClient.LocalMessage(2005, "You are Level 40. If you haven't already, you should visit the Promotion Center in Twin City!");
if (CurLevel == 70) MyClient.LocalMessage(2005, "You are Level 70. If you haven't already, you should visit the Promotion Center in Twin City!");
if (CurLevel == 100) MyClient.LocalMessage(2005, "You are Level 100. If you haven't already, you should visit the Promotion Center in Twin City!");
if (CurLevel == 110) MyClient.LocalMessage(2005, "You are Level 110. If you haven't already, you should visit the Promotion Center in Twin City!");
if (CurLevel >= 3)
{
if (Job <= 45 && Job >= 40) NewSkill(new Skill() { ID = 8002 });
else if (Job >= 10 && Job <= 15) NewSkill(new Skill() { ID = 1110 });
else if (Job >= 20 && Job <= 25) NewSkill(new Skill() { ID = 1025 });
}
}
if (CurLevel > Level)
{
World.Action(this, Packets.GeneralData(EntityID, 0, 0, 0, 92).Get);
if (Reborn || CurLevel >= 120)
{
if (Reborn) StatPoints += (ushort)((CurLevel - Level) * 3);
else
{
if (Level < 120) Level = 120;
int Attributes = Str + Vit + Agi + Spi + StatPoints;
if (Attributes < 800) StatPoints += (ushort)((CurLevel - Level) * 3);
}
}
CurHP = MaxHP;
}
if (CurLevel > Level) Level = CurLevel;
Experience = CurExp;
}
}
#endregion