Register for your free account! | Forgot your password?

You last visited: Today at 04:33

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

Advertisement



[Release]Level Based CP Drop

Discussion on [Release]Level Based CP Drop within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
hyperco's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 112
Received Thanks: 12
Exclamation [Release]Level Based CP Drop

Everyone saw the cp drop system created by walmartboi, so i get the code and maked it according to character's level. (VERSION 5165)

Code:
if (MyMath.ChanceSuccess(100))
                {
                    string acc = "";
                    int CpBase = 1000; // Default Cp drop, i mean lvl 1 :P
                    double cprandomdrop = (Convert.ToDouble(MobTarget.Level) / Convert.ToDouble(Char.Level)) * CpBase;
                    if (MyMath.ChanceSuccess(cprandomdrop))
                    {
                        int cpToAdd = cprandomdrop / Char.Level;

                        Char.CPs += Convert.ToUInt32(cpToAdd);
                        Char.MyClient.LocalMessage(2005, "[CPs] You have gained: " + cpToAdd + " CPs for killing a(n) " + MobTarget.Name + " at your current level.");
                        Database.SaveCharacter(Char, acc);
                    }
But it give me Server crashes, and i found not any problem on this code :/
if someone can finish it better, ill be very grateful.
remembering, its a base (and based) code for cpsdrop system.

If i get new code lines for this, ill update this post.
hyperco is offline  
Old 04/18/2011, 02:52   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Why not just use the one I wrote that takes into account random chance + monster levels?


Someone already upgraded it to work with 5165 lotf lol.

Not sure what would be causing your error just at first glance but couple concerns...

(Convert.ToDouble(MobTarget.Level) / Convert.ToDouble(Char.Level)) * CpBase

You're going to come up with some funky values...

Mob Level 83 (birdmen examples)
Character level 120 (random hunter)
CpBase 1000

Chance for drop is... 83/120 * 1000

Aka 691.6666666666667

So you're saying there's a 700 percent chance of an item dropping from that monster...

You need to think through your values (ALL possibilities) and take that into account.

Do a simple try/catch catch on the code and print out the exception and see if it comes up with anything... the alternative is that your database save code is freezing the server (wouldn't be surprised with lotf lol)
pro4never is offline  
Old 04/18/2011, 05:19   #3
 
hyperco's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 112
Received Thanks: 12
lol man, i forgot to using try an catch, thx pro...

ill try to solve my problem :P
hyperco is offline  
Old 04/20/2011, 13:47   #4
 
elite*gold: 0
Join Date: Mar 2011
Posts: 165
Received Thanks: 17
Why saving account each CP Drop? It will lag out as f*ck.
Also you might get an exception for using the Save Void two times at once.
iStefan is offline  
Old 04/20/2011, 16:58   #5
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
Check impulses source guys, seriously.

Update each value as its changed.

Update all values when only one has changed == false;
Update the value that changed when its changed == true;
_DreadNought_ is offline  
Old 04/20/2011, 17:06   #6
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
this can be like 1 line? use the C# math class
-Shunsui- is offline  
Old 04/22/2011, 16:13   #7
 
hyperco's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 112
Received Thanks: 12
i guess that impulse source will have a better support to these codes....
hyperco is offline  
Old 04/23/2011, 11:07   #8
 
elite*gold: 0
Join Date: Feb 2011
Posts: 46
Received Thanks: 1
Quote:
Originally Posted by _DreadNought_ View Post
Check impulses source guys, seriously.

Update each value as its changed.

Update all values when only one has changed == false;
Update the value that changed when its changed == true;
Jesus para, get Impulse out of your ******.
xElement is offline  
Reply

Tags
cp drop system by level


Similar Threads Similar Threads
(Release) Rohan RBF VB Based Bot
03/25/2010 - General Gaming Discussion - 19 Replies
There are 2 modes in this program - Hunting & Training Hunting mode: 1. Auto use HP/MP when low HP/MP. 2. Press one time Caplock to auto attack mobs (no need to hold right click) Training mode: 1. Auto use MP when low MP 2. Constantly use skills in selected F series 3. Helps you increase exp while afk
[RELEASE] I named my bot LILPROHACKER, based "Disconnect'S packet based BOT"
02/08/2010 - Shaiya Hacks, Bots, Cheats & Exploits - 6 Replies
Hello guys Thats release section right??? http://img686.imageshack.us/img686/8051/fuckthate .jpg Shaiya Packet Bot By lilprohacker - G-R - Your Gaming Community DLL error, but its not my problem i did it just for show people what is dll error. Solution: Put "pipeClient.dll" and "packet.dll" to Shaiya Packet Bot v1023 folder http://img707.imageshack.us/img707/4519/fuckthat. jpg



All times are GMT +2. The time now is 04:33.


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.