Beispiel #1
0
		public BulkOrderBook() : base( 0x2259 )
		{
			Weight = 1.0;
			LootType = LootType.Blessed;

			m_Entries = new ArrayList();
			m_Filter = new BOBFilter();

			m_Level = SecureLevel.CoOwners;
		}
Beispiel #2
0
        public PlayerMobile()
        {
            m_AutoStabled = new List<Mobile>();

            m_VisList = new List<Mobile>();
            m_PermaFlags = new List<Mobile>();
            m_AntiMacroTable = new Hashtable();

            m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            m_GameTime = TimeSpan.Zero;
            m_ShortTermElapse = TimeSpan.FromHours(8.0);
            m_LongTermElapse = TimeSpan.FromHours(40.0);

            m_JusticeProtectors = new List<Mobile>();
            m_GuildRank = Guilds.RankDefinition.Lowest;

            m_ChampionTitles = new ChampionTitleInfo();

            InvalidateMyRunUO();
        }
Beispiel #3
0
        public bool CheckFilter(BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType)
        {
            BOBFilter f = (m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter);

            if (f.IsDefault)
            {
                return(true);
            }

            if (f.Quality == 1 && reqExc)
            {
                return(false);
            }
            else if (f.Quality == 2 && !reqExc)
            {
                return(false);
            }

            if (f.Quantity == 1 && amountMax != 10)
            {
                return(false);
            }
            else if (f.Quantity == 2 && amountMax != 15)
            {
                return(false);
            }
            else if (f.Quantity == 3 && amountMax != 20)
            {
                return(false);
            }

            if (f.Type == 1 && isLarge)
            {
                return(false);
            }
            else if (f.Type == 2 && !isLarge)
            {
                return(false);
            }

            if (BulkOrderSystem.NewSystemEnabled)
            {
                switch (f.Material)
                {
                default:
                case 0:
                    return(true);

                case 1:
                    return(deedType == BODType.Smith);

                case 2:
                    return(deedType == BODType.Tailor);

                case 3:
                    return(deedType == BODType.Tinkering);

                case 4:
                    return(deedType == BODType.Carpentry);

                case 5:
                    return(deedType == BODType.Fletching);

                case 6:
                    return(deedType == BODType.Alchemy);

                case 7:
                    return(deedType == BODType.Inscription);

                case 8:
                    return(deedType == BODType.Cooking);

                case 9:
                    return(mat == BulkMaterialType.None && deedType == BODType.Smith);

                case 10:
                    return(mat == BulkMaterialType.DullCopper && deedType == BODType.Smith);

                case 11:
                    return(mat == BulkMaterialType.ShadowIron && deedType == BODType.Smith);

                case 12:
                    return(mat == BulkMaterialType.Copper && deedType == BODType.Smith);

                case 13:
                    return(mat == BulkMaterialType.Bronze && deedType == BODType.Smith);

                case 14:
                    return(mat == BulkMaterialType.Gold && deedType == BODType.Smith);

                case 15:
                    return(mat == BulkMaterialType.Agapite && deedType == BODType.Smith);

                case 16:
                    return(mat == BulkMaterialType.Verite && deedType == BODType.Smith);

                case 17:
                    return(mat == BulkMaterialType.Valorite && deedType == BODType.Smith);

                case 18:
                    return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth);

                case 19:
                    return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 20:
                    return(mat == BulkMaterialType.Spined && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 21:
                    return(mat == BulkMaterialType.Horned && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 22:
                    return(mat == BulkMaterialType.Barbed && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 23:     // Tinkering
                    return(mat == BulkMaterialType.None && deedType == BODType.Tinkering);

                case 24:
                    return(mat == BulkMaterialType.DullCopper && deedType == BODType.Tinkering);

                case 25:
                    return(mat == BulkMaterialType.ShadowIron && deedType == BODType.Tinkering);

                case 26:
                    return(mat == BulkMaterialType.Copper && deedType == BODType.Tinkering);

                case 27:
                    return(mat == BulkMaterialType.Bronze && deedType == BODType.Tinkering);

                case 28:
                    return(mat == BulkMaterialType.Gold && deedType == BODType.Tinkering);

                case 29:
                    return(mat == BulkMaterialType.Agapite && deedType == BODType.Tinkering);

                case 30:
                    return(mat == BulkMaterialType.Verite && deedType == BODType.Tinkering);

                case 31:
                    return(mat == BulkMaterialType.Valorite && deedType == BODType.Tinkering);

                case 32:     // Carpentry
                    return(mat == BulkMaterialType.None && deedType == BODType.Carpentry);

                case 33:
                    return(mat == BulkMaterialType.OakWood && deedType == BODType.Carpentry);

                case 34:
                    return(mat == BulkMaterialType.AshWood && deedType == BODType.Carpentry);

                case 35:
                    return(mat == BulkMaterialType.YewWood && deedType == BODType.Carpentry);

                case 36:
                    return(mat == BulkMaterialType.Bloodwood && deedType == BODType.Carpentry);

                case 37:
                    return(mat == BulkMaterialType.Heartwood && deedType == BODType.Carpentry);

                case 38:
                    return(mat == BulkMaterialType.Frostwood && deedType == BODType.Carpentry);

                case 39:     // Fletching
                    return(mat == BulkMaterialType.None && deedType == BODType.Fletching);

                case 40:
                    return(mat == BulkMaterialType.OakWood && deedType == BODType.Fletching);

                case 41:
                    return(mat == BulkMaterialType.AshWood && deedType == BODType.Fletching);

                case 42:
                    return(mat == BulkMaterialType.YewWood && deedType == BODType.Fletching);

                case 43:
                    return(mat == BulkMaterialType.Bloodwood && deedType == BODType.Fletching);

                case 44:
                    return(mat == BulkMaterialType.Heartwood && deedType == BODType.Fletching);

                case 45:
                    return(mat == BulkMaterialType.Frostwood && deedType == BODType.Fletching);
                }
            }
            else
            {
                switch (f.Material)
                {
                default:
                case 0: return(true);

                case 1: return(deedType == BODType.Smith);

                case 2: return(deedType == BODType.Tailor);

                case 3: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Iron);

                case 4: return(mat == BulkMaterialType.DullCopper);

                case 5: return(mat == BulkMaterialType.ShadowIron);

                case 6: return(mat == BulkMaterialType.Copper);

                case 7: return(mat == BulkMaterialType.Bronze);

                case 8: return(mat == BulkMaterialType.Gold);

                case 9: return(mat == BulkMaterialType.Agapite);

                case 10: return(mat == BulkMaterialType.Verite);

                case 11: return(mat == BulkMaterialType.Valorite);

                case 12: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth);

                case 13: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 14: return(mat == BulkMaterialType.Spined);

                case 15: return(mat == BulkMaterialType.Horned);

                case 16: return(mat == BulkMaterialType.Barbed);
                }
            }
        }
