Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 02:38

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

Advertisement



Distribute Attributes Command

Discussion on Distribute Attributes Command within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
CIRASH's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
Distribute Attributes Command

I'm using the 4267 CoFuture source and am trying to code some simple commands. I made this command to distribute dexterity attributes but when i try it, the console gives an error saying the index was outside the bounds od the array.

Heres my code.
Code:
                    if (Splitter[0] == "/dex")
                    {
                        if (Client.Char.StatPoints >= Convert.ToUInt16(Splitter[2]))
                        {
                            Client.Char.StatPoints -= Convert.ToUInt16(Splitter[2]);
                            Client.Char.Dexterity = Convert.ToUInt16(Splitter[2]);
                            Client.SendData(ConquerPacket.Status(Client, Client.Char.Dexterity, Struct.StatusTypes.DexterityStatPoints));
                            Client.SendData(ConquerPacket.Status(Client, Client.Char.StatPoints, Struct.StatusTypes.AttributePoints));
                        }
                    }
Any help or feedback is appreciated.
CIRASH is offline  
Old 02/04/2010, 06:42   #2
 
spare2's Avatar
 
elite*gold: 20
Join Date: Oct 2009
Posts: 1,009
Received Thanks: 621
Quote:
Originally Posted by CIRASH View Post
I'm using the 4267 CoFuture source and am trying to code some simple commands. I made this command to distribute dexterity attributes but when i try it, the console gives an error saying the index was outside the bounds od the array.

Heres my code.
Code:
                    if (Splitter[0] == "/dex")
                    {
                        if (Client.Char.StatPoints >= Convert.ToUInt16(Splitter[2]))
                        {
                            Client.Char.StatPoints -= Convert.ToUInt16(Splitter[2]);
                            Client.Char.Dexterity = Convert.ToUInt16(Splitter[2]);
                            Client.SendData(ConquerPacket.Status(Client, Client.Char.Dexterity, Struct.StatusTypes.DexterityStatPoints));
                            Client.SendData(ConquerPacket.Status(Client, Client.Char.StatPoints, Struct.StatusTypes.AttributePoints));
                        }
                    }
Any help or feedback is appreciated.
Should be
Code:
                    if (Splitter[0] == "/dex")
                    {
                        if (Client.Char.StatPoints >= Convert.ToUInt16(Splitter[1]))
                        {
                            Client.Char.StatPoints -= Convert.ToUInt16(Splitter[1]);
                            Client.Char.Dexterity = Convert.ToUInt16(Splitter[1]);
                            Client.SendData(ConquerPacket.Status(Client, Client.Char.Dexterity, Struct.StatusTypes.DexterityStatPoints));
                            Client.SendData(ConquerPacket.Status(Client, Client.Char.StatPoints, Struct.StatusTypes.AttributePoints));
                        }
                    }
spare2 is offline  
Thanks
1 User
Old 02/04/2010, 06:55   #3
 
CIRASH's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
Wow, such a simple problem haha. Thanks Spare
#request close
CIRASH is offline  
Old 02/04/2010, 07:15   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,383
Yah, always remember that [0] is the initial command, they don't start with 1.

It's even more fun when you're selecting ranges of stuff and trying to figure out why it's not grabbing the right data... then you realize you were counting them up wrong :P
pro4never is offline  
Old 02/04/2010, 08:05   #5
 
CIRASH's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
I'm converting your met/db bank for 1.0 now xD
CIRASH is offline  
Old 02/04/2010, 08:17   #6
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,383
Ahaha... that's funny because I converted my metbank FROM 1.0.

here's the original code (no met/db scroll functionality cause I didn't have a itemtype editor to add them)



database voids

PHP Code:
public static void SaveMetPoint(Character Char)
        {
            
lock (DatabaseConnection)
            {
                
MySqlCommand Comm = new MySqlCommand("UPDATE `characters` SET `MetPoint` = " Char.MetPoint " WHERE `CharID` = " Char.ID ""DatabaseConnection);
           
            }
            
        }
        public static 
void SaveDbPoint(Character Char)
        {
            
lock (DatabaseConnection)
            {
                
MySqlCommand Comm = new MySqlCommand("UPDATE `characters` SET `DbPoint` = " Char.DbPoint " WHERE `CharID` = " Char.ID ""DatabaseConnection);

            }

        } 
Not sure if you need these but w/e

here's the voids, most should be in source already though


Enjoy.
pro4never is offline  
Thanks
1 User
Old 02/04/2010, 08:49   #7
 
CIRASH's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
Thanks. Saved me quite some time. Testing now.
CIRASH is offline  
Old 02/04/2010, 09:00   #8
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,383
You might wanna remove some of the console.writeline's. I had them in there when I was first writing it for debug purposes... it's kinda a messy release but it should work.
pro4never is offline  
Old 02/06/2010, 01:13   #9
 
CIRASH's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
Hmm, wont save after logoff even though i added it for saving and loading character.
CIRASH is offline  
Reply


Similar Threads Similar Threads
[REQUEST] What is the command on binary to make attributes 900?
10/05/2009 - CO2 Private Server - 1 Replies
I need the command that will make my attributes 900. I tried /vit 900 and different commands but they don't work. I did the /superman command too many times and I need to get them back to 900 without editing the DB. Help me please.
[HELP] What is the command to make attributes 1000 on ultimateco source?
09/15/2009 - CO2 Private Server - 0 Replies
What is the command to make attributes 1000 on ultimateco source?
What is the command on a v5017 source to make all attributes 1000?
08/31/2009 - CO2 Private Server - 13 Replies
What is the command on a v5017 source to make all attributes 1000?
/GM DISTRIBUTE aint working ?
05/11/2009 - Dekaron Private Server - 5 Replies
I tryed to use the code, but nothing happens, ive tryed to clone a item in the DB but then i cant login -> 400,100 Anyone know fic for this ? Thx
how to distribute those point for fire
05/18/2007 - Conquer Online 2 - 1 Replies
hi everyone. i really nid u all help me out.. i juz rb from water to fire.. i dunno how to distribute my point.. can anyone teach me? ty so much



All times are GMT +1. The time now is 02:39.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

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