Exemple #1
0
        private static void OnLocalizedMessage(Packet p, PacketHandlerEventArgs args)
        {
            Serial      ser    = p.ReadUInt32();
            ushort      body   = p.ReadUInt16();
            MessageType spell  = (MessageType)p.ReadByte();
            ushort      hue    = p.ReadUInt16();
            ushort      font   = p.ReadUInt16();
            int         num    = p.ReadInt32();
            string      name   = p.ReadStringSafe(30);
            string      argstr = p.ReadUnicodeStringLESafe();

            if (((((num >= 0x2dce9b) && (num < 0x2dcedb)) || ((num >= 0x102e9d) && (num < 0x102ead))) || (((num >= 0x102ee9) && (num < 0x102ef3)) || ((num >= 0x102e8d) && (num < 0x102e97)))) || (((num >= 0x102ef3) && (num < 0x102ef9)) || ((num >= 0x102f02) && (num < 0x102f0a))))
            {
                spell = MessageType.Spell;
            }

            BandageTimer.OnLocalizedMessage(num);
            try
            {
                if (enabled && Array.IndexOf(filter, num) != -1)
                {
                    args.Block = true;
                }
                else
                {
                    PacketHandlers.HandleSpeech(p, args, ser, body, spell, hue, font, Language.CliLocName.ToUpper(), name, Language.ClilocFormat(num, argstr));
                }
            }
            catch (Exception exception)
            { Engine.LogCrash(new Exception(string.Format("Exception in Ultima.dll cliloc: {0}, {1}", num, argstr), exception)); }
        }