Beispiel #4
0
        public bool CheckFilter(BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType)
        {
            BOBFilter f = (m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter);

            if (f.IsDefault)
            {
                return(true);
            }

            if (f.Quality == 1 && reqExc)
            {
                return(false);
            }
            else if (f.Quality == 2 && !reqExc)
            {
                return(false);
            }

            if (f.Quantity == 1 && amountMax != 10)
            {
                return(false);
            }
            else if (f.Quantity == 2 && amountMax != 15)
            {
                return(false);
            }
            else if (f.Quantity == 3 && amountMax != 20)
            {
                return(false);
            }

            if (f.Type == 1 && isLarge)
            {
                return(false);
            }
            else if (f.Type == 2 && !isLarge)
            {
                return(false);
            }

            switch (f.Material)
            {
            default:
            case 0:
                return(true);

            case 1:
                return(deedType == BODType.Smith);

            case 2:
                return(deedType == BODType.Tailor);

            case 3:
                return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Iron);

            case 4:
                return(mat == BulkMaterialType.DullCopper);

            case 5:
                return(mat == BulkMaterialType.ShadowIron);

            case 6:
                return(mat == BulkMaterialType.Copper);

            case 7:
                return(mat == BulkMaterialType.Bronze);

            case 8:
                return(mat == BulkMaterialType.Gold);

            case 9:
                return(mat == BulkMaterialType.Agapite);

            case 10:
                return(mat == BulkMaterialType.Verite);

            case 11:
                return(mat == BulkMaterialType.Valorite);

            case 12:
                return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth);

            case 13:
                return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

            case 14:
                return(mat == BulkMaterialType.Spined);

            case 15:
                return(mat == BulkMaterialType.Horned);

            case 16:
                return(mat == BulkMaterialType.Barbed);
            }
        }
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			//46+ (This should ALWAYS come just after the version!)
			if (version >= 46)
			{
				DeserializeSnapshot(reader);
			}

			if (LostStabledPetRecorder.Enabled)
			{
				LostStabledPetRecorder.PlayerMobiles.Add(this);
			}

			switch (version)
			{
                case 51:
                    {
                        HalloweenPaintExpirationOrange = reader.ReadTimeSpan();

                        if (HalloweenPaintExpirationOrange > TimeSpan.Zero)
                        {
                            BodyMod = (Female ? 184 : 183);
                            HueMod = 1358;
                        }

                        HalloweenPaintExpirationPurple = reader.ReadTimeSpan();

                        if (HalloweenPaintExpirationPurple > TimeSpan.Zero)
                        {
                            BodyMod = (Female ? 184 : 183);
                            HueMod = 1378;
                        }
                    }
                    goto case 50;
                case 50:
                    {
                        ZombiePaintExperationBooger = reader.ReadTimeSpan();

                        if (ZombiePaintExperationBooger > TimeSpan.Zero)
                        {
                            BodyMod = (Female ? 184 : 183);
                            HueMod = 61;
                        }

                        ZombiePaintExperationVesper = reader.ReadTimeSpan();

                        if (ZombiePaintExperationVesper > TimeSpan.Zero)
                        {
                            BodyMod = (Female ? 184 : 183);
                            HueMod = 1159;
                        }
                    }
                    goto case 49;
                case 49:
                    {
                        BattlePaintExpirationShadow = reader.ReadTimeSpan();

                        if (BattlePaintExpirationShadow > TimeSpan.Zero)
                        {
                            BodyMod = (Female ? 184 : 183);
                            HueMod = 1175;
                        }

                        BattlePaintExpirationRed = reader.ReadTimeSpan();

                        if (BattlePaintExpirationRed > TimeSpan.Zero)
                        {
                            BodyMod = (Female ? 184 : 183);
                            HueMod = 1157;
                        }
                    }
                    goto case 48;
                case 48:
			    {
			        NewbieQuestCompleted = reader.ReadBool();
			    }
                    goto case 47;
				case 47:
					{
						if (reader.ReadBool())
						{
							BodyValue = Race.Body(this);
						}
					}
					goto case 46;
				case 46:
				case 45:
					{
						EventMsgFlag = reader.ReadBool();
						EventPoints = reader.ReadInt();
					}
					goto case 44;
				case 44:
					{
						int titleCount = reader.ReadInt();

						if (titleCount > 0)
						{
							_ValorTitles = new List<string>();

							for (int i = 0; i < titleCount; i++)
							{
								string title = reader.ReadString();
								_ValorTitles.Add(title);
							}
						}
					}
					goto case 43;
				case 43:
					{
						Lastkilled = reader.ReadDateTime();
						goto case 42;
					}
				case 42:
					_ValorRating = reader.ReadInt();
					goto case 41;
				case 41:
					ValorQuests = reader.ReadInt();
					goto case 40;
				case 40:
					ValorTitle = reader.ReadString();
					goto case 39;
				case 39:
					ValorRank = reader.ReadInt();
					goto case 38;
				case 38:
					MurderersKilled = reader.ReadInt();
					goto case 37;
				case 37:
					ValorPoints = reader.ReadInt();
					goto case 36;
				case 36:
					LongTermLastDecayGameTime = reader.ReadTimeSpan();
					goto case 35;
				case 35:
					Companion = reader.ReadBool();
					goto case 34;
				case 34:
					{
						// don't check stat loss decay here, just on login
						GameParticipant = reader.ReadBool();
					}
					goto case 33;
				case 33:
					{
						// don't check stat loss decay here, just on login
						StatEnd = reader.ReadDateTime();
					}
					goto case 32;
				case 32:
					reader.ReadInt(); //m_InStat = reader.ReadInt(); 
					// TODO: Remove
					goto case 31;
				case 31:
					KMUsed = reader.ReadInt();
					goto case 30;
				case 30:
					MurderBounty = reader.ReadInt();
					goto case 29;
				case 29:
					{
						int skillgaincount = reader.ReadEncodedInt();

						for (int i = 0; i < skillgaincount; i++)
						{
							SkillGainMods.Add(new SkillGainMod(this, reader));
						}

						goto case 28;
					}
				case 28:
					PeacedUntil = reader.ReadDateTime();
					goto case 27;
				case 27:
					AnkhNextUse = reader.ReadDateTime();
					goto case 26;
				case 26:
					{
						AutoStabled = reader.ReadStrongMobileList();

						CustomFlags = (CustomPlayerFlag)reader.ReadEncodedInt();

						if (GetCustomFlag(CustomPlayerFlag.VisibilityList))
						{
							int length = reader.ReadInt();

							for (int i = 0; i < length; i++)
							{
								VisibilityList.Add(reader.ReadMobile());
							}
						}

						if (GetCustomFlag(CustomPlayerFlag.StaffLevel))
						{
							AccessLevelToggler.m_Mobiles.Add(this, new AccessLevelMod((AccessLevel)reader.ReadInt()));
						}

						if (GetCustomFlag(CustomPlayerFlag.StaffRank))
						{
							m_StaffRank = (StaffRank)reader.ReadInt();
						}

						if (GetCustomFlag(CustomPlayerFlag.DisplayStaffRank))
						{
							m_StaffTitle = reader.ReadString();
						}
					}
					goto case 25;
				case 25:
					{
						int recipeCount = reader.ReadInt();

						if (recipeCount > 0)
						{
							m_AcquiredRecipes = new Dictionary<int, bool>();

							for (int i = 0; i < recipeCount; i++)
							{
								int r = reader.ReadInt();

								//Don't add in recipies which we haven't gotten or have been removed
								if (reader.ReadBool())
								{
									m_AcquiredRecipes.Add(r, true);
								}
							}
						}
					}
					goto case 24;
				case 24:
					reader.ReadDeltaTime(); //m_LastHonorLoss = reader.ReadDeltaTime();
					// TODO: Remove
					goto case 23;
				case 23:
					ChampionTitles = new ChampionTitleInfo(reader);
					goto case 22;
				case 22:
					reader.ReadDateTime(); //m_LastValorLoss = reader.ReadDateTime();
					// TODO: Remove
					goto case 21;
				case 21:
					{
						ToTItemsTurnedIn = reader.ReadEncodedInt();
						ToTTotalMonsterFame = reader.ReadInt();
					}
					goto case 20;
				case 20:
					{
						AllianceMessageHue = reader.ReadEncodedInt();
						GuildMessageHue = reader.ReadEncodedInt();
					}
					goto case 19;
				case 19:
					{
						int rank = reader.ReadEncodedInt();
						int maxRank = RankDefinition.Ranks.Length - 1;

						if (rank > maxRank)
						{
							rank = maxRank;
						}

						m_GuildRank = RankDefinition.Ranks[rank];
						LastOnline = reader.ReadDateTime();
					}
					goto case 18;
				case 18:
					SolenFriendship = (SolenFriendship)reader.ReadEncodedInt();
					goto case 17;
				case 17: // changed how DoneQuests is serialized
				case 16:
					{
						Quest = QuestSerializer.DeserializeQuest(reader);

						if (Quest != null)
						{
							Quest.From = this;
						}

						int count = reader.ReadEncodedInt();

						DoneQuests = new List<QuestRestartInfo>(count);

						if (count > 0)
						{
							for (int i = 0; i < count; ++i)
							{
								Type questType = QuestSerializer.ReadType(QuestSystem.QuestTypes, reader);
								DateTime restartTime = version < 17 ? DateTime.MaxValue : reader.ReadDateTime();

								DoneQuests.Add(new QuestRestartInfo(questType, restartTime));
							}
						}

						Profession = reader.ReadEncodedInt();
					}
					goto case 15;
				case 15:
					reader.ReadDeltaTime(); //m_LastCompassionLoss = reader.ReadDeltaTime();
					// TODO: Remove
					goto case 14;
				case 14:
					{
						// TODO: Remove
						if (reader.ReadEncodedInt() > 0)
						{
							reader.ReadDeltaTime(); //m_NextCompassionDay = reader.ReadDeltaTime();
						}
					}
					goto case 13;
				case 13: // removed PaidInsurance list
				case 12:
					BOBFilter = new BOBFilter(reader);
					goto case 11;
				case 11:
					{
						if (version < 13)
						{
							List<Item> paid = reader.ReadStrongItemList();

							foreach (Item i in paid)
							{
								i.PaidInsurance = true;
							}
						}
					}
					goto case 10;
				case 10:
					{
						if (reader.ReadBool())
						{
							m_HairModID = reader.ReadInt();
							m_HairModHue = reader.ReadInt();
							m_BeardModID = reader.ReadInt();
							m_BeardModHue = reader.ReadInt();
						}
					}
					goto case 9;
				case 9:
					{
						SavagePaintExpiration = reader.ReadTimeSpan();

						if (SavagePaintExpiration > TimeSpan.Zero)
						{
							BodyMod = (Female ? 184 : 183);
							HueMod = 0;
						}
					}
					goto case 8;
				case 8:
					{
						NpcGuild = (NpcGuild)reader.ReadInt();
						NpcGuildJoinTime = reader.ReadDateTime();
						NpcGuildGameTime = reader.ReadTimeSpan();
					}
					goto case 7;
				case 7:
					m_PermaFlags = reader.ReadStrongMobileList();
					goto case 6;
				case 6:
					NextTailorBulkOrder = reader.ReadTimeSpan();
					goto case 5;
				case 5:
					NextSmithBulkOrder = reader.ReadTimeSpan();
					goto case 4;
				case 4:
				case 3:
				case 2:
					Flags = (PlayerFlag)reader.ReadInt();
					goto case 1;
				case 1:
					{
						m_ShortTermElapse = reader.ReadDateTime();
						m_GameTime = reader.ReadTimeSpan();
					}
					goto case 0;
				case 0:
					break;
			}

			if (RecentlyReported == null)
			{
				RecentlyReported = new List<Mobile>();
			}

			// Professions weren't verified on 1.0 RC0
			if (!CharacterCreation.VerifyProfession(Profession, Expansion))
			{
				Profession = 0;
			}

			if (m_PermaFlags == null)
			{
				m_PermaFlags = new List<Mobile>();
			}

			if (BOBFilter == null)
			{
				BOBFilter = new BOBFilter();
			}

			if (m_GuildRank == null)
			{
				//Default to member if going from older version to new version (only time it should be null)
				m_GuildRank = RankDefinition.Member;
			}

			if (LastOnline == DateTime.MinValue && Account != null)
			{
				LastOnline = ((Account)Account).LastLogin;
			}

			if (ChampionTitles == null)
			{
				ChampionTitles = new ChampionTitleInfo();
			}

			if (AccessLevel > AccessLevel.Player)
			{
				IgnoreMobiles = true;
			}

			List<Mobile> list = Stabled;

			foreach (BaseCreature bc in list.OfType<BaseCreature>())
			{
				bc.IsStabled = true; //Charge date set in BaseCreature
			}

			CheckAtrophies(this);

			if (Hidden) //Hiding is the only buff where it has an effect that's serialized.
			{
				AddBuff(new BuffInfo(BuffIcon.HidingAndOrStealth, 1075655));
			}
		}
		public PlayerMobile()
		{
			AllFollowers = new List<Mobile>();
			AutoStabled = new List<Mobile>();
			RecentlyReported = new List<Mobile>();
			SkillGainMods = new List<SkillGainMod>();
			m_VisList = new List<Mobile>();
			m_PermaFlags = new List<Mobile>();
			m_AntiMacroTable = new Hashtable();

			BOBFilter = new BOBFilter();

			ChampionTitles = new ChampionTitleInfo();

			Learning = (SkillName)(-1);
			LastHelped = DateTime.MinValue;
			StatEnd = DateTime.MinValue;

			EventMsgFlag = true;

			m_GameTime = TimeSpan.Zero;
			m_ShortTermElapse = DateTime.UtcNow + ShortTermDuration;
			LongTermLastDecayGameTime = TimeSpan.Zero;

			m_GuildRank = RankDefinition.Lowest;

            //InvalidateLegends();
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			switch ( version )
			{
                case 44:
			        {
			            AntiMacroGump = reader.ReadBool();
			            goto case 43;
			        }
                case 43:
                    {
                        ShowTipsOnLogin = reader.ReadBool();
                        goto case 42;
                    }
                case 42:
			        {
			            AllowMulti = reader.ReadBool();
			            goto case 41;
			        }
                case 41:
                    {
                        GameInfoGumpType = (GameInfoGumpType)reader.ReadInt();
                        goto case 40;
                    }
                case 40:
                    {
                        m_EventType = (EventType)reader.ReadByte();
                        m_CurrentEvent = reader.ReadItem() as BaseGame;
                        goto case 39;
                    }
                case 39:
			        {
			            TempCheck = reader.ReadBool();
			            goto case 38;
			        }
                case 38:
                    {
                        m_AutoStabled = reader.ReadStrongMobileList();
                        m_AnkhNextUse = reader.ReadDateTime();
                        m_PeacedUntil = reader.ReadDateTime();
                        goto case 37;
                    }
                case 37:
			        {
			            ShowArriveMsg = reader.ReadBool();
			            goto case 36;
			        }
                case 36:
                    {
                        m_Rating = reader.ReadInt();
                        m_TournamentRating = reader.ReadInt();
                        m_CurrentEvent = null;
                        goto case 35;
                    }
                case 35:
                    {
                        m_Snoopers = reader.ReadStrongMobileList();
                        goto case 34;
                    }
                case 34:
                    m_HasStartingSkillBoost = reader.ReadBool();
                    goto case 33;
                case 33:
			        {
			            m_OriginalHairHue = reader.ReadInt();
			            m_OriginalHairItemID = reader.ReadInt();
			            m_OriginalHue = reader.ReadInt();
			            m_HasCustomRace = reader.ReadBool();
			            goto case 32;
			        }
                case 32:
                    VirtualArmor = reader.ReadInt();
                    goto case 31;
                case 31:
                    m_PlayerGuildGameTime = reader.ReadTimeSpan();
                    goto case 30;
                case 30:
                    m_AlwaysMurderer = reader.ReadBool();
                    goto case 29;
                case 29:
                    m_Imported = reader.ReadBool();
                    goto case 28;
                case 28:
                    /*Item nullItem = reader.ReadItem();
                    goto case 27;*/
                case 27:
                    m_Stoned = reader.ReadBool();
                    goto case 26;
				case 26:
					UseUnicodeSpeech = reader.ReadBool();
					goto case 25;
				case 25:
				{
					int recipeCount = reader.ReadInt();

					if( recipeCount > 0 )
					{
						m_AcquiredRecipes = new Dictionary<int, bool>();

						for( int i = 0; i < recipeCount; i++ )
						{
							int r = reader.ReadInt();
							if( reader.ReadBool() )	//Don't add in recipies which we haven't gotten or have been removed
								m_AcquiredRecipes.Add( r, true );
						}
					}
					goto case 24;
				}
				case 24:
				{
					m_LastHonorLoss = reader.ReadDeltaTime();
					goto case 23;
				}
				case 23:
				{
					m_ChampionTitles = new ChampionTitleInfo( reader );
					goto case 22;
				}
				case 22:
				{
					m_LastValorLoss = reader.ReadDateTime();
					goto case 21;
				}
				case 21:
				{
					m_ToTItemsTurnedIn = reader.ReadEncodedInt();
					m_ToTTotalMonsterFame = reader.ReadInt();
					goto case 20;
				}
				case 20:
				{
					AllianceMessageHue = reader.ReadEncodedInt();
					GuildMessageHue = reader.ReadEncodedInt();

					goto case 19;
				}
				case 19:
				{
					int rank = reader.ReadEncodedInt();
					int maxRank = RankDefinition.Ranks.Length -1;
					if( rank > maxRank )
						rank = maxRank;

					m_GuildRank = RankDefinition.Ranks[rank];
					LastOnline = reader.ReadDateTime();
					goto case 18;
				}
				case 18:
				{
					m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt();

					goto case 17;
				}
				case 17: // changed how DoneQuests is serialized
				case 16:
				{
					m_Quest = QuestSerializer.DeserializeQuest( reader );

					if ( m_Quest != null )
						m_Quest.From = this;

					int count = reader.ReadEncodedInt();

					if ( count > 0 )
					{
						m_DoneQuests = new List<QuestRestartInfo>();

						for ( int i = 0; i < count; ++i )
						{
							Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
							DateTime restartTime;

							if ( version < 17 )
								restartTime = DateTime.MaxValue;
							else
								restartTime = reader.ReadDateTime();

							m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
						}
					}

					Profession = reader.ReadEncodedInt();
					goto case 15;
				}
				case 15:
				{
					m_LastCompassionLoss = reader.ReadDeltaTime();
					goto case 14;
				}
				case 14:
				{
					m_CompassionGains = reader.ReadEncodedInt();

					if ( m_CompassionGains > 0 )
						m_NextCompassionDay = reader.ReadDeltaTime();

					goto case 13;
				}
				case 13: // just removed m_PayedInsurance list
				case 12:
				{
					m_BOBFilter = new BOBFilter( reader );
					goto case 11;
				}
				case 11:
				{
					if ( version < 13 )
					{
						List<Item> payed = reader.ReadStrongItemList();

						for ( int i = 0; i < payed.Count; ++i )
							payed[i].PayedInsurance = true;
					}

					goto case 10;
				}
				case 10:
				{
					if ( reader.ReadBool() )
					{
						m_HairModID = reader.ReadInt();
						m_HairModHue = reader.ReadInt();
						m_BeardModID = reader.ReadInt();
						m_BeardModHue = reader.ReadInt();
					}

					goto case 9;
				}
				case 9:
				{
					SavagePaintExpiration = reader.ReadTimeSpan();

					if ( SavagePaintExpiration > TimeSpan.Zero )
					{
						BodyMod = ( Female ? 184 : 183 );
						HueMod = 0;
					}

					goto case 8;
				}
				case 8:
				{
					NpcGuild = (NpcGuild)reader.ReadInt();
					NpcGuildJoinTime = reader.ReadDateTime();
					NpcGuildGameTime = reader.ReadTimeSpan();
					goto case 7;
				}
				case 7:
				{
					m_PermaFlags = reader.ReadStrongMobileList();
					goto case 6;
				}
				case 6:
				{
					NextTailorBulkOrder = reader.ReadTimeSpan();
					goto case 5;
				}
				case 5:
				{
					NextSmithBulkOrder = reader.ReadTimeSpan();
					goto case 4;
				}
				case 4:
				{
					m_LastJusticeLoss = reader.ReadDeltaTime();
					m_JusticeProtectors = reader.ReadStrongMobileList();
					goto case 3;
				}
				case 3:
				{
					m_LastSacrificeGain = reader.ReadDeltaTime();
					m_LastSacrificeLoss = reader.ReadDeltaTime();
					m_AvailableResurrects = reader.ReadInt();
					goto case 2;
				}
				case 2:
				{
					m_Flags = (PlayerFlag)reader.ReadInt();
					goto case 1;
				}
				case 1:
				{
					m_LongTermElapse = reader.ReadTimeSpan();
					m_ShortTermElapse = reader.ReadTimeSpan();
					m_GameTime = reader.ReadTimeSpan();
					goto case 0;
				}
				case 0:
				{
                    if (version < 43)
                        ShowTipsOnLogin = true;

                    if (version < 38)
                        m_AutoStabled = new List<Mobile>();
					break;
				}
			}

			// Professions weren't verified on 1.0 RC0
			if ( !CharacterCreation.VerifyProfession( Profession ) )
				Profession = 0;

			if ( m_PermaFlags == null )
				m_PermaFlags = new List<Mobile>();

            if ( m_Snoopers == null)
                m_Snoopers = new List<Mobile>();

			if ( m_JusticeProtectors == null )
				m_JusticeProtectors = new List<Mobile>();

			if ( m_BOBFilter == null )
				m_BOBFilter = new BOBFilter();

			if( m_GuildRank == null )
				m_GuildRank = RankDefinition.Member;	//Default to member if going from older verstion to new version (only time it should be null)

			if( LastOnline == DateTime.MinValue && Account != null )
				LastOnline = ((Account)Account).LastLogin;

			if( m_ChampionTitles == null )
				m_ChampionTitles = new ChampionTitleInfo();

            if (AccessLevel > AccessLevel.Player)
                m_IgnoreMobiles = true;

			List<Mobile> list = Stabled;

			for ( int i = 0; i < list.Count; ++i )
			{
				BaseCreature bc = list[i] as BaseCreature;

				if ( bc != null )
					bc.IsStabled = true;
			}

			CheckAtrophies( this );


			if( Hidden )	//Hiding is the only buff where it has an effect that's serialized.
				AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) );
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			
			switch( version )
			{
/*				case 2:
					{
						Hallucinating = ( bool )reader.ReadBool();
						goto case 1;
					}*/
				case 1:
					{
						IsMarried = ( bool )reader.ReadBool();
						m_AllowGayMarriages = ( bool )reader.ReadBool();
						m_AllowCelestialMarriages = ( bool )reader.ReadBool();
						m_MarriageTime = reader.ReadDateTime();
						m_WifeLoc = reader.ReadPoint3D();
						m_HusbandLoc = reader.ReadPoint3D();
						m_MaritalStatus = ( MaritalStatus )reader.ReadInt();
						m_TypeOfMarriage = ( TypeOfMarriage )reader.ReadInt();
						m_FirstName = ( string )reader.ReadString();
						m_LastName = ( string )reader.ReadString();
						m_MaidenName = ( string )reader.ReadString();
						m_RankPoints = reader.ReadInt();
						
						/*GD13_HS_Start_5*/
						m_HuntMode = ( HuntMode )reader.ReadInt();
						m_HuntRank = ( HuntRank )reader.ReadInt();
						m_HuntReward = ( HuntReward )reader.ReadInt();
						m_Hunting = ( bool )reader.ReadBool();
						m_EasyKills = reader.ReadInt();
						m_HardKills = reader.ReadInt();
						m_ExtremeKills = reader.ReadInt();
						m_GodKills = reader.ReadInt();
						/*GD13_HS_End_5*/
						goto case 0;
					}
					
				case 0:
					{
						m_Class = ( PlayerClasses )reader.ReadInt();
						m_Race = ( PlayerRaces )reader.ReadInt();
						m_Tribe = ( PlayerTribes )reader.ReadInt();
						m_Rank = ( PlayerRanks )reader.ReadInt();
						m_RewardsClaimed = reader.ReadInt();
						m_Level = reader.ReadInt();
						m_SkillPts = reader.ReadInt();
						m_Experience = reader.ReadInt();
						m_Age = reader.ReadInt();
						m_NextLevelUp = reader.ReadInt();
						m_Updated = reader.ReadBool();
						m_Bioenginer = reader.ReadBool();
						NextSmithBulkOrder = reader.ReadTimeSpan();
						NextTailorBulkOrder = reader.ReadTimeSpan();
						//NextFletcherBulkOrder = reader.ReadTimeSpan();
						//NextCarpenterBulkOrder = reader.ReadTimeSpan();
						//NextTinkerBulkOrder = reader.ReadTimeSpan();
						//NextTamingBulkOrder = reader.ReadTimeSpan();
						m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
						//m_TinkBOBFilter = new Engines.BulkOrders.TinkBOBFilter( reader );
						//m_TamingBOBFilter = new Engines.BulkOrders.TamingBOBFilter( reader );
						m_Flags = (MyPlayerFlag)reader.ReadInt();
						break;
					}
			}
			
			if ( m_BOBFilter == null )
				m_BOBFilter = new Engines.BulkOrders.BOBFilter();
			
/*			if ( m_TinkBOBFilter == null )
				m_TinkBOBFilter = new Engines.BulkOrders.TinkBOBFilter();
			
			if ( m_TamingBOBFilter == null )
				m_TamingBOBFilter = new Engines.BulkOrders.TamingBOBFilter();*/
		}
        public PlayerMobile()
        {
            m_AllyList = new List<Mobile>();

            m_VisList = new List<Mobile>();
            m_PermaFlags = new List<Mobile>();
            m_AntiMacroTable = new Hashtable();

            m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            m_GameTime = TimeSpan.Zero;
            m_ShortTermElapse = TimeSpan.FromHours( 8.0 );
            m_LongTermElapse = TimeSpan.FromHours( 40.0 );

            m_JusticeProtectors = new List<Mobile>();
            m_GuildRank = Guilds.RankDefinition.Lowest;

            m_ChampionTitles = new ChampionTitleInfo();

            m_CrimesList = new Dictionary<Mobiles.Nation, int>();
            m_CrimesList.Add(Nation.Alyrian, 0);
            m_CrimesList.Add(Nation.Azhuran, 0);
            m_CrimesList.Add(Nation.Khemetar, 0);
            m_CrimesList.Add(Nation.Mhordul, 0);
            m_CrimesList.Add(Nation.Tyrean, 0);
            m_CrimesList.Add(Nation.Vhalurian, 0);
            m_CrimesList.Add(Nation.Imperial, 0);
            m_CrimesList.Add(Nation.Sovereign, 0);
            m_CrimesList.Add(Nation.Society, 0);
            m_CrimesList.Add(Nation.Insularii, 0);

            InvalidateMyRunUO();
        }
