Esempio n. 1
0
        //private Dictionary<int, L2Skill> _skills = new Dictionary<>();
        //private Dictionary<EventType, List<Quest>> _questEvents = new Dictionary<>();

        public NpcTemplate(StatsSet set) : base(set)
        {
            NpcId                 = set.GetInt("id");
            IdTemplate            = set.GetInt("idTemplate", NpcId);
            Type                  = set.GetString("type");
            Name                  = set.GetString("name");
            Title                 = set.GetString("title", string.Empty);
            CantBeChampionMonster = Title.EqualsIgnoreCase("Quest Monster");
            Level                 = set.GetByte("level", 1);
            Exp           = set.GetInt("exp");
            Sp            = set.GetInt("sp");
            RHand         = set.GetInt("rHand");
            LHand         = set.GetInt("lHand");
            EnchantEffect = set.GetInt("enchant");
            CorpseTime    = set.GetInt("corpseTime", 7);
            Hp            = set.GetDouble("hp");
            Mp            = set.GetDouble("mp");

            DropHerbGroup = set.GetInt("dropHerbGroup");
            //if (_dropHerbGroup > 0 && HerbDropTable.getInstance().getHerbDroplist(_dropHerbGroup) == null)
            //{
            //    _log.warning($"Missing dropHerbGroup information for npcId: {_npcId}, dropHerbGroup: {_dropHerbGroup});
            //    _dropHerbGroup = 0;
            //}

            if (set.ContainsKey("raceId"))
            {
                race = (Race)set.GetInt("raceId");
            }

            //_aiType = set.GetEnumerator(new "aiType", AIType.DEFAULT);

            SsCount    = set.GetInt("ssCount");
            SsRate     = set.GetInt("ssRate");
            SpsCount   = set.GetInt("spsCount");
            SpsRate    = set.GetInt("spsRate");
            AggroRange = set.GetInt("aggro");

            if (set.ContainsKey("clan"))
            {
                Clans     = set.GetStringArray("clan");
                ClanRange = set.GetInt("clanRange");

                if (set.ContainsKey("ignoredIds"))
                {
                    IgnoredIds = set.GetIntegerArray("ignoredIds");
                }
            }

            CanMove    = set.GetBool("canMove", true);
            IsSeedable = set.GetBool("seedable");

            // _categories = set.getList("drops");
            // _minions = set.getList("minions");

            //if (set.containsKey("teachTo"))
            //{
            // for (int classId : set.getIntegerArray("teachTo"))

            //addTeachInfo(ClassId.Values.classId]);
            //}

            //addSkills(set.getList("skills"));
        }