Register for your free account! | Forgot your password?

You last visited: Today at 01:48

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

Advertisement



CPs Reward?

Discussion on CPs Reward? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
CPs Reward?

I'm making it so that CPs are like vps without creating a team, like players get a few cps per mob but I've made it so it adds all the CPs the player has earned up and them gives it to them eventually, but I don't know when to decide when to give them the CPs.

Any ideas would be greatly appreciated as I'm swamped:

Code:
public static void RewardCPSForHunting(Character User, short MobLevel)
        {
            uint CpsToGive = (uint)MobLevel;
            User.PlayerTemporaryCPs += CpsToGive;
            if (User.Alive && User.PlayerTemporaryCPs >= User.Level*2)
                UpdatePlayerHuntingCPs(User);
        }
        public static void UpdatePlayerHuntingCPs(Character User)
        {
            User.CPs += User.PlayerTemporaryCPs;
            User.MyClient.SendPacket(General.MyPackets.Vital(User.UID, 30, User.CPs));
            User.MyClient.SendPacket(General.MyPackets.SendMsg(User.MyClient.MessageId, "SYSTEM", User.Name, "You got " + User.PlayerTemporaryCPs + " CPs from killing Monsters.", 2005));
            User.PlayerTemporaryCPs = 0;
        }
(Forget about the MobLevel stuff, I originally did MobLevel + 1.)

Currently I have it at players level times two, but I would rather have it some other way.
scottdavey is offline  
Old 05/23/2010, 23:57   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,379
Quote:
Originally Posted by scottdavey View Post
I'm making it so that CPs are like vps without creating a team, like players get a few cps per mob but I've made it so it adds all the CPs the player has earned up and them gives it to them eventually, but I don't know when to decide when to give them the CPs.

Any ideas would be greatly appreciated as I'm swamped:

Code:
public static void RewardCPSForHunting(Character User, short MobLevel)
        {
            uint CpsToGive = (uint)MobLevel;
            User.PlayerTemporaryCPs += CpsToGive;
            if (User.Alive && User.PlayerTemporaryCPs >= User.Level*2)
                UpdatePlayerHuntingCPs(User);
        }
        public static void UpdatePlayerHuntingCPs(Character User)
        {
            User.CPs += User.PlayerTemporaryCPs;
            User.MyClient.SendPacket(General.MyPackets.Vital(User.UID, 30, User.CPs));
            User.MyClient.SendPacket(General.MyPackets.SendMsg(User.MyClient.MessageId, "SYSTEM", User.Name, "You got " + User.PlayerTemporaryCPs + " CPs from killing Monsters.", 2005));
            User.PlayerTemporaryCPs = 0;
        }
(Forget about the MobLevel stuff, I originally did MobLevel + 1.)

Currently I have it at players level times two, but I would rather have it some other way.
Few suggestions for you to consider... keep in mind it's just how I'd do it. Lots of others have different opinion on auto cps.


#1: You want to add up cps over time and give to the player eventually? I can think of a few options for that... A: Do it when temp cps reaches a certain amount (say 500... 1000... or whatever) or B: do it after a certain amount of time. Such as every 10 minutes award the player for the mobs they've killed during that time or whatever... Hell do it as a quest... Kill as many mobs as you can in 10 mins to collect cps. Can do it few times a day

#2: You can do CHANCE of getting cps from killing. Personally, my system uses the player level as well as mob level and drop rate to calculate how often the player receives cps from hunting. That way high levels hunting low level mobs will have a drastically lower chance of finding cps than a noob running around killing same mobs (reduces camping/ksing)

#3: You can do random amount of cps from killing... again based on all sorts of variables such as random chance, global drop rate, player level, mob level, mob type, etc


Here's some small pseudo code to give you a start/inspiration... hopefully I'm on the right track of what you wanna do.


On monster death do something like..

if(Calculation.PercentSuccess(GlobalCpDropRate))
{
Client.TemporaryCps += Rand.Next(1, Monster.Info.Level);
if(Client.TemporaryCps >= 1000)
{
AwardCps(Client);
}
}

Then have a function called Award Cps that goes ahead and awards the cps and prints out how much the user has gained (and obviously update db and reset the temp cps)


Or you could do something involving monster and player level... such as


double CpsChance = Monster.Info.Level / Client.Level * GlobalCpRate
if(Calculation.PercentSuccess(CpsChance))
{
award the cps, fixed, random, based on mob level... however you decide to do it.
}


note: Alot of these things like Rand.Next and Calculation.PercentSuccess are based off what CoEmu calls things but I can guarentee you that your source will have something almost IDENTICAL coded.

Actually for reference, random is just something like..

Random Rand = new Random();

You can then call it by doing Rand.Next(min, max) and it will give you an int. You can also do Rand.NextDouble or other types if you wanna use some other type of output.
pro4never is offline  
Thanks
1 User
Old 05/24/2010, 02:00   #3
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
Thanks man, will take all this into consideration!
scottdavey is offline  
Reply


Similar Threads Similar Threads
Big reward
06/03/2010 - Shaiya Private Server - 14 Replies
Who ever can help with this issue will receive 7k AP on our new server Shaiya Legacy this is the only issue and once its fixed we can run to the public. well the problem is nprotect command will not turn off. if you can help us fix that or give us a pic of what the game.ini file looks like.
Last Chaos Reward
03/28/2010 - Last Chaos - 8 Replies
Okay first one to make me a server for lc and send me the link to download load it and it works you will be one of the gm's/co-owner email [email protected]
Lv up reward
03/22/2010 - Archlord - 32 Replies
hi i have a question 2 you all some1 have any idea how to get more then 1 time the lv up reward ? i saw a vid on x fire where the char have like 10 event shuta and much cc xD shutaa+wc items:D - Xfire Video so some1 have any idea how 2 do this bug ?
[Help]If you help me i will reward you
01/09/2010 - CO2 Private Server - 5 Replies
DONE ,lol
DB REWARD
10/04/2007 - General Coding - 1 Replies
The story takes place in a small village called the Slipper-by-the-Sea,which is inside the Land Between The Mountains. The main characters was Muggles,Maxims. She is a member of the race called The Minnipins, she hangs out with other people called Curley Green, Walter The Earl decendant of the Earl Family,Gummy and Mingy the Money Box Keeper. It was said that the 'Fooley the Magnificent' was the first guy who ever manage to get out of the Land Between The Mountains by a Large Ballon. When he...



All times are GMT +1. The time now is 01:54.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.