Item GenerateItem() { Item result; int rand = Random.Next(0, 100); if (rand < 95) { result = Rares.ElementAt(Random.Next(0, Rares.Count())); } else { result = Legendarys.ElementAt(Random.Next(0, Legendarys.Count())); } return(Dupe(result)); }
Item GenerateItem(Vector2I position) { // pick an item from commons rares or legendaries Item result; Item prize; int rand = Random.Next(0, 100); if (rand < 95) { prize = Rares.ElementAt(Random.Next(0, Rares.Count())); } else { prize = Legendarys.ElementAt(Random.Next(0, Legendarys.Count())); } result = Dupe(prize); result.Position = position; return(result); }