Exemple #1
0
        /** Creates a spawn list for given area */
        public void BuildList(MDRArea area, int minLevel, int maxLevel)
        {
            PotentialItems.Clear();

            List <MDRMonsterClass> potentialClasses = new List <MDRMonsterClass>();

            // Find list of all potential monster classes.
            for (int lp = 0; lp < CoM.MonsterClasses.Count; lp++)
            {
                if (area.SpawnMask[lp])
                {
                    potentialClasses.Add(CoM.MonsterClasses[lp]);
                }
            }

            for (int lp = 0; lp < CoM.Monsters.Count; lp++)
            {
                MDRMonster monster = CoM.Monsters[lp];
                if (
                    (monster.AppearsOnLevel >= minLevel) &&
                    (monster.AppearsOnLevel <= maxLevel) &&
                    (potentialClasses.Contains(monster.Type.TypeClass)))
                {
                    addWeight(monster, monster.EncounterChance);
                }
            }

            // Add laired monster at 80% chance.
            if (area.LairedMonster != null)
            {
                addWeight(area.LairedMonster, calculateTotalWeighting() * (1f / 0.20f));
            }
        }
Exemple #2
0
        /**
         * Applyies the effects of this spell to each monster stack in an area.
         * Returns one result foreach each monster effected.
         */
        public List <SpellResult> CastArea(MDRActor caster, MDRArea target)
        {
            //todo:

            /*
             * if (target == null)
             *      throw new Exception("Parameter 'target' must not be null.");
             *
             * var results = new List<SpellResult>();
             *
             * for (int lp = 0; lp < 4; lp++) {
             *      MDRMonsterStack stack = target.Stack[lp];
             *      if (stack != null && !stack.IsEliminated)
             *              results.Add(CastTargeted(caster, stack));
             * }
             *
             * return results;
             */
            return(new List <SpellResult>());
        }