Beispiel #10
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 161:
                    this.NumberOfItemsCookedRecently = reader.ReadInt();
                    this.CookingXpLastAwardedOn = reader.ReadDateTime();
                    goto case 160;
                case 160:
                    this.lastSecondWind = reader.ReadDateTime();
                    goto case 159;
                case 159:
                    {
                        this.lastCharge = reader.ReadDateTime();
                        this.chargeCooldown = reader.ReadInt();
                        goto case 158;
                    }
                case 158: SmithTesting = reader.ReadBool(); goto case 157;
                case 157: m_ConsecratedItems = reader.ReadInt(); goto case 156;
                case 156: m_CanBeFaithful = reader.ReadBool();goto case 155;
                case 155: m_HCWound = reader.ReadDateTime(); goto case 154;
                case 154: m_Maimings = reader.ReadInt(); goto case 153;

                case 153:
                {
                        m_CustomAvatarID1 = reader.ReadInt();
                        m_CustomAvatarID2 = reader.ReadInt();
                        m_CustomAvatarID3 = reader.ReadInt();
                        m_IsHardcore = reader.ReadBool(); goto case 152;

                }

                case 152: GroupInfo.Deserialize(reader, Group); goto case 151;
                case 151: m_IsApprentice = reader.ReadBool(); goto case 150;
                case 150: m_AvatarID = reader.ReadInt(); goto case 149;
                case 149:
                case 148:
                case 147:
                case 146:
                case 145:
                case 144:
                {
                    Disguise.Deserialize( reader );
                    MyDisguises.Deserialize( reader );
                    goto case 143;
                }
                case 143: m_GemHarvesting = reader.ReadBool(); goto case 142;
                case 142:
                {
                    m_CanBeThief = reader.ReadBool();
                    m_LastCottonFlaxHarvest = reader.ReadDateTime();
                    goto case 141;
                }
                case 141:
                case 140: m_CraftingSpecialization = reader.ReadString(); goto case 139;
                case 139: m_Forging = reader.ReadBool(); goto case 138;
                case 138: m_ImperialGuard = reader.ReadBool(); goto case 137;
                case 137: m_ExtraCPRewards = reader.ReadInt(); goto case 136;
                case 136: m_EmptyBankBoxOn = reader.ReadDateTime(); goto case 135;
                case 135: m_OldMapChar = reader.ReadBool(); goto case 134;
                case 134:
                {
                    int guilds = reader.ReadInt();

                    for( int i = 0; i < guilds; i++ )
                    {
                        CustomGuildInfo guild = new CustomGuildInfo( reader );

                        if( guild != null && guild.GuildStone != null )
                            CustomGuilds.Add( guild.GuildStone, guild );
                    }

                    goto case 133;
                }
                case 133: m_ChosenDeity = (ChosenDeity)reader.ReadInt(); goto case 132;
                case 132: m_WikiConfig = reader.ReadString(); goto case 131;
                case 131:
                case 130:
                case 129:
                {
                    m_ReforgeLocation = reader.ReadPoint3D();
                    m_ReforgeMap = reader.ReadMap();
                    m_Reforging = reader.ReadBool();
                    m_ReforgesLeft = reader.ReadInt();
                    goto case 128;
                }
                case 128:
                case 127:
                {
                    m_Technique = reader.ReadString();
                    m_TechniqueLevel = reader.ReadInt();
                    m_MediumPieces = reader.ReadInt();
                    m_HeavyPieces = reader.ReadInt();
                    goto case 126;
                }
                case 126: m_VampSight = reader.ReadBool(); goto case 125;
                case 125: m_FreeForRP = reader.ReadBool(); goto case 124;
                case 124: m_VampSafety = reader.ReadBool(); goto case 123;
                case 123:
                {
                    m_LastTimeGhouled = reader.ReadDateTime();
                    m_YearOfDeath = reader.ReadInt();
                    m_MonthOfDeath = reader.ReadInt();
                    m_DayOfDeath = reader.ReadInt();
                    m_IsVampire = reader.ReadBool();
                    m_MaxBPs = reader.ReadInt();
                    m_BPs = reader.ReadInt();
                    m_AutoVampHeal = reader.ReadBool();

                    goto case 122;
                }
                case 122:
                case 121: m_LogMsgs = reader.ReadBool(); goto case 120;
                case 120: m_PureDodge = reader.ReadBool(); goto case 119;
                case 119: m_Tents = reader.ReadStrongItemList(); goto case 118;
                case 118: m_CraftContainer = (Container)reader.ReadItem(); goto case 117;
                case 117:
                case 116: m_SpellBook = (CustomSpellBook)reader.ReadItem(); goto case 115;
                case 115:
                case 114:
                {
                    CustomGuildInfo test = null;

                    if( version < 134 )
                        test = new CustomGuildInfo( reader );

                    goto case 113;
                }
                case 113:
                case 112:
                case 111:
                case 110:
                case 109:
                {
                    m_CurrentCommand = (SongList)reader.ReadInt();
                    goto case 108;
                }
                case 108:
                {
                    m_SpeedHack = reader.ReadBool();
                    goto case 107;
                }
                case 107:
                {
                    m_LogoutTime = reader.ReadDateTime();
                    goto case 106;
                }
                case 106:
                {
                    m_FakeAge = reader.ReadString();
                    m_FakeLooks = reader.ReadString();
                    goto case 105;
                }
                case 105:
                {
                    this.NameMod = reader.ReadString();
                    m_AutoPicking = reader.ReadBool();
                    goto case 104;
                }
                case 104: goto case 103;
                case 103:
                {
                    m_SmoothPicking = reader.ReadBool();
                    goto case 102;
                }
                case 102:
                {
                    m_HasStash = reader.ReadBool();
                    goto case 101;
                }
                case 101:
                {
                    m_FakeHair = reader.ReadInt();
                    m_FakeHairHue = reader.ReadInt();
                    m_FakeFacialHair = reader.ReadInt();
                    m_FakeFacialHairHue = reader.ReadInt();
                    m_FakeHue = reader.ReadInt();
                    m_FakeRPTitle = reader.ReadString();
                    m_FakeTitlePrefix = reader.ReadString();
                    goto case 100;
                }
                case 100: goto case 99;
                case 99: goto case 98;
                case 98: goto case 97;
                case 97: goto case 96;
                case 96:
                {
                    m_FixedRun = reader.ReadBool();
                    goto case 95;
                }
                case 95:
                {
                    m_LightPieces = reader.ReadInt();
                    goto case 94;
                }
                case 94:
                {
                    m_ArmourPieces = reader.ReadInt();
                    goto case 93;
                }
                case 93:
                {
                    m_LightPenalty = reader.ReadInt();
                    m_MediumPenalty = reader.ReadInt();
                    m_HeavyPenalty = reader.ReadInt();
                    goto case 92;
                }
                case 92: goto case 91;
                case 91:
                {
                    m_FixedRage = reader.ReadBool();
                    goto case 90;
                }

                case 90: goto case 89;
                case 89: goto case 88;
                case 88: goto case 87;
                case 87: goto case 86;

                case 86:
                {
                    m_FixedReflexes = reader.ReadBool();
                    goto case 85;
                }
                case 85:
                {
                    m_FixedStyles = reader.ReadBool();
                    goto case 84;
                }
                case 84:
                {
                    m_NextMending = reader.ReadDateTime();
                    goto case 83;
                }
                case 83:
                {
                    m_FixedStatPoints = reader.ReadBool();
                    goto case 82;
                }
                case 82:
                {
                    m_XPFromCrafting = reader.ReadBool();
                    m_XPFromKilling = reader.ReadBool();
                    goto case 81;
                }
                case 81:
                {
                    m_HarvestedCrops = reader.ReadInt();
                    m_NextHarvestAllowed = reader.ReadDateTime();
                    goto case 80;
                }
                case 80:
                {
                    m_Spar = reader.ReadBool();
                    goto case 79;
                }
                case 79:
                {
                    m_HideStatus = reader.ReadBool();
                    goto case 78;
                }
                case 78:
                {
                    m_DayOfBirth = reader.ReadString();
                    m_MonthOfBirth = reader.ReadString();
                    m_YearOfBirth = reader.ReadString();
                    goto case 77;
                }
                case 77:
                {
                    m_AlyrianGuard = reader.ReadBool();
                    m_AzhuranGuard = reader.ReadBool();
                    m_KhemetarGuard = reader.ReadBool();
                    m_MhordulGuard = reader.ReadBool();
                    m_TyreanGuard = reader.ReadBool();
                    m_VhalurianGuard = reader.ReadBool();
                    goto case 76;
                }
                case 76:
                {
                    m_HearAll = reader.ReadInt();
                    goto case 75;
                }
                case 75:
                {
                    m_Friendship = new Friendship( reader );
                    goto case 74;
                }
                case 74:
                {
                    m_CPCapOffset = reader.ReadInt();
                    m_CPSpent = reader.ReadInt();
                    goto case 73;
                }
                case 73:
                {
                    m_Description2 = reader.ReadString();
                    m_Description3 = reader.ReadString();
                    goto case 72;
                }
                case 72:
                {
                    m_NextBirthday = reader.ReadDateTime();
                    m_MaxAge = reader.ReadInt();
                    goto case 71;
                }
                case 71:
                {
                    m_Age = reader.ReadInt();
                    goto case 70;
                }
                case 70:
                {
                    m_LoggedOutPets = reader.ReadStrongMobileList();
                    goto case 69;
                }
                case 69:
                {
                    m_RecreateXP = reader.ReadInt();
                    m_RecreateCP = reader.ReadInt();
                    goto case 68;
                }
                case 68:
                {
                    m_LastOffenseToNature = reader.ReadDateTime();
                    goto case 66;
                }

                case 66:
                {
                    Mobile mob = null;

                    if( version < 92 )
                        mob = reader.ReadMobile();

                    goto case 65;
                }

                case 65:
                {
                    m_LastDonationLife = reader.ReadDateTime();
                    goto case 64;
                }

                case 64:
                {
                    m_Lives = reader.ReadInt();
                    goto case 63;
                }

                case 63:
                {
                    m_AllyList = reader.ReadStrongMobileList();
                    goto case 62;
                }

                case 62:
                {
                    m_Height = reader.ReadInt();
                    m_Weight = reader.ReadInt();
                    goto case 61;
                }

                case 61:
                {
                    m_NextAllowance = reader.ReadDateTime();
                    goto case 60;
                }

                case 60:
                {
                    m_Backgrounds = new Backgrounds( reader );
                    goto case 59;
                }

                case 59:
                {
                    m_Description = reader.ReadString();
                    goto case 58;
                }

                case 58:
                {
                    m_Masterwork = new Masterwork( reader );
                    goto case 57;
                }

                case 57:
                {
                    m_RacialResources = new RacialResources( reader );
                    goto case 56;
                }

                case 56:
                {
                    m_KnownLanguages = new KnownLanguages( reader );
                    goto case 55;
                }

                case 55:
                {
                    m_SpokenLanguage = (KnownLanguage)reader.ReadInt();
                    goto case 54;
                }

                case 54:
                {
                    m_RPTitle = reader.ReadString();
                    m_TitlePrefix = reader.ReadString();
                    goto case 53;
                }

                case 53:
                {
                    m_FocusedShot = reader.ReadInt();
                    m_SwiftShot = reader.ReadInt();
                    goto case 52;
                }

                case 52:
                {
                    m_WeaponSpecialization = reader.ReadString();
                    m_SecondSpecialization = reader.ReadString();
                    goto case 51;
                }

                case 51:
                {
                    m_CombatStyles = new CombatStyles( reader );
                    m_SearingBreath = reader.ReadInt();
                    m_SwipingClaws = reader.ReadInt();
                    m_TempestuousSea = reader.ReadInt();
                    m_SilentHowl = reader.ReadInt();
                    m_ThunderingHooves = reader.ReadInt();
                    m_VenomousWay = reader.ReadInt();
                    goto case 50;
                }

                case 50:
                {
                    m_RageHits = reader.ReadInt();
                    m_RageFeatLevel = reader.ReadInt();
                    goto case 49;
                }

                case 49:
                {
                    int test = reader.ReadInt();
                    goto case 48;
                }

                case 48:
                {
                    m_LastChargeStep = reader.ReadDateTime();
                    goto case 47;
                }

                case 47:
                {
                    m_FormerDirection = (Direction)reader.ReadInt();
                    m_ChargeSteps = reader.ReadInt();
                    goto case 46;
                }

                case 46:
                {
                   m_Trample = reader.ReadBool();
                   goto case 45;
                }

                case 45:
                {
                    m_FlurryOfBlows = reader.ReadInt();
                    goto case 44;
                }

                case 44:
                {
                    m_FocusedAttack = reader.ReadInt();
                    m_FightingStance = (FeatList)reader.ReadInt();
                    goto case 43;
                }

                case 43:
                {
                    m_Intimidated = reader.ReadInt();
                    goto case 42;
                }

                case 42:
                {
                    m_HasHuntingHoundBonus = reader.ReadBool();
                    goto case 41;
                }

                case 41:
                {
                    m_HuntingHound = reader.ReadMobile();
                    m_FreeToUse = reader.ReadBool();
                    goto case 40;
                }

                case 40:
                {
                    m_Informants = new Informants( reader );
                    goto case 39;
                }

                case 39:
                {
                    m_EscortPrisoner = reader.ReadMobile();
                    goto case 38;
                }

                case 38:
                {
                    m_CanBeReplaced = reader.ReadBool();
                    goto case 37;
                }

                case 37:
                {
                    m_BackToBack = reader.ReadBool();
                    goto case 36;
                }

                case 36:
                {
                    m_Crippled = reader.ReadBool();
                    goto case 35;
                }

                case 35:
                {
                    m_CleaveAttack = reader.ReadBool();
                    goto case 34;
                }

                case 34: goto case 33;

                case 33:
                {
                    goto case 32;
                }

                case 32:
                {
                    m_SpecialAttack = (FeatList)reader.ReadInt();
                    m_OffensiveFeat = (FeatList)reader.ReadInt();
                    goto case 31;
                }

                case 31:
                {
                    m_Feats = new Feats( reader );
                    goto case 30;
                }

                case 30:
                {
                    m_Subclass = (Subclass)reader.ReadInt();
                    m_Advanced = (Advanced)reader.ReadInt();
                    goto case 29;
                }
                case 29:
                {
                    m_CanBeMage = reader.ReadBool();
                    goto case 28;
                }

                case 28:
                {
                    m_Level = reader.ReadInt();
                    m_XP = reader.ReadInt();
                    m_NextLevel = reader.ReadInt();
                    m_CP = reader.ReadInt();
                    goto case 27;
                }

                case 27:
                {
                    m_StatPoints = reader.ReadInt();
                    m_SkillPoints = reader.ReadInt();
                    m_FeatSlots = reader.ReadInt();
                    goto case 26;
                }
                case 26:
                {
                    m_Class = (Class)reader.ReadInt();
                    m_Nation = (Nation)reader.ReadInt();
                    goto case 25;
                }
                case 25:
                {
                    int recipeCount = reader.ReadInt();

                    if( recipeCount > 0 )
                    {
                        m_AcquiredRecipes = new Dictionary<int, bool>();

                        for( int i = 0; i < recipeCount; i++ )
                        {
                            int r = reader.ReadInt();
                            if( reader.ReadBool() )	//Don't add in recipies which we haven't gotten or have been removed
                                m_AcquiredRecipes.Add( r, true );
                        }
                    }
                    goto case 24;
                }
                case 24:
                {
                    m_LastHonorLoss = reader.ReadDeltaTime();
                    goto case 23;
                }
                case 23:
                {
                    m_ChampionTitles = new ChampionTitleInfo( reader );
                    goto case 22;
                }
                case 22:
                {
                    m_LastValorLoss = reader.ReadDateTime();
                    goto case 21;
                }
                case 21:
                {
                    m_ToTItemsTurnedIn = reader.ReadEncodedInt();
                    m_ToTTotalMonsterFame = reader.ReadInt();
                    goto case 20;
                }
                case 20:
                {
                    m_AllianceMessageHue = reader.ReadEncodedInt();
                    m_GuildMessageHue = reader.ReadEncodedInt();

                    goto case 19;
                }
                case 19:
                {
                    int rank = reader.ReadEncodedInt();
                    int maxRank = Guilds.RankDefinition.Ranks.Length -1;
                    if( rank > maxRank )
                        rank = maxRank;

                    m_GuildRank = Guilds.RankDefinition.Ranks[rank];
                    m_LastOnline = reader.ReadDateTime();
                    goto case 18;
                }
                case 18:
                {
                    m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt();

                    goto case 17;
                }
                case 17: // changed how DoneQuests is serialized
                case 16:
                {
                    m_Quest = QuestSerializer.DeserializeQuest( reader );

                    if ( m_Quest != null )
                        m_Quest.From = this;

                    int count = reader.ReadEncodedInt();

                    if ( count > 0 )
                    {
                        m_DoneQuests = new List<QuestRestartInfo>();

                        for ( int i = 0; i < count; ++i )
                        {
                            Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
                            DateTime restartTime;

                            if ( version < 17 )
                                restartTime = DateTime.MaxValue;
                            else
                                restartTime = reader.ReadDateTime();

                            m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
                        }
                    }

                    m_Profession = reader.ReadEncodedInt();
                    goto case 15;
                }
                case 15:
                {
                    m_LastCompassionLoss = reader.ReadDeltaTime();
                    goto case 14;
                }
                case 14:
                {
                    m_CompassionGains = reader.ReadEncodedInt();

                    if ( m_CompassionGains > 0 )
                        m_NextCompassionDay = reader.ReadDeltaTime();

                    goto case 13;
                }
                case 13: // just removed m_PayedInsurance list
                case 12:
                {
                    m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
                    goto case 11;
                }
                case 11:
                {
                    if ( version < 13 )
                    {
                        List<Item> payed = reader.ReadStrongItemList();

                        for ( int i = 0; i < payed.Count; ++i )
                            payed[i].PayedInsurance = true;
                    }

                    goto case 10;
                }
                case 10:
                {
                    if ( reader.ReadBool() )
                    {
                        m_HairModID = reader.ReadInt();
                        m_HairModHue = reader.ReadInt();
                        m_BeardModID = reader.ReadInt();
                        m_BeardModHue = reader.ReadInt();

                        // We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
                        Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RevertHair ) );
                    }

                    goto case 9;
                }
                case 9:
                {
                    SavagePaintExpiration = reader.ReadTimeSpan();

                    if ( SavagePaintExpiration > TimeSpan.Zero )
                    {
                        BodyMod = ( Female ? 184 : 183 );
                        HueMod = 0;
                    }

                    goto case 8;
                }
                case 8:
                {
                    m_NpcGuild = (NpcGuild)reader.ReadInt();
                    m_NpcGuildJoinTime = reader.ReadDateTime();
                    m_NpcGuildGameTime = reader.ReadTimeSpan();
                    goto case 7;
                }
                case 7:
                {
                    m_PermaFlags = reader.ReadStrongMobileList();
                    goto case 6;
                }
                case 6:
                {
                    NextTailorBulkOrder = reader.ReadTimeSpan();
                    goto case 5;
                }
                case 5:
                {
                    NextSmithBulkOrder = reader.ReadTimeSpan();
                    goto case 4;
                }
                case 4:
                {
                    m_LastJusticeLoss = reader.ReadDeltaTime();
                    m_JusticeProtectors = reader.ReadStrongMobileList();
                    goto case 3;
                }
                case 3:
                {
                    m_LastSacrificeGain = reader.ReadDeltaTime();
                    m_LastSacrificeLoss = reader.ReadDeltaTime();
                    m_AvailableResurrects = reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Flags = (PlayerFlag)reader.ReadInt();
                    goto case 1;
                }
                case 1:
                {
                    m_LongTermElapse = reader.ReadTimeSpan();
                    m_ShortTermElapse = reader.ReadTimeSpan();
                    m_GameTime = reader.ReadTimeSpan();

                    if (version < 147) m_Crimes = reader.ReadInt();
                    //CrimesList
                    if (version < 148)
                    {
                        m_CrimesList = new Dictionary<Mobiles.Nation, int>();
                        m_CrimesList.Add(Nation.Alyrian, 0);
                        m_CrimesList.Add(Nation.Azhuran, 0);
                        m_CrimesList.Add(Nation.Khemetar, 0);
                        m_CrimesList.Add(Nation.Mhordul, 0);
                        m_CrimesList.Add(Nation.Tyrean, 0);
                        m_CrimesList.Add(Nation.Vhalurian, 0);
                        m_CrimesList.Add(Nation.Imperial, 0);
                        m_CrimesList.Add(Nation.Sovereign, 0);
                        m_CrimesList.Add(Nation.Society, 0);

                        int count = reader.ReadInt();
                        for (int i = 0; i < count; i++)
                        {
                            Nation n = (Nation)reader.ReadInt();
                            int c = reader.ReadInt();
                            //m_CrimesList.Add(n, c);
                        }
                    }
                    else
                    {
                        m_CrimesList = new Dictionary<Mobiles.Nation, int>();
                        int count = reader.ReadInt();
                        for (int i = 0; i < count; i++)
                        {
                            Nation n = (Nation)reader.ReadInt();
                            int c = reader.ReadInt();
                            m_CrimesList.Add(n, c);
                        }
                    }

                    m_NextCriminalAct = reader.ReadDateTime();
                    m_CriminalActivity = reader.ReadBool();
                    m_Disguised = reader.ReadBool();
                    m_LastDisguiseTime = reader.ReadDateTime();

                    if (version < 149)
                    {
                        m_LastDeath = DateTime.Now - TimeSpan.FromDays(1);
                    }
                    else
                        m_LastDeath = reader.ReadDateTime();

                    goto case 0;
                }
                case 0:
                {
                    break;
                }
            }

            if (m_AvatarID == 0)
            m_AvatarID = 1076;

            //m_CrimesList.Add(Nation.Insularii, 0);

            if (m_CustomAvatarID1 == 0)
            m_CustomAvatarID1 = 1076;

            if (m_CustomAvatarID2 == 0)
            m_CustomAvatarID2 = 1076;

            if (m_CustomAvatarID3 == 0)
            m_CustomAvatarID3 = 1076;

            // Professions weren't verified on 1.0 RC0
            if ( !CharacterCreation.VerifyProfession( m_Profession ) )
                m_Profession = 0;

            if ( m_PermaFlags == null )
                m_PermaFlags = new List<Mobile>();

            if ( m_JusticeProtectors == null )
                m_JusticeProtectors = new List<Mobile>();

            if ( m_BOBFilter == null )
                m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            if( m_GuildRank == null )
                m_GuildRank = Guilds.RankDefinition.Member;	//Default to member if going from older verstion to new version (only time it should be null)

            if( m_LastOnline == DateTime.MinValue && Account != null )
                m_LastOnline = ((Account)Account).LastLogin;

            if( m_ChampionTitles == null )
                m_ChampionTitles = new ChampionTitleInfo();

            List<Mobile> list = this.Stabled;

            for ( int i = 0; i < list.Count; ++i )
            {
                BaseCreature bc = list[i] as BaseCreature;

                if ( bc != null )
                    bc.IsStabled = true;
            }

            CheckAtrophies( this );

            /*if( Hidden )	//Hiding is the only buff where it has an effect that's serialized.
                AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) );*/

            if( this.Lives >= 0 && !this.Alive && this.Corpse != null )
                this.SendGump( new DeathGump( this, 15, this.Corpse ) );

            if( this.Backpack is ArmourBackpack )
            {
                ArmourBackpack pack = this.Backpack as ArmourBackpack;
                pack.Attributes.NightSight = 0;
            }

            if( version < 135 && AccessLevel < AccessLevel.GameMaster )
                OldMapChar = true;

            if( version < 141 )
            {
                FixSkillCost( FeatInfo.FeatCost.High, FeatInfo.FeatCost.Medium, Feats.GetFeatLevel(FeatList.Magery) );
                FixSkillCost( FeatInfo.FeatCost.High, FeatInfo.FeatCost.Low, Feats.GetFeatLevel(FeatList.Concentration) );
            }

            if( version < 145 )
            {
                m_TitlePrefix = null;
                m_RPTitle = "the Alyrian";

                if( m_Nation == Nation.Alyrian )
                    m_RPTitle = "the Alyrian";
                else if( m_Nation == Nation.Azhuran )
                    m_RPTitle = "the Azhuran";
                else if( m_Nation == Nation.Khemetar )
                    m_RPTitle = "the Khemetar";
                else if( m_Nation == Nation.Mhordul )
                    m_RPTitle = "the Mhordul";
                else if( m_Nation == Nation.Tyrean )
                    m_RPTitle = "the Tyrean";
                else if( m_Nation == Nation.Vhalurian )
                    m_RPTitle = "the Vhalurian";
            }

            m_Intimidated = 0;

            #region Removing Healing and HairStyling as feats and returning to players their CP
            if (Feats.GetFeatLevel(FeatList.Healing) == 3)
            {
                Feats.FeatDictionary[FeatList.Healing].AttemptRemoval(this, 3, true);
            }
            if (Feats.GetFeatLevel(FeatList.Healing) == 2)
            {
                Feats.FeatDictionary[FeatList.Healing].AttemptRemoval(this, 2, true);
            }
            if (Feats.GetFeatLevel(FeatList.Healing) == 1)
            {
                Feats.FeatDictionary[FeatList.Healing].AttemptRemoval(this, 1, true);
            }
            if (Feats.GetFeatLevel(FeatList.HairStyling) == 3)
            {
                Feats.FeatDictionary[FeatList.HairStyling].AttemptRemoval(this, 3, true);
            }
            if (Feats.GetFeatLevel(FeatList.HairStyling) == 2)
            {
                Feats.FeatDictionary[FeatList.HairStyling].AttemptRemoval(this, 2, true);
            }
            if (Feats.GetFeatLevel(FeatList.HairStyling) == 1)
            {
                Feats.FeatDictionary[FeatList.HairStyling].AttemptRemoval(this, 1, true);
            }
            #endregion

            m_Deserialized = true;
        }
        public PlayerMobile()
        {
            m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            m_GameTime = TimeSpan.Zero;
            m_ShortTermElapse = TimeSpan.FromHours( 8.0 );
            m_LongTermElapse = TimeSpan.FromHours( 40.0 );

            InvalidateMyRunUO();
        }
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();

            switch ( version )
            {
                case 36:
                {
                    m_PeacedUntil = reader.ReadDateTime();

                    goto case 35;
                }
                case 35:
                {
                    m_AnkhNextUse = reader.ReadDateTime();

                    goto case 34;
                }
                case 34:
                {
                    m_AutoStabled = reader.ReadStrongMobileList();

                    m_CustomFlags = (CustomPlayerFlag)reader.ReadEncodedInt();

                    if ( GetCustomFlag( CustomPlayerFlag.VisibilityList ) )
                    {
                        int length = reader.ReadInt();
                        for( int i = 0; i < length; i++ )
                            VisibilityList.Add( reader.ReadMobile() );
                    }

                    if ( GetCustomFlag( CustomPlayerFlag.StaffLevel ) )
                        AccessLevelToggler.m_Mobiles.Add( this, new AccessLevelMod( (AccessLevel)reader.ReadInt() ) );

                    if ( GetCustomFlag( CustomPlayerFlag.StaffRank ) )
                        m_StaffRank = (StaffRank)reader.ReadInt();

                    if ( GetCustomFlag( CustomPlayerFlag.DisplayStaffRank ) )
                        m_StaffTitle = reader.ReadString();

                    goto case 33;
                }
                case 33: // Added by Blady for Sphynx
                {
                    m_FortuneType = reader.ReadEncodedInt();
                    if ( m_FortuneType > 0 )
                    {
                        m_FortunePower = reader.ReadEncodedInt();
                        FortuneExpire = reader.ReadDateTime();
                        if ( FortuneExpire > DateTime.Now )
                        {
                            ApplyFortune( m_FortuneType, m_FortunePower );
                            FortuneGump.Told.Add( this );
                        }
                        else
                            m_FortuneType = m_FortunePower = 0;
                    }

                    goto case 32;
                }
                case 32: //PowerHour added by Blady
                {
                    m_PowerHourStart = reader.ReadDeltaTime();
                    goto case 31;
                }
                //*** Edit by Sunny ***\\
                case 31:
                case 30:
                {
                    m_OSIHouseLoading = reader.ReadBool();
                    goto case 29;
                }
                //*** End edit ***\\

                case 29:
                {
                    int recipeCount = reader.ReadInt();

                    if ( recipeCount > 0 )
                    {
                        m_AcquiredRecipes = new Dictionary<int, bool>();

                        for (int i = 0; i < recipeCount; i++)
                        {
                            int r = reader.ReadInt();
                            if (reader.ReadBool())	//Don't add in recipies which we haven't gotten or have been removed
                                m_AcquiredRecipes.Add(r, true);
                        }
                    }
                    goto case 28;
                }
                case 28:
                {
                    m_LastHonorLoss = reader.ReadDeltaTime();
                    goto case 27;
                }
                case 27:
                {
                    m_ChampionTitles = new ChampionTitleInfo(reader);
                    goto case 26;
                }
                case 26:
                {
                    m_LastValorLoss = reader.ReadDateTime();
                    goto case 25;
                }
                case 25:
                {
                    m_ToTItemsTurnedIn = reader.ReadEncodedInt();
                    m_ToTTotalMonsterFame = reader.ReadInt();
                    goto case 24;
                }
                case 24:
                {
                    m_AllianceMessageHue = reader.ReadEncodedInt();
                    m_GuildMessageHue = reader.ReadEncodedInt();

                    goto case 23;
                }
                case 23:
                {
                    int rank = reader.ReadEncodedInt();
                    int maxRank = Guilds.RankDefinition.Ranks.Length - 1;
                    if (rank > maxRank)
                        rank = maxRank;

                    m_GuildRank = Guilds.RankDefinition.Ranks[rank];
                    m_LastOnline = reader.ReadDateTime();
                    goto case 22;
                }
                case 22:
                {
                    if (version < 31)
                        reader.ReadInt();
                    goto case 21;
                }
                // *** Added for Hunting Contracts ***
                case 21:
                {
                    m_NextHuntContract = reader.ReadDateTime();
                    goto case 20;
                }
                // *** ***
                // *** Added for Honor ***
                case 20:
                {
                    if (version < 29)
                    {
                        double m_HonorGain = reader.ReadDouble();
                        DateTime m_LastHonorLoss = reader.ReadDateTime();
                        DateTime m_LastEmbrace = reader.ReadDateTime();
                    }
                    goto case 19;
                }
                // *** ***
                // *** Added for Valor ***
                case 19:
                {
                    if (version < 29)
                    {
                        double m_ValorGain = reader.ReadDouble();
                        DateTime m_LastValorLoss = reader.ReadDeltaTime();
                    }
                    goto case 18;
                }
                // *** ***
                case 18:
                {
                    m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt();

                    goto case 17;
                }
                case 17: // changed how DoneQuests is serialized
                case 16:
                {
                    m_Quest = QuestSerializer.DeserializeQuest( reader );

                    if ( m_Quest != null )
                        m_Quest.From = this;

                    int count = reader.ReadEncodedInt();

                    if ( count > 0 )
                    {
                        m_DoneQuests = new List<QuestRestartInfo>();

                        for ( int i = 0; i < count; ++i )
                        {
                            Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
                            DateTime restartTime;

                            if ( version < 17 )
                                restartTime = DateTime.MaxValue;
                            else
                                restartTime = reader.ReadDateTime();

                            m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
                        }
                    }

                    m_Profession = reader.ReadEncodedInt();
                    goto case 15;
                }
                case 15:
                {
                    m_LastCompassionLoss = reader.ReadDeltaTime();
                    goto case 14;
                }
                case 14:
                {
                    m_CompassionGains = reader.ReadEncodedInt();

                    if ( m_CompassionGains > 0 )
                        m_NextCompassionDay = reader.ReadDeltaTime();

                    goto case 13;
                }
                case 13: // just removed m_PaidInsurance list
                case 12:
                {
                    m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
                    goto case 11;
                }
                case 11:
                {
                    if ( version < 13 )
                    {
                        List<Item> paid = reader.ReadStrongItemList();

                        for ( int i = 0; i < paid.Count; ++i )
                            paid[i].PaidInsurance = true;
                    }

                    goto case 10;
                }
                case 10:
                {
                    if ( reader.ReadBool() )
                    {
                        m_HairModID = reader.ReadInt();
                        m_HairModHue = reader.ReadInt();
                        m_BeardModID = reader.ReadInt();
                        m_BeardModHue = reader.ReadInt();

                        // We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
            //						Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RevertHair ) );
                    }

                    goto case 9;
                }
                case 9:
                {
                    SavagePaintExpiration = reader.ReadTimeSpan();

                    if ( SavagePaintExpiration > TimeSpan.Zero )
                    {
                        BodyMod = ( Female ? 184 : 183 );
                        HueMod = 0;
                    }

                    goto case 8;
                }
                case 8:
                {
                    m_NpcGuild = (NpcGuild)reader.ReadInt();
                    m_NpcGuildJoinTime = reader.ReadDateTime();
                    m_NpcGuildGameTime = reader.ReadTimeSpan();
                    goto case 7;
                }
                case 7:
                {
                    m_PermaFlags = reader.ReadStrongMobileList();
                    goto case 6;
                }
                case 6:
                {
                    NextTailorBulkOrder = reader.ReadTimeSpan();
                    goto case 5;
                }
                case 5:
                {
                    NextSmithBulkOrder = reader.ReadTimeSpan();
                    goto case 4;
                }
                case 4:
                {
                    m_LastJusticeLoss = reader.ReadDeltaTime();
                    m_JusticeProtectors = reader.ReadStrongMobileList();
                    goto case 3;
                }
                case 3:
                {
                    m_LastSacrificeGain = reader.ReadDeltaTime();
                    m_LastSacrificeLoss = reader.ReadDeltaTime();
                    m_AvailableResurrects = reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Flags = (PlayerFlag)reader.ReadInt();
                    goto case 1;
                }
                case 1:
                {
                    m_LongTermElapse = reader.ReadTimeSpan();
                    m_ShortTermElapse = reader.ReadTimeSpan();
                    m_GameTime = reader.ReadTimeSpan();
                    goto case 0;
                }
                case 0:
                {
                    if( version < 34 )
                        m_AutoStabled = new List<Mobile>();
                    break;
                }
            }

            // Professions weren't verified on 1.0 RC0
            if ( !CharacterCreation.VerifyProfession( m_Profession ) )
                m_Profession = 0;

            if ( m_PermaFlags == null )
                m_PermaFlags = new List<Mobile>();

            if ( m_JusticeProtectors == null )
                m_JusticeProtectors = new List<Mobile>();

            if ( m_BOBFilter == null )
                m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            if( m_GuildRank == null )
                m_GuildRank = Guilds.RankDefinition.Member;	//Default to member if going from older verstion to new version (only time it should be null)

            if( m_LastOnline == DateTime.MinValue && Account != null )
                m_LastOnline = ((Account)Account).LastLogin;

            if( m_ChampionTitles == null )
                m_ChampionTitles = new ChampionTitleInfo();
            if ( AccessLevel > AccessLevel.Player )
                m_IgnoreMobiles = true;

            List<Mobile> list = this.Stabled;

            for ( int i = 0; i < list.Count; ++i )
            {
                BaseCreature bc = list[i] as BaseCreature;

                if ( bc != null )
                    bc.IsStabled = true;
            }

            CheckAtrophies( this );

            if( Hidden )	//Hiding is the only buff where it has an effect that's serialized.
                AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) );
        }
		public PlayerMobile()
		{
			m_VisList = new List<Mobile>();
			m_PermaFlags = new List<Mobile>();
			m_AntiMacroTable = new Hashtable();

			m_BOBFilter = new Engines.BulkOrders.BOBFilter();

			m_GameTime = TimeSpan.Zero;
			m_ShortTermElapse = TimeSpan.FromHours( 8.0 );
			m_LongTermElapse = TimeSpan.FromHours( 40.0 );

			m_JusticeProtectors = new List<Mobile>();
			m_GuildRank = Guilds.RankDefinition.Lowest;

			m_ChampionTitles = new ChampionTitleInfo();

            //######################## -- Mobile Settings Start <<<
            #region -- Mobile Settings --
            m_Settings = new MobileSettings(this);
            #endregion
            //######################## -- Mobile Settings End <<<

			InvalidateMyRunUO();
		}
