Ejemplo n.º 1
0
 /// <summary>
 /// </summary>
 /// <param name="character">
 /// </param>
 /// <param name="destination">
 /// </param>
 /// <param name="heading">
 /// </param>
 /// <param name="playfield">
 /// </param>
 /// <returns>
 /// </returns>
 private MessageDataFiller NormalTeleport(
     ICharacter character,
     Vector3 destination,
     Quaternion heading,
     Identity playfield)
 {
     return(x =>
     {
         x.Identity = character.Identity;
         x.Destination = new SmokeLounge.AOtomation.Messaging.GameData.Vector3()
         {
             X = (float)destination.x,
             Y = (float)destination.y,
             Z = (float)destination.z
         };
         x.Heading = new SmokeLounge.AOtomation.Messaging.GameData.Quaternion()
         {
             X = (float)heading.x,
             Y = (float)heading.x,
             Z = (float)heading.y,
             W = (float)heading.w
         };
         x.Unknown1 = 0x61;
         x.Playfield = new Identity()
         {
             Type = IdentityType.Playfield1, Instance = playfield.Instance
         };
         x.ChangePlayfield = ((playfield.Instance != character.Playfield.Identity.Instance) ||
                              (playfield.Type != character.Playfield.Identity.Type))
             ? new Identity {
             Type = IdentityType.Playfield2, Instance = playfield.Instance
         }
             : Identity.None;
         x.Playfield2 = new Identity()
         {
             Type = IdentityType.Playfield3, Instance = playfield.Instance
         };
     });
 }
Ejemplo n.º 2
0
 /// <summary>
 /// </summary>
 /// <param name="character">
 /// </param>
 /// <param name="destination">
 /// </param>
 /// <param name="heading">
 /// </param>
 /// <param name="playfield">
 /// </param>
 /// <param name="playfieldInstance">
 /// </param>
 /// <param name="GS">
 /// </param>
 /// <param name="SG">
 /// </param>
 /// <param name="destinationidentity">
 /// </param>
 /// <returns>
 /// </returns>
 private MessageDataFiller ProxyTeleport(
     ICharacter character,
     Vector3 destination,
     Quaternion heading,
     int playfield,
     Identity playfieldInstance,
     int GS,
     int SG,
     Identity destinationidentity)
 {
     return(x =>
     {
         x.Identity = character.Identity;
         x.Destination = new SmokeLounge.AOtomation.Messaging.GameData.Vector3()
         {
             X = (float)destination.x,
             Y = (float)destination.y,
             Z = (float)destination.z
         };
         x.Heading = new SmokeLounge.AOtomation.Messaging.GameData.Quaternion()
         {
             X = (float)heading.x,
             Y = (float)heading.y,
             Z = (float)heading.z,
             W = (float)heading.w
         };
         x.Unknown1 = 0x61;
         x.Playfield = playfieldInstance;
         x.GameServerId = GS;
         x.SgId = SG;
         x.ChangePlayfield = ((playfield != character.Playfield.Identity.Instance) ||
                              (IdentityType.Playfield != character.Playfield.Identity.Type))
             ? new Identity {
             Type = IdentityType.Playfield2, Instance = playfield
         }
             : Identity.None;
         x.Playfield2 = destinationidentity;
     });
 }
Ejemplo n.º 3
0
 /// <summary>
 /// </summary>
 /// <param name="character">
 /// </param>
 /// <param name="destination">
 /// </param>
 /// <param name="heading">
 /// </param>
 /// <param name="playfield">
 /// </param>
 /// <param name="playfieldInstance">
 /// </param>
 /// <param name="GS">
 /// </param>
 /// <param name="SG">
 /// </param>
 /// <param name="destinationidentity">
 /// </param>
 public void SendTeleportProxy(
     ICharacter character,
     Vector3 destination,
     Quaternion heading,
     int playfield,
     Identity playfieldInstance,
     int GS,
     int SG,
     Identity destinationidentity)
 {
     this.Send(
         character,
         this.ProxyTeleport(
             character,
             destination,
             heading,
             playfield,
             playfieldInstance,
             GS,
             SG,
             destinationidentity),
         false);
 }
Ejemplo n.º 4
0
 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()));
         }
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// </summary>
 /// <param name="character">
 /// </param>
 /// <param name="destination">
 /// </param>
 /// <param name="heading">
 /// </param>
 /// <param name="playfield">
 /// </param>
 public void Send(ICharacter character, Vector3 destination, Quaternion heading, Identity playfield)
 {
     this.Send(character, this.NormalTeleport(character, destination, heading, playfield), false);
 }