[Help]Random drop cps in 5530 +

12/07/2012 08:32 xenomco#1
How can help with how can i put random drop cps in my source .


i have this

#region Pheasant
if (Name == "Pheasant")
{
if (ChanceSuccess(50)) 50% to get the cps from monsters you can change to 50% to any % you want
{
killer.ConquerPoints += 100; = how much you want want them to drop?
}
}
#endregion




and i have this error . Error 5 The name 'ChanceSuccess' does not exist in the current context
12/07/2012 13:21 Super Aids#2
Use ID's instead of Names.

ChanceSuccess is a method, you need to create that one...

I guess something like.
Notice you have to change the Random thing, because I do not know wheres your is located.

Code:
static bool ChanceSuccess(byte chance)
{
	if (chance > 100)
		throw new Exception("You can't put more than 100% win chance.");
	return (Misc.Generators.Random.Next(101) <= chance);
}
12/07/2012 16:46 AhmedAli0#3
Quote:
Originally Posted by Super Aids View Post
Use ID's instead of Names.

ChanceSuccess is a method, you need to create that one...

I guess something like.
Notice you have to change the Random thing, because I do not know wheres your is located.

Code:
static bool ChanceSuccess(byte chance)
{
	if (chance > 100)
		throw new Exception("You can't put more than 100% win chance.");
	return (Misc.Generators.Random.Next(101) <= chance);
}
ur solution will work like that
if he made it 10% that means 1-10 pheasnts will drop the 100 cps.
he just want to add this code:

Random rnd = new Random();
killer.ConquerPoints += (uint)rnd.Next(1, 100);// where 1 - 100
12/07/2012 17:22 Super Aids#4
Quote:
Originally Posted by AhmedAli0 View Post
ur solution will work like that
if he made it 10% that means 1-10 pheasnts will drop the 100 cps.
he just want to add this code:

Random rnd = new Random();
killer.ConquerPoints += (uint)rnd.Next(1, 100);// where 1 - 100
Actually no. If you read his post he asked why he got an error and that ^_^

But yeah, you could even use both codes ^^
12/07/2012 18:14 AhmedAli0#5
Quote:
Originally Posted by Super Aids View Post
Actually no. If you read his post he asked why he got an error and that ^_^

But yeah, you could even use both codes ^^
sorry didn't see the last line :D
any way can u please check my thread?
i want to know where can i find the level exp in this source