Beispiel #14
0
        public PlayerMobile()
        {
            m_ShowChat = true;
            m_ShowChat = true;

            m_LastCraftPlatinum = DateTime.Now;
            m_LastPvPPlatinum = DateTime.Now;
            m_LastGatherPlatinum = DateTime.Now;

            m_VisList = new List<Mobile>();
            m_PermaFlags = new List<Mobile>();
            m_AntiMacroTable = new Hashtable();

            m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            m_GameTime = TimeSpan.Zero;
            m_MonthlyGameTime = TimeSpan.Zero;
            m_ShortTermElapse = TimeSpan.FromHours( 8.0 );
            m_DeathCountElapse = TimeSpan.FromMinutes( 20.0 );
            m_LongTermElapse = TimeSpan.FromHours( 12.0/*40.0*/ );

            m_JusticeProtectors = new List<Mobile>();
            m_GuildRank = Guilds.RankDefinition.Lowest;

            m_ChampionTitles = new ChampionTitleInfo();

            InvalidateMyRunUO();
        }
Beispiel #15
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 2:
				{
					m_ItemCount = reader.ReadInt();
					goto case 1;
				}
				case 1:
				{
					m_Level = (SecureLevel)reader.ReadInt();
					goto case 0;
				}
				case 0:
				{
					m_BookName = reader.ReadString();

					m_Filter = new BOBFilter( reader );

					int count = reader.ReadEncodedInt();

					m_Entries = new ArrayList( count );

					for ( int i = 0; i < count; ++i )
					{
						int v = reader.ReadEncodedInt();

						switch ( v )
						{
							case 0: m_Entries.Add( new BOBLargeEntry( reader ) ); break;
							case 1: m_Entries.Add( new BOBSmallEntry( reader ) ); break;
						}
					}

					break;
				}
			}
		}
