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 != 0x3779 || speed != 1 || count != 30) { return(null); } ushort duration = 11; Item item = World.Player.GetItemOnLayer(Layer.Arms); if (item != null) { ArrayList content = item.ObjPropList.m_Content; if (content.Count > 0) { ObjectPropertyList.OPLEntry entry = ((ObjectPropertyList.OPLEntry)content[content.Count - 1]); if (entry.Args != null && entry.Args.Contains("Consecrate Weapon")) { duration += 20; } } } consTimer.Stop(); RemoveBuff(BuffIcon.ConsecrateWeapon); AddBuff(BuffIcon.ConsecrateWeapon, 1060587, 1060587, string.Empty, duration); consTimer.Delay = TimeSpan.FromSeconds(duration); consTimer.Start(); return(null); }
private static void SOS_OnGump(int x, int y) { if (Environment.TickCount - lastTime < 5000) { list[lastSerial].Location = new Point3D(x, y, 0); Item item = World.FindItem(lastSerial); if (item != null && item.ObjPropList.m_Content.Count == 3) { ObjectPropertyList.OPLEntry entry = (ObjectPropertyList.OPLEntry)item.ObjPropList.m_Content[2]; if (entry.Number == 1042971) { if (entry.Args == "Trammel") { list[lastSerial].Felucca = false; } else if (entry.Args == "Felucca") { list[lastSerial].Felucca = true; } } } DragDrop.Move(World.FindItem(lastSerial), World.FindItem(lastContainer)); Save(); MoveNext(); } }
private static ushort GetHue(Item item) { if (item != null && item.ItemID == 0x14F0 && item.Hue == 0x0625 && item.ObjPropList.m_Content.Count > 1) { ObjectPropertyList.OPLEntry entry = (ObjectPropertyList.OPLEntry)item.ObjPropList.m_Content[1]; ushort hue; if (scrolls.TryGetValue(entry.Number, out hue)) { return(hue); } } return(0); }
private static void OnProps(PacketReader p, PacketHandlerEventArgs args) { try { p.Seek(5, SeekOrigin.Begin); Item item = World.FindItem(p.ReadUInt32()); if (item == null) { return; } item.ReadPropertyList(p); if (item.RootContainer != World.Player || item.IsInBank) { return; } ObjectPropertyList.OPLEntry opl = item.ObjPropList.m_Content.OfType <ObjectPropertyList.OPLEntry>().FirstOrDefault(o => o.Number == 1060639); if (opl == null) { return; } string str = opl.Args.Trim(); int start, end; while ((start = str.IndexOf('<')) != -1 && (end = str.IndexOf('>')) != -1) { str = str.Remove(start, end - start + 1).Trim(); } string[] durab = str.Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); double current, max; if (double.TryParse(durab[0], out current) && double.TryParse(durab[1], out max) && (((current / max) * 100) < ConfigEx.GetElement(25, "MinDurability") && current < max)) { opl = (ObjectPropertyList.OPLEntry)item.ObjPropList.m_Content[0]; string[] name = opl.Args.Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); WorldEx.SendMessage(string.Format("!{0} {1}/{2}!", FormatString(name.Last()), current, max)); } } catch {} }