Exemple #1
0
 public virtual void Coordinates(Vector3 position)
 {
     this.RawCoordinates = position;
 }
 public void MoveTo(Vector3 destination)
 {
     FollowTargetMessageHandler.Default.Send(this.Character, this.Character.RawCoordinates, destination);
 }
 public void MoveTo(Vector3 destination)
 {
     FollowTargetMessageHandler.Default.Send(this.Character, this.Character.RawCoordinates, destination);
 }
Exemple #4
0
 public virtual void Coordinates(Vector3 position)
 {
     this.RawCoordinates = position;
 }
 public override void ExecuteCommand(ICharacter character, Identity target, string[] args)
 {
     if (args[0].ToLower() == "walktest")
     {
         ICharacter npc = Pool.Instance.GetObject<ICharacter>(character.Playfield.Identity, character.SelectedTarget);
         if (npc != null)
         {
             Vector3 newcoords = new Vector3();
             newcoords.X = npc.RawCoordinates.X;
             newcoords.Y = npc.RawCoordinates.Y;
             newcoords.Z = npc.RawCoordinates.Z;
             newcoords.X += 20;
             npc.Controller.MoveTo(newcoords);
         }
     }
     if (args[0].ToLower() == "walkback")
     {
         ICharacter npc = Pool.Instance.GetObject<ICharacter>(character.Playfield.Identity, character.SelectedTarget);
         if (npc != null)
         {
             Vector3 newcoords = new Vector3();
             newcoords.X = npc.RawCoordinates.X;
             newcoords.Y = npc.RawCoordinates.Y;
             newcoords.Z = npc.RawCoordinates.Z;
             newcoords.X -= 20;
             npc.Controller.MoveTo(newcoords);
         }
     }
     if (args[0].ToLower() == "followtest")
     {
         ICharacter npc = Pool.Instance.GetObject<ICharacter>(character.Playfield.Identity, character.SelectedTarget);
         if (npc != null)
         {
             npc.Controller.Follow(character.Identity);
         }
     }
     if (args[0].ToLower() == "showcoords")
     {
         ICharacter npc = Pool.Instance.GetObject<ICharacter>(character.Playfield.Identity, character.SelectedTarget);
         if (npc != null)
         {
             character.Playfield.Publish(
                 ChatTextMessageHandler.Default.CreateIM(
                     character,
                     "Coordinates of " + character.SelectedTarget.ToString(true) + ": "
                     + npc.Coordinates().ToString()));
             character.Playfield.Publish(
                 ChatTextMessageHandler.Default.CreateIM(
                     character,
                     "Heading of " + character.SelectedTarget.ToString(true) + ": " + npc.Heading.ToString()));
         }
     }
     if (args[0].ToLower() == "addwp")
     {
         CellAO.Core.Vector.Vector3 v = character.Coordinates().coordinate;
         bool running = character.MoveMode == MoveModes.Run;
         ICharacter npc = Pool.Instance.GetObject<ICharacter>(character.Playfield.Identity, character.SelectedTarget);
         if (npc != null)
         {
             npc.AddWaypoint(v, running);
             character.Playfield.Publish(
                 ChatTextMessageHandler.Default.CreateIM(
                     character,
                     "Waypoint added: " + character.SelectedTarget.ToString(true) + ": "
                     + character.Coordinates().ToString()));
         }
     }
 }