本文整理汇总了C#中Server.Items.MegaSpawner.CompileSettings方法的典型用法代码示例。如果您正苦于以下问题:C# MegaSpawner.CompileSettings方法的具体用法?C# MegaSpawner.CompileSettings怎么用?C# MegaSpawner.CompileSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.MegaSpawner
的用法示例。
在下文中一共展示了MegaSpawner.CompileSettings方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
//.........这里部分代码省略.........
for ( int j = 6; j < settingCount; j++ )
{
ArrayList ItemsList = new ArrayList();
ItemsList.Add( reader.ReadString() );
ItemsList.Add( reader.ReadInt() );
ItemsList.Add( reader.ReadInt() );
List.Add( ItemsList );
}
break;
}
}
megaSpawner.SettingsList.Add( List );
}
}
else
{
for ( int i = 0; i < settingsCount; i++ )
megaSpawner.SettingsList.Add( reader.ReadString() );
megaSpawner.ConvertOldSettings();
}
}
if ( megaSpawner.Workspace )
{
megaSpawner.Delete();
}
else
{
megaSpawner.MoveToWorld( location, map );
megaSpawner.Start();
if ( megaSpawner.Imported != "" )
MC.FileImportAdd( megaSpawner.Imported, megaSpawner.ImportVersion );
megaSpawner.CompileSettings();
megaSpawner.CheckEntryErrors();
megaSpawner.SettingsList.Sort( new MC.SettingsSorter() );
if ( megaSpawner.OverrideIndividualEntries )
{
for ( int i = 0; i < megaSpawner.OverrideAmount; i++ )
{
megaSpawner.OverrideRespawnEntryList.Add( "" );
megaSpawner.OverrideRespawnTimeList.Add( 0 );
megaSpawner.OverrideSpawnCounterList.Add( DateTime.Now );
megaSpawner.OverrideSpawnTimeList.Add( 0 );
megaSpawner.OverrideDespawnTimeList.Add( 0 );
}
}
else
{
for ( int i = 0; i < megaSpawner.EntryList.Count; i++ )
{
ArrayList respawnEntryList = new ArrayList();
ArrayList respawnTimeList = new ArrayList();
ArrayList spawnCounterList = new ArrayList();
ArrayList spawnTimeList = new ArrayList();
ArrayList respawnOnSaveList = new ArrayList();
ArrayList despawnTimeList = new ArrayList();
for ( int j = 0; j < (int) megaSpawner.AmountList[i]; j++ )
{
respawnEntryList.Add( (string) megaSpawner.EntryList[i] );
respawnTimeList.Add( 0 );
spawnCounterList.Add( DateTime.Now );
spawnTimeList.Add( 0 );
respawnOnSaveList.Add( (bool) false );
despawnTimeList.Add( 0 );
}
megaSpawner.RespawnEntryList.Add( respawnEntryList );
megaSpawner.RespawnTimeList.Add( respawnTimeList );
megaSpawner.SpawnCounterList.Add( spawnCounterList );
megaSpawner.SpawnTimeList.Add( spawnTimeList );
megaSpawner.RespawnOnSaveList.Add( respawnOnSaveList );
megaSpawner.DespawnTimeList.Add( despawnTimeList );
megaSpawner.SpawnedEntries.Add( new ArrayList() );
megaSpawner.LastMovedList.Add( new ArrayList() );
}
}
megaSpawner.Respawn();
}
success = true;
}
catch
{
if ( megaSpawner != null )
megaSpawner.Delete();
}
return success;
}
示例2: ImportMegaSpawner
//.........这里部分代码省略.........
}
}
catch{}
}
else
{
foreach ( XmlElement setting in settingsList.GetElementsByTagName( "Setting" ) )
{
try{ megaSpawner.SettingsList.Add( setting.InnerText ); }
catch{ errors++; totalErrors++; }
}
megaSpawner.ConvertOldSettings();
}
}
if ( errors > 0 )
{
megaSpawner.Delete();
amountOfSpawners--;
}
else
{
megaSpawner.MoveToWorld( location, map );
if ( location.Z == -999 )
megaSpawner.Location = GetLocation( megaSpawner, location );
if ( megaSpawner.Location.Z == -999 )
{
megaSpawner.Delete();
amountOfSpawners--;
autoFailures++;
return;
}
megaSpawner.CheckDupedSettings();
megaSpawner.CompileSettings();
megaSpawner.SettingsList.Sort( new MC.SettingsSorter() );
if ( megaSpawner.OverrideIndividualEntries )
{
for ( int i = 0; i < megaSpawner.OverrideAmount; i++ )
{
megaSpawner.OverrideRespawnEntryList.Add( "" );
megaSpawner.OverrideRespawnTimeList.Add( 0 );
megaSpawner.OverrideSpawnCounterList.Add( DateTime.Now );
megaSpawner.OverrideSpawnTimeList.Add( 0 );
megaSpawner.OverrideDespawnTimeList.Add( 0 );
}
}
else
{
for ( int i = 0; i < megaSpawner.EntryList.Count; i++ )
{
ArrayList respawnEntryList = new ArrayList();
ArrayList respawnTimeList = new ArrayList();
ArrayList spawnCounterList = new ArrayList();
ArrayList spawnTimeList = new ArrayList();
ArrayList respawnOnSaveList = new ArrayList();
ArrayList despawnTimeList = new ArrayList();
for ( int j = 0; j < (int) megaSpawner.AmountList[i]; j++ )
{
respawnEntryList.Add( (string) megaSpawner.EntryList[i] );
respawnTimeList.Add( 0 );
spawnCounterList.Add( DateTime.Now );
spawnTimeList.Add( 0 );
respawnOnSaveList.Add( (bool) false );
despawnTimeList.Add( 0 );
}
megaSpawner.RespawnEntryList.Add( respawnEntryList );
megaSpawner.RespawnTimeList.Add( respawnTimeList );
megaSpawner.SpawnCounterList.Add( spawnCounterList );
megaSpawner.SpawnTimeList.Add( spawnTimeList );
megaSpawner.RespawnOnSaveList.Add( respawnOnSaveList );
megaSpawner.DespawnTimeList.Add( despawnTimeList );
megaSpawner.SpawnedEntries.Add( new ArrayList() );
megaSpawner.LastMovedList.Add( new ArrayList() );
}
}
SpawnerList.Add( megaSpawner );
if ( megaSpawner.Active )
{
megaSpawner.Respawn();
}
HideSpawnerList.Add( (bool) false );
MSGCheckBoxesList.Add( (bool) false );
MC.FileImportAdd( megaSpawner.Imported, megaSpawner.ImportVersion );
}
}
示例3: DupeSpawner
public static MegaSpawner DupeSpawner( MegaSpawner fromDupe, MegaSpawner toDupe )
{
toDupe.EntryList = DupeList( fromDupe.EntryList );
toDupe.SpawnRangeList = DupeList( fromDupe.SpawnRangeList );
toDupe.WalkRangeList = DupeList( fromDupe.WalkRangeList );
toDupe.AmountList = DupeList( fromDupe.AmountList );
toDupe.MinDelayList = DupeList( fromDupe.MinDelayList );
toDupe.MaxDelayList = DupeList( fromDupe.MaxDelayList );
toDupe.SpawnTypeList = DupeList( fromDupe.SpawnTypeList );
toDupe.ActivatedList = DupeList( fromDupe.ActivatedList );
toDupe.EventRangeList = DupeList( fromDupe.EventRangeList );
toDupe.EventKeywordList = DupeList( fromDupe.EventKeywordList );
toDupe.KeywordCaseSensitiveList = DupeList( fromDupe.KeywordCaseSensitiveList );
toDupe.TriggerEventNowList = DupeList( fromDupe.TriggerEventNowList );
toDupe.EventAmbushList = DupeList( fromDupe.EventAmbushList );
toDupe.BeginTimeBasedList = DupeList( fromDupe.BeginTimeBasedList );
toDupe.EndTimeBasedList = DupeList( fromDupe.EndTimeBasedList );
toDupe.GroupSpawnList = DupeList( fromDupe.GroupSpawnList );
toDupe.MinStackAmountList = DupeList( fromDupe.MinStackAmountList );
toDupe.MaxStackAmountList = DupeList( fromDupe.MaxStackAmountList );
toDupe.MovableList = DupeList( fromDupe.MovableList );
toDupe.MinDespawnList = DupeList( fromDupe.MinDespawnList );
toDupe.MaxDespawnList = DupeList( fromDupe.MaxDespawnList );
toDupe.DespawnList = DupeList( fromDupe.DespawnList );
toDupe.DespawnGroupList = DupeList( fromDupe.DespawnGroupList );
toDupe.DespawnTimeExpireList = DupeList( fromDupe.DespawnTimeExpireList );
toDupe.SettingsList = DupeList( fromDupe.SettingsList );
toDupe.RespawnEntryList = new ArrayList();
toDupe.RespawnTimeList = new ArrayList();
toDupe.SpawnCounterList = new ArrayList();
toDupe.SpawnTimeList = new ArrayList();
toDupe.RespawnOnSaveList = new ArrayList();
toDupe.DespawnTimeList = new ArrayList();
toDupe.OverrideRespawnEntryList = new ArrayList();
toDupe.OverrideRespawnTimeList = new ArrayList();
toDupe.OverrideSpawnCounterList = new ArrayList();
toDupe.OverrideSpawnTimeList = new ArrayList();
toDupe.OverrideDespawnTimeList = new ArrayList();
toDupe.SpawnedEntries = new ArrayList();
toDupe.LastMovedList = new ArrayList();
toDupe.OverrideSpawnedEntries = new ArrayList();
toDupe.OverrideLastMovedList = new ArrayList();
toDupe.Name = fromDupe.Name;
toDupe.Active = fromDupe.Active;
toDupe.NoProximityType = fromDupe.NoProximityType;
toDupe.NoSpeechType = fromDupe.NoSpeechType;
toDupe.ContainerSpawn = fromDupe.ContainerSpawn;
toDupe.OverrideRespawnOnSave = fromDupe.OverrideRespawnOnSave;
toDupe.CompileSettings();
for( int i = 0; i < toDupe.EntryList.Count; i++ )
{
string entryType = (string) toDupe.EntryList[i];
int amount = (int) toDupe.AmountList[i];
toDupe.SpawnedEntries.Add( new ArrayList() );
toDupe.LastMovedList.Add( new ArrayList() );
ArrayList respawnEntryList = new ArrayList();
ArrayList respawnTimeList = new ArrayList();
ArrayList spawnCounterList = new ArrayList();
ArrayList spawnTimeList = new ArrayList();
ArrayList respawnOnSaveList = new ArrayList();
ArrayList despawnTimeList = new ArrayList();
for( int j = 0; j < amount; j++ )
{
respawnEntryList.Add( entryType );
respawnTimeList.Add( 0 );
spawnCounterList.Add( DateTime.Now );
spawnTimeList.Add( 0 );
respawnOnSaveList.Add( (bool) false );
despawnTimeList.Add( 0 );
}
toDupe.RespawnEntryList.Add( respawnEntryList );
toDupe.RespawnTimeList.Add( respawnTimeList );
toDupe.SpawnCounterList.Add( spawnCounterList );
toDupe.SpawnTimeList.Add( spawnTimeList );
toDupe.RespawnOnSaveList.Add( respawnOnSaveList );
toDupe.DespawnTimeList.Add( despawnTimeList );
}
for( int i = 0; i < toDupe.OverrideAmount; i++ )
{
toDupe.OverrideRespawnEntryList.Add( "" );
toDupe.OverrideRespawnTimeList.Add( 0 );
toDupe.OverrideSpawnCounterList.Add( DateTime.Now );
toDupe.OverrideSpawnTimeList.Add( 0 );
toDupe.OverrideDespawnTimeList.Add( 0 );
}
return toDupe;
}
示例4: ConvertDistroSpawner
//.........这里部分代码省略.........
else
megaSpawner.AmountList.Add( (int) ( spawner.Count / count ) + 1 );
calcMinDelay = ( spawner.MinDelay.Hours * 3600 ) + ( spawner.MinDelay.Minutes * 60 ) + spawner.MinDelay.Seconds;
calcMaxDelay = ( spawner.MaxDelay.Hours * 3600 ) + ( spawner.MaxDelay.Minutes * 60 ) + spawner.MaxDelay.Seconds;
Type entryType = ScriptCompiler.FindTypeByName( (string) spawner.CreaturesName[i] );
if ( entryType != null )
{
Item toAdd = null;
try
{
toAdd = (Item) Activator.CreateInstance( entryType );
movable = toAdd.Movable;
}
catch{}
if ( toAdd != null )
toAdd.Delete();
}
megaSpawner.MinDelayList.Add( calcMinDelay );
megaSpawner.MaxDelayList.Add( calcMaxDelay );
megaSpawner.SpawnTypeList.Add( SpawnType.Regular );
megaSpawner.ActivatedList.Add( (bool) true );
megaSpawner.EventRangeList.Add( 10 );
megaSpawner.EventKeywordList.Add( "" );
megaSpawner.KeywordCaseSensitiveList.Add( (bool) false );
megaSpawner.TriggerEventNowList.Add( (bool) true );
megaSpawner.EventAmbushList.Add( (bool) true );
megaSpawner.BeginTimeBasedList.Add( 0 );
megaSpawner.EndTimeBasedList.Add( 0 );
megaSpawner.GroupSpawnList.Add( spawner.Group );
megaSpawner.MinStackAmountList.Add( 1 );
megaSpawner.MaxStackAmountList.Add( 1 );
megaSpawner.MovableList.Add( movable );
megaSpawner.MinDespawnList.Add( 1800 );
megaSpawner.MaxDespawnList.Add( 3600 );
megaSpawner.DespawnList.Add( (bool) false );
megaSpawner.DespawnGroupList.Add( (bool) false );
megaSpawner.DespawnTimeExpireList.Add( (bool) true );
}
}
ArrayList settingList = new ArrayList();
settingList.Add( Setting.OverrideIndividualEntries );
settingList.Add( spawner.HomeRange );
settingList.Add( walkRange );
settingList.Add( spawner.Count );
settingList.Add( calcMinDelay );
settingList.Add( calcMaxDelay );
settingList.Add( spawner.Group );
settingList.Add( (bool) true );
settingList.Add( SpawnType.Regular );
settingList.Add( "" );
settingList.Add( (bool) false );
settingList.Add( 10 );
settingList.Add( 0 );
settingList.Add( 0 );
settingList.Add( 0 );
settingList.Add( 0 );
settingList.Add( 1800 );
settingList.Add( 3600 );
settingList.Add( (bool) false );
settingList.Add( (bool) false );
settingList.Add( (bool) true );
megaSpawner.SettingsList.Add( settingList );
megaSpawner.CompileSettings();
megaSpawner.SettingsList.Sort( new MC.SettingsSorter() );
for ( int j = 0; j < megaSpawner.OverrideAmount; j++ )
{
megaSpawner.OverrideRespawnEntryList.Add( "" );
megaSpawner.OverrideRespawnTimeList.Add( 0 );
megaSpawner.OverrideSpawnCounterList.Add( DateTime.Now );
megaSpawner.OverrideSpawnTimeList.Add( 0 );
megaSpawner.OverrideDespawnTimeList.Add( 0 );
}
megaSpawner.MoveToWorld( spawner.Location, spawner.Map );
if ( megaSpawner.Active )
{
MegaSpawnerOverride.CheckDupedEntries( megaSpawner );
megaSpawner.Start();
megaSpawner.Respawn();
}
HideSpawnerList.Add( (bool) false );
MSGCheckBoxesList.Add( (bool) false );
spawner.Delete();
}