So the next code doesnt compute Z coords, i would like to add a z -75

Code:
			protected override void OnTick()
			{
				if (m_attachment == null) return;

				Mobile draggedby = m_attachment.DraggedBy;
				object parent = m_attachment.AttachedTo;

				if (parent == null || !(parent is Mobile || parent is Item) || draggedby == null || draggedby.Deleted || draggedby == parent || !draggedby.Alive )
				{
					
					Stop();
					return;
				}

			//location of the mobile

				Point3D newloc = draggedby.Location;
				Map newmap = draggedby.Map;

				if (newmap == null || newmap == Map.Internal)
				{
					// if the m has an invalid map, then stop
					m_attachment.DraggedBy = null;
					Stop();
					return;
				}

				// update the location object if the parent has moved
				if (newloc != m_attachment.CurrentLoc || newmap != m_attachment.CurrentMap)
				{
					m_attachment.CurrentLoc = newloc;
					m_attachment.CurrentMap = newmap;

					int x = newloc.X;
					int y = newloc.Y;
					int lag = m_attachment.Distance;
					// compute the new location for the object
					switch (draggedby.Direction & Direction.Mask)
					{
						case Direction.North: y -= lag; break;
						case Direction.Right: x += lag; y -= lag; break;
						case Direction.East: x += lag; break;
						case Direction.Down: x += lag; y += lag; break;
						case Direction.South: y += lag; break;
						case Direction.Left: x -= lag; y += lag; break;
						case Direction.West: x -= lag; break;
						case Direction.Up: x -= lag; y -= lag; break;
					}

					if (parent is Mobile)
					{
						((Mobile)parent).Location = new Point3D(x, y, newloc.Z);
						((Mobile)parent).Map = newmap;
				
					}
					else
						if (parent is Item)
						{
							((Item)parent).Location = new Point3D(x, y, newloc.Z);
							((Item)parent).Map = newmap;
						}
				}
				

			}
		}
                }

Thanks ServUO community.
 
I think he's trying to add a tile dragged by a mobile but it's hidden at -75. Why? Because the tile will show up on the map so you'll be able to see where the monsters are.

At least, that's an idea I considered doing myself. He may be doing something else
 
Trying to make an item appear above player head -75 is the correct place, so thats what i was trying to do :D

its working

Thanks
 
Back