Beispiel #16
0
        public PlayerMobile()
        {
            #region GeNova: Mondain's Legacy
            m_Quests = new List<BaseQuest>();
            m_Chains = new Dictionary<QuestChain, BaseChain>();
            m_DoneQuests = new List<QuestRestartInfo>();
            m_Collections = new Dictionary<Collection, int>();
            m_CollectionTitles = new List<object>();

            m_Peaced = DateTime.Now;
            #endregion

            m_VisList = new List<Mobile>();
            m_PermaFlags = new List<Mobile>();
            m_AntiMacroTable = new Hashtable();

            m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            m_GameTime = TimeSpan.Zero;
            m_ShortTermElapse = TimeSpan.FromHours(8.0);
            m_LongTermElapse = TimeSpan.FromHours(40.0);

            m_JusticeProtectors = new List<Mobile>();
            m_GuildRank = Guilds.RankDefinition.Lowest;

            m_ChampionTitles = new ChampionTitleInfo();

            InvalidateMyRunUO();
        }
Beispiel #17
0
        public BOBGump(PlayerMobile from, BulkOrderBook book, int page = 0, List <IBOBEntry> list = null) : base(12, 24)
        {
            from.CloseGump <BOBGump>();
            from.CloseGump <BOBFilterGump>();

            m_From = from;
            m_Book = book;
            m_Page = page;

            if (list == null)
            {
                list = new List <IBOBEntry>(book.Entries.Count);

                for (int i = 0; i < book.Entries.Count; ++i)
                {
                    IBOBEntry entry = book.Entries[i];

                    if (CheckFilter(entry))
                    {
                        list.Add(entry);
                    }
                }
            }

            m_List = list;

            int index = GetIndexForPage(page);
            int count = GetCountForIndex(index);

            int tableIndex = 0;

            PlayerVendor pv = book.RootParent as PlayerVendor;

            bool canDrop  = book.IsChildOf(from.Backpack);
            bool canBuy   = pv != null;
            bool canPrice = canDrop || canBuy;

            if (canBuy)
            {
                VendorItem vi = pv.GetVendorItem(book);

                canBuy = vi?.IsForSale == false;
            }

            int width = 600;

            if (!canPrice)
            {
                width = 516;
            }

            X = (624 - width) / 2;

            AddPage(0);

            AddBackground(10, 10, width, 439, 5054);
            AddImageTiled(18, 20, width - 17, 420, 2624);

            if (canPrice)
            {
                AddImageTiled(573, 64, 24, 352, 200);
                AddImageTiled(493, 64, 78, 352, 1416);
            }

            if (canDrop)
            {
                AddImageTiled(24, 64, 32, 352, 1416);
            }

            AddImageTiled(58, 64, 36, 352, 200);
            AddImageTiled(96, 64, 133, 352, 1416);
            AddImageTiled(231, 64, 80, 352, 200);
            AddImageTiled(313, 64, 100, 352, 1416);
            AddImageTiled(415, 64, 76, 352, 200);

            for (int i = index; i < index + count && i >= 0 && i < list.Count; ++i)
            {
                IBOBEntry entry = list[i];

                if (!CheckFilter(entry))
                {
                    continue;
                }

                AddImageTiled(24, 94 + tableIndex * 32, canPrice ? 573 : 489, 2, 2624);
                tableIndex += entry is BOBLargeEntry largeEntry ? largeEntry.Entries.Length : 1;
            }

            AddAlphaRegion(18, 20, width - 17, 420);
            AddImage(5, 5, 10460);
            AddImage(width - 15, 5, 10460);
            AddImage(5, 424, 10460);
            AddImage(width - 15, 424, 10460);

            AddHtmlLocalized(canPrice ? 266 : 224, 32, 200, 32, 1062220, LabelColor); // Bulk Order Book
            AddHtmlLocalized(63, 64, 200, 32, 1062213, LabelColor);                   // Type
            AddHtmlLocalized(147, 64, 200, 32, 1062214, LabelColor);                  // Item
            AddHtmlLocalized(246, 64, 200, 32, 1062215, LabelColor);                  // Quality
            AddHtmlLocalized(336, 64, 200, 32, 1062216, LabelColor);                  // Material
            AddHtmlLocalized(429, 64, 200, 32, 1062217, LabelColor);                  // Amount

            AddButton(35, 32, 4005, 4007, 1);
            AddHtmlLocalized(70, 32, 200, 32, 1062476, LabelColor); // Set Filter

            BOBFilter f = from.UseOwnFilter ? from.BOBFilter : book.Filter;

            if (f.IsDefault)
            {
                AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062475, 16927); // Using No Filter
            }
            else if (from.UseOwnFilter)
            {
                AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062451, 16927); // Using Your Filter
            }
            else
            {
                AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062230, 16927); // Using Book Filter
            }
            AddButton(375, 416, 4017, 4018, 0);
            AddHtmlLocalized(410, 416, 120, 20, 1011441, LabelColor); // EXIT

            if (canDrop)
            {
                AddHtmlLocalized(26, 64, 50, 32, 1062212, LabelColor); // Drop
            }
            if (canPrice)
            {
                AddHtmlLocalized(516, 64, 200, 32, 1062218, LabelColor); // Price

                if (canBuy)
                {
                    AddHtmlLocalized(576, 64, 200, 32, 1062219, LabelColor); // Buy
                }
                else
                {
                    AddHtmlLocalized(576, 64, 200, 32, 1062227, LabelColor); // Set

                    AddButton(450, 416, 4005, 4007, 4);
                    AddHtml(485, 416, 120, 20, "<BASEFONT COLOR=#FFFFFF>Price all</FONT>");
                }
            }

            tableIndex = 0;

            if (page > 0)
            {
                AddButton(75, 416, 4014, 4016, 2);
                AddHtmlLocalized(110, 416, 150, 20, 1011067, LabelColor); // Previous page
            }

            if (GetIndexForPage(page + 1) < list.Count)
            {
                AddButton(225, 416, 4005, 4007, 3);
                AddHtmlLocalized(260, 416, 150, 20, 1011066, LabelColor); // Next page
            }

            for (int i = index; i < index + count && i >= 0 && i < list.Count; ++i)
            {
                IBOBEntry entry = list[i];

                if (!CheckFilter(entry))
                {
                    continue;
                }

                if (entry is BOBLargeEntry largeEntry)
                {
                    int y = 96 + tableIndex * 32;

                    if (canDrop)
                    {
                        AddButton(35, y + 2, 5602, 5606, 5 + i * 2);
                    }

                    if (canDrop || canBuy && entry.Price > 0)
                    {
                        AddButton(579, y + 2, 2117, 2118, 6 + i * 2);
                        AddLabel(495, y, 1152, entry.Price.ToString());
                    }

                    AddHtmlLocalized(61, y, 50, 32, 1062225, LabelColor); // Large

                    for (int j = 0; j < largeEntry.Entries.Length; ++j)
                    {
                        BOBLargeSubEntry sub = largeEntry.Entries[j];

                        AddHtmlLocalized(103, y, 130, 32, sub.Number, LabelColor);

                        if (entry.RequireExceptional)
                        {
                            AddHtmlLocalized(235, y, 80, 20, 1060636, LabelColor); // exceptional
                        }
                        else
                        {
                            AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor); // normal
                        }
                        object name = GetMaterialName(entry.Material, entry.DeedType, sub.ItemType);

                        if (name is int intName)
                        {
                            AddHtmlLocalized(316, y, 100, 20, intName, LabelColor);
                        }
                        else
                        {
                            AddLabel(316, y, 1152, name.ToString());
                        }

                        AddLabel(421, y, 1152, $"{sub.AmountCur} / {entry.AmountMax}");

                        ++tableIndex;
                        y += 32;
                    }
                }
                else
                {
                    BOBSmallEntry smallEntry = (BOBSmallEntry)entry;

                    int y = 96 + tableIndex++ *32;

                    if (canDrop)
                    {
                        AddButton(35, y + 2, 5602, 5606, 5 + i * 2);
                    }

                    if (canDrop || canBuy && smallEntry.Price > 0)
                    {
                        AddButton(579, y + 2, 2117, 2118, 6 + i * 2);
                        AddLabel(495, y, 1152, smallEntry.Price.ToString());
                    }

                    AddHtmlLocalized(61, y, 50, 32, 1062224, LabelColor); // Small

                    AddHtmlLocalized(103, y, 130, 32, smallEntry.Number, LabelColor);

                    if (smallEntry.RequireExceptional)
                    {
                        AddHtmlLocalized(235, y, 80, 20, 1060636, LabelColor); // exceptional
                    }
                    else
                    {
                        AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor); // normal
                    }
                    object name = GetMaterialName(smallEntry.Material, smallEntry.DeedType, smallEntry.ItemType);

                    if (name is int intName)
                    {
                        AddHtmlLocalized(316, y, 100, 20, intName, LabelColor);
                    }
                    else
                    {
                        AddLabel(316, y, 1152, name.ToString());
                    }

                    AddLabel(421, y, 1152, $"{smallEntry.AmountCur} / {smallEntry.AmountMax}");
                }
            }
        }
		public BODModule( Serial serial ) : base( serial )
		{
			m_BOBFilter = new Engines.BulkOrders.BOBFilter();
		}
Beispiel #19
0
        public bool CheckFilter(BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType,
                                Type itemType)
        {
            BOBFilter f = m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter;

            if (f.IsDefault)
            {
                return(true);
            }

            if (f.Quality == 1 && reqExc)
            {
                return(false);
            }
            if (f.Quality == 2 && !reqExc)
            {
                return(false);
            }

            if (f.Quantity == 1 && amountMax != 10)
            {
                return(false);
            }
            if (f.Quantity == 2 && amountMax != 15)
            {
                return(false);
            }
            if (f.Quantity == 3 && amountMax != 20)
            {
                return(false);
            }

            if (f.Type == 1 && isLarge)
            {
                return(false);
            }
            if (f.Type == 2 && !isLarge)
            {
                return(false);
            }

            return(f.Material switch
            {
                1 => (deedType == BODType.Smith),
                2 => (deedType == BODType.Tailor),
                3 => (mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Iron),
                4 => (mat == BulkMaterialType.DullCopper),
                5 => (mat == BulkMaterialType.ShadowIron),
                6 => (mat == BulkMaterialType.Copper),
                7 => (mat == BulkMaterialType.Bronze),
                8 => (mat == BulkMaterialType.Gold),
                9 => (mat == BulkMaterialType.Agapite),
                10 => (mat == BulkMaterialType.Verite),
                11 => (mat == BulkMaterialType.Valorite),
                12 => (mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth),
                13 => (mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather),
                14 => (mat == BulkMaterialType.Spined),
                15 => (mat == BulkMaterialType.Horned),
                16 => (mat == BulkMaterialType.Barbed),
                _ => true
            });
Beispiel #20
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();

            switch ( version )
            {
                case 34:
                    {
                        //SYSTEM IMION  Setname
                        //Odczytywanie danych
                        int count = reader.ReadInt();
                        m_SetNames = new Dictionary<int, string>();
                        for (int i = 0; i < count; i++)
                        {
                            int ri = reader.ReadInt();
                            string rs = reader.ReadString();
                            m_SetNames.Add(ri, rs);
                            //Console.WriteLine();
                            //Console.WriteLine("{0}: {1}: {2}", DateTime.Now, ri, rs);
                        }
                        goto case 33;
                        //SYSTEM IMION  <-- KONIEC
                    }
                case 33:
                    {

                        //Timer od oslonki po wskrzeszeniu
                        DateTime ADShield = reader.ReadDateTime();
                        DateTime Shield = ADShield;
                        Shield = Shield.AddMinutes(PlayerMobile.c_ADShield);
                        if (Shield.CompareTo(DateTime.Now) > 0)
                        {
                            TimeSpan Minutes = Shield.Subtract(DateTime.Now);
                            this.m_ADShieldTimer = new ADShieldTimer(this, Minutes.TotalMinutes);
                            this.m_ADShieldTimer.Start();
                            this.m_ADShieldTime = ADShield;
                        }
                        //////////
                        goto case 32;
                    }
                case 32:
                {

                    int huesCount = reader.ReadInt();

                    if( huesCount > 0 )
                    {
                        m_LanguageHues = new Dictionary<int, int>();

                        for( int i = 0; i < huesCount; i++ )
                        {
                            int key = reader.ReadInt();
                            int v = reader.ReadInt();
                                m_LanguageHues.Add( key, v );
                        }
                    }
                    goto case 31;
                }

                case 31:
                    {
                        //SYSTEM IMION
                        //Odczytywanie danych
                        int count = reader.ReadInt();
                        m_KnewNames = new List<int>();
                        for (int i = 0; i < count; i++)
                        {
                            int ri = reader.ReadInt();
                            //string rs = reader.ReadString();
                            this.m_KnewNames.Add(ri);
                            //Console.WriteLine();
                            //Console.WriteLine("{0}: {1}: {2}", DateTime.Now, ri, rs);
                        }
                        goto case 30;
                        //SYSTEM IMION  <-- KONIEC
                    }
                case 30:
                {
                    this.PDcount = reader.ReadInt();
                    goto case 29;
                }
                case 29:
                {
                    //LISTA PD
                    int i = reader.ReadInt();
                    //Console.Write("array size: " + i);
                    for(int n = 0; n < i; n++ ){
                        int Amount = reader.ReadInt();
                        string GM_name = reader.ReadString();
                        string Reason = reader.ReadString();
                        //Console.Write(n + ": Amount -" + Amount + "\n");
                        //Console.Write(n + ":GM_name-" + GM_name + "\n");
                        //Console.Write(n + ": Reason-" + Reason + "\n");
                        this.ListaPD.Add(new Object[3] {Amount, GM_name, Reason} );
                    }
                    ////////////////
                    goto case 28;
                }
                case 28:
                {

                    //Timer od umierania i wskrzeszania
                    DateTime DeathTime = reader.ReadDateTime();
                    DateTime ResTime = DeathTime;
                    ResTime = ResTime.AddMinutes(PlayerMobile.c_DeathTime);
                    if(ResTime.CompareTo(DateTime.Now) > 0){
                        TimeSpan Minutes = ResTime.Subtract(DateTime.Now);
                        this.m_DeathTimer = new DeathTimer(this, Minutes.TotalMinutes);
                        this.m_DeathTimer.Start();
                        this.m_DeathTime = DeathTime;
                    }
                    //////////

                    m_PeacedUntil = reader.ReadDateTime();

                    goto case 27;
                }
                case 27:
                {
                    m_AnkhNextUse = reader.ReadDateTime();

                    goto case 26;
                }
                case 26:
                {
                    m_AutoStabled = reader.ReadStrongMobileList();

                    goto case 25;
                }
                case 25:
                {
                    int recipeCount = reader.ReadInt();

                    if( recipeCount > 0 )
                    {
                        m_AcquiredRecipes = new Dictionary<int, bool>();

                        for( int i = 0; i < recipeCount; i++ )
                        {
                            int r = reader.ReadInt();
                            if( reader.ReadBool() )	//Don't add in recipies which we haven't gotten or have been removed
                                m_AcquiredRecipes.Add( r, true );
                        }
                    }
                    goto case 24;
                }
                case 24:
                {
                    m_LastHonorLoss = reader.ReadDeltaTime();
                    goto case 23;
                }
                case 23:
                {
                    m_ChampionTitles = new ChampionTitleInfo( reader );
                    goto case 22;
                }
                case 22:
                {
                    m_LastValorLoss = reader.ReadDateTime();
                    goto case 21;
                }
                case 21:
                {
                    m_ToTItemsTurnedIn = reader.ReadEncodedInt();
                    m_ToTTotalMonsterFame = reader.ReadInt();
                    goto case 20;
                }
                case 20:
                {
                    m_AllianceMessageHue = reader.ReadEncodedInt();
                    m_GuildMessageHue = reader.ReadEncodedInt();

                    goto case 19;
                }
                case 19:
                {
                    int rank = reader.ReadEncodedInt();
                    int maxRank = Guilds.RankDefinition.Ranks.Length -1;
                    if( rank > maxRank )
                        rank = maxRank;

                    m_GuildRank = Guilds.RankDefinition.Ranks[rank];
                    m_LastOnline = reader.ReadDateTime();
                    goto case 18;
                }
                case 18:
                {
                    m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt();

                    goto case 17;
                }
                case 17: // changed how DoneQuests is serialized
                case 16:
                {
                    m_Quest = QuestSerializer.DeserializeQuest( reader );

                    if ( m_Quest != null )
                        m_Quest.From = this;

                    int count = reader.ReadEncodedInt();

                    if ( count > 0 )
                    {
                        m_DoneQuests = new List<QuestRestartInfo>();

                        for ( int i = 0; i < count; ++i )
                        {
                            Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
                            DateTime restartTime;

                            if ( version < 17 )
                                restartTime = DateTime.MaxValue;
                            else
                                restartTime = reader.ReadDateTime();

                            m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
                        }
                    }

                    m_Profession = reader.ReadEncodedInt();
                    goto case 15;
                }
                case 15:
                {
                    m_LastCompassionLoss = reader.ReadDeltaTime();
                    goto case 14;
                }
                case 14:
                {
                    m_CompassionGains = reader.ReadEncodedInt();

                    if ( m_CompassionGains > 0 )
                        m_NextCompassionDay = reader.ReadDeltaTime();

                    goto case 13;
                }
                case 13: // just removed m_PayedInsurance list
                case 12:
                {
                    m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
                    goto case 11;
                }
                case 11:
                {
                    if ( version < 13 )
                    {
                        List<Item> payed = reader.ReadStrongItemList();

                        for ( int i = 0; i < payed.Count; ++i )
                            payed[i].PayedInsurance = true;
                    }

                    goto case 10;
                }
                case 10:
                {
                    if ( reader.ReadBool() )
                    {
                        m_HairModID = reader.ReadInt();
                        m_HairModHue = reader.ReadInt();
                        m_BeardModID = reader.ReadInt();
                        m_BeardModHue = reader.ReadInt();
                    }

                    goto case 9;
                }
                case 9:
                {
                    SavagePaintExpiration = reader.ReadTimeSpan();

                    if ( SavagePaintExpiration > TimeSpan.Zero )
                    {
                        BodyMod = ( Female ? 184 : 183 );
                        HueMod = 0;
                    }

                    goto case 8;
                }
                case 8:
                {
                    m_NpcGuild = (NpcGuild)reader.ReadInt();
                    m_NpcGuildJoinTime = reader.ReadDateTime();
                    m_NpcGuildGameTime = reader.ReadTimeSpan();
                    goto case 7;
                }
                case 7:
                {
                    m_PermaFlags = reader.ReadStrongMobileList();
                    goto case 6;
                }
                case 6:
                {
                    NextTailorBulkOrder = reader.ReadTimeSpan();
                    goto case 5;
                }
                case 5:
                {
                    NextSmithBulkOrder = reader.ReadTimeSpan();
                    goto case 4;
                }
                case 4:
                {
                    m_LastJusticeLoss = reader.ReadDeltaTime();
                    m_JusticeProtectors = reader.ReadStrongMobileList();
                    goto case 3;
                }
                case 3:
                {
                    m_LastSacrificeGain = reader.ReadDeltaTime();
                    m_LastSacrificeLoss = reader.ReadDeltaTime();
                    m_AvailableResurrects = reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Flags = (PlayerFlag)reader.ReadInt();
                    goto case 1;
                }
                case 1:
                {
                    m_LongTermElapse = reader.ReadTimeSpan();
                    m_ShortTermElapse = reader.ReadTimeSpan();
                    m_GameTime = reader.ReadTimeSpan();
                    goto case 0;
                }
                case 0:
                {
                    if( version < 26 )
                        m_AutoStabled = new List<Mobile>();
                    break;
                }
            }

            if (m_RecentlyReported == null)
                m_RecentlyReported = new List<Mobile>();

            // Professions weren't verified on 1.0 RC0
            if ( !CharacterCreation.VerifyProfession( m_Profession ) )
                m_Profession = 0;

            if ( m_PermaFlags == null )
                m_PermaFlags = new List<Mobile>();

            if ( m_JusticeProtectors == null )
                m_JusticeProtectors = new List<Mobile>();

            if ( m_BOBFilter == null )
                m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            if( m_GuildRank == null )
                m_GuildRank = Guilds.RankDefinition.Member;	//Default to member if going from older verstion to new version (only time it should be null)

            if( m_LastOnline == DateTime.MinValue && Account != null )
                m_LastOnline = ((Account)Account).LastLogin;

            if( m_ChampionTitles == null )
                m_ChampionTitles = new ChampionTitleInfo();

            if ( AccessLevel > AccessLevel.Player )
                m_IgnoreMobiles = true;

            List<Mobile> list = this.Stabled;

            for ( int i = 0; i < list.Count; ++i )
            {
                BaseCreature bc = list[i] as BaseCreature;

                if ( bc != null )
                    bc.IsStabled = true;
            }

            CheckAtrophies( this );

            if( Hidden )	//Hiding is the only buff where it has an effect that's serialized.
                AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) );
        }
