Ejemplo n.º 1
0
        protected override void OnStart()
        {
            SpellDelay      = SpellDelay < 0 ? 0 : SpellDelay;
            WindowDelay     = WindowDelay < 1000 ? 1000 : WindowDelay;
            SkipWindowDelay = SkipWindowDelay < 200 ? 200 : SkipWindowDelay;
            GpPerTick       = CharacterResource.GetGpPerTick();

            if (Distance > 3.5f)
            {
                TreeRoot.Stop(Localization.ExGather_Distance);
            }

            if (HotSpots != null)
            {
                HotSpots.IsCyclic = Loops < 1;
            }

            // backwards compatibility
            if (GatherObjects == null && !string.IsNullOrWhiteSpace(GatherObject))
            {
                GatherObjects = new List <string> {
                    GatherObject
                }
            }
            ;

            startTime = DateTime.Now;

            if (Items == null)
            {
                Items = new NamedItemCollection();
            }

            if (Collect && Collectables == null)
            {
                Collectables = new List <Collectable> {
                    new Collectable {
                        Name = string.Empty, Value = (int)CollectabilityValue
                    }
                }
            }
            ;

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = Items.Count > 0 ? Items.First().Name : string.Format(Localization.ExGather_Zone, WorldManager.ZoneId, ExProfileBehavior.Me.Location);
            }

            StatusText = Name;

            GamelogManager.MessageRecevied += ReceiveMessage;
            poiCoroutine = new ActionRunCoroutine(ctx => ExecutePoiLogic());
            TreeHooks.Instance.AddHook("PoiAction", poiCoroutine);
        }
Ejemplo n.º 2
0
        protected override void OnStart()
        {
            SpellDelay      = SpellDelay < 0 ? 0 : SpellDelay;
            WindowDelay     = WindowDelay < 500 ? 500 : WindowDelay;
            SkipWindowDelay = SkipWindowDelay < 200 ? 200 : SkipWindowDelay;
            GpPerTick       = CharacterResource.GetGpPerTick();

            if (Distance > 3.5f)
            {
                TreeRoot.Stop(Localization.Localization.ExGather_Distance);
            }

            if (HotSpots != null)
            {
                HotSpots.IsCyclic = Loops < 1;
            }

            // backwards compatibility
            if (GatherObjects == null && !string.IsNullOrWhiteSpace(GatherObject))
            {
                GatherObjects = new List <string> {
                    GatherObject
                };
            }

            startTime = DateTime.Now;

            if (Items == null)
            {
                Items = new NamedItemCollection();

#pragma warning disable 618
                if (ItemNames != null)
                {
                    foreach (var item in ItemNames)
                    {
                        Items.Add(new GatherItem {
                            Name = item
                        });
                    }
                }

                if (Collectables != null)
                {
                    foreach (var collectable in Collectables)
                    {
                        Items.Add(collectable);
                    }
                }
#pragma warning restore 618
            }

            if (string.IsNullOrWhiteSpace(Name))
            {
                if (Items.Count > 0)
                {
                    Name = Items.First().Name;
                }
                else
                {
                    Name = string.Format(Localization.Localization.ExGather_Zone, WorldManager.ZoneId, ExProfileBehavior.Me.Location);
                }
            }

            StatusText = Name;

            poiCoroutine = new ActionRunCoroutine(ctx => ExecutePoiLogic());
            TreeHooks.Instance.AddHook("PoiAction", poiCoroutine);

            ResolveGatherRotation();
        }