private static void Info(bool location, Serial serial, Point3D p, ushort gfxid) { StringBuilder str = new StringBuilder(); UOEntity entity = WorldEx.GetEntity(serial); if (entity == null) { return; } str.AppendLine("Serial: " + serial); str.AppendLine("Graphic: 0x" + gfxid.ToString("X4")); str.AppendLine("Color: 0x" + entity.Hue.ToString("X4")); str.AppendLine("Position: " + entity.Position); str.AppendLine("Distance: " + Utility.Distance(entity.Position, World.Player.Position)); str.AppendLine(); foreach (PropertyInfo property in entity.GetType().GetProperties()) { str.AppendLine(string.Format("{0}: {1}\n", property.Name, property.GetValue(entity, null))); } new MessageDialog("Info", str.ToString()) { TopMost = true }.Show(Engine.MainWindow); }
private static void DyeTarget(Serial target, ushort hue) { UOEntity targetObject = WorldEx.GetEntity(target); if (targetObject == null) { return; } Packet packet; if (targetObject is Item) { if (((Item)targetObject).Container is Mobile) { packet = new EquipmentItem((Item)targetObject, hue, ((Mobile)((Item)targetObject).Container).Serial); } else { packet = new ContainerItem((Item)targetObject); packet.Seek(-2, SeekOrigin.End); packet.Write(hue); } } else if (targetObject is Mobile) { Item mount = ((Mobile)targetObject).GetItemOnLayer(Layer.Mount); if (mount != null) { packet = new EquipmentItem(mount, hue, targetObject.Serial); } else { packet = new MobileIncoming((Mobile)targetObject); packet.Seek(15, SeekOrigin.Begin); packet.Write(hue); } } else { return; } WorldEx.SendToClient(packet); }
private static void OnCommand2(bool location, Serial serial, Point3D p, ushort gfxid) { UOEntity item = WorldEx.GetEntity(serial); if (item == null) { return; } StringBuilder sb = new StringBuilder(); foreach (ObjectPropertyList.OPLEntry opl in item.ObjPropList.m_Content) { sb.AppendLine(string.Format("{0} - {1}", opl.Number, string.IsNullOrEmpty(opl.Args) ? string.Empty : opl.Args.Trim())); } new MessageDialog("Props", sb.ToString()) { TopMost = true }.Show(Engine.MainWindow); }
private static void OnDye(Serial source, Serial target) { UOEntity sourceObject = WorldEx.GetEntity(source); if (sourceObject != null) { ushort hue = sourceObject.Hue; Mobile mobile = sourceObject as Mobile; if (mobile != null) { Item mount = mobile.GetItemOnLayer(Layer.Mount); if (mount != null) { hue = mount.Hue; } } DyeTarget(target, hue); } }