Slightly more inteligent Auto Cp System

01/12/2010 07:34 pro4never#1
So I've seen alot of releases over time for different sources dealing with auto cp/gold. The main problem that's bugged me with these scripts is there is no real chance to them! (it always seems to be, kill this mob, get x cp) or something similar.

My goal in this very small project was to create something that can be customized easily by server owners to allow for a more fair auto cp system.

The calculations WORK but they are not exactly set in stone, that's why I've made them so easy to edit to suit your server (not all servers need thousands of cps earnable in 5 minutes while others do, depends on your economy)


<edit>

Here's a link to the 5165 version: Full credit to walmartboi for converting it
[Only registered and activated users can see links. Click Here To Register...]

This is for CoEmu but can be easily modified for use in an source. The principles are very basic and it's nothing complex by any means. Took all of like 5 minutes to code really

Code:
#region CpRates
                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
                #endregion                
                double cpMobDropRate = (Convert.ToDouble(AttackedMob.Level) / Convert.ToDouble(CSocket.Client.Level)) * cpDroprate;                
                if (Calculation.PercentSuccess(cpMobDropRate))
                {
                    int cpBaseReward = Nano.Rand.Next(cpLow, cpHigh);
                    int cpToAdd = cpBaseReward * cpMultiplyer;
                    CSocket.Client.CPs += cpToAdd;
                    CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                    Database.Database.SaveCharacter(CSocket.Client);                  
                    CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[CPs] You have gained: " + cpToAdd + " CPs for killing a(n) " + AttackedMob.Info.Name , Struct.ChatType.Top));

                }
In this case drop RATES are effected by how high/low level a player is compared to a monster.

Drop AMOUNT is a random number between min/max drop rate multiplied by the server cp multiplier (could add more randomness ot he script by having the multiplier based on mob/player level and or random roll)

Install instructions!

doMonsterPlayer.cs search AttackedMob.Die(CSocket.Client.ID); and paste this code directly underneath. Nothing else should be required (make sure your SaveCharacter database void saves cp or this will not save properly. If you want, it would help to write a new database void for cp saving so you don't have to save the entire character every time you gain cp... redundant and resource consuming.



Please post any questions, problems or improvements to the script. This is not designed to be the ULTIMATE script, it's simply to help people think a bit more when implementing these systems. You could go a long way with this sort of thing (adding in different rates for lucky time, 2nd reborn, vip. Doing more complex calculations, etc) but this should point some ppl in the right direction.

Enjoy!
p4n
01/12/2010 12:37 zbest#2
Can u make a script like this for web?;)
01/12/2010 16:13 ImmuneOne#3
Why would you intend to make this script for a website?
01/12/2010 22:24 .Ryu#4
I like this thanks chris =P
01/12/2010 22:26 ~Yuki~#5
got the same question...
01/12/2010 23:48 pro4never#6
Quote:
Originally Posted by ~Yuki~ View Post
got the same question...
Huh, what question?

If you have any questions about it I'll be happy to try to help.
01/12/2010 23:55 Arcо#7
Quote:
Originally Posted by pro4never View Post
Huh, what question?

If you have any questions about it I'll be happy to try to help.

He was talking about zbest's question that made no sense whatsoever.
01/13/2010 01:24 zbest#8
Would be a good ideea.
Pay for a vip web account ,log there click the buton and you got 999KK CPS :X:X.
And TADA you make some money and you can pay you HOST :X:X.
01/13/2010 01:30 pro4never#9
So you are looking for a donation system?

You do realize this has to do with earning cps from hunting right? That has NOTHING to do with donations or websites.

I haven't done any donation systems but I would assume you would need to

A) Setup a merchant paypal account that would send proper confirmation to you when payment has cleared
B) use that confirmation to have the web server either
i: Send out a confirmation e-mail with a claim id/pass which can be used on the website
ii: Use the pre-entered paypal info to make a database entry for the character determining what they can claim ingame
C) Have a php form on the website for claim id/pass given character id/pass/server which (if it matches a valid id/pass on server database) will modify the character database to determine what they can claim ingame
D) Npc ingame that will check the character database to see if they can claim anything, and if they can then award the prize (cp in this case) and then update the database (so it can't be claimed multiple times)

That should be all there would be to such a system but as stated it has NOTHING to do with this thread.
01/13/2010 01:35 gl0verseer#10
Quote:
Originally Posted by zbest View Post
Would be a good ideea.
Pay for a vip web account ,log there click the buton and you got 999KK CPS :X:X.
And TADA you make some money and you can pay you HOST :X:X.
So what you mean is, when a person that has bought a VIP account for your website and logs in, their character will receive 999 million cps? Well, I think you might want to consult a php coder for that, or just learn php yourself.

[Only registered and activated users can see links. Click Here To Register...]
01/13/2010 02:54 copz1337#11
lmao zbest
01/13/2010 02:57 Arcо#12
Quote:
Originally Posted by gl0verseer View Post
So what you mean is, when a person that has bought a VIP account for your website and logs in, their character will receive 999 million cps? Well, I think you might want to consult a php coder for that, or just learn php yourself.

[Only registered and activated users can see links. Click Here To Register...]
It can be done by lets say the person donates and everything, then they type in their character name. After that have a MySQL function that changes that characters cps in the cps table to 999kk.
01/13/2010 03:09 zbest#13
Quote:
Originally Posted by Hepatitis C View Post
It can be done by lets say the person donates and everything, then they type in their character name. After that have a MySQL function that changes that characters cps in the cps table to 999kk.
Yeah that i want to say,999KK was a example lol:P
Not only CPS and silvers :X.:handsdown:
01/13/2010 03:10 Arcо#14
Quote:
Originally Posted by zbest View Post
Yeah that i want to say,999KK was a example lol:P
Not only CPS and silvers :X.:handsdown:

Well can you be a bit more specific?
I'm a bit handy with MySQL shiz.
01/13/2010 03:27 zbest#15
Now you understand?
[Only registered and activated users can see links. Click Here To Register...]