Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- int itemLevel = 0;
- List<int> attackMultiply = new List<int>() { 100, 250, 650, 900, 1500, 2300, 3000, 3500, 4000, 5000};
- Random generator = new Random();
- int statsGet = 0, diceOne = 0, diceTwo = 0, diceThree = 0;
- int statsDelta = 0;
- int randomMin = 0;
- Console.Write("Введите уровень предмета для генерации: 5, 10, 20, 30,40,50,60,70,80,90,100");
- itemLevel = Convert.ToInt32(Console.ReadLine());
- //Определяем редкость предмета
- int diceSum = 0;
- string typeRare = "";
- int common = 0;
- int rare = 0;
- int legend = 0;
- int mythical = 0;
- int attack = 0;
- switch (itemLevel)
- {
- case 5:
- {
- statsGet = 100;
- }
- break;
- case 10:
- {
- statsGet = 250;
- }
- break;
- }
- for (int index = 0; index < 1000; index++)
- {
- diceOne = generator.Next(0, 7);
- diceTwo = generator.Next(6, 13);
- diceThree = generator.Next(12, 23); //min 18 max 40, 18 - 30, 31 - 33, 34 - 37, 38-40
- diceSum = diceOne + diceThree + diceTwo;
- if (diceSum < 30)
- {
- statsDelta = Convert.ToInt32(statsGet * 0.1) + 1; //standart
- randomMin = 0;
- common++;
- typeRare = "Common";
- }
- else if (diceSum < 34)
- {
- statsDelta = Convert.ToInt32(statsGet * 0.25) + 1; //rare
- randomMin = Convert.ToInt32(statsGet * 0.1);
- rare++;
- typeRare = "Rare";
- }
- else if (diceSum < 38)
- {
- statsDelta = Convert.ToInt32(statsGet * 0.5) + 1; //legendary
- randomMin = Convert.ToInt32(statsGet * 0.25);
- legend++;
- typeRare = "Legendary";
- }
- else
- {
- statsDelta = statsGet+1; // mythical
- randomMin = Convert.ToInt32(statsGet * 0.5);
- mythical++;
- typeRare = "Mythical";
- }
- //generate
- attack = generator.Next(randomMin, statsDelta);
- Console.WriteLine("Уровень предмета: " + itemLevel + " редкость предмета: " + typeRare + " атака предмета: " + (attack+statsGet));
- }
- Console.WriteLine("Дропы: обычный предмет - " + common + "\nредкие: " + rare + "\nлегендарные: " + legend + "\nмифики: " + mythical);
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement