Example #1
0
        public void StartRunning(Point a)
        {
            //Set is moving to true
            this.stance = 5;

            //Set my destination position
            this.DestPosition = a;

            //Generate packet
            SMSG_ACTORMOVEMENTSTART spkt = new SMSG_ACTORMOVEMENTSTART();

            spkt.SourceActorID = this.id;
            //spkt.Stance = this.stance;
            spkt.Speed = (ushort)this._RUNSPEED;
            spkt.Source(this.Position);
            spkt.Destination(this.DestPosition);
            //this.Position = NextPosition;

            //Send over movement start to all characters in neighbourhood
            Regiontree tree = this.currentzone.Regiontree;

            foreach (Character character in tree.SearchActors(this, SearchFlags.Characters))
            {
                if (Point.IsInSightRangeByRadius(this.Position, character.Position))
                {
                    spkt.SessionId = character.id;
                    character.client.Send((byte[])spkt);
                }
            }
        }
Example #2
0
        public void StartMovement(Point a)
        {
            if (this._status.CannotMove > 0 || this._status.Sleep > 0)
            {
                this.DestPosition = this.Position;
                this.stance       = 3;
            }
            else
            {
                this.stance       = 4;
                this.DestPosition = a;
            }
            this.Yaw = new Rotator(Point.CalculateYaw(this.Position, a), 0);

            //Generate packet
            SMSG_ACTORMOVEMENTSTART spkt = new SMSG_ACTORMOVEMENTSTART();

            spkt.SourceActorID = this.id;
            //spkt.Stance = this.stance;
            spkt.Speed = (ushort)this.Status.WalkingSpeed;
            spkt.Source(this.Position);
            spkt.Destination(this.DestPosition);
            //this.Position = NextPosition;

            //Send over movement start to all characters in neighbourhood
            Regiontree tree = this.currentzone.Regiontree;

            foreach (Character character in tree.SearchActors(this, SearchFlags.Characters))
            {
                if (Point.IsInSightRangeByRadius(this.Position, character.Position))
                {
                    spkt.SessionId = character.id;
                    character.client.Send((byte[])spkt);
                }
            }
        }