[Release]Chances of a drop/something

10/06/2010 19:49 ryuchetval#1
Release for : 5165 tanel's source (but it can be converted easily)

Ok guys idk if this was actually released or know but I'll release this.

With this you can calculate how many mobs/tries you have to kill/try so that you get something (like a DB drop)

ok so in chat.cs search for
Code:
                        if (Cmd[0] == "/item")
under/above that put this
Code:
                        if (Cmd[0] == "/chance")
                        {
                            double chance = double.Parse(Cmd[1]);
                            int i = 0;
                            if (chance != 0)
                            {
                                while (!MyMath.ChanceSuccess(chance))
                                    i++;
                                Program.WriteLine("On chance: " + chance + " it would take " + i + " tries/kills to get something");
                            }
                            else
                                GC.LocalMessage(2000, "Type another chance above 0!");
                        }
now in-game you can type /chance 0.1 , /chance 2 , /chance 0.001 etc...
and you'll see on console how many time you have to try achieve something

+ Thanks if it helped :)
10/06/2010 20:33 Galactic#2
I don't really get the purpose of it. Can you better explain please? What it does.
Maybe it's just me. But I don't really get it.
10/06/2010 20:35 ryuchetval#3
let's say you want to check how many monsters you have to kill to get the item x with the chance 0.02 of the x item to drop...you go in-game and type /chance 0.02 and on the console will tell you the average number of monsters you should kill to get the x item
10/08/2010 06:09 copz1337#4
Does it require a server restart in order to take effect?
10/08/2010 07:38 ryuchetval#5
umm...everything u add in the sources needs a compile so that it takes effect
10/08/2010 12:50 CØĐ£Ř||Mã©hÍñє#6
awwww useful release thanks for sharing .