Exemple #1
0
 /// <summary>
 /// Constructor for an item on the ground.
 /// </summary>
 /// <param name="tileObject"></param>
 public ItemLocation(Map.TileObject tileObject)
 {
     this.WorldLocation = tileObject.Parent.WorldLocation;
     this.ItemID        = tileObject.ID;
     this.ItemCount     = tileObject.Count;
     this.StackIndex    = tileObject.StackIndex;
 }
Exemple #2
0
 /// <summary>
 /// Attempts to use this item on a tile object.
 /// Only use this method if you got a tile's top item.
 /// </summary>
 /// <param name="tileObject"></param>
 public void UseOnTileObject(Map.TileObject tileObject)
 {
     if (tileObject == null)
     {
         return;
     }
     this.Client.Packets.UseItemOnTileObject(this.ToItemLocation(), tileObject);
 }
 /// <summary>
 /// Attempts to use an item on a tile object.
 /// Use this method with the utmost care, and only send this packet when getting a tile's top item.
 /// </summary>
 /// <param name="itemLocation"></param>
 /// <param name="tileObject"></param>
 public void UseItemOnTileObject(Objects.ItemLocation itemLocation, Map.TileObject tileObject)
 {
     if (itemLocation == null || tileObject == null)
     {
         return;
     }
     this.FunctionUseItemEx.Call(itemLocation.WorldLocation.X, itemLocation.WorldLocation.Y, itemLocation.WorldLocation.Z,
                                 itemLocation.ItemID, itemLocation.StackIndex,
                                 tileObject.Parent.WorldLocation.X, tileObject.Parent.WorldLocation.Y, tileObject.Parent.WorldLocation.Z,
                                 tileObject.ID, tileObject.StackIndex);
     if (this.ItemUsedOn != null)
     {
         this.ItemUsedOn(itemLocation, tileObject.ToItemLocation());
     }
 }