Beispiel #1
0
        protected RunnerTask(NodeTask node)
            : base(node)
        {
            this.Locations = new List <Location>();
            Value        hs     = node.GetValueOfId("Locations");
            List <Value> hsList = hs.GetCollectionValue();

            foreach (Value v in hsList)
            {
                Location l = v.GetLocationValue();
                this.Locations.Add(l);
            }
            this.useMount = node.GetBoolValueOfId("UseMount");
            var expression = node.GetExpressionOfId("HowClose");

            if (expression != null)
            {
                this.howClose = node.GetFloatValueOfId("HowClose");
            }
            else
            {
                this.howClose = 3.0f;
            }
        }
Beispiel #2
0
        public PullTask(PPather pather, NodeTask node)
            : base(pather, node)
        {
            Value v_names = node.GetValueOfId("Names");

            if (v_names != null)
            {
                names = v_names.GetStringCollectionValues();
                if (names.Count == 0)
                {
                    names = null;
                }
            }

            Value v_ignore = node.GetValueOfId("Ignore");

            if (v_ignore != null)
            {
                ignore = v_ignore.GetStringCollectionValues();
                if (ignore.Count == 0)
                {
                    ignore = null;
                }
            }

            Value v_factions = node.GetValueOfId("Factions");

            if (v_factions != null)
            {
                factions = v_factions.GetIntCollectionValues();
                if (factions.Count == 0)
                {
                    factions = null;
                }
                if (factions != null)
                {
                    foreach (int faction in factions)
                    {
                        PPather.WriteLine("  faction '" + faction + "'");
                    }
                }
            }

            MinLevel = node.GetValueOfId("MinLevel").GetIntValue();
            MaxLevel = node.GetValueOfId("MaxLevel").GetIntValue();

            Distance = node.GetValueOfId("Distance").GetFloatValue();
            if (Distance == 0.0f)
            {
                Distance = 1E30f;
            }

            if (MaxLevel == 0)
            {
                MaxLevel = 10000;
            }
            //PPather.WriteLine("  Max level " + MaxLevel);
            //PPather.WriteLine("  Min level " + MinLevel);
            SetKillCount();
            UseMount = node.GetBoolValueOfId("UseMount");

            skipMobsWithAdds = node.GetBoolValueOfId("SkipMobsWithAdds");
            if (skipMobsWithAdds)
            {
                addsDistance = node.GetFloatValueOfId("AddsDistance");
                addsCount    = node.GetIntValueOfId("AddsCount");
                if (addsDistance == 0)
                {
                    addsDistance = 15;
                }
                if (addsCount == 0)
                {
                    addsCount = 2;
                }
            }
        }