Beispiel #21
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();

            switch ( version )
            {
            //duel system
                case 19:
                {
                    m_Wins = reader.ReadEncodedInt();
                    m_Losses = reader.ReadEncodedInt();

                    goto case 18;
                }
            //duel system
                case 18:
                {
                    if ( version < 19 )
                    {
                        m_Wins = 0;
                        m_Losses = 0;
                    }
                    m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt();

                    goto case 17;
                }
                case 17: // changed how DoneQuests is serialized
                case 16:
                {
                    m_Quest = QuestSerializer.DeserializeQuest( reader );

                    if ( m_Quest != null )
                        m_Quest.From = this;

                    int count = reader.ReadEncodedInt();

                    if ( count > 0 )
                    {
                        m_DoneQuests = new ArrayList();

                        for ( int i = 0; i < count; ++i )
                        {
                            Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
                            DateTime restartTime;

                            if ( version < 17 )
                                restartTime = DateTime.MaxValue;
                            else
                                restartTime = reader.ReadDateTime();

                            m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
                        }
                    }

                    m_Profession = reader.ReadEncodedInt();
                    goto case 15;
                }
                case 15:
                {
                    m_LastCompassionLoss = reader.ReadDeltaTime();
                    goto case 14;
                }
                case 14:
                {
                    m_CompassionGains = reader.ReadEncodedInt();

                    if ( m_CompassionGains > 0 )
                        m_NextCompassionDay = reader.ReadDeltaTime();

                    goto case 13;
                }
                case 13: // just removed m_PayedInsurance list
                case 12:
                {
                    m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
                    goto case 11;
                }
                case 11:
                {
                    if ( version < 13 )
                    {
                        ArrayList payed = reader.ReadItemList();

                        for ( int i = 0; i < payed.Count; ++i )
                            ((Item)payed[i]).PayedInsurance = true;
                    }

                    goto case 10;
                }
                case 10:
                {
                    if ( reader.ReadBool() )
                    {
                        m_HairModID = reader.ReadInt();
                        m_HairModHue = reader.ReadInt();
                        m_BeardModID = reader.ReadInt();
                        m_BeardModHue = reader.ReadInt();

                        // We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
                        Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RevertHair ) );
                    }

                    goto case 9;
                }
                case 9:
                {
                    SavagePaintExpiration = reader.ReadTimeSpan();

                    if ( SavagePaintExpiration > TimeSpan.Zero )
                    {
                        BodyMod = ( Female ? 184 : 183 );
                        HueMod = 0;
                    }

                    goto case 8;
                }
                case 8:
                {
                    m_NpcGuild = (NpcGuild)reader.ReadInt();
                    m_NpcGuildJoinTime = reader.ReadDateTime();
                    m_NpcGuildGameTime = reader.ReadTimeSpan();
                    goto case 7;
                }
                case 7:
                {
                    m_PermaFlags = reader.ReadMobileList();
                    goto case 6;
                }
                case 6:
                {
                    NextTailorBulkOrder = reader.ReadTimeSpan();
                    goto case 5;
                }
                case 5:
                {
                    NextSmithBulkOrder = reader.ReadTimeSpan();
                    goto case 4;
                }
                case 4:
                {
                    m_LastJusticeLoss = reader.ReadDeltaTime();
                    m_JusticeProtectors = reader.ReadMobileList();
                    goto case 3;
                }
                case 3:
                {
                    m_LastSacrificeGain = reader.ReadDeltaTime();
                    m_LastSacrificeLoss = reader.ReadDeltaTime();
                    m_AvailableResurrects = reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Flags = (PlayerFlag)reader.ReadInt();
                    goto case 1;
                }
                case 1:
                {
                    m_LongTermElapse = reader.ReadTimeSpan();
                    m_ShortTermElapse = reader.ReadTimeSpan();
                    m_GameTime = reader.ReadTimeSpan();
                    goto case 0;
                }
                case 0:
                {
                    break;
                }
            }

            // Professions weren't verified on 1.0 RC0
            if ( !CharacterCreation.VerifyProfession( m_Profession ) )
                m_Profession = 0;

            if ( m_PermaFlags == null )
                m_PermaFlags = new ArrayList();

            if ( m_JusticeProtectors == null )
                m_JusticeProtectors = new ArrayList();

            if ( m_BOBFilter == null )
                m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            ArrayList list = this.Stabled;

            for ( int i = 0; i < list.Count; ++i )
            {
                BaseCreature bc = list[i] as BaseCreature;

                if ( bc != null )
                    bc.IsStabled = true;
            }
        }
Beispiel #22
0
		public PlayerMobile(Serial s)
			: base(s)
		{
			AllFollowers = new List<Mobile>();
			AutoStabled = new List<Mobile>();
			RecentlyReported = new List<Mobile>();
			SkillGainMods = new List<SkillGainMod>();
			m_VisList = new List<Mobile>();
			m_PermaFlags = new List<Mobile>();
			m_AntiMacroTable = new Hashtable();

			BOBFilter = new BOBFilter();

			ChampionTitles = new ChampionTitleInfo();

			Learning = (SkillName)(-1);
			LastHelped = DateTime.MinValue;
			StatEnd = DateTime.MinValue;

			EventMsgFlag = true;

            //InvalidateLegends();
		}
Beispiel #23
0
        public PlayerMobile()
        {
            m_VisList = new ArrayList();
            m_PermaFlags = new ArrayList();
            m_AntiMacroTable = new Hashtable();

            m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            m_GameTime = TimeSpan.Zero;
            m_ShortTermElapse = TimeSpan.FromHours( 8.0 );
            m_LongTermElapse = TimeSpan.FromHours( 40.0 );

            m_JusticeProtectors = new ArrayList();

            InvalidateMyRunUO();
        }
Beispiel #24
0
        public override void OnResponse(Network.NetState sender, RelayInfo info)
        {
            BOBFilter f = (m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter);

            int index = info.ButtonID;

            switch (index)
            {
            case 0:     // Apply
            {
                m_From.SendGump(new BOBGump(m_From, m_Book));

                break;
            }

            case 1:     // Set Book Filter
            {
                m_From.UseOwnFilter = false;
                m_From.SendGump(new BOBFilterGump(m_From, m_Book));

                break;
            }

            case 2:     // Set Your Filter
            {
                m_From.UseOwnFilter = true;
                m_From.SendGump(new BOBFilterGump(m_From, m_Book));

                break;
            }

            case 3:     // Clear Filter
            {
                f.Clear();
                m_From.SendGump(new BOBFilterGump(m_From, m_Book));

                break;
            }

            default:
            {
                index -= 4;

                int type = index % 4;
                index /= 4;

                int[][,] filter = BulkOrderSystem.NewSystemEnabled ? m_FiltersNew : m_Filters;

                if (type >= 0 && type < filter.Length)
                {
                    int[,] filters = filter[type];

                    if (index >= 0 && index < filters.GetLength(0))
                    {
                        if (filters[index, 0] == 0)
                        {
                            break;
                        }

                        switch (type)
                        {
                        case 0:
                            f.Type = filters[index, 1];
                            break;

                        case 1:
                            f.Quality = filters[index, 1];
                            break;

                        case 2:
                            f.Material = filters[index, 1];
                            break;

                        case 3:
                            f.Quantity = filters[index, 1];
                            break;
                        }

                        m_From.SendGump(new BOBFilterGump(m_From, m_Book));
                    }
                }

                break;
            }
            }
        }
Beispiel #25
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            BOBFilter f = (m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter);

            int index = info.ButtonID;

            switch (index)
            {
            case 0:                     // Apply
            {
                m_From.SendGump(new BOBGump(m_From, m_Book));

                break;
            }

            case 1:                     // Set Book Filter
            {
                m_From.UseOwnFilter = false;
                m_From.SendGump(new BOBFilterGump(m_From, m_Book));

                break;
            }

            case 2:                     // Set Your Filter
            {
                m_From.UseOwnFilter = true;
                m_From.SendGump(new BOBFilterGump(m_From, m_Book));

                break;
            }

            case 3:                     // Clear Filter
            {
                f.Clear();
                m_From.SendGump(new BOBFilterGump(m_From, m_Book));

                break;
            }

            default:
            {
                index -= 4;

                int type = index % 4;
                index /= 4;

                if (type >= 0 && type < m_Filters.Length)
                {
                    int[,] filters = m_Filters[type];

                    if (index >= 0 && index < filters.GetLength(0))
                    {
                        //daat99 OWLTR start - custom ores
                        if (filters[index, 0] == 0 && filters[index, 1] == 0)
                        {
                            //daat99 OWLTR end - custom ores
                            break;
                        }

                        switch (type)
                        {
                        case 0: f.Type = filters[index, 1]; break;

                        case 1: f.Quality = filters[index, 1]; break;

                        case 2: f.Material = filters[index, 1]; break;

                        case 3: f.Quantity = filters[index, 1]; break;
                        }

                        m_From.SendGump(new BOBFilterGump(m_From, m_Book));
                    }
                }

                break;
            }
            }
        }
