Nevermind buddies, I got it the way to work i needed it to =D
No, this is absolutely horrid code. It's incomplete and you don't even have a case to break.Quote:
Simple make it connect to another file,where it is listed like
else if (Character.Level == 1)
Character.Level = 25;
con.Send(UpdatePackets.Update.Ding(Character.Playe rID, UpdateThings.Level, Character.Level));
HeadController.SendVisibilityfield(StandardPackets .Effect.Packet("LevelUp", Character.PlayerID), Character);
StatPoints SP = StatSystem.KrijgPoints(Character.Level, Character.Class);
Character.Vitality = SP.Vitality;
Character.Strength = SP.Strength;
Character.Spirit = SP.Spritit;
Character.Agility = SP.Agility;
con.Send(UpdatePackets.Update.Ding(Character.Playe rID, UpdateThings.Agility, Character.Agility));
con.Send(UpdatePackets.Update.Ding(Character.Playe rID, UpdateThings.Vitality, Character.Vitality));
con.Send(UpdatePackets.Update.Ding(Character.Playe rID, UpdateThings.Strenght, Character.Strength));
con.Send(UpdatePackets.Update.Ding(Character.Playe rID, UpdateThings.Spirit, Character.Spirit));
Character.HP = Character.MaxHP;
}
else
{
Dia.AddMessage("You used 5 expball's today. Are you sure you want to use more?");
Dia.AddOption("Yeah", 1);
Dia.AddOption("No thanks", 255);
Dia.Open();
}
if (Character.LevelUp)
HeadController.SendVisibilityfield(StandardPackets .Effect.Packet("LevelUp", Character.PlayerID), Character);
}
break;
This is also incorrect, exp balls give raw experience, and it would be so much easier (and less sloppy) if you would measure it in raw experience rather than level/percentage.Quote:
I think another way also is to do this:
case "120": = new string[] { "0", "8" }; break;
case "129": = new string[] { "0", "2.4" }; break;
The numbers after case are the levels,then the numbers after "new string" , is first the level,and ofcourse you dont get a whole level when you use an expball at 120,you get pcts. thats why its 8 after,gives 8 pcts.
well ofcourse you need to write a bunch of stuffs before to make the code working,but it shouldnt be too hard.
public const int ExpBallValue = 5e7; //50 million exp points
...
//in RequestEquipItem
case 723700:
{
int exp = ExpBallValue;
while(true)
{
//Start Pseudo-code
int req = ExpForNextLevel - Player.CurrentEXP; //Get the amount of exp for the next level minus what the player already has.
exp -= req; //subtract that amount from the exp available from the exp ball
if (exp <= 0) //Check if the exp is below zero, if so, we can't level from the amt remaining anymore
{
req = exp; //Make the two values equal. this way we add only what's left
}
Player.CurrentEXP += req; //Add the exp to the player
Player.LevelUp(); //Check for level up ie: show the anim, add the stats or stat points
//End pseudo code
}
}
break;
That's looking nice. Yeah, I'd go with his code.Quote:
Lol, Exp balls?
Anyway, just define a const for the amount exp an exp ball would give.
Code:public const int ExpBallValue = 5e7; //50 million exp points ... //in RequestEquipItem case 723700: { int exp = ExpBallValue; while(true) { //Start Pseudo-code int req = ExpForNextLevel - Player.CurrentEXP; //Get the amount of exp for the next level minus what the player already has. exp -= req; //subtract that amount from the exp available from the exp ball if (exp <= 0) //Check if the exp is below zero, if so, we can't level from the amt remaining anymore { req = exp; //Make the two values equal. this way we add only what's left } Player.CurrentEXP += req; //Add the exp to the player Player.LevelUp(); //Check for level up ie: show the anim, add the stats or stat points //End pseudo code } } break;