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


C# Items.MegaSpawner类代码示例

本文整理汇总了C#中Server.Items.MegaSpawner的典型用法代码示例。如果您正苦于以下问题:C# MegaSpawner类的具体用法?C# MegaSpawner怎么用?C# MegaSpawner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: AddToRespawnEntries

        public static void AddToRespawnEntries( MegaSpawner megaSpawner, object o )
        {
            bool success = false;

            for ( int i = 0; i < megaSpawner.OverrideRespawnEntryList.Count; i++ )
            {
                int randomDespawnTime = Utility.Random( megaSpawner.OverrideMinDespawn, megaSpawner.OverrideMaxDespawn - megaSpawner.OverrideMinDespawn );

                if ( megaSpawner.OverrideRespawnEntryList[i] is string )
                {
                    object respawnEntry = o;

                    if ( o is Item )
                        respawnEntry = (Item) o;
                    else if ( o is Mobile )
                        respawnEntry = (Mobile) o;

                    if ( (string) megaSpawner.OverrideRespawnEntryList[i] == "" && ( (int) megaSpawner.OverrideRespawnTimeList[i] <= MegaSpawner.tickOffset || megaSpawner.OverrideGroupSpawn ) )
                    {
                        success = true;

                        megaSpawner.OverrideRespawnEntryList[i] = respawnEntry;
                        megaSpawner.OverrideDespawnTimeList[i] = randomDespawnTime;

                        break;
                    }
                }
            }

            if ( !success )
                MC.DeleteObject( o );
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:32,代码来源:MegaSpawnerOverride.cs

示例2: CheckEntries

		public static void CheckEntries( MegaSpawner megaSpawner )
		{
			for ( int i = 0; i < megaSpawner.OverrideSpawnedEntries.Count; i++ )
			{
				object o = megaSpawner.OverrideSpawnedEntries[i];

				if ( o is Item )
				{
					Item item = (Item) o;

					if ( megaSpawner.OverrideLastMovedList[i] is int )
						megaSpawner.OverrideLastMovedList[i] = item.LastMoved;

					DateTime lastMoved = (DateTime) megaSpawner.OverrideLastMovedList[i];

					if ( item.RootParent != null && item.RootParent == (object) megaSpawner.ContainerSpawn && lastMoved != item.LastMoved )
					{
						lastMoved = item.LastMoved;
						megaSpawner.OverrideLastMovedList[i] = item.LastMoved;
					}

					if ( item.Deleted || ( item.RootParent != null && megaSpawner.ContainerSpawn != null && item.RootParent != (object) megaSpawner.ContainerSpawn ) || ( item.RootParent != null && megaSpawner.RootParent != null && item.RootParent != megaSpawner.RootParent ) || lastMoved != item.LastMoved )
					{
						megaSpawner.OverrideSpawnedEntries.RemoveAt( i );
						megaSpawner.OverrideLastMovedList.RemoveAt( i );

						SpawnCounter( megaSpawner, o );

						i--;
					}
				}
				else if ( o is Mobile )
				{
					Mobile mob = (Mobile) o;

					if ( mob.Deleted || ( mob is BaseCreature && ( ( (BaseCreature) mob ).Controlled || ( (BaseCreature) mob ).IsStabled ) ) )
					{
						megaSpawner.OverrideSpawnedEntries.RemoveAt( i );
						megaSpawner.OverrideLastMovedList.RemoveAt( i );

						SpawnCounter( megaSpawner, o );

						i--;
					}
				}
				else
				{
					megaSpawner.OverrideSpawnedEntries.RemoveAt( i );
					megaSpawner.OverrideLastMovedList.RemoveAt( i );

					SpawnCounter( megaSpawner, o );

					i--;
				}
			}
		}
开发者ID:brodock,项目名称:genova-project,代码行数:56,代码来源:MegaSpawnerOverride.cs

示例3: BringToHome

        public static void BringToHome( MegaSpawner megaSpawner )
        {
            for ( int i = 0; i < megaSpawner.OverrideSpawnedEntries.Count; i++ )
            {
                object o = megaSpawner.OverrideSpawnedEntries[i];

                if ( o is Mobile )
                    ( (Mobile) o ).Location = megaSpawner.Location;
            }
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:10,代码来源:MegaSpawnerOverride.cs

示例4: CountEntries

		public static int CountEntries( MegaSpawner megaSpawner, int index )
		{
			int entryCount = 0;

			for ( int i = 0; i < megaSpawner.OverrideSpawnedEntries.Count; i++ )
			{
				object o = megaSpawner.OverrideSpawnedEntries[i];
				string entryType = (string) megaSpawner.EntryList[index];

				if ( o.GetType().Name.ToLower() == entryType.ToLower() )
					entryCount++;
			}

			return entryCount;
		}
开发者ID:brodock,项目名称:genova-project,代码行数:15,代码来源:MegaSpawnerOverride.cs

示例5: AddSpawnCount

        public static void AddSpawnCount( MegaSpawner megaSpawner, int index )
        {
            int randomDelay = Utility.Random( megaSpawner.OverrideMinDelay, megaSpawner.OverrideMaxDelay - megaSpawner.OverrideMinDelay );

            if ( megaSpawner.OverrideGroupSpawn )
            {
                for ( int i = 0; i < megaSpawner.OverrideRespawnEntryList.Count; i++ )
                {
                    if ( (string) megaSpawner.OverrideRespawnEntryList[i] == "" )
                    {
                        megaSpawner.OverrideRespawnTimeList[i] = randomDelay + MegaSpawner.tickOffset;
                        megaSpawner.OverrideSpawnCounterList[i] = DateTime.Now;
                        megaSpawner.OverrideSpawnTimeList[i] = randomDelay;
                    }
                }
            }
            else
            {
                megaSpawner.OverrideRespawnTimeList[index] = randomDelay + MegaSpawner.tickOffset;
                megaSpawner.OverrideSpawnCounterList[index] = DateTime.Now;
                megaSpawner.OverrideSpawnTimeList[index] = randomDelay;
            }
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:23,代码来源:MegaSpawnerOverride.cs

示例6: Deserialize

        public static bool Deserialize( GenericReader reader )
        {
            bool success = false;

            Map map = null;
            Point3D location = new Point3D();

            MegaSpawner megaSpawner = new MegaSpawner( true );

            try
            {
                int version = reader.ReadInt();

                if ( version >= 1 )
                {
                    location = reader.ReadPoint3D();
                    map = reader.ReadMap();
                    megaSpawner.Active = reader.ReadBool();

                    megaSpawner.Imported = reader.ReadString();
                    megaSpawner.ImportVersion = reader.ReadString();
                    megaSpawner.ContainerSpawn = (Container) reader.ReadItem();
                    megaSpawner.Workspace = reader.ReadBool();

                    int count = reader.ReadInt();

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EntryList.Add( reader.ReadString() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.SpawnRangeList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.WalkRangeList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                    {
                        int amount = reader.ReadInt();

                        if ( amount == 0 )
                            amount = 1;

                        megaSpawner.AmountList.Add( amount );
                    }

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MinDelayList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MaxDelayList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.SpawnTypeList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.ActivatedList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EventRangeList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EventKeywordList.Add( reader.ReadString() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.KeywordCaseSensitiveList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.TriggerEventNowList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EventAmbushList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.BeginTimeBasedList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EndTimeBasedList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.GroupSpawnList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MinStackAmountList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MaxStackAmountList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MovableList.Add( reader.ReadBool() );

                    if ( version >= 2 )
                    {
                        for ( int i = 0; i < count; i++ )
                            megaSpawner.MinDespawnList.Add( reader.ReadInt() );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.MaxDespawnList.Add( reader.ReadInt() );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.DespawnList.Add( reader.ReadBool() );
//.........这里部分代码省略.........
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:101,代码来源:BackupSystem.cs

示例7: GetArgsList

        private void GetArgsList()
        {
            MessagesTitle = (string)					ArgsList[2];
            Messages = (string)						ArgsList[4];
            HideSpawnerList = (ArrayList) 					ArgsList[6];
            MSGCheckBoxesList = (ArrayList)					ArgsList[13];
            megaSpawner = (MegaSpawner) 					ArgsList[19];
            fromSpawnerList = (bool) 					ArgsList[20];
            PersonalConfigList = (ArrayList)				ArgsList[28];

            StyleTypeConfig = (StyleType)					PersonalConfigList[0];
            BackgroundTypeConfig = (BackgroundType)				PersonalConfigList[1];
            DefaultTextColor = (TextColor)					PersonalConfigList[4];
            TitleTextColor = (TextColor)					PersonalConfigList[5];
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:15,代码来源:ConfirmDeleteSpawnerGump.cs

示例8: RemoveEditor

		public static void RemoveEditor( Mobile mobile, MegaSpawner megaSpawner )
		{
			for ( int i = 0; i < MSUsers.Count; i++ )
			{
				Mobile MSUser = (Mobile) MSUsers[i];
				
				if ( mobile == MSUser )
					MSEdit[i] = null;
			}
		}
开发者ID:brodock,项目名称:genova-project,代码行数:10,代码来源:MasterControl.cs

示例9: AddToWorkspace

		public static void AddToWorkspace( Mobile mobile, MegaSpawner megaSpawner )
		{
			for ( int i = 0; i < MSUsers.Count; i++ )
			{
				Mobile MSUser = (Mobile) MSUsers[i];
				
				if ( mobile == MSUser )
				{
					ArrayList Workspace = (ArrayList) MSWorkspace[i];
					Workspace.Add( megaSpawner );
					MSWorkspace[i] = Workspace;
				}
			}
		}
开发者ID:brodock,项目名称:genova-project,代码行数:14,代码来源:MasterControl.cs

示例10: LocationSorter

		private static int LocationSorter( bool descOrder, SortSearchType sortType, MegaSpawner a, MegaSpawner b )
		{
			int aX, bX, aY, bY, aZ, bZ, sort=0;
			
			if ( a.Parent != null )
			{
				aX = ( (Item) a.Parent ).Location.X;
				aY = ( (Item) a.Parent ).Location.Y;
				aZ = ( (Item) a.Parent ).Location.Z;
			}
			else
			{
				aX = a.X;
				aY = a.Y;
				aZ = a.Z;
			}
			
			if ( b.Parent != null )
			{
				bX = ( (Item) b.Parent ).Location.X;
				bY = ( (Item) b.Parent ).Location.Y;
				bZ = ( (Item) b.Parent ).Location.Z;
			}
			else
			{
				bX = b.X;
				bY = b.Y;
				bZ = b.Z;
			}
			
			switch ( sortType )
			{
				case SortSearchType.LocationX:
					{
						if ( aX < bX )
						{
							sort = -1;
						}
						else if ( aX > bX )
						{
							sort = 1;
						}
						else // if ( aX == bX )
						{
							if ( aY < bY )
							{
								if ( descOrder )
									sort = 1;
								else
									sort = -1;
							}
							else if ( aY > bY )
							{
								if ( descOrder )
									sort = -1;
								else
									sort = 1;
							}
							else // if ( aY == bY )
							{
								if ( aZ < bZ )
									sort = -1;
								else if ( aZ > bZ )
									sort = 1;
								else // if ( aZ == bZ )
									sort = 0;
								
								if ( descOrder )
									sort = -sort;
							}
						}
						
						break;
					}
				case SortSearchType.LocationY:
					{
						if ( aY < bY )
						{
							sort = -1;
						}
						else if ( aY > bY )
						{
							sort = 1;
						}
						else // if ( aY == bY )
						{
							if ( aX < bX )
							{
								if ( descOrder )
									sort = 1;
								else
									sort = -1;
							}
							else if ( aX > bX )
							{
								if ( descOrder )
									sort = -1;
								else
									sort = 1;
							}
//.........这里部分代码省略.........
开发者ID:brodock,项目名称:genova-project,代码行数:101,代码来源:MasterControl.cs

示例11: SpawnerCompare

		public static int SpawnerCompare( MegaSpawner fromCompare, MegaSpawner toCompare, bool delete )
		{
			if ( !ListCompare( fromCompare.EntryList, toCompare.EntryList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.SpawnRangeList, toCompare.SpawnRangeList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.WalkRangeList, toCompare.WalkRangeList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.AmountList, toCompare.AmountList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.MinDelayList, toCompare.MinDelayList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.MaxDelayList, toCompare.MaxDelayList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.SpawnTypeList, toCompare.SpawnTypeList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.ActivatedList, toCompare.ActivatedList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.EventRangeList, toCompare.EventRangeList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.EventKeywordList, toCompare.EventKeywordList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.KeywordCaseSensitiveList, toCompare.KeywordCaseSensitiveList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.EventAmbushList, toCompare.EventAmbushList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.BeginTimeBasedList, toCompare.BeginTimeBasedList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.EndTimeBasedList, toCompare.EndTimeBasedList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.GroupSpawnList, toCompare.GroupSpawnList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.MinStackAmountList, toCompare.MinStackAmountList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.MaxStackAmountList, toCompare.MaxStackAmountList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.MovableList, toCompare.MovableList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.MinDespawnList, toCompare.MinDespawnList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.MaxDespawnList, toCompare.MaxDespawnList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.DespawnList, toCompare.DespawnList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.DespawnGroupList, toCompare.DespawnGroupList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.DespawnTimeExpireList, toCompare.DespawnTimeExpireList ) )
				return 0;
			
			if ( !ListCompare( fromCompare.SettingsList, toCompare.SettingsList ) )
				return 0;
			
			if ( delete )
				toCompare.Delete();
			
			return 1;
		}
开发者ID:brodock,项目名称:genova-project,代码行数:79,代码来源:MasterControl.cs

示例12: GetArgsList

        private void GetArgsList()
        {
            Help = (bool)											ArgsList[0];
            DisplayMessages = (bool)								ArgsList[1];
            MessagesTitle = (string)								ArgsList[2];
            OldMessagesTitle = (string)								ArgsList[3];
            Messages = (string)										ArgsList[4];
            OldMessages = (string)									ArgsList[5];
            PageInfoList = (ArrayList)								ArgsList[12];
            SettingsCheckBoxesList = (ArrayList)					ArgsList[17];
            megaSpawner = (MegaSpawner)								ArgsList[19];
            AVSArgsList = (ArrayList)								ArgsList[22];
            AVSSetList = (ArrayList)								ArgsList[23];
            PersonalConfigList = (ArrayList)						ArgsList[28];

            cpg = (int)												PageInfoList[12];
            pg = (int)												PageInfoList[13];

            StyleTypeConfig = (StyleType)							PersonalConfigList[0];
            BackgroundTypeConfig = (BackgroundType)					PersonalConfigList[1];
            DefaultTextColor = (TextColor)							PersonalConfigList[4];
            TitleTextColor = (TextColor)							PersonalConfigList[5];
            MessagesTextColor = (TextColor)							PersonalConfigList[6];
            CommandButtonsTextColor = (TextColor)					PersonalConfigList[7];
            PageNumberTextColor = (int)								PersonalConfigList[8];
            FlagTextColor = (TextColor)									PersonalConfigList[14];
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:27,代码来源:SettingsGump.cs

示例13: DeleteEntries

		public static void DeleteEntries( MegaSpawner megaSpawner )
		{
			for ( int i = 0; i < megaSpawner.OverrideSpawnedEntries.Count; i++ )
			{
				object o = megaSpawner.OverrideSpawnedEntries[i];

				MC.DeleteObject( o );

				if ( megaSpawner.OverrideRespawnEntryList.Count == megaSpawner.OverrideSpawnedEntries.Count )
					megaSpawner.OverrideRespawnEntryList[i] = "";
			}

			megaSpawner.OverrideSpawnedEntries.Clear();
			megaSpawner.OverrideLastMovedList.Clear();
		}
开发者ID:brodock,项目名称:genova-project,代码行数:15,代码来源:MegaSpawnerOverride.cs

示例14: OnSpeech

		public static void OnSpeech( MegaSpawner megaSpawner, SpeechEventArgs e )
		{
			Mobile mobile = e.Mobile;

			if ( EventSpawnAttempt( megaSpawner, SpawnType.Speech ) )
			{
				if ( Utility.InRange( megaSpawner.Location, mobile.Location, megaSpawner.OverrideEventRange ) )
				{
					int entryCount = CountEntries( megaSpawner );

					if ( megaSpawner.OverrideCaseSensitive && megaSpawner.OverrideEventKeyword != e.Speech )
						return;
					else if ( megaSpawner.OverrideEventKeyword.ToLower() != e.Speech.ToLower() )
						return;

					if ( megaSpawner.OverrideGroupSpawn && entryCount != 0 )
						return;

					if ( ( megaSpawner.OverrideGroupSpawn && entryCount == 0 ) || CheckEventAmbush( megaSpawner ) )
						FullSpawn( megaSpawner );
					else
						SingleSpawn( megaSpawner );
				}

				megaSpawner.OverrideTriggerEventNow = false;
			}
		}
开发者ID:brodock,项目名称:genova-project,代码行数:27,代码来源:MegaSpawnerOverride.cs

示例15: GetSettingInfo

		public static string GetSettingInfo( MegaSpawner megaSpawner, ArrayList setting )
		{
			bool AddItem=false, ContainerItems=false;
			
			string entryName=null, addItem=null, entryType=null;
			int entryIndex=0, minStackAmount=0, maxStackAmount=0;
			
			try
			{
				switch( (Setting) setting[0] )
				{
						case Setting.OverrideIndividualEntries:{ return "Override Individual Entries"; }
					case Setting.AddItem:
						{
							AddItem = true;
							
							entryName = (string)								setting[1];
							entryIndex = (int)							setting[2];
							addItem = (string)									setting[3];
							minStackAmount = (int)							setting[4];
							maxStackAmount = (int)							setting[5];
							
							if ( megaSpawner != null )
								entryType = (string) megaSpawner.EntryList[entryIndex];
							else
								entryType = entryName;
							
							break;
						}
					case Setting.AddContainer:
						{
							AddItem = true;
							ContainerItems = true;
							
							entryName = (string)								setting[1];
							entryIndex = (int)							setting[2];
							addItem = (string)									setting[3];
							minStackAmount = (int)							setting[4];
							maxStackAmount = (int)							setting[5];
							
							if ( megaSpawner != null )
								entryType = (string) megaSpawner.EntryList[entryIndex];
							else
								entryType = entryName;
							
							break;
						}
						default:{ return "Unknown Error"; }
				}
				
				if ( AddItem )
				{
					if ( megaSpawner != null && entryName != entryType )
						return String.Format( "Entry #{0}: Add Item To Spawn Entry [Discrepancy Error]", entryIndex );
					else if ( IsStackable( addItem ) )
						return String.Format( "Entry #{0}: Add Random {1} To {2} \"{3}\" To \"{4}\"", entryIndex, minStackAmount, maxStackAmount, addItem, entryType );
					else
						return String.Format( "Entry #{0}: Add \"{1}\"{2} To \"{3}\"", entryIndex, addItem, ContainerItems ? " With Items" : "", entryType );
				}
			}
			catch{}
			
			return "Error reading setting info. Possible missing or corrupt data.";
		}
开发者ID:brodock,项目名称:genova-project,代码行数:64,代码来源:MasterControl.cs


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