Beispiel #26
0
        public BOBGump(PlayerMobile from, BulkOrderBook book, int page, ArrayList list)
            : base(12, 24)
        {
            from.CloseGump(typeof(BOBGump));
            from.CloseGump(typeof(BOBFilterGump));

            m_From = from;
            m_Book = book;
            m_Page = page;

            if (list == null)
            {
                list = new ArrayList(book.Entries.Count);

                for (int i = 0; i < book.Entries.Count; ++i)
                {
                    object obj = book.Entries[i];

                    if (CheckFilter(obj))
                    {
                        list.Add(obj);
                    }
                }
            }

            m_List = list;

            int index = GetIndexForPage(page);
            int count = GetCountForIndex(index);

            int tableIndex = 0;

            PlayerVendor pv = book.RootParent as PlayerVendor;

            bool canDrop  = book.IsChildOf(from.Backpack);
            bool canBuy   = (pv != null);
            bool canPrice = (canDrop || canBuy);

            if (canBuy)
            {
                VendorItem vi = pv.GetVendorItem(book);

                canBuy = (vi != null && !vi.IsForSale);
            }

            int width = 600;

            if (!canPrice)
            {
                width = 516;
            }

            X = (624 - width) / 2;

            AddPage(0);

            AddBackground(10, 10, width, 439, 5054);
            AddImageTiled(18, 20, width - 17, 420, 2624);

            if (canPrice)
            {
                AddImageTiled(573, 64, 24, 352, 200);
                AddImageTiled(493, 64, 78, 352, 1416);
            }

            if (canDrop)
            {
                AddImageTiled(24, 64, 32, 352, 1416);
            }

            AddImageTiled(58, 64, 36, 352, 200);
            AddImageTiled(96, 64, 133, 352, 1416);
            AddImageTiled(231, 64, 80, 352, 200);
            AddImageTiled(313, 64, 100, 352, 1416);
            AddImageTiled(415, 64, 76, 352, 200);

            for (int i = index; i < (index + count) && i >= 0 && i < list.Count; ++i)
            {
                object obj = list[i];

                if (!CheckFilter(obj))
                {
                    continue;
                }

                AddImageTiled(24, 94 + (tableIndex * 32), canPrice ? 573 : 489, 2, 2624);

                if (obj is BOBLargeEntry)
                {
                    tableIndex += ((BOBLargeEntry)obj).Entries.Length;
                }
                else if (obj is BOBSmallEntry)
                {
                    ++tableIndex;
                }
            }

            AddAlphaRegion(18, 20, width - 17, 420);
            AddImage(5, 5, 10460);
            AddImage(width - 15, 5, 10460);
            AddImage(5, 424, 10460);
            AddImage(width - 15, 424, 10460);

            AddHtmlLocalized(canPrice ? 266 : 224, 32, 200, 32, 1062220, LabelColor, false, false); // Bulk Order Book
            AddHtmlLocalized(63, 64, 200, 32, 1062213, LabelColor, false, false);                   // Type
            AddHtmlLocalized(147, 64, 200, 32, 1062214, LabelColor, false, false);                  // Item
            AddHtmlLocalized(246, 64, 200, 32, 1062215, LabelColor, false, false);                  // Quality
            AddHtmlLocalized(336, 64, 200, 32, 1062216, LabelColor, false, false);                  // Material
            AddHtmlLocalized(429, 64, 200, 32, 1062217, LabelColor, false, false);                  // Amount

            AddButton(35, 32, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(70, 32, 200, 32, 1062476, LabelColor, false, false); // Set Filter

            BOBFilter f = (from.UseOwnFilter ? from.BOBFilter : book.Filter);

            if (f.IsDefault)
            {
                AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062475, 16927, false, false); // Using No Filter
            }
            else if (from.UseOwnFilter)
            {
                AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062451, 16927, false, false); // Using Your Filter
            }
            else
            {
                AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062230, 16927, false, false); // Using Book Filter
            }
            AddButton(375, 416, 4017, 4018, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(410, 416, 120, 20, 1011441, LabelColor, false, false); // EXIT

            if (canDrop)
            {
                AddHtmlLocalized(26, 64, 50, 32, 1062212, LabelColor, false, false); // Drop
            }
            if (canPrice)
            {
                AddHtmlLocalized(516, 64, 200, 32, 1062218, LabelColor, false, false); // Price

                if (canBuy)
                {
                    AddHtmlLocalized(576, 64, 200, 32, 1062219, LabelColor, false, false); // Buy
                }
                else
                {
                    AddHtmlLocalized(576, 64, 200, 32, 1062227, LabelColor, false, false); // Set

                    AddButton(450, 416, 4005, 4007, 4, GumpButtonType.Reply, 0);
                    AddHtml(485, 416, 120, 20, "<BASEFONT COLOR=#FFFFFF>Price all</FONT>", false, false);
                }
            }

            tableIndex = 0;

            if (page > 0)
            {
                AddButton(75, 416, 4014, 4016, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(110, 416, 150, 20, 1011067, LabelColor, false, false); // Previous page
            }

            if (GetIndexForPage(page + 1) < list.Count)
            {
                AddButton(225, 416, 4005, 4007, 3, GumpButtonType.Reply, 0);
                AddHtmlLocalized(260, 416, 150, 20, 1011066, LabelColor, false, false); // Next page
            }

            for (int i = index; i < (index + count) && i >= 0 && i < list.Count; ++i)
            {
                object obj = list[i];

                if (!CheckFilter(obj))
                {
                    continue;
                }

                if (obj is BOBLargeEntry)
                {
                    BOBLargeEntry e = (BOBLargeEntry)obj;

                    int y = 96 + (tableIndex * 32);

                    if (canDrop)
                    {
                        AddButton(35, y + 2, 5602, 5606, 5 + (i * 2), GumpButtonType.Reply, 0);
                    }

                    if (canDrop || (canBuy && e.Price > 0))
                    {
                        AddButton(579, y + 2, 2117, 2118, 6 + (i * 2), GumpButtonType.Reply, 0);
                        AddLabel(495, y, 1152, e.Price.ToString());
                    }

                    AddHtmlLocalized(61, y, 50, 32, 1062225, LabelColor, false, false); // Large

                    for (int j = 0; j < e.Entries.Length; ++j)
                    {
                        BOBLargeSubEntry sub = e.Entries[j];

                        AddHtmlLocalized(103, y, 130, 32, sub.Number, LabelColor, false, false);

                        if (e.RequireExceptional)
                        {
                            AddHtmlLocalized(235, y, 80, 20, 1060636, LabelColor, false, false); // exceptional
                        }
                        else
                        {
                            AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor, false, false); // normal
                        }
                        object name = GetMaterialName(e.Material, e.DeedType, sub.ItemType);

                        if (name is int)
                        {
                            AddHtmlLocalized(316, y, 100, 20, (int)name, LabelColor, false, false);
                        }
                        else if (name is string)
                        {
                            AddLabel(316, y, 1152, (string)name);
                        }

                        AddLabel(421, y, 1152, String.Format("{0} / {1}", sub.AmountCur, e.AmountMax));

                        ++tableIndex;
                        y += 32;
                    }
                }
                else if (obj is BOBSmallEntry)
                {
                    BOBSmallEntry e = (BOBSmallEntry)obj;

                    int y = 96 + (tableIndex++ *32);

                    if (canDrop)
                    {
                        AddButton(35, y + 2, 5602, 5606, 5 + (i * 2), GumpButtonType.Reply, 0);
                    }

                    if (canDrop || (canBuy && e.Price > 0))
                    {
                        AddButton(579, y + 2, 2117, 2118, 6 + (i * 2), GumpButtonType.Reply, 0);
                        AddLabel(495, y, 1152, e.Price.ToString());
                    }

                    AddHtmlLocalized(61, y, 50, 32, 1062224, LabelColor, false, false); // Small

                    AddHtmlLocalized(103, y, 130, 32, e.Number, LabelColor, false, false);

                    if (e.RequireExceptional)
                    {
                        AddHtmlLocalized(235, y, 80, 20, 1060636, LabelColor, false, false); // exceptional
                    }
                    else
                    {
                        AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor, false, false); // normal
                    }
                    object name = GetMaterialName(e.Material, e.DeedType, e.ItemType);

                    if (name is int)
                    {
                        AddHtmlLocalized(316, y, 100, 20, (int)name, LabelColor, false, false);
                    }
                    else if (name is string)
                    {
                        AddLabel(316, y, 1152, (string)name);
                    }

                    AddLabel(421, y, 1152, String.Format("{0} / {1}", e.AmountCur, e.AmountMax));
                }
            }
        }
Beispiel #27
0
        public static void SetBOBFilter(PlayerMobile pm, BOBFilter filter)
        {
            BODContext context = GetContext(pm);

            context.BOBFilter = filter;
        }
Beispiel #28
0
        public bool CheckFilter(BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType)
        {
            BOBFilter f = (m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter);

            if (f.IsDefault)
            {
                return(true);
            }

            if (f.Quality == 1 && reqExc)
            {
                return(false);
            }
            else if (f.Quality == 2 && !reqExc)
            {
                return(false);
            }

            if (f.Quantity == 1 && amountMax != 10)
            {
                return(false);
            }
            else if (f.Quantity == 2 && amountMax != 15)
            {
                return(false);
            }
            else if (f.Quantity == 3 && amountMax != 20)
            {
                return(false);
            }

            if (f.Type == 1 && isLarge)
            {
                return(false);
            }
            else if (f.Type == 2 && !isLarge)
            {
                return(false);
            }

            switch (f.Material)
            {
            default:
            case  0: return(true);

            case 1: return(deedType == BODType.Carpenter);

            case 2: return(deedType == BODType.Fletcher);

            case 3: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.RegularWood);

            case 4: return(mat == BulkMaterialType.OakWood);

            case 5: return(mat == BulkMaterialType.AshWood);

            case 6: return(mat == BulkMaterialType.YewWood);

            case 7: return(mat == BulkMaterialType.Heartwood);

            case 8: return(mat == BulkMaterialType.Bloodwood);

            case 9: return(mat == BulkMaterialType.Frostwood);

            case 10: return(mat == BulkMaterialType.Ebony);

            case 11: return(mat == BulkMaterialType.Bamboo);

            case 12: return(mat == BulkMaterialType.PurpleHeart);

            case 13: return(mat == BulkMaterialType.Redwood);

            case 14: return(mat == BulkMaterialType.Petrified);

            case 15: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.RegularWood);

            case 16: return(mat == BulkMaterialType.OakWood);

            case 17: return(mat == BulkMaterialType.AshWood);

            case 18: return(mat == BulkMaterialType.YewWood);

            case 19: return(mat == BulkMaterialType.Heartwood);

            case 20: return(mat == BulkMaterialType.Bloodwood);

            case 21: return(mat == BulkMaterialType.Frostwood);

            case 22: return(mat == BulkMaterialType.Ebony);

            case 23: return(mat == BulkMaterialType.Bamboo);

            case 24: return(mat == BulkMaterialType.PurpleHeart);

            case 25: return(mat == BulkMaterialType.Redwood);

            case 26: return(mat == BulkMaterialType.Petrified);
            }
        }
Beispiel #29
0
        public BODContext()
        {
            BOBFilter = new BOBFilter();

            ConfigEntries();
        }
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);
			int version = reader.ReadInt();

			switch (version)
			{
                case 29:
					{
						m_GauntletPoints = reader.ReadDouble();

						m_SSNextSeed = reader.ReadDateTime();
						m_SSSeedExpire = reader.ReadDateTime();
						m_SSSeedLocation = reader.ReadPoint3D();
						m_SSSeedMap = reader.ReadMap();

						m_LevelExp = reader.ReadLong();
						m_Exp = reader.ReadLong();
						m_Level = reader.ReadInt();
						m_ExpTitle = reader.ReadString();

						m_VASTotalMonsterFame = reader.ReadInt();

						m_Quests = QuestReader.Quests(reader, this);
						m_Chains = QuestReader.Chains(reader);

						m_Collections = new Dictionary<Collection, int>();
						m_CollectionTitles = new List<object>();

						for (int i = reader.ReadInt(); i > 0; i--)
						{
							m_Collections.Add((Collection)reader.ReadInt(), reader.ReadInt());
						}

						for (int i = reader.ReadInt(); i > 0; i--)
						{
							m_CollectionTitles.Add(QuestReader.Object(reader));
						}

						m_SelectedTitle = reader.ReadInt();

						goto case 28;
					}
				case 28:
					{
						m_PeacedUntil = reader.ReadDateTime();

						goto case 27;
					}
				case 27:
					{
						m_AnkhNextUse = reader.ReadDateTime();

						goto case 26;
					}
				case 26:
					{
						m_AutoStabled = reader.ReadStrongMobileList();

						goto case 25;
					}
				case 25:
					{
						int recipeCount = reader.ReadInt();

						if (recipeCount > 0)
						{
							m_AcquiredRecipes = new Dictionary<int, bool>();

							for (int i = 0; i < recipeCount; i++)
							{
								int r = reader.ReadInt();
								if (reader.ReadBool()) //Don't add in recipies which we haven't gotten or have been removed
								{
									m_AcquiredRecipes.Add(r, true);
								}
							}
						}
						goto case 24;
					}
				case 24:
					{
						m_LastHonorLoss = reader.ReadDeltaTime();
						goto case 23;
					}
				case 23:
					{
						m_ChampionTitles = new ChampionTitleInfo(reader);
						goto case 22;
					}
				case 22:
					{
						m_LastValorLoss = reader.ReadDateTime();
						goto case 21;
					}
				case 21:
					{
						m_ToTItemsTurnedIn = reader.ReadEncodedInt();
						m_ToTTotalMonsterFame = reader.ReadInt();
						goto case 20;
					}
				case 20:
					{
						m_AllianceMessageHue = reader.ReadEncodedInt();
						m_GuildMessageHue = reader.ReadEncodedInt();

						goto case 19;
					}
				case 19:
					{
						int rank = reader.ReadEncodedInt();
						int maxRank = RankDefinition.Ranks.Length - 1;
						if (rank > maxRank)
						{
							rank = maxRank;
						}

						m_GuildRank = RankDefinition.Ranks[rank];
						m_LastOnline = reader.ReadDateTime();
						goto case 18;
					}
				case 18:
					{
						m_SolenFriendship = (SolenFriendship)reader.ReadEncodedInt();

						goto case 17;
					}
				case 17: // changed how DoneQuests is serialized
				case 16:
					{
						m_Quest = QuestSerializer.DeserializeQuest(reader);

						if (m_Quest != null)
						{
							m_Quest.From = this;
						}

						int count = reader.ReadEncodedInt();

						if (count > 0)
						{
							m_DoneQuests = new List<QuestRestartInfo>();

							for (int i = 0; i < count; ++i)
							{
								Type questType = QuestSerializer.ReadType(QuestSystem.QuestTypes, reader);
								DateTime restartTime;

								if (version < 17)
								{
									restartTime = DateTime.MaxValue;
								}
								else
								{
									restartTime = reader.ReadDateTime();
								}

								m_DoneQuests.Add(new QuestRestartInfo(questType, restartTime));
							}
						}

						m_Profession = reader.ReadEncodedInt();
						goto case 15;
					}
				case 15:
					{
						m_LastCompassionLoss = reader.ReadDeltaTime();
						goto case 14;
					}
				case 14:
					{
						m_CompassionGains = reader.ReadEncodedInt();

						if (m_CompassionGains > 0)
						{
							m_NextCompassionDay = reader.ReadDeltaTime();
						}

						goto case 13;
					}
				case 13: // just removed m_PayedInsurance list
				case 12:
					{
						m_BOBFilter = new BOBFilter(reader);
						goto case 11;
					}
				case 11:
					{
						if (version < 13)
						{
							var payed = reader.ReadStrongItemList();

							for (int i = 0; i < payed.Count; ++i)
							{
								payed[i].PayedInsurance = true;
							}
						}

						goto case 10;
					}
				case 10:
					{
						if (reader.ReadBool())
						{
							m_HairModID = reader.ReadInt();
							m_HairModHue = reader.ReadInt();
							m_BeardModID = reader.ReadInt();
							m_BeardModHue = reader.ReadInt();
						}

						goto case 9;
					}
				case 9:
					{
						SavagePaintExpiration = reader.ReadTimeSpan();

						if (SavagePaintExpiration > TimeSpan.Zero)
						{
							BodyMod = (Female ? 184 : 183);
							HueMod = 0;
						}

						goto case 8;
					}
				case 8:
					{
						m_NpcGuild = (NpcGuild)reader.ReadInt();
						m_NpcGuildJoinTime = reader.ReadDateTime();
						m_NpcGuildGameTime = reader.ReadTimeSpan();
						goto case 7;
					}
				case 7:
					{
						m_PermaFlags = reader.ReadStrongMobileList();
						goto case 6;
					}
				case 6:
					{
						NextTailorBulkOrder = reader.ReadTimeSpan();
						goto case 5;
					}
				case 5:
					{
						NextSmithBulkOrder = reader.ReadTimeSpan();
						goto case 4;
					}
				case 4:
					{
						m_LastJusticeLoss = reader.ReadDeltaTime();
						m_JusticeProtectors = reader.ReadStrongMobileList();
						goto case 3;
					}
				case 3:
					{
						m_LastSacrificeGain = reader.ReadDeltaTime();
						m_LastSacrificeLoss = reader.ReadDeltaTime();
						m_AvailableResurrects = reader.ReadInt();
						goto case 2;
					}
				case 2:
					{
						m_Flags = (PlayerFlag)reader.ReadInt();
						goto case 1;
					}
				case 1:
					{
						m_LongTermElapse = reader.ReadTimeSpan();
						m_ShortTermElapse = reader.ReadTimeSpan();
						m_GameTime = reader.ReadTimeSpan();
						goto case 0;
					}
				case 0:
					{
						if (version < 26)
						{
							m_AutoStabled = new List<Mobile>();
						}
						break;
					}
			}

			if (version < 29)
			{
				m_SSNextSeed = m_SSSeedExpire = DateTime.UtcNow;
				m_SSSeedLocation = Point3D.Zero;
			}

			if (m_RecentlyReported == null)
			{
				m_RecentlyReported = new List<Mobile>();
			}

			#region QueensLoyaltySystem
			if (version < 29)
			{
				m_LevelExp = 2000;
				m_Exp = 0;
				m_Level = 0;

				m_ExpTitle = "Friend of TerMur";
			}
			#endregion

			#region Mondain's Legacy
			if (m_Quests == null)
			{
				m_Quests = new List<BaseQuest>();
			}

			if (m_Chains == null)
			{
				m_Chains = new Dictionary<QuestChain, BaseChain>();
			}

			if (m_DoneQuests == null)
			{
				m_DoneQuests = new List<QuestRestartInfo>();
			}

			if (m_Collections == null)
			{
				m_Collections = new Dictionary<Collection, int>();
			}

			if (m_CollectionTitles == null)
			{
				m_CollectionTitles = new List<object>();
			}
			#endregion

			// Professions weren't verified on 1.0 RC0
			if (!CharacterCreation.VerifyProfession(m_Profession))
			{
				m_Profession = 0;
			}

			if (m_PermaFlags == null)
			{
				m_PermaFlags = new List<Mobile>();
			}

			if (m_JusticeProtectors == null)
			{
				m_JusticeProtectors = new List<Mobile>();
			}

			if (m_BOBFilter == null)
			{
				m_BOBFilter = new BOBFilter();
			}

			if (m_GuildRank == null)
			{
				m_GuildRank = RankDefinition.Member;
				//Default to member if going from older version to new version (only time it should be null)
			}

			if (m_LastOnline == DateTime.MinValue && Account != null)
			{
				m_LastOnline = ((Account)Account).LastLogin;
			}

			if (m_ChampionTitles == null)
			{
				m_ChampionTitles = new ChampionTitleInfo();
			}

			var list = Stabled;

			for (int i = 0; i < list.Count; ++i)
			{
				BaseCreature bc = list[i] as BaseCreature;

				if (bc != null)
				{
					bc.IsStabled = true;
					bc.StabledBy = this;
				}
			}

			CheckAtrophies(this);

			if (Hidden) //Hiding is the only buff where it has an effect that's serialized.
			{
				AddBuff(new BuffInfo(BuffIcon.HidingAndOrStealth, 1075655));
			}
		}
Beispiel #31
0
		public PlayerMobile()
		{
			this.STRBonusCap = STRBonusCapDefault;		// have player mobiles start out with a capped STR bonus when using weapons
			m_LastSkillGainTime = new DateTime[52];
			m_VisList = new ArrayList();
			m_PermaFlags = new ArrayList();
			m_AntiMacroTable = new Hashtable();
			m_BOBFilter = new Engines.BulkOrders.BOBFilter();
			m_GameTime = TimeSpan.Zero;

			if ( Inmate && Alive )
			{
				m_ShortTermElapse = TimeSpan.FromHours( 4.0 );
				m_LongTermElapse = TimeSpan.FromHours( 20.0 );
			}
			else
			{
				m_ShortTermElapse = TimeSpan.FromHours( 8.0 );
				m_LongTermElapse = TimeSpan.FromHours( 40.0 );
			}

			m_JusticeProtectors = new ArrayList();

			m_LastSkillUsed     = new SkillName();		// wea: for [FindSkill
			m_LastSkillTime     = new DateTime();		//

			m_SpiritCohesion = 0;						// wea: for Spirit Cohesion
			m_LastResurrectTime = new DateTime();

			m_SpeechRecord = new Queue();				// TK: [report command
			m_Reported = DateTime.MinValue;

			InvalidateMyRunUO();
		}
