private static void ContainerContent(Packet p, PacketHandlerEventArgs args) { int count = p.ReadUInt16(); for (int i = 0; i < count; i++) { Item item = World.FindItem(p.ReadUInt32()); Item container = item.Container as Item; if (container != null && container.ItemID == 0x2006) { foreach (LootItem loot in items) { if (item.ItemID == loot.Graphic && (item.Hue == loot.Color || loot.Color == 0xFFFF)) { if (Fixes.LootBag.Bag != 0) { DragDrop.Move(item, Fixes.LootBag.Bag); } WorldEx.OverHeadMessage(loot.Name, container); } } } p.Seek(15, System.IO.SeekOrigin.Current); } }
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); }
private static void OnCompressedGump(PacketReader p, PacketHandlerEventArgs e) { p.MoveToData(); uint sender = p.ReadUInt32(); uint id = p.ReadUInt32(); if (id == responseID) { _responseSender = sender; } if (id != compressedID) { return; } p.Seek(19, SeekOrigin.Begin); p.Seek(p.ReadInt32(), SeekOrigin.Current); int lines = p.ReadInt32(), cLen = p.ReadInt32(), dLen = p.ReadInt32(); if (cLen < 5) { return; } byte[] buffer = new byte[dLen]; ZLib.uncompress(buffer, ref dLen, p.CopyBytes(p.Position, cLen - 4), cLen - 4); string afk = string.Empty; for (int i = 0, pos = 0; i < lines; i++) { int strLen = (buffer[pos++] << 8) | buffer[pos++]; string str = Encoding.BigEndianUnicode.GetString(buffer, pos, strLen * 2); int index = str.IndexOf('>'); if (index != -1 && index < str.Length - 1) { afk += str[index + 1].ToString().ToUpper().Normalize(NormalizationForm.FormD)[0]; } pos += strLen * 2; } afk = afk.Trim(); if (afk.Length == 5 && _responseSender != 0) { /*ClientCommunication.SendToClient(new CloseGump(responseID)); * WorldEx.SendToServer(new GumpResponse(responseSender, responseID, 0x310, new int[0], new[] { new GumpTextEntry(0x310, afk) })); * responseSender = 0;*/ WorldEx.OverHeadMessage(afk); } }
private static void BuffIcons_Added(BuffIcon buffId, BuffInfo info) { if (buffId == BuffIcon.BloodOathCurse) { Mobile mobile = World.FindMobile(lastSerial); if (mobile == null) { return; } lastOath = lastSerial; if (Utility.Distance(mobile.Position, World.Player.Position) < 2) { WorldEx.SendToServer(new SetWarMode(true)); WorldEx.SendToServer(new SetWarMode(false)); WorldEx.OverHeadMessage("!Blood Oath!", 0x0017); } } }
private static void OnTimer() { timer = null; WorldEx.OverHeadMessage("Gift of Life ends in 15 seconds!!!"); }
protected override void OnTick() { WorldEx.OverHeadMessage((5 - m_Index).ToString(), 0x0017); }