Пример #1
0
		public Dragon()
			: base(AIType.AI_Dragon, FightMode.All | FightMode.Closest, 10, 1, 0.25, 0.5)
		{
			Name = "a dragon";
			Body = Female ? 12 : 59;
			BaseSoundID = 362;

			SetStr(675 + StrMax / 100, 754 + StrMax / 100);
			SetInt(370 + IntMax / 100, 434 + IntMax / 100);
			SetDex(73 + DexMax / 100, 96 + DexMax / 100);

			SetSkill(SkillName.EvalInt, 30.1, 40.0);
			SetSkill(SkillName.Magery, 30.1, 40.0);
			SetSkill(SkillName.MagicResist, 99.1, 100.0);
			SetSkill(SkillName.Tactics, 97.6, 100.0);
			SetSkill(SkillName.Wrestling, 90.1, 92.5);

			Fame = 15000;
			Karma = -15000;

			Tamable = true;
			ControlSlots = 3;
			MinTameSkill = 93.9;

			m_Maturity = DragonMaturity.Adult;
			m_GainFactor = 1.0;
		}
Пример #2
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);
			int version = reader.ReadInt();

			switch (version)
			{
				case 3:
					{
						m_Maturity = (DragonMaturity)reader.ReadInt();
						m_LastGrowth = reader.ReadDateTime();
						m_GainFactor = reader.ReadDouble();
						m_Hatchdate = reader.ReadDateTime();
						m_CheckedBody = reader.ReadDateTime();

						goto case 2;
					}
				case 2:
					{
						goto case 1;
					}
				case 1:
					{
						m_IntMax = reader.ReadInt();
						m_DexMax = reader.ReadInt();
						m_StrMax = reader.ReadInt();
						m_StatCapFactor = reader.ReadDouble();
						m_Hides = reader.ReadInt();
						m_Meat = reader.ReadInt();
						m_HitsMaxDiff = reader.ReadInt();

						goto case 0;
					}
				case 0:
					break;
			}

			if (version < 3)
			{
				m_Maturity = DragonMaturity.Adult;
				m_GainFactor = 1.0;
			}
			if (version < 2)
			{
				StatCapFactor = Utility.RandomDouble() * 0.05 + 1.975;
				StrMax = (int)(Utility.RandomDouble() * 150) + 1145;
				IntMax = (int)(Utility.RandomDouble() * 96) + 640;
				DexMax = (int)(Utility.RandomDouble() * 26) + 133;
			}
		}
Пример #3
0
		public void CheckGrow()
		{
			// sanity check
			if (BreedingParticipant == false)
				return;

			m_CheckedBody = DateTime.Now;

			if (Maturity == DragonMaturity.Ancient)
				return; // no work to do

			double weeks = (DateTime.Now - Hatchdate).TotalDays / 7;
			if (TestCenter.Enabled)
				weeks = (DateTime.Now - Hatchdate).TotalHours / 7;
			double stats = ((double)RawStr / StrMax + (double)RawInt / IntMax + (double)RawDex / DexMax) / StatCapFactor;

			// initialize with safe values
			DragonMaturity mat = DragonMaturity.Adult;
			int body = 0x3B;
			double gainfactor = 1.0;
			double statmult = 1.0; // THIS PERMANENTLY AFFECTS STATS - IF IN DOUBT, LEAVE ALONE
			int hue = 0;

			if (m_Maturity == DragonMaturity.Egg && m_Hatchdate <= DateTime.Now)
			{
				body = 0xCE;
				mat = DragonMaturity.Infant;
				gainfactor = 1.0;
				statmult = 0.4;
				hue = Female ? 1053 : 1138;
			}
			else if (m_Maturity == DragonMaturity.Infant && weeks * stats >= 1)
			{
				body = 0x31F;
				mat = DragonMaturity.Child;
				gainfactor = 1.5;
				statmult = 1.0;
				hue = Female ? 1053 : 1138;
			}
			else if (m_Maturity == DragonMaturity.Child && weeks * stats >= 3)
			{
				body = Female ? 0x3C : 0x3D;
				mat = DragonMaturity.Youth;
				gainfactor = 5.0;
				statmult = 1.0;
				hue = 0;
			}
			else if (m_Maturity == DragonMaturity.Youth && weeks * stats >= 5)
			{
				body = Female ? 0xC : 0x3B;
				mat = DragonMaturity.Adult;
				gainfactor = 1.0;
				statmult = 1.0;
				hue = 0;
			}
			else if (m_Maturity == DragonMaturity.Adult && weeks / stats >= 50)
			{
				body = 0x2E;
				mat = DragonMaturity.Ancient;
				gainfactor = 0.0;
				statmult = 0.6;
				hue = 0;
			}
			else
				return; // no change needed

			//if (IsStabled || Maturity == DragonMaturity.Egg)
			//{
			m_LastGrowth = DateTime.Now;

			Body = body;
			m_Maturity = mat;
			m_GainFactor = gainfactor;
			Hue = hue;

			RawStr = (int)((double)RawStr * statmult);
			RawInt = (int)((double)RawInt * statmult);
			RawDex = (int)((double)RawDex * statmult);
			//}
			//else
			//    PublicOverheadMessage(Server.Network.MessageType.Regular, 0, true, "*your pet seems tired*");
		}