public Item( BinaryReader reader, byte version ) : base(reader, version) { m_ItemID = reader.ReadUInt16(); m_Amount = reader.ReadUInt16(); m_Direction = reader.ReadByte(); ProcessPacketFlags( reader.ReadByte() ); m_Layer = (Layer)reader.ReadByte(); m_Name = reader.ReadString(); m_Parent = (Serial)reader.ReadUInt32(); if ( ((Serial)m_Parent) == Serial.Zero ) m_Parent = null; int count = reader.ReadInt32(); m_Items = new ArrayList( count ); for(int i=0;i<count;i++) m_Items.Add( (Serial)reader.ReadUInt32() ); if ( version > 2 ) { m_HouseRev = reader.ReadInt32(); if ( m_HouseRev != 0 ) { int len = reader.ReadUInt16(); m_HousePacket = reader.ReadBytes( len ); } } else { m_HouseRev = 0; m_HousePacket = null; } }
private static bool? Event_ASCIIMessage(Serial serial, ItemID graphic, byte type, ushort hue, ushort font, string lang, string name, string msg) { if (msg == "Banish!" || msg == "Decimate!" || msg == "Pool of Poison!") { msg = string.Format("!!!{0}!!", msg); WorldEx.OverHeadMessage(msg, 0x0017); if (msg == "!!!Banish!!!") timer.Start(); } return null; }
public static IEnumerable<Item> FindItems(this Item container, ItemID itemID, ushort hue, Predicate<Item> predicate = null, bool recurse = true, bool include = true) { return container.FindItems(i => i.ItemID == itemID && i.Hue == hue && (predicate == null || predicate(i)), recurse, include); }
public static Item FindItemG(ItemID itemID, ushort hue, Predicate<Item> predicate = null) { return FindItemsG(itemID, hue, predicate).FirstOrDefault(); }
public static Item FindItem(this Item container, ItemID itemID, ushort hue, Predicate<Item> predicate = null, bool recurse = true, bool include = true) { return container.FindItems(itemID, hue, predicate, recurse, include).FirstOrDefault(); }
private bool? Event_LocalizedMessage(Serial serial, ItemID graphic, byte type, ushort hue, ushort font, int num, string name, string args) { if (Array.IndexOf(msgs, num) != -1) { Last = num; Recieved = true; } return null; }
private static bool? Event_LocalizedMessage(Serial serial, ItemID graphic, byte type, ushort hue, ushort font, int num, string name, string args) { if (num == 500641) disturbed = true; return null; }
private static bool? Event_HuedEffect(byte type, Serial src, Serial dest, ItemID itemID, byte speed, byte count, uint hue, uint mode) { if (type == 3 && src != World.Player.Serial && dest == 0 && itemID == 0x375A) lastSerial = src; return null; }
public HuePicker( ItemID itemid ) : this(Serial.MinusOne, itemid) { }
private static void AddFakeItem(string name, ItemID origID, ushort origHue, ItemID newID, ushort newHue) { FakeItem item = new FakeItem(name, origID, origHue, newID, newHue); items.Add(item.Serial, item); }
public FakeItem(string name, ItemID origID, ushort origHue, ItemID newID, ushort newHue) : base(++fakeSerial) { List = new List<Serial>(); Name = name; ItemID = newID; Hue = newHue; OrigID = origID; OrigHue = origHue; Position = new Point3D(ConfigEx.GetAttribute(100, "X", "FakeItems", Name), ConfigEx.GetAttribute(100, "Y", "FakeItems", Name), 0); }
public Item FindItemByID( ItemID id ) { for (int i=0;i<Contains.Count;i++) { Item item = (Item)Contains[i]; if ( item.ItemID == id ) return item; } return null; }
public Item FindItemByID( ItemID id, bool recurse ) { for (int i=0;i<m_Items.Count;i++) { Item item = (Item)m_Items[i]; if ( item.ItemID == id ) { return item; } else if ( recurse ) { item = item.FindItemByID( id, true ); if ( item != null ) return item; } } return null; }
public Item FindItemByID( ItemID id ) { return FindItemByID( id, true ); }
public static IEnumerable<Item> FindItemsG(ItemID itemID, ushort hue, Predicate<Item> predicate = null) { return FindItemsG(i => i.ItemID == itemID && i.Hue == hue && (predicate == null || predicate(i))); }
public RestockItem( ItemID id, int amount ) { ItemID = id; Amount = amount; }
private static bool IsFish(ItemID id) { return (id >= 0x3AF9 && id <= 0x3B15 && id != 0x3B10 && id != 0x3B0C) || id == 0x0C93 || id == 0x0DD7; }
private static bool IsStaffItem( ItemID itemID ) { return ( itemID == 0x36FF || // LOS blocker itemID == 0x1183 // Movement blocker ); }
public HuePicker( Serial serial, ItemID itemid ) : base(0x95, 9) { Write( (uint)serial ); Write( (ushort)0 ); Write( (ushort)itemid ); }
public static void PostAddMulti( ItemID iid, Point3D Position ) { IntPtr pos = (IntPtr)((int)((Position.X&0xFFFF)|((Position.Y&0xFFFF)<<16))); if ( pos == IntPtr.Zero ) return; for(int i=0;i<m_WndReg.Count;i++) { WndRegEnt wnd = (WndRegEnt)m_WndReg[i]; if ( wnd.Type == 1 ) PostMessage( (IntPtr)wnd.Handle, (uint)UOAMessage.ADD_MULTI, pos, (IntPtr)iid.Value ); } }