예제 #1
0
        public uint GetMoney()
        {
            Monster m = this;
            uint    g = (uint)(m.Gold * ExtraStaticFunctions.RandomInteger(60, 140) / 100);

            return(g);
        }
예제 #2
0
        public Item[] GetDrops(Items itemdb)
        {
            Monster m = this;

            int[] ReturnDrop = new int[m.DropIDs.Length];
            for (int i = 0; i < m.DropIDs.Length; i++)
            {
                if (ExtraStaticFunctions.RandomInteger(0, 100) < m.DropProbability[i])
                {
                    ReturnDrop[i] = m.DropIDs[i];
                }
                else
                {
                    ReturnDrop[i] = 0;
                }
            }

            Item[] retDrop = new Item[ReturnDrop.Length];
            for (int i = 0; i < ReturnDrop.Length; i++)
            {
                if (ReturnDrop[i] == 0)
                {
                    retDrop[i] = new Item();
                    continue;
                }
                Item tmpitem = itemdb.GetItemByID(ReturnDrop[i]);
                if (tmpitem.ID > -1)
                {
                    double tmpPower = tmpitem.Power * ExtraStaticFunctions.RandomInteger(80, 120) / 100;
                    double tmpDef   = tmpitem.Defense * ExtraStaticFunctions.RandomInteger(70, 130) / 100;
                    double tmpHP    = tmpitem.HP * ExtraStaticFunctions.RandomInteger(80, 120) / 100;
                    int    tmpStat1 = itemdb.GetStat();
                    int    tmpStat2 = 0;
                    tmpitem.Power   = (int)Math.Round(tmpPower, MidpointRounding.AwayFromZero);
                    tmpitem.Defense = (int)Math.Round(tmpDef, MidpointRounding.AwayFromZero);
                    tmpitem.HP      = (int)Math.Round(tmpHP, MidpointRounding.AwayFromZero);
                    tmpitem.Stat1   = tmpStat1 < 0 ? 0 : tmpStat1;
                    if (tmpStat1 < 0)
                    {
                        tmpStat2 = itemdb.GetStat();
                    }
                    else
                    {
                        tmpStat2 = itemdb.GetStat(15);
                    }

                    tmpitem.Stat2 = tmpStat2 < 0 ? 0 : tmpStat2;

                    retDrop[i] = tmpitem;
                }
            }
            return(retDrop);
        }
예제 #3
0
        public int GetStat(int found = 0)
        {
            // 1-9 : HP
            // 10-19 : Def
            // 20-29 : Attack
            // 30-39 : STR
            // 40-49 : DEX
            // 50-59 : INT
            // 60-69 : LUCK
            // 70-79 : DODGE
            int rand1 = ExtraStaticFunctions.RandomInteger(0, 100); // chance of getting a stat on the item
            int rand2 = ExtraStaticFunctions.RandomInteger(0, 7);   // which category of stats
            int rand3 = ExtraStaticFunctions.RandomInteger(0, 100); // how good the stat is

            int statcategory = -1;
            int statvalue    = 0;

            if (rand1 < 50 - found)
            {
                statcategory = rand2 * 10;
                if (rand3 >= 50)
                {
                    statvalue = ExtraStaticFunctions.RandomInteger(0, 2); // 50% chance
                }
                if (rand3 >= 25 && rand3 < 50)
                {
                    statvalue = ExtraStaticFunctions.RandomInteger(3, 5); // 25% chance
                }
                if (rand3 >= 10 && rand3 < 25)
                {
                    statvalue = ExtraStaticFunctions.RandomInteger(6, 7); // 15% chance
                }
                if (rand3 < 10)
                {
                    statvalue = ExtraStaticFunctions.RandomInteger(8, 9);
                }
            }
            return(statcategory + statvalue);
        }