예제 #1
0
		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
					m_Stream.Write((short)max); // Damage max

					m_Stream.Write(beheld.TithingPoints);
				}

				if (type >= 6)
				{
					for (int i = 0; i < 15; ++i)
					{
						m_Stream.Write((short)beheld.GetAosStatus(i));
					}

                    if (isEnhancedClient)
                    {
                        m_Stream.Write((short)beheld.AttackChance); // Hit Chance Increase
                        m_Stream.Write((short)beheld.WeaponSpeed); // Swing Speed Increase
                        m_Stream.Write((short)beheld.WeaponDamage); // Damage Increase
                        m_Stream.Write((short)beheld.LowerRegCost); // Lower Reagent Cost
                        m_Stream.Write((short)beheld.RegenHits); // Hit Points Regeneration
                        m_Stream.Write((short)beheld.RegenStam); // Stamina Regeneration
                        m_Stream.Write((short)beheld.RegenMana); // Mana Regeneration
                        m_Stream.Write((short)beheld.ReflectPhysical); // Reflect Physical Damage
                        m_Stream.Write((short)beheld.EnhancePotions); // Enhance Potions
                        m_Stream.Write((short)beheld.DefendChance); // Defense Chance Increase
                        m_Stream.Write((short)beheld.SpellDamage); // Spell Damage Increase
                        m_Stream.Write((short)beheld.CastRecovery); // Faster Cast Recovery
                        m_Stream.Write((short)beheld.CastSpeed); // Faster Casting
                        m_Stream.Write((short)beheld.LowerManaCost); // Lower Mana Cost
                        m_Stream.Write((short)beheld.BonusStr); // Strength Increase
                        m_Stream.Write((short)beheld.BonusDex); // Dexterity Increase
                        m_Stream.Write((short)beheld.BonusInt); // Intelligence Increase
                        m_Stream.Write((short)beheld.BonusHits); // Hit Points Increase
                        m_Stream.Write((short)beheld.BonusStam); // Stamina Increase
                        m_Stream.Write((short)beheld.BonusMana); // Mana Increase
                        m_Stream.Write((short)beheld.MaxHitIncrease); // Maximum Hit Points Increase
                        m_Stream.Write((short)beheld.MaxStamIncrease); // Maximum Stamina Increase
                        m_Stream.Write((short)beheld.MaxManaIncrease); // Maximum Mana Increase
                    }
				}
			}
		}
예제 #2
0
		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(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(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(m.TithingPoints);
			}

			if (type >= 6)
			{
				for (int i = 0; i < 15; ++i)
				{
					m_Stream.Write((short)m.GetAosStatus(i));
				}
			}
		}