本文整理汇总了C#中Server.Mobiles.Spawner.GetSpawnPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Spawner.GetSpawnPosition方法的具体用法?C# Spawner.GetSpawnPosition怎么用?C# Spawner.GetSpawnPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.Spawner
的用法示例。
在下文中一共展示了Spawner.GetSpawnPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpawnAt
public Mobile SpawnAt( Spawner spawner, Mobile mob )
{
Map map = spawner.Map;
if ( map == null || map == Map.Internal )
return null;
if ((mob is BaseCreature) == false)
return null;
try
{
BaseOverland bo = null;
BaseCreature bc = mob as BaseCreature;
// we will make it so this is passed in
if (mob is BaseOverland)
bo = mob as BaseOverland;
// use the spawners homerange except when it is a special 'guard post'
// spawner (HomeRange == 0)
bc.RangeHome = spawner.HomeRange == 0? 10 : spawner.HomeRange;
// could be useful ... but not today
// c.CurrentWayPoint = spawner.WayPoint;
// c.NavDestination = spawner.NavPoint;
bc.Home = spawner.Location;
bc.Spawner = spawner;
//if we have a navdestination as soon as we spawn start on it
if(bc.NavDestination != NavDestinations.None)
bc.AIObject.Think();
/////////////////////////////
// move it to the world
Point3D loc = spawner.GetSpawnPosition(bc);
bc.MoveToWorld( loc, map );
// Okay, indicate that this overland mob should be announced on the Town Crier
// This must be after we are moved off the internal map because the accounce code
// supplies 'world location' information which would be wrong if we were still on the internal map
if (bo != null)
bo.Announce = true;
return bc;
}
catch (Exception e)
{
LogHelper.LogException(e);
Console.WriteLine("Server.Engines.OverlandSpawner : Exception {0}", e);
}
return null;
}