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;
that should be it. well,its alot of easier ways,um if you want more help or need an good coder,just tell me.
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.
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;
No, this is absolutely horrid code. It's incomplete and you don't even have a case to break.
Quote:
Originally Posted by emildayan1
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.
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.
and Yeh emildayan1 there is no loop or switch to break.
Like lat said, we dont know the methods/variables to do anything. But ur closest will be how shitboi has it.
Make a formula in some class, do some maths then do something like
Formula formula = new Formula();
int itemId = use_item[0];
switch (itemId)
{
case 723700:
char.exp += formula.getExpBallFormula(); // <-- would tally up the percentage according to your level.
char.checkLevel(); // not sure how this is done in ur source, but it would check if you need to be leveled up.
inventory.removeItem(723700, 1); // however it is done in ur source
break;
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;
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;
[RELEASE]Conquer Online Private Server Code Put it in your general.cs (LOTF) 11/14/2009 - CO2 PServer Guides & Releases - 12 Replies Console.WriteLine("If im noob im gonna copy");
Console.WriteLine("If I have experience im gonan make it self");
Console.WriteLine("If I ahvent made anything better i cant complain others work");
Console.WriteLine("ElitePvpers still sucks");
Console.WriteLine("Hybrids guide can help you get through this shit if you are noob");
Console.WriteLine("If i helped press thanks, if not then GTFO");
Console.WriteLine("Put this to general.cs");
You cant report me for this cause is not spam and it...
[Release]CoEmuV2 EXPBall code 07/10/2009 - CO2 PServer Guides & Releases - 28 Replies This is converted from LOTF, but meh, here it goes.
1) Open your UseItem.cs
2) Add this code under one of the cases :