本文整理匯總了C#中Server.Items.MegaSpawner.Respawn方法的典型用法代碼示例。如果您正苦於以下問題:C# MegaSpawner.Respawn方法的具體用法?C# MegaSpawner.Respawn怎麽用?C# MegaSpawner.Respawn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Items.MegaSpawner
的用法示例。
在下文中一共展示了MegaSpawner.Respawn方法的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: Importv1
//.........這裏部分代碼省略.........
megaSpawner.EventKeywordList.Add( "" ); // EVent Keyword List
megaSpawner.KeywordCaseSensitiveList.Add( (bool) false );
megaSpawner.TriggerEventNowList.Add( (bool) true ); // Trigger Event Now List
megaSpawner.EventAmbushList.Add( (bool) true ); // Event Ambush List
megaSpawner.BeginTimeBasedList.Add( 0 ); // Begin Time Based List
megaSpawner.EndTimeBasedList.Add( 0 ); // End Time Based List
megaSpawner.GroupSpawnList.Add( (bool) false ); // Group Spawn List
megaSpawner.MinStackAmountList.Add( 0 );
megaSpawner.MaxStackAmountList.Add( 0 );
megaSpawner.MovableList.Add( (bool) true );
megaSpawner.MinDespawnList.Add( 1800 );
megaSpawner.MaxDespawnList.Add( 3600 );
megaSpawner.DespawnList.Add( (bool) false );
megaSpawner.DespawnGroupList.Add( (bool) false );
megaSpawner.DespawnTimeExpireList.Add( (bool) true );
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[cnt]; j++ )
{
respawnEntryList.Add( (string) megaSpawner.EntryList[cnt] );
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() );
}
if ( errors > 0 )
{
megaSpawner.Delete();
amountOfSpawners--;
}
else
{
SpawnerList.Add( megaSpawner );
megaSpawner.MoveToWorld( new Point3D( locX, locY, locZ ), spawnerMap );
if ( megaSpawner.Active )
{
megaSpawner.Start();
megaSpawner.Respawn();
}
HideSpawnerList.Add( (bool) false );
MSGCheckBoxesList.Add( (bool) false );
MC.FileImportAdd( megaSpawner.Imported, megaSpawner.ImportVersion );
}
示例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();
}