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:22

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

Advertisement



5165 Version of p4n's Intelligent Auto CP System

Discussion on 5165 Version of p4n's Intelligent Auto CP System within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
5165 Version of p4n's Intelligent Auto CP System

OK, so this isn't entirely my idea, I just simply converted it to 5165.

You can give me thanks, but also give pro4never thanks too if he posts here(even though I know he will post here lol).

Find in Mob.cs:

Code:
if (MyMath.ChanceSuccess(100))
                {
or whatever you have your auto CPs as in your source.

Replace it with this:

Code:
if (MyMath.ChanceSuccess(100))
                {
                    string acc = "";
                    int cpDroprate = 10;//rate of cp for server
                    int cpLow = 1;//min cp drop
                    int cpHigh = 25;// max cp drop
                    int cpMultiplyer = 5;// cp drop multiplier
                    double cpMobDropRate = (Convert.ToDouble(MobTarget.Level) / Convert.ToDouble(Char.Level)) * cpDroprate;
                    if (MyMath.ChanceSuccess(cpMobDropRate))
                    {
                        Random rand = new Random();
                        int cpBaseReward = rand.Next(cpLow, cpHigh);
                        int cpToAdd = cpBaseReward * cpMultiplyer;

                        Char.CPs += Convert.ToUInt32(cpToAdd);
                        Char.MyClient.LocalMessage(2005, "[CPs] You have gained: " + cpToAdd + " CPs for killing a(n) " + MobTarget.Name);
                        Database.SaveCharacter(Char, acc);
                    }
                }
There, all done.
walmartboi is offline  
Thanks
7 Users
Old 02/25/2010, 21:26   #2
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
good work.
~Yuki~ is offline  
Old 02/25/2010, 21:27   #3
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
awesome job bro, no errors!
killersub is offline  
Old 02/25/2010, 21:35   #4
 
NukingFuts's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 480
Received Thanks: 111
well done mate keep up da good work
NukingFuts is offline  
Old 02/25/2010, 22:57   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Good job, nice to see things being transferred over to a source ppl will actually bother with.
pro4never is offline  
Thanks
3 Users
Old 02/25/2010, 23:17   #6
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Quote:
Originally Posted by pro4never View Post
Good job, nice to see things being transferred over to a source ppl will actually bother with.
Thanks, you mind adding a link to this on your original thread?
walmartboi is offline  
Old 02/25/2010, 23:21   #7
 
elite*gold: 0
Join Date: Nov 2006
Posts: 65
Received Thanks: 2
this line is throwing an error on my console when my char or a guard kills mobs:

double cpMobDropRate = (Convert.ToDouble(MobTarget.Level) / Convert.ToDouble(Char.Level)) * cpDroprate;

my console says=> System.NullReferenceException: Object reference not set to an instance of an object.
killerbee is offline  
Old 02/26/2010, 00:37   #8
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
Nice work mate.
Arcо is offline  
Old 02/26/2010, 06:17   #9
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Quote:
Originally Posted by killerbee View Post
this line is throwing an error on my console when my char or a guard kills mobs:

double cpMobDropRate = (Convert.ToDouble(MobTarget.Level) / Convert.ToDouble(Char.Level)) * cpDroprate;

my console says=> System.NullReferenceException: Object reference not set to an instance of an object.
Try replacing that line with this:

Code:
double dub = (Convert.ToDouble(MobTarget.Level) / Convert.ToDouble(Char.Level));
double cpMobDropRate = (dub * cpDroprate);
And tell me if that works
walmartboi is offline  
Old 02/27/2010, 00:00   #10
 
elite*gold: 0
Join Date: Nov 2006
Posts: 65
Received Thanks: 2
Quote:
Originally Posted by walmartboi View Post
Try replacing that line with this:

Code:
double dub = (Convert.ToDouble(MobTarget.Level) / Convert.ToDouble(Char.Level));
double cpMobDropRate = (dub * cpDroprate);
And tell me if that works
doesnt work.
killerbee is offline  
Old 02/27/2010, 04:07   #11
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Quote:
Originally Posted by killerbee View Post
doesnt work.
Well that's strange, it works perfectly for me, and apparently everyone else that has posted here.
walmartboi is offline  
Old 02/27/2010, 04:10   #12
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
@killer
More than likely you are pasting it wrong.
Arcо is offline  
Old 02/27/2010, 04:14   #13
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Quote:
Originally Posted by .Arco View Post
@killer
More than likely you are pasting it wrong.
Yeah, if he left out the ChanceSuccess part it would cause the NullException error.
walmartboi is offline  
Old 02/28/2010, 03:02   #14
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by walmartboi View Post
Thanks, you mind adding a link to this on your original thread?
Done


Always appreciate things that mean I don't have to go anywhere near lotf.
pro4never is offline  
Old 02/28/2010, 03:04   #15
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Quote:
Originally Posted by pro4never View Post
Done


Always appreciate things that mean I don't have to go anywhere near lotf.
<sarcasm>LOTF is the best</end sarcasm>
walmartboi is offline  
Reply


Similar Threads Similar Threads
[Release] 5165 Warehouses Auth System
04/01/2011 - CO2 PServer Guides & Releases - 18 Replies
this is just a simple Auth system for warehouses. It will ask for password (set from WHGuardian) each time players will open their warehouse. Attempt limit is not included in this release... btw; with this release, warehouseGuardian will now save the password in Character file. here are the screenshots: http://img408.imageshack.us/img408/6986/98867182. jpg Click The Image to see more screen shots 1. Go to NPCDialog.cs and search for this code: public static void...
[Release] Flower System (5165)
09/25/2010 - CO2 PServer Guides & Releases - 71 Replies
Heya! Mostly complete... just figure a way to save it on your server.... ScreenShots: http://img98.imageshack.us/img98/1949/164947279.j pg http://img714.imageshack.us/img714/5372/64922998. jpg http://img59.imageshack.us/img59/1025/64930238.jp g
[RELEASE]Anti bot system 5165
06/15/2010 - CO2 PServer Guides & Releases - 15 Replies
Here is an simple anti bot system. Credits goes to Arco for the npc send thing :) First go to MyThreads.cs and find: interval = Interval; T = new Thread(new ThreadStart(Run)); T.Start();
[question] how to changes system message 5165?
05/17/2010 - CO2 Private Server - 4 Replies
hi guys how to changes system message like this?: http://img40.imageshack.us/img40/175/69485093.jpg
[Release]NPC system 5165 simplified
05/10/2010 - CO2 PServer Guides & Releases - 14 Replies
//



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


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.