Exemple #1
0
		public MobileUpdateOld( Mobile m ) : base( 0x20, 19 )
		{
			//int hue = m.Hue;
            int hue = m.GetHue(m);  // Scriptiz : hallucinations

			if ( m.SolidHueOverride >= 0 )
				hue = m.SolidHueOverride;

			m_Stream.Write( (int) m.Serial );
			//m_Stream.Write( (short) m.Body );
            m_Stream.Write((short)m.GetBody(m));    // Scriptiz : hallucinations
			m_Stream.Write( (byte) 0 );
			m_Stream.Write( (short) hue );
			m_Stream.Write( (byte) m.GetOldPacketFlags() );
			m_Stream.Write( (short) m.X );
			m_Stream.Write( (short) m.Y );
			m_Stream.Write( (short) 0 );
			m_Stream.Write( (byte) m.Direction );
			m_Stream.Write( (sbyte) m.Z );
		}
Exemple #2
0
        public MobileIncomingSA(Mobile beholder, Mobile beheld)
            : base(0x78)
        {
            m_Beheld = beheld;

#if Framework_4_0
       int m_Version = ++(m_VersionTL.Value);
       int[] m_DupedLayers = m_DupedLayersTL.Value;
#else
            ++m_Version;
#endif
            List<Item> eq = beheld.Items;
            int count = eq.Count;

            if (beheld.HairItemID > 0)
                count++;
            if (beheld.FacialHairItemID > 0)
                count++;

            this.EnsureCapacity(23 + (count * 9));

            //int hue = beheld.Hue;
            int hue = beholder.GetHue(beheld);  // Scriptiz : hallucinations

            if (beheld.SolidHueOverride >= 0)
                hue = beheld.SolidHueOverride;

            m_Stream.Write((int)beheld.Serial);
            //m_Stream.Write( (short) beheld.Body );
            m_Stream.Write((short)beholder.GetBody(beheld));    // Scriptiz : hallucinations
            m_Stream.Write((short)beheld.X);
            m_Stream.Write((short)beheld.Y);
            m_Stream.Write((sbyte)beheld.Z);
            m_Stream.Write((byte)beheld.Direction);
            m_Stream.Write((short)hue);
            m_Stream.Write((byte)beheld.GetPacketFlags());
            m_Stream.Write((byte)Notoriety.Compute(beholder, beheld));

            for (int i = 0; i < eq.Count; ++i)
            {
                Item item = eq[i];

                byte layer = (byte)item.Layer;

                if (!item.Deleted && beholder.CanSee(item) && m_DupedLayers[layer] != m_Version)
                {
                    m_DupedLayers[layer] = m_Version;

                    hue = item.Hue;

                    if (beheld.SolidHueOverride >= 0)
                        hue = beheld.SolidHueOverride;

                    int itemID = item.ItemID & 0x7FFF;
                    bool writeHue = (hue != 0);

                    if (writeHue)
                        itemID |= 0x8000;

                    m_Stream.Write((int)item.Serial);
                    m_Stream.Write((ushort)itemID);
                    m_Stream.Write((byte)layer);

                    if (writeHue)
                        m_Stream.Write((short)hue);
                }
            }

            if (beheld.HairItemID > 0)
            {
                if (m_DupedLayers[(int)Layer.Hair] != m_Version)
                {
                    m_DupedLayers[(int)Layer.Hair] = m_Version;
                    hue = beheld.HairHue;

                    if (beheld.SolidHueOverride >= 0)
                        hue = beheld.SolidHueOverride;

                    int itemID = beheld.HairItemID & 0x7FFF;

                    bool writeHue = (hue != 0);

                    if (writeHue)
                        itemID |= 0x8000;

                    m_Stream.Write((int)HairInfo.FakeSerial(beheld));
                    m_Stream.Write((ushort)itemID);
                    m_Stream.Write((byte)Layer.Hair);

                    if (writeHue)
                        m_Stream.Write((short)hue);
                }
            }

            if (beheld.FacialHairItemID > 0)
            {
                if (m_DupedLayers[(int)Layer.FacialHair] != m_Version)
                {
                    m_DupedLayers[(int)Layer.FacialHair] = m_Version;
                    hue = beheld.FacialHairHue;

                    if (beheld.SolidHueOverride >= 0)
                        hue = beheld.SolidHueOverride;

                    int itemID = beheld.FacialHairItemID & 0x7FFF;

                    bool writeHue = (hue != 0);

                    if (writeHue)
                        itemID |= 0x8000;

                    m_Stream.Write((int)FacialHairInfo.FakeSerial(beheld));
                    m_Stream.Write((ushort)itemID);
                    m_Stream.Write((byte)Layer.FacialHair);

                    if (writeHue)
                        m_Stream.Write((short)hue);
                }
            }

            m_Stream.Write((int)0); // terminate
        }
Exemple #3
0
		public MobileMovingOld( Mobile m, int noto, Mobile receiver ) : base( 0x77, 17 )
		{
			Point3D loc = m.Location;

			//int hue = m.Hue;
            int hue = receiver.GetHue(m);   // Scriptiz : hallucinations

			if ( m.SolidHueOverride >= 0 )
				hue = m.SolidHueOverride;

			m_Stream.Write( (int) m.Serial );
			//m_Stream.Write( (short) m.Body );
            m_Stream.Write((short)receiver.GetBody(m)); // Scriptiz : hallucinations
			m_Stream.Write( (short) loc.m_X );
			m_Stream.Write( (short) loc.m_Y );
			m_Stream.Write( (sbyte) loc.m_Z );
			m_Stream.Write( (byte) m.Direction );
			m_Stream.Write( (short) hue );
			m_Stream.Write( (byte) m.GetOldPacketFlags() );
			m_Stream.Write( (byte) noto );
		}