Register for your free account! | Forgot your password?

You last visited: Today at 07:47

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

Advertisement



[REQUEST]DropMoney.

Discussion on [REQUEST]DropMoney. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Luiz01's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 110
Received Thanks: 32
[REQUEST]DropMoney.

I'm using CoEmuv2 source...
I can't drop money..
if I can't == monsters cant

if you can not help me fix this little or big bug, I'II update my system (make it drop db's)
so you can tell me where can i get ID db, and I need just add ID item on db, or i need add ID action tho?

I need ID itens
Luiz01 is offline  
Old 11/02/2009, 20:49   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
full item list is right in the source files

game server> bin> debug> items.txt

All the item drop code for when you kill monsters is in the source:

Game server> entities> monster.cs

here is some sample code (from animeco source cause that's only sample source I have left that I was reading)

Code:
if (Calculation.PercentSuccess(1) && Level > 15)
                    {
                        Struct.ItemGround IG = new Struct.ItemGround();
                        IG.ItemID = 1088000;
                        IG.Map = Map;
                        IG.X = X;
                        IG.Y = Y;
                        if (!IG.SelectCoordonates(X, Y))
                            return;
                        IG.OwnerOnly = new System.Timers.Timer();
                        IG.OwnerOnly.Interval = 10000;
                        IG.OwnerOnly.AutoReset = false;
                        IG.OwnerID = Killer;
                        IG.UID = Nano.DropItemUID;
                        IG.Dispose = new System.Timers.Timer();
                        IG.Dispose.Interval = 60000;
                        IG.Dispose.AutoReset = false;
                        IG.Dispose.Elapsed += delegate { IG.Disappear(); };
                        IG.Dispose.Start();
                        IG.OwnerOnly.Start();
                        //lock(Nano.ItemFloor)
                        //{
                        try
                        {
                            Monitor.Enter(Nano.ItemFloor);
                            Nano.ItemFloor.Add(IG.UID, IG);
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.ToString());
                        }
                        finally
                        {
                            Monitor.Exit(Nano.ItemFloor);
                        }
                        //}
                        ConquerPacket.ToLocal(ConquerPacket.DropItem(IG.UID, IG.ItemID, IG.X, IG.Y, IG.Color), IG.X, IG.Y, IG.Map, 0, 0);
                    }
In this case there is a percent success rate (drop rate)

IG.ItemID = *item id here*

in this case it's the drop calculation for a dragon ball

So in essence this section of code is saying if the player killing a monster is over lvl 15 AND there is a 1 percent success rate (so aprox 1/100 mobs will drop a db) then a db will be dropped.


Your source may read it a little bit differently but I guarantee there is something in there controlling drops for mets/db's/money
pro4never is offline  
Thanks
1 User
Old 11/02/2009, 21:04   #3
 
Luiz01's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 110
Received Thanks: 32
My source is AnimeCo tho.
If cant do this i need you make for me

#EDIT OMG Thanks that was one of my last bug
I'm greatfull.

another ask, so how can i make it drop CPs and goto inventory automatically?
Do you know?
Luiz01 is offline  
Old 11/02/2009, 22:13   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
I haven't done it but it should be the same way, use a percentage calculation to control if cp's are given, then have it simply increase the players cp and update database (you may want it to also print a msg in top left saying how much the player has gained)

You will probably have to add in a few steps to that though because last time I checked the entities>monsters.cs section of the source didn't know how to handle the basic cp commands used by npcs and stuff. Should just be a matter of creating some definitions for it.
pro4never is offline  
Old 11/02/2009, 22:34   #5
 
Luiz01's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 110
Received Thanks: 32
Quote:
Originally Posted by pro4never View Post
I haven't done it but it should be the same way, use a percentage calculation to control if cp's are given, then have it simply increase the players cp and update database (you may want it to also print a msg in top left saying how much the player has gained)

You will probably have to add in a few steps to that though because last time I checked the entities>monsters.cs section of the source didn't know how to handle the basic cp commands used by npcs and stuff. Should just be a matter of creating some definitions for it.
i changed the percentage calculation to drop Db's, and it'snt dropping as you say.

Can you make me a simple example like Db's drop at birdman 50% calculation?
Luiz01 is offline  
Old 11/03/2009, 01:34   #6
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
No I can't because you already have multiple examples of drops built into the source and I explained exactly where to find them. I suggest you re-read the section in the source code where it's controlled and then re-compile server, restart it and test it out some.

