Register for your free account! | Forgot your password?

You last visited: Today at 05:34

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

 

[Release]Level Based CP Drop

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2010
Posts: 96
Received Thanks: 9
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   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,196
Received Thanks: 5,305
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   #3
 
elite*gold: 0
Join Date: Aug 2010
Posts: 96
Received Thanks: 9
lol man, i forgot to using try an catch, thx pro...

ill try to solve my problem :P
hyperco is offline  
Old   #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   #5
 
elite*gold: 0
Join Date: Jun 2010
Posts: 2,183
Received Thanks: 843
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   #6
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 319
this can be like 1 line? use the C# math class
-Shunsui- is offline  
Old   #7
 
elite*gold: 0
Join Date: Aug 2010
Posts: 96
Received Thanks: 9
i guess that impulse source will have a better support to these codes....
hyperco is offline  
Old   #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



« Previous Thread | Next Thread »

Similar Threads
(Release) Rohan RBF VB Based Bot
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...
19 Replies - General Gaming Discussion
[RELEASE] I named my bot LILPROHACKER, based "Disconnect'S packet based BOT"
Hello guys Thats release section right??? http://img686.imageshack.us/img686/8051/fuckthate.jpg Shaiya Packet Bot By lilprohacker - G-R -...
6 Replies - Shaiya Hacks, Bots, Cheats & Exploits



All times are GMT +1. The time now is 05:34.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.