当前位置: 首页>>代码示例>>C#>>正文


C# Mobile.CanBeRenamedBy方法代码示例

本文整理汇总了C#中Mobile.CanBeRenamedBy方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.CanBeRenamedBy方法的具体用法?C# Mobile.CanBeRenamedBy怎么用?C# Mobile.CanBeRenamedBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mobile的用法示例。


在下文中一共展示了Mobile.CanBeRenamedBy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MobileStatus

        public MobileStatus( Mobile beholder, Mobile beheld )
            : base(0x11)
        {
            string name = beheld.Name;
            if ( name == null ) name = "";

            this.EnsureCapacity( 43 + (beholder == beheld ? 45 : 0) );

            m_Stream.Write( beheld.Serial );

            m_Stream.WriteAsciiFixed( name, 30 );

            if ( beholder == beheld )
                WriteAttr( beheld.Hits, beheld.HitsMax );
            else
                WriteAttrNorm( beheld.Hits, beheld.HitsMax );

            m_Stream.Write( beheld.CanBeRenamedBy( beholder ) );

            if ( beholder == beheld )
            {
                m_Stream.Write( (byte) (m_SendAosInfo ? 0x04 : 0x03) );

                m_Stream.Write( beheld.Female );

                m_Stream.Write( (short) beheld.Str );
                m_Stream.Write( (short) beheld.Dex );
                m_Stream.Write( (short) beheld.Int );

                WriteAttr( beheld.Stam, beheld.StamMax );
                WriteAttr( beheld.Mana, beheld.ManaMax );

                m_Stream.Write( (int) beheld.TotalGold );
                m_Stream.Write( (short) (Core.AOS ? beheld.PhysicalResistance : (int)(beheld.ArmorRating + 0.5)) );
                m_Stream.Write( (short) (Mobile.BodyWeight + beheld.TotalWeight) );

                m_Stream.Write( (short) beheld.StatCap );

                m_Stream.Write( (byte) beheld.Followers );
                m_Stream.Write( (byte) beheld.FollowersMax );

                if ( m_SendAosInfo )
                {
                    m_Stream.Write( (short) beheld.FireResistance ); // Fire
                    m_Stream.Write( (short) beheld.ColdResistance ); // Cold
                    m_Stream.Write( (short) beheld.PoisonResistance ); // Poison
                    m_Stream.Write( (short) beheld.EnergyResistance ); // Energy
                    m_Stream.Write( (short) beheld.Luck ); // Luck

                    IWeapon weapon = beheld.Weapon;

                    int min = 0, max = 0;

                    if ( weapon != null )
                        weapon.GetStatusDamage( beheld, out min, out max );

                    m_Stream.Write( (short) min ); // Damage min
                    m_Stream.Write( (short) max ); // Damage max

                    m_Stream.Write( (int) beheld.TithingPoints );
                }
            }
            else
            {
                m_Stream.Write( (byte) 0x00 );
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:67,代码来源:Packets.cs

示例2: MobileStatusExtended

        public MobileStatusExtended( Mobile m )
            : base(0x11)
        {
            string name = m.Name;
            if ( name == null ) name = "";

            this.EnsureCapacity( 88 );

            m_Stream.Write( (int) m.Serial );
            m_Stream.WriteAsciiFixed( name, 30 );

            m_Stream.Write( (short) m.Hits );
            m_Stream.Write( (short) m.HitsMax );

            m_Stream.Write( m.CanBeRenamedBy( m ) );

            m_Stream.Write( (byte) (MobileStatus.SendAosInfo ? 0x04 : 0x03) ); // type

            m_Stream.Write( m.Female );

            m_Stream.Write( (short) m.Str );
            m_Stream.Write( (short) m.Dex );
            m_Stream.Write( (short) m.Int );

            m_Stream.Write( (short) m.Stam );
            m_Stream.Write( (short) m.StamMax );

            m_Stream.Write( (short) m.Mana );
            m_Stream.Write( (short) m.ManaMax );

            m_Stream.Write( (int) m.TotalGold );
            m_Stream.Write( (short) (Core.AOS ? m.PhysicalResistance : (int)(m.ArmorRating + 0.5)) );
            m_Stream.Write( (short) (Mobile.BodyWeight + m.TotalWeight) );

            m_Stream.Write( (short) m.StatCap );

            m_Stream.Write( (byte) m.Followers );
            m_Stream.Write( (byte) m.FollowersMax );

            if ( MobileStatus.SendAosInfo )
            {
                m_Stream.Write( (short) m.FireResistance ); // Fire
                m_Stream.Write( (short) m.ColdResistance ); // Cold
                m_Stream.Write( (short) m.PoisonResistance ); // Poison
                m_Stream.Write( (short) m.EnergyResistance ); // Energy
                m_Stream.Write( (short) m.Luck ); // Luck

                IWeapon weapon = m.Weapon;

                int min = 0, max = 0;

                if ( weapon != null )
                    weapon.GetStatusDamage( m, out min, out max );

                m_Stream.Write( (short) min ); // Damage min
                m_Stream.Write( (short) max ); // Damage max

                m_Stream.Write( (int) m.TithingPoints );
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:60,代码来源:Packets.cs

示例3: MobileStatus

		public MobileStatus(Mobile beholder, Mobile beheld)
			: base(0x11)
		{
			string name = beheld.Name;
			if (name == null) name = "";

			bool sendMaxWeight = (Core.ML && beheld.NetState != null && beheld.NetState.SupportsExpansion(Expansion.ML));

			this.EnsureCapacity(43 + (beholder == beheld ? (sendMaxWeight ? 48 : 45) : 0));

			m_Stream.Write(beheld.Serial);

			m_Stream.WriteAsciiFixed(name, 30);

			if (beholder == beheld)
				WriteAttr(beheld.Hits, beheld.HitsMax);
			else
				WriteAttrNorm(beheld.Hits, beheld.HitsMax);

			m_Stream.Write(beheld.CanBeRenamedBy(beholder));

			if (beholder == beheld)
			{
				m_Stream.Write((byte)(sendMaxWeight ? 0x05 : Core.AOS ? 0x04 : 0x03)); // type

				m_Stream.Write(beheld.Female);

				m_Stream.Write((short)beheld.Str);
				m_Stream.Write((short)beheld.Dex);
				m_Stream.Write((short)beheld.Int);

				WriteAttr(beheld.Stam, beheld.StamMax);
				WriteAttr(beheld.Mana, beheld.ManaMax);

				m_Stream.Write((int)beheld.TotalGold);
				//m_Stream.Write( (short) (Core.AOS ? beheld.PhysicalResistance : (int)(beheld.ArmorRating + 0.5)) );
				m_Stream.Write((short)((int)(beheld.ArmorRating + 0.5)));
				m_Stream.Write((short)(Mobile.BodyWeight + beheld.TotalWeight));

				if (sendMaxWeight)
				{
					//SMD: we're never ML, so we shouldn't need this!
					//m_Stream.Write( (short)beheld.MaxWeight );
					//m_Stream.Write( (byte)(beheld.Race.RaceID + 1) );	// Would be 0x00 if it's a non-ML enabled account but...
				}

				m_Stream.Write((short)beheld.StatCap);

				m_Stream.Write((byte)beheld.Followers);
				m_Stream.Write((byte)beheld.FollowersMax);

				if (Core.AOS)
				{
					//SMD: We're never AOS, so we shouldn't need this!
					//					m_Stream.Write( (short) beheld.FireResistance ); // Fire
					//					m_Stream.Write( (short) beheld.ColdResistance ); // Cold
					//					m_Stream.Write( (short) beheld.PoisonResistance ); // Poison
					//					m_Stream.Write( (short) beheld.EnergyResistance ); // Energy
					//					m_Stream.Write( (short) beheld.Luck ); // Luck
					//
					//					IWeapon weapon = beheld.Weapon;
					//
					//					int min = 0, max = 0;
					//
					//					if ( weapon != null )
					//						weapon.GetStatusDamage( beheld, out min, out max );
					//
					//					m_Stream.Write( (short) min ); // Damage min
					//					m_Stream.Write( (short) max ); // Damage max
					//
					//					m_Stream.Write( (int) beheld.TithingPoints );
				}
			}
			else
			{
				m_Stream.Write((byte)0x00);
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:78,代码来源:Packets.cs

示例4: MobileStatusExtended

        public MobileStatusExtended( Mobile m, NetState ns )
            : base(0x11)
        {
            string name = m.Name;
            if ( name == null ) name = "";

            int type;

            if ( Core.HS && ns != null && ns.ExtendedStatus )
            {
                type = 6;
                EnsureCapacity( 121 );
            }
            else if ( Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ) )
            {
                type = 5;
                EnsureCapacity( 91 );
            }
            else
            {
                type = Core.AOS ? 4 : 3;
                EnsureCapacity( 88 );
            }

            m_Stream.Write( (int) m.Serial );
            m_Stream.WriteAsciiFixed( name, 30 );

            m_Stream.Write( (short) m.Hits );
            m_Stream.Write( (short) m.HitsMax );

            m_Stream.Write( m.CanBeRenamedBy( m ) );

            m_Stream.Write( (byte) type );

            m_Stream.Write( m.Female );

            m_Stream.Write( (short) m.Str );
            m_Stream.Write( (short) m.Dex );
            m_Stream.Write( (short) m.Int );

            m_Stream.Write( (short) m.Stam );
            m_Stream.Write( (short) m.StamMax );

            m_Stream.Write( (short) m.Mana );
            m_Stream.Write( (short) m.ManaMax );

            m_Stream.Write( (int) m.TotalGold );
            m_Stream.Write( (short) (Core.AOS ? m.PhysicalResistance : (int)(m.ArmorRating + 0.5)) );
            m_Stream.Write( (short) (Mobile.BodyWeight + m.TotalWeight) );

            if ( type >= 5 )
            {
                m_Stream.Write( (short)m.MaxWeight );
                m_Stream.Write( (byte)(m.Race.RaceID + 1));	// Would be 0x00 if it's a non-ML enabled account but...
            }

            m_Stream.Write( (short) m.StatCap );

            m_Stream.Write( (byte) m.Followers );
            m_Stream.Write( (byte) m.FollowersMax );

            if ( type >= 4 )
            {
                m_Stream.Write( (short) m.FireResistance ); // Fire
                m_Stream.Write( (short) m.ColdResistance ); // Cold
                m_Stream.Write( (short) m.PoisonResistance ); // Poison
                m_Stream.Write( (short) m.EnergyResistance ); // Energy
                m_Stream.Write( (short) m.Luck ); // Luck

                IWeapon weapon = m.Weapon;

                int min = 0, max = 0;

                if ( weapon != null )
                    weapon.GetStatusDamage( m, out min, out max );

                m_Stream.Write( (short) min ); // Damage min
                m_Stream.Write( (short) max ); // Damage max

                m_Stream.Write( (int) m.TithingPoints );
            }

            if ( type >= 6 )
            {
                for ( int i = 0; i < 15; ++i )
                    m_Stream.Write( (short) m.GetAOSStatus( i ) );
            }
        }
开发者ID:Leorgrium,项目名称:runuo,代码行数:88,代码来源:Packets.cs

示例5: MobileStatusExtended

        public MobileStatusExtended( Mobile m, NetState ns )
            : base(0x11)
        {
            string name = m.Name;
            if ( name == null ) name = "";

            bool sendMLExtended = (Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ));

            #region UOSA: KR Support
            this.EnsureCapacity((m.NetState != null && m.NetState.IsKRClient) ? 161 : (sendMLExtended ? 91 : 88));
            #endregion

            m_Stream.Write( (int) m.Serial );
            m_Stream.WriteAsciiFixed( name, 30 );

            m_Stream.Write( (short) m.Hits );
            m_Stream.Write( (short) m.HitsMax );

            m_Stream.Write( m.CanBeRenamedBy( m ) );

            #region UOSA: KR Support
            m_Stream.Write((byte)((m.NetState != null && m.NetState.IsKRClient) ? 0x06 : (sendMLExtended ? 0x05 : Core.AOS ? 0x04 : 0x03))); // type
            #endregion

            m_Stream.Write( m.Female );

            m_Stream.Write( (short) m.Str );
            m_Stream.Write( (short) m.Dex );
            m_Stream.Write( (short) m.Int );

            m_Stream.Write( (short) m.Stam );
            m_Stream.Write( (short) m.StamMax );

            m_Stream.Write( (short) m.Mana );
            m_Stream.Write( (short) m.ManaMax );

            m_Stream.Write( (int) m.TotalGold );
            m_Stream.Write( (short) (Core.AOS ? m.PhysicalResistance : (int)(m.ArmorRating + 0.5)) );
            m_Stream.Write( (short) (Mobile.BodyWeight + m.TotalWeight) );

            if( sendMLExtended )
            {
                m_Stream.Write( (short)m.MaxWeight );
                m_Stream.Write( (byte)(m.Race.RaceID + 1));	// Would be 0x00 if it's a non-ML enabled account but...
            }

            m_Stream.Write( (short) m.StatCap );

            m_Stream.Write( (byte) m.Followers );
            m_Stream.Write( (byte) m.FollowersMax );

            if ( Core.AOS )
            {
                m_Stream.Write( (short) m.FireResistance ); // Fire
                m_Stream.Write( (short) m.ColdResistance ); // Cold
                m_Stream.Write( (short) m.PoisonResistance ); // Poison
                m_Stream.Write( (short) m.EnergyResistance ); // Energy
                m_Stream.Write( (short) m.Luck ); // Luck

                IWeapon weapon = m.Weapon;

                int min = 0, max = 0;

                if ( weapon != null )
                    weapon.GetStatusDamage( m, out min, out max );

                m_Stream.Write( (short) min ); // Damage min
                m_Stream.Write( (short) max ); // Damage max

                m_Stream.Write( (int) m.TithingPoints );
            }

            #region UOSA: KR Support
            if (m.NetState != null && m.NetState.IsKRClient)
            {
                m_Stream.Write((short)m.AttackChance); // Hit Chance Increase
                m_Stream.Write((short)m.WeaponSpeed); // Swing Speed Increase
                m_Stream.Write((short)m.WeaponDamage); // Damage Increase
                m_Stream.Write((short)m.LowerRegCost); // Lower Reagent Cost
                m_Stream.Write((short)m.RegenHits); // Hit Points Regeneration
                m_Stream.Write((short)m.RegenStam); // Stamina Regeneration
                m_Stream.Write((short)m.RegenMana); // Mana Regeneration
                m_Stream.Write((short)m.ReflectPhysical); // Reflect Physical Damage
                m_Stream.Write((short)m.EnhancePotions); // Enhance Potions
                m_Stream.Write((short)m.DefendChance); // Defense Chance Increase
                m_Stream.Write((short)m.SpellDamage); // Spell Damage Increase
                m_Stream.Write((short)m.CastRecovery); // Faster Cast Recovery
                m_Stream.Write((short)m.CastSpeed); // Faster Casting
                m_Stream.Write((short)m.LowerManaCost); // Lower Mana Cost
                m_Stream.Write((short)m.BonusStr); // Strength Increase
                m_Stream.Write((short)m.BonusDex); // Dexterity Increase
                m_Stream.Write((short)m.BonusInt); // Intelligence Increase
                m_Stream.Write((short)m.BonusHits); // Hit Points Increase
                m_Stream.Write((short)m.BonusStam); // Stamina Increase
                m_Stream.Write((short)m.BonusMana); // Mana Increase
                m_Stream.Write((short)m.MaxHitIncrease); // Maximum Hit Points Increase
                m_Stream.Write((short)m.MaxStamIncrease); // Maximum Stamina Increase
                m_Stream.Write((short)m.MaxManaIncrease); // Maximum Mana Increase
            }
            #endregion
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:liberdade-uo-server,代码行数:101,代码来源:Packets.cs

示例6: MobileStatusExtended

		public MobileStatusExtended(Mobile m)
			: base(0x11)
		{
			string name = m.Name;
			if (name == null) name = "";

			bool sendMaxWeight = (Core.ML && m.NetState != null && m.NetState.SupportsExpansion(Expansion.ML));


			this.EnsureCapacity(sendMaxWeight ? 91 : 88);

			m_Stream.Write((int)m.Serial);
			m_Stream.WriteAsciiFixed(name, 30);

			m_Stream.Write((short)m.Hits);
			m_Stream.Write((short)m.HitsMax);

			m_Stream.Write(m.CanBeRenamedBy(m));

			m_Stream.Write((byte)(sendMaxWeight ? 0x05 : Core.AOS ? 0x04 : 0x03)); // type

			m_Stream.Write(m.Female);

			m_Stream.Write((short)m.Str);
			m_Stream.Write((short)m.Dex);
			m_Stream.Write((short)m.Int);

			m_Stream.Write((short)m.Stam);
			m_Stream.Write((short)m.StamMax);

			m_Stream.Write((short)m.Mana);
			m_Stream.Write((short)m.ManaMax);

			m_Stream.Write((int)m.TotalGold);
			//m_Stream.Write( (short) (Core.AOS ? m.PhysicalResistance : (int)(m.ArmorRating + 0.5)) );
			m_Stream.Write((short)((int)(m.ArmorRating + 0.5)));
			m_Stream.Write((short)(Mobile.BodyWeight + m.TotalWeight));

			if (sendMaxWeight)
			{
				//SMD: we're never ML, so we shouldn't need this!
				//				m_Stream.Write( (short)m.MaxWeight );
				//				m_Stream.Write( (byte)(m.Race.RaceID + 1));	// Would be 0x00 if it's a non-ML enabled account but...
			}

			m_Stream.Write((short)m.StatCap);

			m_Stream.Write((byte)m.Followers);
			m_Stream.Write((byte)m.FollowersMax);

			if (Core.AOS)
			{
				//SMD: we're never AOS, so we shouldn't need this!
				//                m_Stream.Write( (short) m.FireResistance ); // Fire
				//				m_Stream.Write( (short) m.ColdResistance ); // Cold
				//				m_Stream.Write( (short) m.PoisonResistance ); // Poison
				//				m_Stream.Write( (short) m.EnergyResistance ); // Energy
				//				m_Stream.Write( (short) m.Luck ); // Luck
				//
				//				IWeapon weapon = m.Weapon;
				//
				//				int min = 0, max = 0;
				//
				//				if ( weapon != null )
				//					weapon.GetStatusDamage( m, out min, out max );
				//
				//				m_Stream.Write( (short) min ); // Damage min
				//				m_Stream.Write( (short) max ); // Damage max
				//
				//				m_Stream.Write( (int) m.TithingPoints );
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:72,代码来源:Packets.cs

示例7: OnStatsQuery

		public void OnStatsQuery( Mobile beholder, Mobile beheld )
		{
			if ( beholder != beheld && Contains( beholder ) && beholder.Map == beheld.Map && Utility.InUpdateRange( beholder, beheld ) )
			{
				if ( !beholder.CanSee( beheld ) )
					beholder.Send( new MobileStatusCompact( beheld.CanBeRenamedBy( beholder ), beheld ) );

				beholder.Send( new MobileAttributesN( beheld ) );
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:10,代码来源:Party.cs

示例8: MobileStatus

        public MobileStatus(Mobile beholder, Mobile beheld, NetState ns)
            : base(0x11)
        {
            string name = beheld.Name;
            if (name == null)
            {
                name = "";
            }

            int type;

            if (beholder != beheld)
            {
                type = 0;
                EnsureCapacity(43);
            }
            else if (Core.HS && ns != null && ns.ExtendedStatus)
            {
                type = 6;
                EnsureCapacity(121);
            }
            else if (Core.ML && ns != null && ns.SupportsExpansion(Expansion.ML))
            {
                type = 5;
                EnsureCapacity(91);
            }
            else
            {
                type = Core.AOS ? 4 : 3;
                EnsureCapacity(88);
            }

            m_Stream.Write(beheld.Serial);

            m_Stream.WriteAsciiFixed(name, 30);

            if (beholder == beheld)
            {
                WriteAttr(beheld.Hits, beheld.HitsMax);
            }
            else
            {
                WriteAttrNorm(beheld.Hits, beheld.HitsMax);
            }

            m_Stream.Write(beheld.CanBeRenamedBy(beholder));

            m_Stream.Write((byte)type);

            if (type > 0)
            {
                m_Stream.Write(beheld.Female);

                m_Stream.Write((short)beheld.Str);
                m_Stream.Write((short)beheld.Dex);
                m_Stream.Write((short)beheld.Int);

                WriteAttr(beheld.Stam, beheld.StamMax);
                WriteAttr(beheld.Mana, beheld.ManaMax);

                m_Stream.Write(beheld.TotalGold);
                m_Stream.Write((short)(Core.AOS ? beheld.PhysicalResistance : (int)(beheld.ArmorRating + 0.5)));
                m_Stream.Write((short)(Mobile.BodyWeight + beheld.TotalWeight));

                if (type >= 5)
                {
                    m_Stream.Write((short)beheld.MaxWeight);
                    m_Stream.Write((byte)(beheld.Race.RaceID + 1)); // Would be 0x00 if it's a non-ML enabled account but...
                }

                m_Stream.Write((short)beheld.StatCap);

                m_Stream.Write((byte)beheld.Followers);
                m_Stream.Write((byte)beheld.FollowersMax);

                if (type >= 4)
                {
                    m_Stream.Write((short)beheld.FireResistance); // Fire
                    m_Stream.Write((short)beheld.ColdResistance); // Cold
                    m_Stream.Write((short)beheld.PoisonResistance); // Poison
                    m_Stream.Write((short)beheld.EnergyResistance); // Energy
                    m_Stream.Write((short)beheld.Luck); // Luck

                    IWeapon weapon = beheld.Weapon;

                    int min = 0, max = 0;

                    if (weapon != null)
                    {
                        weapon.GetStatusDamage(beheld, out min, out max);
                    }

                    m_Stream.Write((short)min); // Damage min
                    m_Stream.Write((short)max); // Damage max

                    m_Stream.Write(beheld.TithingPoints);
                }

                if (type >= 6)
                {
//.........这里部分代码省略.........
开发者ID:Ravenwolfe,项目名称:ServUO,代码行数:101,代码来源:Packets.cs

示例9: MobileStatus

        public MobileStatus(Mobile beholder, Mobile beheld, NetState ns)
            : base(0x11)
        {
            string name = beheld.Name;
            if (name == null)
                name = "";

            bool sendMLExtended = (Core.ML && ns != null && ns.SupportsExpansion(Expansion.ML));

            this.EnsureCapacity(43 + (beholder == beheld ? (sendMLExtended ? 48 : 45) : 0));

            this.m_Stream.Write(beheld.Serial);

            this.m_Stream.WriteAsciiFixed(name, 30);

            if (beholder == beheld)
                this.WriteAttr(beheld.Hits, beheld.HitsMax);
            else
                this.WriteAttrNorm(beheld.Hits, beheld.HitsMax);

            this.m_Stream.Write(beheld.CanBeRenamedBy(beholder));

            if (beholder == beheld)
            {
                this.m_Stream.Write((byte)(sendMLExtended ? 0x05 : Core.AOS ? 0x04 : 0x03)); // type

                this.m_Stream.Write(beheld.Female);

                this.m_Stream.Write((short)beheld.Str);
                this.m_Stream.Write((short)beheld.Dex);
                this.m_Stream.Write((short)beheld.Int);

                this.WriteAttr(beheld.Stam, beheld.StamMax);
                this.WriteAttr(beheld.Mana, beheld.ManaMax);

                this.m_Stream.Write((int)beheld.TotalGold);
                this.m_Stream.Write((short)(Core.AOS ? beheld.PhysicalResistance : (int)(beheld.ArmorRating + 0.5)));
                this.m_Stream.Write((short)(Mobile.BodyWeight + beheld.TotalWeight));

                if (sendMLExtended)
                {
                    this.m_Stream.Write((short)beheld.MaxWeight);
                    this.m_Stream.Write((byte)(beheld.Race.RaceID + 1));	// Would be 0x00 if it's a non-ML enabled account but...
                }

                this.m_Stream.Write((short)beheld.StatCap);

                this.m_Stream.Write((byte)beheld.Followers);
                this.m_Stream.Write((byte)beheld.FollowersMax);

                if (Core.AOS)
                {
                    this.m_Stream.Write((short)beheld.FireResistance); // Fire
                    this.m_Stream.Write((short)beheld.ColdResistance); // Cold
                    this.m_Stream.Write((short)beheld.PoisonResistance); // Poison
                    this.m_Stream.Write((short)beheld.EnergyResistance); // Energy
                    this.m_Stream.Write((short)beheld.Luck); // Luck

                    IWeapon weapon = beheld.Weapon;

                    int min = 0, max = 0;

                    if (weapon != null)
                        weapon.GetStatusDamage(beheld, out min, out max);

                    this.m_Stream.Write((short)min); // Damage min
                    this.m_Stream.Write((short)max); // Damage max

                    this.m_Stream.Write((int)beheld.TithingPoints);
                }
            }
            else
            {
                this.m_Stream.Write((byte)0x00);
            }
        }
开发者ID:m309,项目名称:ForkUO,代码行数:76,代码来源:Packets.cs

示例10: Add

		public void Add( Mobile m )
		{
			PartyMemberInfo mi = this[m];

			if ( mi == null )
			{
				m_Members.Add( new PartyMemberInfo( m ) );
				m.Party = this;

				Packet memberList = Packet.Acquire( new PartyMemberList( this ) );
				Packet attrs = Packet.Acquire( new MobileAttributesN( m ) );

				for ( int i = 0; i < m_Members.Count; ++i )
				{
					Mobile f = ((PartyMemberInfo)m_Members[i]).Mobile;

					f.Send( memberList );

					if ( f != m )
					{
						f.Send( new MobileStatusCompact( m.CanBeRenamedBy( f ), m ) );
						f.Send( attrs );
						m.Send( new MobileStatusCompact( f.CanBeRenamedBy( m ), f ) );
						m.Send( new MobileAttributesN( f ) );
					}
				}

				Packet.Release( memberList );
				Packet.Release( attrs );
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:31,代码来源:Party.cs

示例11: MobileStatus

        public MobileStatus(Mobile beholder, Mobile beheld, NetState ns)
            : base(0x11)
        {
            string name = beheld.Name;
            if (name == null)
            {
                name = "";
            }

            int type;

            // bool isEnhancedClient = beholder.NetState != null && beholder.NetState.Version.IsEnhanced;

            if (beholder != beheld)
            {
                type = 0;
                EnsureCapacity(43);
            }
            //else if (isEnhancedClient)
            //{
            //type = 7;
            //EnsureCapacity(149);
            //}
            else if (Core.HS && ns != null && ns.ExtendedStatus)
            {
                type = 6;
                EnsureCapacity(121);
            }
            else if (Core.ML && ns != null && ns.SupportsExpansion(Expansion.ML))
            {
                type = 5;
                EnsureCapacity(91);
            }
            else
            {
                type = Core.AOS ? 4 : 3;
                EnsureCapacity(88);
            }

            m_Stream.Write(beheld.Serial);

            m_Stream.WriteAsciiFixed(name, 30);

            if (beholder == beheld)
            {
                WriteAttr(beheld.Hits, beheld.HitsMax);
            }
            else
            {
                WriteAttrNorm(beheld.Hits, beheld.HitsMax);
            }

            m_Stream.Write(beheld.CanBeRenamedBy(beholder));

            m_Stream.Write((byte)type);

            if (type > 0)
            {
                m_Stream.Write(beheld.Female);

                m_Stream.Write((short)beheld.Str);
                m_Stream.Write((short)beheld.Dex);
                m_Stream.Write((short)beheld.Int);

                WriteAttr(beheld.Stam, beheld.StamMax);
                WriteAttr(beheld.Mana, beheld.ManaMax);

                m_Stream.Write(beheld.TotalGold);
                m_Stream.Write((short)(Core.AOS ? beheld.PhysicalResistance : (int)(beheld.ArmorRating + 0.5)));
                m_Stream.Write((short)(Mobile.BodyWeight + beheld.TotalWeight));

                if (type >= 5)
                {
                    m_Stream.Write((short)beheld.MaxWeight);
                    m_Stream.Write((byte)(beheld.Race.RaceID + 1)); // Would be 0x00 if it's a non-ML enabled account but...
                }

                m_Stream.Write((short)beheld.StatCap);

                m_Stream.Write((byte)beheld.Followers);
                m_Stream.Write((byte)beheld.FollowersMax);

                if (type >= 4)
                {
                    m_Stream.Write((short)beheld.FireResistance); // Fire
                    m_Stream.Write((short)beheld.ColdResistance); // Cold
                    m_Stream.Write((short)beheld.PoisonResistance); // Poison
                    m_Stream.Write((short)beheld.EnergyResistance); // Energy
                    m_Stream.Write((short)beheld.Luck); // Luck

                    IWeapon weapon = beheld.Weapon;

                    int min = 0, max = 0;

                    if (weapon != null)
                    {
                        weapon.GetStatusDamage(beheld, out min, out max);
                    }

                    m_Stream.Write((short)min); // Damage min
//.........这里部分代码省略.........
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:101,代码来源:Packets.cs

示例12: MobileStatus

		public MobileStatus( Mobile beholder, Mobile beheld ) : base( 0x11 )
		{
			string name = beheld.Name;
			if ( name == null ) name = "";

			int type;

			if ( beholder != beheld )
			{
				type = 0;
				EnsureCapacity( 43 );
			}
			else
			{
				type = 3;
				EnsureCapacity( 88 );
			}

			m_Stream.Write( beheld.Serial );

			m_Stream.WriteAsciiFixed( name, 30 );

			if ( beholder == beheld )
				WriteAttr( beheld.Hits, beheld.HitsMax );
			else
				WriteAttrNorm( beheld.Hits, beheld.HitsMax );

			m_Stream.Write( beheld.CanBeRenamedBy( beholder ) );

			m_Stream.Write( (byte) type );

			if ( type > 0 )
			{
				m_Stream.Write( beheld.Female );

				m_Stream.Write( (short) beheld.Str );
				m_Stream.Write( (short) beheld.Dex );
				m_Stream.Write( (short) beheld.Int );

				WriteAttr( beheld.Stam, beheld.StamMax );
				WriteAttr( beheld.Mana, beheld.ManaMax );

				m_Stream.Write( (int) beheld.TotalGold );
				m_Stream.Write( (short) (int)(beheld.ArmorRating + 0.5) );
				m_Stream.Write( (short) (Mobile.BodyWeight + beheld.TotalWeight) );

				m_Stream.Write( (short) beheld.StatCap );

				m_Stream.Write( (byte) beheld.Followers );
				m_Stream.Write( (byte) beheld.FollowersMax );
			}
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:52,代码来源:Packets.cs

示例13: MobileStatusExtended

		public MobileStatusExtended( Mobile m ) : base( 0x11 )
		{
			string name = m.Name;
			if ( name == null ) name = "";

			EnsureCapacity( 88 );

			m_Stream.Write( (int) m.Serial );
			m_Stream.WriteAsciiFixed( name, 30 );

			m_Stream.Write( (short) m.Hits );
			m_Stream.Write( (short) m.HitsMax );

			m_Stream.Write( m.CanBeRenamedBy( m ) );

			m_Stream.Write( (byte) 3 ); // Expantions Type 

			m_Stream.Write( m.Female );

			m_Stream.Write( (short) m.Str );
			m_Stream.Write( (short) m.Dex );
			m_Stream.Write( (short) m.Int );

			m_Stream.Write( (short) m.Stam );
			m_Stream.Write( (short) m.StamMax );

			m_Stream.Write( (short) m.Mana );
			m_Stream.Write( (short) m.ManaMax );

			m_Stream.Write( (int) m.TotalGold );
			m_Stream.Write( (short) (int)(m.ArmorRating + 0.5) );
			m_Stream.Write( (short) (Mobile.BodyWeight + m.TotalWeight) );

			m_Stream.Write( (short) m.StatCap );

			m_Stream.Write( (byte) m.Followers );
			m_Stream.Write( (byte) m.FollowersMax );
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:38,代码来源:Packets.cs

示例14: MobileStatusExtended

        public MobileStatusExtended(Mobile m, NetState ns)
            : base(0x11)
        {
			string name = m.Name;
			if ( name == null ) name = "";

            bool sendMLExtended = (Core.ML && ns != null && ns.SupportsExpansion(Expansion.ML));

            this.EnsureCapacity(sendMLExtended ? 91 : 88);

			m_Stream.Write( (int) m.Serial );
			m_Stream.WriteAsciiFixed( name, 30 );

			m_Stream.Write( (short) m.Hits );
			m_Stream.Write( (short) m.HitsMax );

			m_Stream.Write( m.CanBeRenamedBy( m ) );

            m_Stream.Write((byte)(sendMLExtended ? 0x05 : Core.AOS ? 0x04 : 0x03)); // type

			m_Stream.Write( m.Female );

			m_Stream.Write( (short) m.Str );
			m_Stream.Write( (short) m.Dex );
			m_Stream.Write( (short) m.Int );

			m_Stream.Write( (short) m.Stam );
			m_Stream.Write( (short) m.StamMax );

			m_Stream.Write( (short) m.Mana );
			m_Stream.Write( (short) m.ManaMax );

            int totalGold = m.TotalGold;

            if (m.BankBox != null)
                totalGold += m.BankBox.TotalGold;

            m_Stream.Write(totalGold);
			m_Stream.Write( (short) (Core.AOS ? m.PhysicalResistance : (int)(m.ArmorRating + 0.5)) );
			m_Stream.Write( (short) (Mobile.BodyWeight + m.TotalWeight) );

            if (sendMLExtended)
			{
				m_Stream.Write( (short)m.MaxWeight );
				m_Stream.Write( (byte)(m.Race.RaceID + 1));	// Would be 0x00 if it's a non-ML enabled account but...
			}

			m_Stream.Write( (short) m.StatCap );

			m_Stream.Write( (byte) m.Followers );
			m_Stream.Write( (byte) m.FollowersMax );

			if ( Core.AOS )
			{
				m_Stream.Write( (short) m.FireResistance ); // Fire
				m_Stream.Write( (short) m.ColdResistance ); // Cold
				m_Stream.Write( (short) m.PoisonResistance ); // Poison
				m_Stream.Write( (short) m.EnergyResistance ); // Energy
				m_Stream.Write( (short) m.Luck ); // Luck

				IWeapon weapon = m.Weapon;

				int min = 0, max = 0;

				if ( weapon != null )
					weapon.GetStatusDamage( m, out min, out max );

				m_Stream.Write( (short) min ); // Damage min
				m_Stream.Write( (short) max ); // Damage max

				m_Stream.Write( (int) m.TithingPoints );
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:73,代码来源:Packets.cs

示例15: Add

        public void Add(Mobile m)
        {
            PartyMemberInfo mi = this[m];

            if (mi == null)
            {
                this.m_Members.Add(new PartyMemberInfo(m));
                m.Party = this;

                Packet memberList = Packet.Acquire(new PartyMemberList(this));
                Packet attrs = Packet.Acquire(new MobileAttributesN(m));

                for (int i = 0; i < this.m_Members.Count; ++i)
                {
                    Mobile f = ((PartyMemberInfo)this.m_Members[i]).Mobile;

                    f.Send(memberList);

                    if (f != m)
                    {
                        #region Enhance Client
                        f.Send(new MobileStatusCompact(m.CanBeRenamedBy(f), m));
                        f.Send(attrs);
                        f.Send(new KRDisplayWaypoint(m, WaypointType.PartyMember, false, 1062613, m.Name));
                        m.Send(new MobileStatusCompact(f.CanBeRenamedBy(m), f));
                        m.Send(new MobileAttributesN(f));
                        m.Send(new KRDisplayWaypoint(f, WaypointType.PartyMember, false, 1062613, f.Name));
                        /*
                        for (int i2 = 0; i2 < m_Members.Count; ++i2)
                        {
                            Mobile f2 = ((PartyMemberInfo)m_Members[i2]).Mobile;

                            if (f2.NetState != null && f2.NetState.IsKRClient)
                            {
                                f2.NetState.Send(new DisplayWaypoint(f.Serial, f.X, f.Y, f.Z, f.Map.MapID, WaypointType.PartyMember, f.Name));
                            }
                        }
                         */
                        #endregion
                    }
                }

                Packet.Release(memberList);
                Packet.Release(attrs);
            }
        }
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:46,代码来源:Party.cs


注:本文中的Mobile.CanBeRenamedBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。