I'm more then willing to offer advice to people and give them some pointers but I don't simply "write codes" for people. They should be learning to do that themselves. If they don't they will never learn to run their server anyways.
pro4never is offline  
Old 11/03/2009, 03:20   #7
 
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
Quote:
Originally Posted by Luiz01 View Post
I'm using CoEmuv2 source...
I can't drop money..
if I can't == monsters cant

if you can not help me fix this little or big bug, I'II update my system (make it drop db's)
so you can tell me where can i get ID db, and I need just add ID item on db, or i need add ID action tho?

I need ID itens
if u can't drop money doesn't mean the mobs can't coz they are 2 different cases any way

for the mob drops search for
Code:
//Partial credit: LOTF Core
below it u will c this lines
Code:
if (Calculation.PercentSuccess(30))[COLOR="Red"]//change the 30 to increase/decrease the drop rate[/COLOR]
                {
                    int Times = 1;
                    if (Calculation.PercentSuccess(15)) [COLOR="Red"]// this part to drop more than 1 money drop[/COLOR]
                    {
                        Times = Nano.Rand.Next(1, 6);
                    }
                    for (int i = 0; i < Times; i++)
                    {[COLOR="Red"]//the following 12 lines calculates the chances of how much money to drop[/COLOR]
                        int Money = Nano.Rand.Next(1, 10);
                        if (Calculation.PercentSuccess(90))
                            Money = Nano.Rand.Next(2, 240);
                        if (Calculation.PercentSuccess(70))
                            Money = Nano.Rand.Next(60, 3000);
                        if (Calculation.PercentSuccess(50))
                            Money = Nano.Rand.Next(200, 4000);
                        if (Calculation.PercentSuccess(30))
                            Money = Nano.Rand.Next(1000, 30000);
                        if (Calculation.PercentSuccess(100))
                            Money = Nano.Rand.Next(2000, 50000);
                        Money = Money / ((138 - Level) * 10);
                        if (Money < 1)
                            Money = 1;
                        Struct.ItemGround IG = new Struct.ItemGround();
                        Money *= 3;
                        IG.Money = Money;
                        if (Money < 10)
                            IG.ItemID = 1090000;
                        else if (Money < 100)
                            IG.ItemID = 1090010;
                        else if (Money < 1000)
                            IG.ItemID = 1090020;
                        else if (Money < 3000)
                            IG.ItemID = 1091000;
                        else if (Money < 10000)
                            IG.ItemID = 1091010;
                        else
                            IG.ItemID = 1091020;
                        IG.UID = Nano.DropItemUID;
                        IG.Map = Map;
                        IG.X = X;
                        IG.Y = Y;
                        if (!IG.SelectCoordonates(X, Y))
                            return;
                        IG.OwnerOnly = new System.Timers.Timer();
                        IG.OwnerOnly.Interval = 10000;
                        IG.OwnerOnly.AutoReset = false;
                        IG.OwnerID = Killer;
                        IG.Dispose = new System.Timers.Timer();
                        IG.Dispose.Interval = 60000;
                        IG.Dispose.AutoReset = false;
                        IG.Dispose.Elapsed += delegate { IG.Disappear(); };
                        IG.Dispose.Start();
                        IG.OwnerOnly.Start();
                        //lock(Nano.ItemFloor)
                        //{
                        try
                        {
                            Monitor.Enter(Nano.ItemFloor);
                            Nano.ItemFloor.Add(IG.UID, IG);
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.ToString());
                        }
                        finally
                        {
                            Monitor.Exit(Nano.ItemFloor);
                        }
                        //}
                        ConquerPacket.ToLocal(ConquerPacket.DropItem(IG.UID, IG.ItemID, IG.X, IG.Y, 4), IG.X, IG.Y, IG.Map, 0, 0);
                    }
                }
                else[COLOR="Red"]//here where the Item section starts (if the item isn't money)[/COLOR]
                {
so if u want the mops always drop money then remove that first if and the last else ,
now for the player drops money it depends on which drop u mean , do u mean u want to drop money by urself or u mean drop money when some player dies ?
samehvan is offline  
Thanks
1 User
Old 11/03/2009, 16:15   #8
 
Luiz01's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 110
Received Thanks: 32
Quote:
Originally Posted by samehvan View Post
if u can't drop money doesn't mean the mobs can't coz they are 2 different cases any way

for the mob drops search for
Code:
//Partial credit: LOTF Core
below it u will c this lines
Code:
if (Calculation.PercentSuccess(30))[COLOR="Red"]//change the 30 to increase/decrease the drop rate[/COLOR]
                {
                    int Times = 1;
                    if (Calculation.PercentSuccess(15)) [COLOR="Red"]// this part to drop more than 1 money drop[/COLOR]
                    {
                        Times = Nano.Rand.Next(1, 6);
                    }
                    for (int i = 0; i < Times; i++)
                    {[COLOR="Red"]//the following 12 lines calculates the chances of how much money to drop[/COLOR]
                        int Money = Nano.Rand.Next(1, 10);
                        if (Calculation.PercentSuccess(90))
                            Money = Nano.Rand.Next(2, 240);
                        if (Calculation.PercentSuccess(70))
                            Money = Nano.Rand.Next(60, 3000);
                        if (Calculation.PercentSuccess(50))
                            Money = Nano.Rand.Next(200, 4000);
                        if (Calculation.PercentSuccess(30))
                            Money = Nano.Rand.Next(1000, 30000);
                        if (Calculation.PercentSuccess(100))
                            Money = Nano.Rand.Next(2000, 50000);
                        Money = Money / ((138 - Level) * 10);
                        if (Money < 1)
                            Money = 1;
                        Struct.ItemGround IG = new Struct.ItemGround();
                        Money *= 3;
                        IG.Money = Money;
                        if (Money < 10)
                            IG.ItemID = 1090000;
                        else if (Money < 100)
                            IG.ItemID = 1090010;
                        else if (Money < 1000)
                            IG.ItemID = 1090020;
                        else if (Money < 3000)
                            IG.ItemID = 1091000;
                        else if (Money < 10000)
                            IG.ItemID = 1091010;
                        else
                            IG.ItemID = 1091020;
                        IG.UID = Nano.DropItemUID;
                        IG.Map = Map;
                        IG.X = X;
                        IG.Y = Y;
                        if (!IG.SelectCoordonates(X, Y))
                            return;
                        IG.OwnerOnly = new System.Timers.Timer();
                        IG.OwnerOnly.Interval = 10000;
                        IG.OwnerOnly.AutoReset = false;
                        IG.OwnerID = Killer;
                        IG.Dispose = new System.Timers.Timer();
                        IG.Dispose.Interval = 60000;
                        IG.Dispose.AutoReset = false;
                        IG.Dispose.Elapsed += delegate { IG.Disappear(); };
                        IG.Dispose.Start();
                        IG.OwnerOnly.Start();
                        //lock(Nano.ItemFloor)
                        //{
                        try
                        {
                            Monitor.Enter(Nano.ItemFloor);
                            Nano.ItemFloor.Add(IG.UID, IG);
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.ToString());
                        }
                        finally
                        {
                            Monitor.Exit(Nano.ItemFloor);
                        }
                        //}
                        ConquerPacket.ToLocal(ConquerPacket.DropItem(IG.UID, IG.ItemID, IG.X, IG.Y, 4), IG.X, IG.Y, IG.Map, 0, 0);
                    }
                }
                else[COLOR="Red"]//here where the Item section starts (if the item isn't money)[/COLOR]
                {
so if u want the mops always drop money then remove that first if and the last else ,
now for the player drops money it depends on which drop u mean , do u mean u want to drop money by urself or u mean drop money when some player dies ?
by myself

Thank you so much.
Luiz01 is offline  
Old 11/03/2009, 22:15   #9
 
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
Quote:
Originally Posted by Luiz01 View Post
by myself

Thank you so much.
Added to my thread post 3
samehvan is offline  
Old 11/03/2009, 23:11   #10
 
Luiz01's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 110
Received Thanks: 32
Quote:
Originally Posted by samehvan View Post
Added to my thread post 3
Thank you, you are helping ppl alot.. you should be a moderator!
Luiz01 is offline  
Reply


Similar Threads Similar Threads
[Request] Request all 5165 sources/npc dialog
02/28/2010 - CO2 Private Server - 0 Replies
so i want to do a good source like every1 right ? so i stay some time and i got a idea to take lot of 5165 and take what's not bugged and essentialy :mofo: i will release it :D
[Request]ZeroTolerance Dekaron Admin Request
02/21/2010 - Dekaron Private Server - 1 Replies
We need Staff Members ~EDITED~
[REQUEST] speak freakin english -_- florensi hack [REQUEST]
01/22/2010 - Florensia - 1 Replies
any florensia hacks?



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


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.