Register for your free account! | Forgot your password?

You last visited: Today at 15:22

  • Please register to post and access all features, it's quick, easy and FREE!

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.

Reply
 
Old 06/03/2009, 01:02   #16
 
scottdavey's Avatar
 
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));
            }
        }
scottdavey is offline  
Thanks
3 Users
Old 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
quadruple1 is offline  
Old 06/04/2009, 23:32   #18
 
Zeroxelli's Avatar
 
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
Zeroxelli is offline  
Thanks
1 User
Old 06/04/2009, 23:43   #19
 
elite*gold: 0
Join Date: May 2009
Posts: 6
Received Thanks: 0
thanks
SuperDragonMan is offline  
Old 06/05/2009, 01:45   #20
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
Quote:
Originally Posted by Zeroxelli View Post
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.
scottdavey is offline  
Old 06/05/2009, 02:07   #21
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
Quote:
Originally Posted by scottdavey View Post
"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.
Zeroxelli is offline  
Old 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.
killerbee is offline  
Old 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
0105653642 is offline  
Old 07/06/2009, 15:38   #24
 
Zeroxelli's Avatar
 
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.
Zeroxelli is offline  
Old 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
0105653642 is offline  
Old 07/10/2009, 17:58   #26
 
taylor2846's Avatar
 
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
taylor2846 is offline  
Old 07/10/2009, 19:15   #27
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
Quote:
Originally Posted by taylor2846 View Post
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".
alexbigfoot is offline  
Old 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
killerbee is offline  
Old 07/10/2009, 21:44   #29
 
CIRASH's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
Quote:
Originally Posted by alexbigfoot View Post
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
CIRASH is offline  
Reply


Similar Threads 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.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.