Register for your free account! | Forgot your password?

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

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

Advertisement



[Help]Coding a Npc Thats stores stuff(Not a wh)

Discussion on [Help]Coding a Npc Thats stores stuff(Not a wh) within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2007
Posts: 36
Received Thanks: 6
[Help]Coding a Npc Thats stores stuff(Not a wh)

Ok i have been trying to get a Npc to Store PlusPoints. I want it so that every time i give a +1 stone it will add 1 point to PlusPoints Colum in my MySql Character table. Ive got it to take the stone, got the Colum ready, Just cant get it to add 1 point to it.
Im Using CoEmuV2
Any ideas on this?
Is it possibel
duddz is offline  
Old 06/26/2009, 16:47   #2
 
elite*gold: 0
Join Date: Jun 2009
Posts: 33
Received Thanks: 3
are you using lotf?
Akarama is offline  
Old 06/26/2009, 20:31   #3
 
elite*gold: 0
Join Date: Sep 2007
Posts: 36
Received Thanks: 6
[QUOTE=Akarama;2444066]are you using lotf?[/QUOTE

Oh sorry i forgot to say. Using CoEmuV2
duddz is offline  
Old 06/26/2009, 20:46   #4
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
Code:
        public static void SavePlusPoint(ClientSocket CSocket)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `PlusPoints` = " + CSocket.Client.PlusPoints + " WHERE `CharID` = " + CSocket.Client.ID + "", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
kinshi88 is offline  
Thanks
3 Users
Old 06/26/2009, 22:59   #5
 
elite*gold: 0
Join Date: Sep 2007
Posts: 36
Received Thanks: 6
Quote:
Originally Posted by kinshi88 View Post
Code:
        public static void SavePlusPoint(ClientSocket CSocket)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `PlusPoints` = " + CSocket.Client.PlusPoints + " WHERE `CharID` = " + CSocket.Client.ID + "", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
Thanks you!
duddz is offline  
Old 06/27/2009, 02:57   #6
 
elite*gold: 0
Join Date: May 2008
Posts: 103
Received Thanks: 3
I HAVE THIS ERROR

PLEASE HELP
m7med is offline  
Old 06/27/2009, 23:06   #7
 
elite*gold: 0
Join Date: Sep 2007
Posts: 36
Received Thanks: 6
Quote:
Originally Posted by m7med View Post
I HAVE THIS ERROR

PLEASE HELP
Your dont put it in NpcTalk.cs i believe its Database.cs
duddz is offline  
Thanks
1 User
Old 06/28/2009, 01:39   #8
 
TheLeGend209's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 157
Received Thanks: 15
Quote:
Originally Posted by m7med View Post
I HAVE THIS ERROR

PLEASE HELP

You Must put that in Database.cs
TheLeGend209 is offline  
Old 06/28/2009, 01:40   #9
 
TheLeGend209's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 157
Received Thanks: 15
Quote:
Originally Posted by kinshi88 View Post
Code:
        public static void SavePlusPoint(ClientSocket CSocket)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `PlusPoints` = " + CSocket.Client.PlusPoints + " WHERE `CharID` = " + CSocket.Client.ID + "", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
Ty Kinshi
TheLeGend209 is offline  
Old 07/08/2009, 23:53   #10
 
elite*gold: 0
Join Date: May 2008
Posts: 103
Received Thanks: 3
i have an error in PlusPoints

i fixed
in Entities\Character.cs
i add
public uint PlusPoints = 0;
m7med is offline  
Old 07/08/2009, 23:57   #11
 
n0mansland's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 780
Received Thanks: 255
This isn't exactly a code.. That's just part of it... You still have to add a lot more parts in character.cs,npctalk.cs, etc. anyways duddz has already figured this out and released a Met Bank search for it and then use the codes in there...
n0mansland is offline  
Old 07/09/2009, 00:04   #12
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
its actually very easy.

here is what you have to add.

1. Points(or w.e u want) in the source, and mysql or ini w.e u use.
2. a save ( super easy )
3. a npc or command that lets you put it in and/or take it out.

and your done.
PeTe Ninja is offline  
Reply




All times are GMT +2. The time now is 10:41.


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.