Ejemplo n.º 1
0
        private static void GenerateHonestyItems()
        {
            var lstCopy = new List <Item>(_HonestyItems);

            foreach (Item i in lstCopy)
            {
                if (ItemFlags.GetTaken(i) && _HonestyItems.Contains(i))
                {
                    _HonestyItems.Remove(i);
                }
            }

            if (_HonestyItems.Count < 1000)
            {
                int spawnamount = _HonestyItems.Count + 50 > 1000 ? _HonestyItems.Count % 50 : 50;

                for (int i = 0; i < spawnamount; i++)
                {
                    Item toSpawn = Loot.RandomArmorOrShieldOrWeapon();
                    ItemFlags.SetTaken(toSpawn, false);
                    toSpawn.HonestyItem = true;
                    PlaceItemOnWorld(toSpawn);
                    _HonestyItems.Add(toSpawn);
                }
            }
        }
Ejemplo n.º 2
0
        public static void HonestyItemsVersion5()
        {
            Timer.DelayCall(TimeSpan.FromSeconds(10), () =>
            {
                int count = 0;
                foreach (var item in World.Items.Values.Where(i => i.HonestyItem && !ItemFlags.GetTaken(i)))
                {
                    RunicReforging.GenerateRandomItem(item, 0, 100, 1000);
                    count++;
                }

                ToConsole(String.Format("Honesty items given magical properties: {0}", count.ToString()));
            });
        }