Ejemplo n.º 1
0
        protected override void DoExecute(WowPlayer Entity)
        {
            //on execute, if the distance to our corpose is more then 5 yards, we need to get there
            if (Entity.DistanceFromCorpse() > 5f)
            {
                // so we make a new move to state that will take us to our corpose
                var mtsCorpse = new MoveToState(_CorpseLocation);

                //request that we move to this location
                CallChangeStateEvent(Entity, mtsCorpse, true, false);

                return;
            }

            //we should now web close to our corpse so rez!
            // but since we can't yet... just finish and exit...
            Finish(Entity);
            Exit(Entity);
        }
Ejemplo n.º 2
0
        protected override void DoExecute(WowPlayer Entity)
        {
            //if we don't have a target then get one
            if (!Entity.HasTarget)
            {
                List <WowObject> d = ProcessManager.ObjectManager.GetAllObjectsAroundLocalPlayer();

                IEnumerable <WowObject> m = from c in d
                                            where c.Type == Descriptor.eObjType.OT_UNIT && ((WowUnit)c).IsLootable
                                            select c;

                //get first unit and select it
                if (m.Count() > 0)
                {
                    Entity.SelectMob((WowUnit)m.First());
                }
            }

            //if distance to target is to far, then use a move to first
            if (Entity.DistanceFromTarget() > 0.5f)
            {
                var mtsTarget = new MoveToState(Entity.CurTarget.Location);

                //request that we move to this location
                CallChangeStateEvent(Entity, mtsTarget, true, false);

                return;
            }

            //interact with it
            Entity.CurTarget.Interact();

            while (Entity.CurTarget.Hp > 0)
            {
                Thread.Sleep(100);
            }
        }