RandomScroll() public static méthode

public static RandomScroll ( int minIndex, int maxIndex, SpellbookType type ) : SpellScroll
minIndex int
maxIndex int
type SpellbookType
Résultat Server.Items.SpellScroll
Exemple #1
0
        public static Item RandomScroll(int minCircle, int maxCircle)
        {
            if (Utility.Random(500) == 17)
            {
                return(new Item(Utility.Random(6) + 0xEf4));
            }

            int min = GetIntensityCircle(minCircle);
            int rnd = Utility.Random(min, GetIntensityCircle(maxCircle) - min);

            if (50 > rnd)
            {
                return(Loot.RandomScroll(0, 15));
            }
            else
            {
                rnd -= 50;
            }

            if (25 > rnd)
            {
                return(Loot.RandomScroll(16, 31));
            }
            else
            {
                rnd -= 25;
            }

            if (14 > rnd)
            {
                return(Loot.RandomScroll(32, 47));
            }
            else
            {
                rnd -= 14;
            }

            if (8 > rnd)
            {
                return(Loot.RandomScroll(48, 55));
            }

            return(Loot.RandomScroll(56, 63));
        }
Exemple #2
0
        public static Item RandomScroll(int index, int minCircle, int maxCircle)
        {
            --minCircle;
            --maxCircle;

            int scrollCount = ((maxCircle - minCircle) + 1) * 8;

            if (index == 0)
            {
                scrollCount += m_BlankTypes.Length;
            }

            int rnd = Utility.Random(scrollCount);

            if (index == 0 && rnd < m_BlankTypes.Length)
            {
                return(Loot.Construct(m_BlankTypes));
            }

            return(Loot.RandomScroll(minCircle * 8, (maxCircle * 8) + 7, SpellbookType.Regular));
        }
Exemple #3
0
        public static Item RandomScroll(int minCircle, int maxCircle)
        {
            --minCircle;
            --maxCircle;

            int           minIndex, maxIndex, rnd, rndMax;
            SpellbookType spellBookType;

            // Magery scrolls are weighted at 4 because there are four times as many magery
            // spells as other scolls of magic
            rndMax = 4;
            if (Core.ML)
            {
                rndMax += 2;
            }
            else if (Core.AOS)
            {
                rndMax += 1;
            }
            rnd  = Utility.Random(rndMax);
            rnd -= 3;
            if (rnd < 0)
            {
                rnd = 0;
            }

            minIndex = m_ScrollIndexMin[rnd][minCircle];
            maxIndex = m_ScrollIndexMax[rnd][maxCircle];
            if (rnd == 2 && maxCircle == 7)
            {
                ++maxIndex;
            }
            spellBookType = m_BookTypes[rnd];

            return(Loot.RandomScroll(minIndex, maxIndex, spellBookType));
        }