Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 13:45

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

Advertisement



[Release] Met/db bank using input fields

Discussion on [Release] Met/db bank using input fields within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
[Release] Met/db bank using input fields

So I was bored and re-wrote my met/db bank that I made for my 1.0 server and converted it for use with CoEmu. I ended up changing some stuff around so that it works with met/db scrolls also.


As far as I know there is no better, more complete system released publicly. It may not be perfect but it's close. I don't actually run a server so there could be some bugs that I didn't run into while testing it for a few minutes so keep your eyes open.

Main Npc text (using lady luck simply because I don't want lottery on my server but simple enough to change the npc number)

Place in handlers>NpcTalk.cs

You will also be needing some functions so I may as well post some of them (if I miss some, that's your own damn problem to fix them.)

Note: the base source I was messing around with doesn't have composition or anything like that so you will need to modify the codes accordingly.

Place in Database>Database.cs


place in the bottom of Handlers>Npctalk.cs



Note: If you don't have Data you will need to modify the top npctalk void to include it by using this line of code

Code:
public static void NpcTalk(ClientSocket CSocket, int ID, int LinkBack, byte[] Data)
and under character.cs

Code:
public int DbPoints = 0;
        public int MetPoints = 0;

Obviously you will need to modify the character database to have a field for MetPoints and DbPoints (int, not nul, 0 decimals, default 0 etc)

Now modify your database so that it loads the points with the character (if not you will lose them on logoff even though they ARE being saved to the database properly)

Search Client.ID = Convert.ToInt32(DR["CharID"]);

and place
Client.MetPoints = Convert.ToInt32(DR["MetPoints"]);
Client.DbPoints = Convert.ToInt32(DR["DbPoints"]);

somewhere below it

Should be simple enough to setup by simply following other met/db storage scripts. Only difference is this one uses input fields. Storage will store scrolls first and extra mets second, removal should work perfectly with inventory space calculating scrolls and loose met/db's separately.


Anyways, should be easily converted to use in any source but figured seeing as I finished it and have no real use for it I'd release. Hopefully it will help ppl be able to learn from it.

<edit>

Cleaned up some stuff, had two copies of the database voids. Added spoilers so it's not quite as massive a post, grouped some stuff together. Nothing big changed.

<edit 2>

Re-wrote alot of the depositing code so you can't get free db/mets.. WHOOPS!
pro4never is offline  
Thanks
10 Users
Old 01/02/2010, 01:03   #2
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
Nice release : )
-Shunsui- is offline  
Old 01/02/2010, 05:56   #3
 
shadow8994's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 124
Received Thanks: 16
Nice Release
shadow8994 is offline  
Old 01/12/2010, 07:47   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Glad you enjoyed it.

Really is shocking after having come back how few people care about CoEmu anymore. 10 bux said if I or someone else converted it for the new lotf source this thread would be buzzing ^^
pro4never is offline  
Old 01/12/2010, 09:06   #5


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Agreed, its a nice system to have instead of hundreds of met scrolls (or even just mets if your on 1.0), its a shame these things just get ignored.
Korvacs is offline  
Old 01/14/2010, 02:56   #6
 
ktamer's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 99
Received Thanks: 35
Good work, despite CoEmu's "dying" popularity. It's good to see a public system that many people are going to try and implement into their PS'. Can't wait 'till my level of coding is as decent, so many ideas so many steps ^_^
ktamer is offline  
Old 01/14/2010, 05:06   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by ktamer View Post
Good work, despite CoEmu's "dying" popularity. It's good to see a public system that many people are going to try and implement into their PS'. Can't wait 'till my level of coding is as decent, so many ideas so many steps ^_^
Glad you find it useful. There isn't anything super complex with this script (although as you mentioned there is alot of it lol) except getting a hang of input fields and making sure I handled counting properly. If you have any questions about how to use some of the stuff out of it for a different script (or even have a request for a system/npc you would like to see made), lemme know.

When I get bored I tend to put together lil scripts just for fun so having a direction to them would be kinda nice.
pro4never is offline  
Old 01/16/2010, 16:29   #8
 
ktamer's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 99
Received Thanks: 35
Quote:
Originally Posted by pro4never View Post
Glad you find it useful. There isn't anything super complex with this script (although as you mentioned there is alot of it lol) except getting a hang of input fields and making sure I handled counting properly. If you have any questions about how to use some of the stuff out of it for a different script (or even have a request for a system/npc you would like to see made), lemme know.

When I get bored I tend to put together lil scripts just for fun so having a direction to them would be kinda nice.
Cool, I really appreciate it. And all the help everyone's been. It's hard to find a community with patience.
ktamer is offline  
Old 01/16/2010, 17:11   #9
 
ImmuneOne's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
Quote:
Originally Posted by pro4never View Post
Glad you enjoyed it.

Really is shocking after having come back how few people care about CoEmu anymore. 10 bux said if I or someone else converted it for the new lotf source this thread would be buzzing ^^
I have converted it, anyway conqueremu have died just because ninety percent of the forum only cares about highest patch and not about the quantity nor quality.
ImmuneOne is offline  
Thanks
1 User
Old 01/16/2010, 19:20   #10
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
Quote:
Originally Posted by ImmuneOne View Post
I have converted it, anyway conqueremu have died just because ninety percent of the forum only cares about highest patch and not about the quantity nor quality.
Yeah, I noticed that today.
****, some things never change.
Basser is offline  
Old 01/16/2010, 19:26   #11
 
.Ryu's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
**** chris your on a roll goodjob =P
.Ryu is offline  
Old 01/16/2010, 19:52   #12
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
Pro4Never, just sayin gratz.
You have a lot more experience from the first time I saw one of your releases.
This script is proving you know the very basics now. Gratz on that.
Basser is offline  
Old 01/20/2010, 01:54   #13
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Ahaha thanks, I wrote this ages ago though so not sure what codes you are referring to unless you mean the ones I did like 6+ months ago.

Anyways, hopefully people can find this useful.
pro4never is offline  
Old 02/03/2010, 13:12   #14
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Ok so I was using this script again and when I grabbed if off here and actually tested what I posted I realized just how messed up my checks were. I re-wrote them and updated the npc.

The way it was before, it would check inventory met/db's and account for scroll but it wouldn't actually check while removing stuff.. so lets say you have 21 db's in your inventory (2 scrolls 1 loose) and you try to deposit 19 dbs. It would pass the check cause you DO have enough but instead it would only remove 11 db's and give you the 19 points giving you 8 free dbs.

Not a good thing so I re-wrote it using some more checks. They may not be the prettiest things ever but they work. Also re-added some missing stuff that was organized wrong, mislabeled or just missing from the post.


Enjoy!
pro4never is offline  
Old 02/12/2010, 13:36   #15
 
renetjuuh's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 97
Received Thanks: 9
good job new i learn more about it realy nice
renetjuuh is offline  
Reply


Similar Threads Similar Threads
Unused cq_user fields
07/18/2009 - CO2 Private Server - 0 Replies
//
[Re-Release]Met/Db Bank
07/17/2009 - CO2 PServer Guides & Releases - 3 Replies
Did it, this time dbs and mets store seperate. 1. You need to "Design" your Sql table, i dont know a command for this but heres the manual way. A. Open up Navicat(what i use) B. Go to the Character table C. Go to File/ Design Table D. Click on Add field E. Name the field Name: MetPoint,Type: int,Lenght: 11,Decimals: 0, Not Null. F. Add a second one for DbPoint Put this in NpcTalk.cs(obviously)
Openkore Fields bearbeiten
08/28/2006 - Ragnarok Online - 1 Replies
Hallo, wie die Topic schon sagt gibt es ein Programm womit ich die einzelnen Fields bearbeiten kann?



All times are GMT +2. The time now is 13:45.


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.