Beispiel #32
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
            SaveFlag saveFlags = ReadSaveBits(reader, version, 30);

			///////////////////////////////////////////////////
			// put all normal serialization below this line
			///////////////////////////////////////////////////

	        switch ( version )
			{
				case 32:
					{
						//Adam: v32 add mini game ID and save data.
						if (GetSaveFlag(saveFlags, SaveFlag.ZCodeMiniGame) == true)
						{
							m_ZCodeMiniGameID = reader.ReadInt();				// hash code of the string naming the mini game
							int size = reader.ReadInt();						// saved game size
							m_ZCodeMiniGameData = new byte[size];				// allocate a new game buffer
							for (int ix = 0; ix < size; ix++)
								m_ZCodeMiniGameData[ix] = reader.ReadByte();	// saved game
						}
						goto case 31;
					}
                case 31:
                {
                    if (GetSaveFlag(saveFlags, SaveFlag.NPCGuild) == true)
                        m_NpcGuildPoints = reader.ReadDouble();

                    goto case 30;
                }
                case 30: // Adam: v.30 Dummy version, removed NPCGuild vars when not needed
                {
                    goto case 29;
                }
				case 29: //Pla: Dummy version, removed duel system vars
				{
					goto case 28;
				}
                case 28: //Pix: Kin Faction additions
                {
                    m_KinSoloPoints = reader.ReadDouble();
                    m_KinTeamPoints = reader.ReadDouble();

                    goto case 27;
                }
				case 27: //Pix: challenge duel system
				{
					//pla: not used anymore
					if (version < 29)
					{
						//m_iChallengeDuelWins = reader.ReadInt();
						//m_iChallengeDuelLosses = reader.ReadInt();
						reader.ReadInt();
						reader.ReadInt();
					}
					
					goto case 26;
				}
                case 26: //Adam: ghost blindness
                {
                    m_Blind = reader.ReadBool();
                    m_SightExpire = reader.ReadDateTime();
                    if (m_SightExpire != DateTime.MaxValue)
                    {
                        if (m_SightExpire <= DateTime.Now)
                            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(GoBlind));
                        else
                            Timer.DelayCall(m_SightExpire - DateTime.Now, new TimerCallback(GoBlind));
                    }
                           
                    goto case 25;
                }
				case 25: //Pix: WatchList enhancements
				{
					m_WatchReason = reader.ReadString();
					m_WatchExpire = reader.ReadDateTime();
					goto case 24;
				}
				case 24: // Rhi: FilterMusic
				{
					m_FilterMusic = reader.ReadBool();
					goto case 23;
				}
				case 23: // Pix: IOB System changes
				{
					m_IOBKillPoints = reader.ReadDouble();
					m_LastGuildIOBAlignment = (IOBAlignment)reader.ReadInt();
					m_LastGuildChange = reader.ReadDateTime();

					goto case 22;
				}
				case 22:
				{
					m_Reported = reader.ReadDateTime();
					if (m_Reported > DateTime.Now - ReportTime)
					{
						m_ReportLogger = new LogHelper( GetReportLogName(m_Reported.ToString("MM-dd-yyyy HH-mm-ss")), false );
						m_ReportLogStopper = Timer.DelayCall(ReportTime - (DateTime.Now - m_Reported), new TimerCallback(EndReport));
					}
					goto case 21;
				}
				case 21:
				{
					LastRegion = Region.Find( this.Location, this.Map );
					goto case 20;
				}
				case 20: //Pix: Offline short count decay
				{
					m_LastShortDecayed = reader.ReadDateTime();
					goto case 19;
				}
				case 19: //Pix - for IOB Ranks
				{
					m_IOBRankTime = reader.ReadTimeSpan();
					goto case 18;
				}
				case 18: //Pigpen - Addition for IOB Sytem
				{
					if( version < 23 )
					{
						//m_IOBAlignment = (IOBAlignment)reader.ReadInt();
						//IOBTimer = reader.ReadTimeSpan();
						reader.ReadInt();
						reader.ReadTimeSpan();
					}
					m_IOBEquipped = reader.ReadBool();
					goto case 16;
				}
				case 17: // changed how DoneQuests is serialized
				case 16:
				{
					m_Quest = QuestSerializer.DeserializeQuest( reader );

					if ( m_Quest != null )
						m_Quest.From = this;

					int count = reader.ReadEncodedInt();

					if ( count > 0 )
					{
						m_DoneQuests = new ArrayList();

						for ( int i = 0; i < count; ++i )
						{
							Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
							DateTime restartTime;

							if ( version < 17 )
								restartTime = DateTime.MaxValue;
							else
								restartTime = reader.ReadDateTime();

							m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
						}
					}

					m_Profession = reader.ReadEncodedInt();
					goto case 15;
				}
				case 15:
				{
					m_LastCompassionLoss = reader.ReadDeltaTime();
					goto case 14;
				}
				case 14:
				{
					m_CompassionGains = reader.ReadEncodedInt();

					if ( m_CompassionGains > 0 )
						m_NextCompassionDay = reader.ReadDeltaTime();

					goto case 13;
				}
				case 13: // just removed m_PayedInsurance list
				case 12:
				{
					m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
					goto case 11;
				}
				case 11:
				{
					if ( version < 13 )
					{
						ArrayList payed = reader.ReadItemList();
						// Adam: no more insurance
						//for ( int i = 0; i < payed.Count; ++i )
						//((Item)payed[i]).PayedInsurance = true;
					}

					goto case 10;
				}
				case 10:
				{
					if ( reader.ReadBool() )
					{
						m_HairModID = reader.ReadInt();
						m_HairModHue = reader.ReadInt();
						m_BeardModID = reader.ReadInt();
						m_BeardModHue = reader.ReadInt();

						// We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
						Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RevertHair ) );
					}

					goto case 9;
				}
				case 9:
				{
					SavagePaintExpiration = reader.ReadTimeSpan();

					if ( SavagePaintExpiration > TimeSpan.Zero )
					{
						// BodyMod = ( Female ? 184 : 183 );
						HueMod = 0;
					}

					goto case 8;
				}
				case 8:
				{
                    if (version < 30)
                    {
                        m_NpcGuild = (NpcGuild)reader.ReadInt();
                        m_NpcGuildJoinTime = reader.ReadDateTime();
                        m_NpcGuildGameTime = reader.ReadTimeSpan();
                    }
                    else if (GetSaveFlag(saveFlags, SaveFlag.NPCGuild) == true)
                    {
                        m_NpcGuild = (NpcGuild)reader.ReadInt();
                        m_NpcGuildJoinTime = reader.ReadDateTime();
                        m_NpcGuildGameTime = reader.ReadTimeSpan();
                    }
					goto case 7;
				}
				case 7:
				{
					m_PermaFlags = reader.ReadMobileList();
					goto case 6;
				}
				case 6:
				{
					NextTailorBulkOrder = reader.ReadTimeSpan();
					goto case 5;
				}
				case 5:
				{
					NextSmithBulkOrder = reader.ReadTimeSpan();
					goto case 4;
				}
				case 4:
				{
					m_LastJusticeLoss = reader.ReadDeltaTime();
					m_JusticeProtectors = reader.ReadMobileList();
					goto case 3;
				}
				case 3:
				{
					m_LastSacrificeGain = reader.ReadDeltaTime();
					m_LastSacrificeLoss = reader.ReadDeltaTime();
					m_AvailableResurrects = reader.ReadInt();
					goto case 2;
				}
				case 2:
				{
					m_Flags = (PlayerFlag)reader.ReadInt();
					goto case 1;
				}
				case 1:
				{
					m_LongTermElapse = reader.ReadTimeSpan();
					m_ShortTermElapse = reader.ReadTimeSpan();
					m_GameTime = reader.ReadTimeSpan();
					goto case 0;
				}
				case 0:
				{
					break;
				}
			}

			if ( m_PermaFlags == null )
				m_PermaFlags = new ArrayList();

			if ( m_JusticeProtectors == null )
				m_JusticeProtectors = new ArrayList();

			if ( m_BOBFilter == null )
				m_BOBFilter = new Engines.BulkOrders.BOBFilter();

			ArrayList list = this.Stabled;

			for ( int i = 0; i < list.Count; ++i )
			{
				BaseCreature bc = list[i] as BaseCreature;

				if ( bc != null )
					bc.IsStabled = true;
			}

			//Pix: this is for safety... to make sure it's set
			m_InmateLastDeathTime = DateTime.MinValue;

			//Pix: make sure this is set to minvalue for loading
			m_IOBStartedWearing = DateTime.MinValue;

			//wea: SpiritCohesion is not persistent across saves
			m_SpiritCohesion = 0;

			//wea: For spirit cohesion, last resurrect time
			m_LastResurrectTime = DateTime.MinValue;

		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			
		
			NextFletcherBulkOrder = reader.ReadTimeSpan();
			NextCarpenterBulkOrder = reader.ReadTimeSpan();
			m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
			m_Flags = (MyPlayerFlag)reader.ReadInt();
			
			if ( m_BOBFilter == null )
				m_BOBFilter = new Engines.BulkOrders.BOBFilter();
			
			
		}
Beispiel #34
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
                case 26:
                    {
                        #region GeNova: Mondain's Legacy
                        m_Quests = QuestReader.Quests(reader, this);
                        m_Chains = QuestReader.Chains(reader);

                        m_Collections = new Dictionary<Collection, int>();
                        m_CollectionTitles = new List<object>();

                        for (int i = reader.ReadInt(); i > 0; i--)
                            m_Collections.Add((Collection)reader.ReadInt(), reader.ReadInt());

                        for (int i = reader.ReadInt(); i > 0; i--)
                            m_CollectionTitles.Add(QuestReader.Object(reader));

                        m_SelectedTitle = reader.ReadInt();
                        m_Peaced = reader.ReadDateTime();
                        #endregion

                        goto case 25;
                    }
                case 25:
                    {
                        int recipeCount = reader.ReadInt();

                        if (recipeCount > 0)
                        {
                            m_AcquiredRecipes = new Dictionary<int, bool>();

                            for (int i = 0; i < recipeCount; i++)
                            {
                                int r = reader.ReadInt();
                                if (reader.ReadBool())	//Don't add in recipies which we haven't gotten or have been removed
                                    m_AcquiredRecipes.Add(r, true);
                            }
                        }
                        goto case 24;
                    }
                case 24:
                    {
                        m_LastHonorLoss = reader.ReadDeltaTime();
                        goto case 23;
                    }
                case 23:
                    {
                        m_ChampionTitles = new ChampionTitleInfo(reader);
                        goto case 22;
                    }
                case 22:
                    {
                        m_LastValorLoss = reader.ReadDateTime();
                        goto case 21;
                    }
                case 21:
                    {
                        m_ToTItemsTurnedIn = reader.ReadEncodedInt();
                        m_ToTTotalMonsterFame = reader.ReadInt();
                        goto case 20;
                    }
                case 20:
                    {
                        m_AllianceMessageHue = reader.ReadEncodedInt();
                        m_GuildMessageHue = reader.ReadEncodedInt();

                        goto case 19;
                    }
                case 19:
                    {
                        int rank = reader.ReadEncodedInt();
                        int maxRank = Guilds.RankDefinition.Ranks.Length - 1;
                        if (rank > maxRank)
                            rank = maxRank;

                        m_GuildRank = Guilds.RankDefinition.Ranks[rank];
                        m_LastOnline = reader.ReadDateTime();
                        goto case 18;
                    }
                case 18:
                    {
                        m_SolenFriendship = (SolenFriendship)reader.ReadEncodedInt();

                        goto case 17;
                    }
                case 17: // changed how DoneQuests is serialized
                case 16:
                    {
                        m_Quest = QuestSerializer.DeserializeQuest(reader);

                        if (m_Quest != null)
                            m_Quest.From = this;

                        int count = reader.ReadEncodedInt();

                        if (count > 0)
                        {
                            m_DoneQuests = new List<QuestRestartInfo>();

                            for (int i = 0; i < count; ++i)
                            {
                                Type questType = QuestSerializer.ReadType(QuestSystem.QuestTypes, reader);
                                DateTime restartTime;

                                if (version < 17)
                                    restartTime = DateTime.MaxValue;
                                else
                                    restartTime = reader.ReadDateTime();

                                m_DoneQuests.Add(new QuestRestartInfo(questType, restartTime));
                            }
                        }

                        m_Profession = reader.ReadEncodedInt();
                        goto case 15;
                    }
                case 15:
                    {
                        m_LastCompassionLoss = reader.ReadDeltaTime();
                        goto case 14;
                    }
                case 14:
                    {
                        m_CompassionGains = reader.ReadEncodedInt();

                        if (m_CompassionGains > 0)
                            m_NextCompassionDay = reader.ReadDeltaTime();

                        goto case 13;
                    }
                case 13: // just removed m_PayedInsurance list
                case 12:
                    {
                        m_BOBFilter = new Engines.BulkOrders.BOBFilter(reader);
                        goto case 11;
                    }
                case 11:
                    {
                        if (version < 13)
                        {
                            List<Item> payed = reader.ReadStrongItemList();

                            for (int i = 0; i < payed.Count; ++i)
                                payed[i].PayedInsurance = true;
                        }

                        goto case 10;
                    }
                case 10:
                    {
                        if (reader.ReadBool())
                        {
                            m_HairModID = reader.ReadInt();
                            m_HairModHue = reader.ReadInt();
                            m_BeardModID = reader.ReadInt();
                            m_BeardModHue = reader.ReadInt();

                            // We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
                            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(RevertHair));
                        }

                        goto case 9;
                    }
                case 9:
                    {
                        SavagePaintExpiration = reader.ReadTimeSpan();

                        if (SavagePaintExpiration > TimeSpan.Zero)
                        {
                            BodyMod = (Female ? 184 : 183);
                            HueMod = 0;
                        }

                        goto case 8;
                    }
                case 8:
                    {
                        m_NpcGuild = (NpcGuild)reader.ReadInt();
                        m_NpcGuildJoinTime = reader.ReadDateTime();
                        m_NpcGuildGameTime = reader.ReadTimeSpan();
                        goto case 7;
                    }
                case 7:
                    {
                        m_PermaFlags = reader.ReadStrongMobileList();
                        goto case 6;
                    }
                case 6:
                    {
                        NextTailorBulkOrder = reader.ReadTimeSpan();
                        goto case 5;
                    }
                case 5:
                    {
                        NextSmithBulkOrder = reader.ReadTimeSpan();
                        goto case 4;
                    }
                case 4:
                    {
                        m_LastJusticeLoss = reader.ReadDeltaTime();
                        m_JusticeProtectors = reader.ReadStrongMobileList();
                        goto case 3;
                    }
                case 3:
                    {
                        m_LastSacrificeGain = reader.ReadDeltaTime();
                        m_LastSacrificeLoss = reader.ReadDeltaTime();
                        m_AvailableResurrects = reader.ReadInt();
                        goto case 2;
                    }
                case 2:
                    {
                        m_Flags = (PlayerFlag)reader.ReadInt();
                        goto case 1;
                    }
                case 1:
                    {
                        m_LongTermElapse = reader.ReadTimeSpan();
                        m_ShortTermElapse = reader.ReadTimeSpan();
                        m_GameTime = reader.ReadTimeSpan();
                        goto case 0;
                    }
                case 0:
                    {
                        break;
                    }
            }

            #region GeNova: Mondain's Legacy
            if (m_Quests == null)
                m_Quests = new List<BaseQuest>();

            if (m_Chains == null)
                m_Chains = new Dictionary<QuestChain, BaseChain>();

            if (m_DoneQuests == null)
                m_DoneQuests = new List<QuestRestartInfo>();

            if (m_Collections == null)
                m_Collections = new Dictionary<Collection, int>();

            if (m_CollectionTitles == null)
                m_CollectionTitles = new List<object>();
            #endregion

            // Professions weren't verified on 1.0 RC0
            if (!CharacterCreation.VerifyProfession(m_Profession))
                m_Profession = 0;

            if (m_PermaFlags == null)
                m_PermaFlags = new List<Mobile>();

            if (m_JusticeProtectors == null)
                m_JusticeProtectors = new List<Mobile>();

            if (m_BOBFilter == null)
                m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            if (m_GuildRank == null)
                m_GuildRank = Guilds.RankDefinition.Member;	//Default to member if going from older verstion to new version (only time it should be null)

            if (m_LastOnline == DateTime.MinValue && Account != null)
                m_LastOnline = ((Account)Account).LastLogin;

            if (m_ChampionTitles == null)
                m_ChampionTitles = new ChampionTitleInfo();

            List<Mobile> list = this.Stabled;

            for (int i = 0; i < list.Count; ++i)
            {
                BaseCreature bc = list[i] as BaseCreature;

                if (bc != null)
                    bc.IsStabled = true;
            }

            CheckAtrophies(this);


            if (Hidden)	//Hiding is the only buff where it has an effect that's serialized.
                AddBuff(new BuffInfo(BuffIcon.HidingAndOrStealth, 1075655));
        }
		//--<<Custom BODs>>-----------------------[End 1/1]
		
		public PlayerModule( Serial serial ): base( serial )
		{
		//--<<Custom BODs>>-----------------------[Start 1/1]
			m_BOBFilter = new Engines.BulkOrders.BOBFilter();
			//m_TamingBOBFilter = new Engines.BulkOrders.TamingBOBFilter();
			//m_TinkBOBFilter = new Engines.BulkOrders.TinkBOBFilter();
		//--<<Custom BODs>>-----------------------[End 1/1]
		}