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 15:06

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

Advertisement



[Release] Item dropping (for events/gm command)

Discussion on [Release] Item dropping (for events/gm command) 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,380
[Release] Item dropping (for events/gm command)

So I was bored and figured I might finish my random event code for 1.0 and in the process realized just how much better alot of what I had could be written so I'm in the process of re-writing it all to use voids, switch and all that good stuff.

During that, for my random drop event I decided to write a little command/void to handle dropping items. This can be used however you wish. Maybe you want a gm command to drop x number of db's in twin city, a random event or anything else you want really.


NOTE: Coded for CoFuture 1.0 server, SUPER easy to convert to CoEmu and I'm sure a lotf version would be very easy to make.

Enjoy


For my version I created a new class file under handlers but you could obviously pack this in somewhere else (although there is no reason to)

Right click handles>Add>Class and name it w/e you want, mine is ItemDrop1.cs but it makes no real diff

replace the entire new file with this



Notice I just stole the existing item drop code from monsters and modified it to use a new void. As the drop code already seems to work perfectly fine I felt no need to change it.

Now for implimentation of it

under Commands.cs place

Code:
if (Splitter[0] == "/itemdrop")
                    {
                        try
                        {
                            Handler.ItemDrop(Client.Char.ID, Convert.ToInt32(Splitter[1]), Convert.ToInt32(Splitter[2]), Convert.ToInt32(Splitter[3]), Convert.ToUInt16(Splitter[4]), Convert.ToUInt16(Splitter[5]));
                        }
                        catch
                        {
                            Console.WriteLine("Error! Failed to drop item!");
                        }

                        return 2;
                    }

The way this works is very simple.

The item permission (who can grab item) is set to the person using the command (this way the gm could grab if he made a mistake but ppl in server have to wait a while to grab them!)

Everything else is set through the command.


Eg:
/itemdrop 1088001 10 1002 515 422 would drop 10 meteors at 515 422 twin city

And that's all there is to it. You can invoke the command anywhere in the source for any use where you want multiple (or even single) items dropping at a specific place.

All you have to do for that is

Handler.ItemDrop(Client.Char.ID, itemId#, Amount, Map, x, y);

Please let me know if I made any mistakes as I haven't really tested this much (Note! This would need to be changed if you wanted to deal with item quality/+/gem/etc! This is for mets/db mainly, or + stones if using a higher patched source.)

Enjoy,
P4N


Ooh: and a screenshot just so you have an example



Edit: bahh I realized when posting this that it only will drop 9 items due to the limitations of the system I used... I have no reason to fix it right now but feel free if you want to post the correction and obviously all credit will go to you.
pro4never is offline  
Thanks
1 User
Old 01/14/2010, 18:26   #2
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
=0 thats cool. Can you translate to 5165 xD
.Kob is offline  
Old 01/14/2010, 18:26   #3
 
elite*gold: 188
Join Date: Dec 2009
Posts: 79
Received Thanks: 36
This is a very nice release.
Thanks!
Fleaman is offline  
Old 01/14/2010, 19:27   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
I don't use lotf so I don't know the syntax properly. It's simple enough to convert though. Just change around the drop structure to be the same as lotf and look at how handlers are done in lotf.

Fairly simple conversion (although the code in itself is quite simple).
pro4never is offline  
Old 01/14/2010, 19:39   #5
 
.Ryu's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
Chris is only into this COFuture source because its co 1.0
Goodjob chris =P
.Ryu is offline  
Old 01/14/2010, 19:43   #6
 
elite*gold: 0
Join Date: Jun 2006
Posts: 72
Received Thanks: 3
yes converting to 5156 would be nice =p
Cassiuss is offline  
Old 01/14/2010, 19:43   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Naw actually I like CoFuture just because it's fairly complete and stable/well coded source. I'm also a big fan of CoEmu but I have no time or desire to re-write all the features required for it.

This was for CoFuture just cause I had a half finished system for it and in the process of re-writing the coding found this necessary. Seeing as I had finished it I thought I'd share it with people.


@Fox, do you guys have a forum up for development of the 1.0 server? If so lemme know so I can start working on some stuff.
pro4never is offline  
Old 01/14/2010, 19:45   #8
 
.Ryu's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
Quote:
Originally Posted by pro4never View Post
Naw actually I like CoFuture just because it's fairly complete and stable/well coded source. I'm also a big fan of CoEmu but I have no time or desire to re-write all the features required for it.

This was for CoFuture just cause I had a half finished system for it and in the process of re-writing the coding found this necessary. Seeing as I had finished it I thought I'd share it with people.


@Fox, do you guys have a forum up for development of the 1.0 server? If so lemme know so I can start working on some stuff.
I have the website up im working on the forum but it wont let me do phpbb... So i gotta fix this i would go with punbb but nah that sucks to much but ill get this fix in no time
.Ryu is offline  
Old 01/14/2010, 19:47   #9
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
:O why wouldn't phpbb work? All it should require is mysql and php functionality which any web server should have (if it doesn't you are gonna have alot of problems with other features anyways)

Anyways lemme know when the forum is up. Things will be getting busy for me soon but till then this is a way for me to waste some time and be semi-productive at the same time.
pro4never is offline  
Old 01/14/2010, 19:50   #10
 
.Ryu's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
Quote:
Originally Posted by pro4never View Post
:O why wouldn't phpbb work? All it should require is mysql and php functionality which any web server should have (if it doesn't you are gonna have alot of problems with other features anyways)

Anyways lemme know when the forum is up. Things will be getting busy for me soon but till then this is a way for me to waste some time and be semi-productive at the same time.
Well im using x10hosting and for some reason it doesent let me install phpbb...
And ive made a site there befor but it wont let me =\
It doesent have the installation no more...

But anyways pm if you wanna check out the site
.Ryu is offline  
Old 01/16/2010, 07:51   #11
 
gulpi_de_gulat's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 71
Received Thanks: 40
Quote:
Originally Posted by Cassiuss View Post
yes converting to 5156 would be nice =p
drop event is already there in 5165 source
gulpi_de_gulat is offline  
Reply


Similar Threads Similar Threads
Proxy Help: Dropping an Item
08/16/2010 - CO2 Programming - 23 Replies
Alright, so i have decided to mess around with a proxy and try to make myself an autominer. I have gotten as far as to dropping the items. I am not sure what the problem with it is, weather its the packet structure or the Item ids itself. EDIT: Totally forgot to mention its for a 5065 binary server. This is in my PacketHandler, everytime i pick something up, or mine an ore i Add the item to a dictionary, then i check to see if There are more than 19 items, if their are i call my drop...
[Release]Bound Item Command(5165)
08/05/2010 - CO2 PServer Guides & Releases - 15 Replies
Got bored... this is the usage: /free Item Quality Plus -Damage Socket1 Socket2 if (Cmd == "/free") { uint ID = 0; foreach (DatabaseItem DI in Database.DatabaseItems.Values) if (DI.Name == Cmd) {
[SEARCH]GM Command for item dropping
08/16/2009 - Dekaron Private Server - 11 Replies
I have an own Dekaron private Server(Only4Fun) and a few questions What is the GM Command to drop an item i chosed? If i type /GM callmonster 101 (Spider larva) the there is no monster spawning. Why? Pls help me Greets Ghosthunter PS: I have a List with the commands but the most one are not working. I type them and then nothing happens



All times are GMT +1. The time now is 15:07.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.