Beispiel #1
0
        public static NeopalsAccount GenerateAccount(string handle, bool isActiveUser = false)
        {
            NeopalsAccount neopalsAccount = new NeopalsAccount()
            {
                AccountName = handle, NeoPoints = isActiveUser ? (long)Utils.random.Next(50000) : (long)Utils.random.Next(5000), BankedPoints = isActiveUser ? (long)Utils.random.Next(10000) : (long)Utils.random.Next(2000), InventoryID = Guid.NewGuid().ToString(), Pets = new List <Neopal>()
            };
            int num = 1 + Utils.random.Next(2);

            if (num == 2 && Utils.flipCoin() && Utils.flipCoin())
            {
                ++num;
            }
            for (int index = 0; index < num; ++index)
            {
                neopalsAccount.Pets.Add(Neopal.GeneratePet(isActiveUser));
            }
            return(neopalsAccount);
        }
Beispiel #2
0
        public static Neopal GeneratePet(bool isActiveUser = false)
        {
            isActiveUser = isActiveUser || (double)Utils.randm(1f) < 0.0199999995529652;
            Array values = Enum.GetValues(typeof(Neopal.PetType));

            Neopal.PetType petType = (Neopal.PetType)values.GetValue(Utils.random.Next(values.Length));
            return(new Neopal()
            {
                CombatRating = (byte)Utils.random.Next((int)byte.MaxValue), DaysSinceFed = isActiveUser ? Utils.random.Next(2) : Utils.random.Next(3650), Happiness = isActiveUser ? 1f - Utils.randm(0.15f) : Utils.randm(0.05f), Name = Neopal.GenerateName(), Type = petType, Identifier = Guid.NewGuid().ToString().Substring(0, 13)
            });
        }