|
You last visited: Today at 15:22
Advertisement
[Release]CoEmuV2 EXPBall code
Discussion on [Release]CoEmuV2 EXPBall code within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
06/03/2009, 01:02
|
#16
|
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
|
Lots of npcs are gonna add exp, best just to create a function, stick this at the bottom of useitem.
Code:
public static void GiveExp(int exp, ClientSocket CSocket)
{
CSocket.Client.Exp += (ulong)exp;
if (Calculation.NeededExp(CSocket.Client.Level) <= CSocket.Client.Exp)
{
Calculation.GiveLevel(CSocket);
}
else
{
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Exp, Struct.StatusTypes.Exp));
}
}
|
|
|
06/04/2009, 22:28
|
#17
|
elite*gold: 0
Join Date: Oct 2007
Posts: 116
Received Thanks: 16
|
It doesnt work for me...
Itl show the notice where it says itl level you up by this much... you click okay and nothing happens
|
|
|
06/04/2009, 23:32
|
#18
|
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
|
Guys, all your code fails. You only give ONE FRIGGIN LEVEL and the rest is just off in space. -.-
Here's an example using the Qonquer
Code:
Math.Floor(600000 * (1 + ((CSocket.Client.Level - 1) * 0.4)));
Kinshi posted
Code:
case 723700:
{
ulong ExpToGive = (ulong)Math.Floor(600000 * (1 + ((CSocket.Client.Level - 1) * 0.4)));
ulong ExpNeed = Calculation.NeededExp(CSocket.Client.Level) - CSocket.Client.Exp;
int Safety = 0;
while (ExpToGive >= 0)
{
if (Safety >= 150)
break;
if (ExpToGive < ExpNeed)
{
CSocket.Client.Exp += (ulong)ExpToGive;
ExpToGive = 0;
break;
}
else
{
CSocket.Client.Exp += (ulong)ExpNeed;
ExpToGive -= ExpNeed;
if (CSocket.Client.Exp >= Calculation.NeededExp(CSocket.Client.Level))
{
Calculation.GiveLevel(CSocket);
ExpNeed = Calculation.NeededExp(CSocket.Client.Level) - CSocket.Client.Exp;
CSocket.Client.Exp = 0;
}
} ++Safety;
}
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Exp, Struct.StatusTypes.Exp));
break;
}
Please learn to code guys, you're making me lonely
|
|
|
06/04/2009, 23:43
|
#19
|
elite*gold: 0
Join Date: May 2009
Posts: 6
Received Thanks: 0
|
thanks
|
|
|
06/05/2009, 01:45
|
#20
|
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
|
Quote:
Originally Posted by Zeroxelli
Guys, all your code fails. You only give ONE FRIGGIN LEVEL and the rest is just off in space. -.-
Here's an example using the Qonquer
Code:
Math.Floor(600000 * (1 + ((CSocket.Client.Level - 1) * 0.4)));
Kinshi posted
Code:
case 723700:
{
ulong ExpToGive = (ulong)Math.Floor(600000 * (1 + ((CSocket.Client.Level - 1) * 0.4)));
ulong ExpNeed = Calculation.NeededExp(CSocket.Client.Level) - CSocket.Client.Exp;
int Safety = 0;
while (ExpToGive >= 0)
{
if (Safety >= 150)
break;
if (ExpToGive < ExpNeed)
{
CSocket.Client.Exp += (ulong)ExpToGive;
ExpToGive = 0;
break;
}
else
{
CSocket.Client.Exp += (ulong)ExpNeed;
ExpToGive -= ExpNeed;
if (CSocket.Client.Exp >= Calculation.NeededExp(CSocket.Client.Level))
{
Calculation.GiveLevel(CSocket);
ExpNeed = Calculation.NeededExp(CSocket.Client.Level) - CSocket.Client.Exp;
CSocket.Client.Exp = 0;
}
} ++Safety;
}
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Exp, Struct.StatusTypes.Exp));
break;
}
Please learn to code guys, you're making me lonely
|
"guys"? There was one person that posted fail code, i merely posted an example.
Ignorant.
|
|
|
06/05/2009, 02:07
|
#21
|
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
|
Quote:
Originally Posted by scottdavey
"guys"? There was one person that posted fail code, i merely posted an example.
Ignorant.
|
Uh, no. Check the thread. Also, it wasn't directed at your function. But even so with yours, since you bring it up; It's blindly adding EXP onto the current.
|
|
|
06/08/2009, 08:43
|
#22
|
elite*gold: 0
Join Date: Nov 2006
Posts: 65
Received Thanks: 2
|
ok, all the codes ya gave was great, working like charms, but if you buy like 5 expballs from shopping mall and use them, only one will be remove from your inventory and the other 4 wont be remove and you can still get experience by clicking it. any idea why its doing that.
|
|
|
07/06/2009, 11:09
|
#23
|
elite*gold: 0
Join Date: Jul 2007
Posts: 73
Received Thanks: 1
|
do you know how to control of it i only want players use 10 expball only
|
|
|
07/06/2009, 15:38
|
#24
|
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
|
@killerbee
Mall fix, you need it.
@0105653642
Just save/load an integer to/from the db, and increment it.
|
|
|
07/07/2009, 14:51
|
#25
|
elite*gold: 0
Join Date: Jul 2007
Posts: 73
Received Thanks: 1
|
I want to know how to control in expballs use i want the players only use 10 expball in day any idea
|
|
|
07/10/2009, 17:58
|
#26
|
elite*gold: 0
Join Date: Aug 2007
Posts: 469
Received Thanks: 94
|
il give you an example def in in character.cs and put this
if (CSocket.Client.expballuse <= 10)
{
CSocket.Client.expballuse += 1;
and you may want set it to save the expballuse. if not the acc can just relog and us 10 more
|
|
|
07/10/2009, 19:15
|
#27
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
Quote:
Originally Posted by taylor2846
il give you an example def in in character.cs and put this
if (CSocket.Client.expballuse <= 10)
{
CSocket.Client.expballuse += 1;
and you may want set it to save the expballuse. if not the acc can just relog and us 10 more
|
wooh, and next day will u be able to use another 10? i doubt cuz you certainly dont know how to handle the "tomorrow".
|
|
|
07/10/2009, 19:37
|
#28
|
elite*gold: 0
Join Date: Nov 2006
Posts: 65
Received Thanks: 2
|
Quote:
Zeroxelli;2508278]@killerbee
Mall fix, you need it.
|
I already have the mall fix, but it was my ExpBall code that was the problem, but i fix it. thanks
|
|
|
07/10/2009, 21:44
|
#29
|
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
|
Quote:
Originally Posted by alexbigfoot
wooh, and next day will u be able to use another 10? i doubt cuz you certainly dont know how to handle the "tomorrow".
|
add a 24 hour timer or sumtin?
lol i barely know anything about coding
|
|
|
Similar Threads
|
[(Awesome)RELEASE] CoEmuv2.Nano(5095) Source Code
09/04/2013 - CO2 PServer Guides & Releases - 1480 Replies
--DO NOT PM ME ABOUT THIS SOURCE CODE OR ABOUT WHERE TO EDIT, CHANGE, ETC ANYTHING. THIS SOURCE CODE IS PROVIDED "AS IS" AND NO IMPLIED WARRANTY OR ASSISTANCE IS OFFERED TO YOU--
Sorry, but I'm overwhelmed with PMs about this..
This is CoEmu v2's leveling server source code. There is no implementation of any commands for players, though it is possible to add some.
I will be updating this sometimes, though I'm not sure how often.
You need a client of version 5095 to play with this...
|
All times are GMT +2. The time now is 15:22.
|
|