本文整理汇总了C#中IEntity.MoveToWorld方法的典型用法代码示例。如果您正苦于以下问题:C# IEntity.MoveToWorld方法的具体用法?C# IEntity.MoveToWorld怎么用?C# IEntity.MoveToWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntity
的用法示例。
在下文中一共展示了IEntity.MoveToWorld方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MOVETOWORLD
public static void MOVETOWORLD(TriggerObject trigObject, IEntity entity, IPoint3D loc, object map)
{
Map existingMap = map as Map;
if (existingMap == null && map is string)
{
try
{
existingMap = Map.Parse((string)map);
}
catch
{ }
}
if (existingMap == null)
{
throw new UberScriptException("A map named " + map + " does not exist!");
}
entity.MoveToWorld(new Point3D(loc.X, loc.Y, loc.Z), existingMap);
}
示例2: PUTNEARBY
public static bool PUTNEARBY(
TriggerObject trigObject, IPoint3D target, IEntity toPut, int range, bool dupe, int amount, bool dupeContents)
{
if (target == null || toPut == null)
{
return false;
}
Point3D point = GETVALIDSPAWNLOCATION(trigObject, target, range);
if (point == Point3D.Zero)
{
return false;
}
Map map = (target is IEntity ? ((IEntity)target).Map : Map.Felucca);
if (dupe)
{
if (toPut is BaseCreature)
{
for (int i = 0; i < amount; i++)
{
BaseCreature copy = (BaseCreature)DUPEMOB(trigObject, (BaseCreature)toPut, 1, dupeContents);
if (copy == null)
{
continue;
}
point = GETVALIDSPAWNLOCATION(trigObject, target, range, true);
if (point == Point3D.Zero)
{
point = new Point3D(target);
}
copy.MoveToWorld(point, map);
}
}
else if (toPut is Item)
{
for (int i = 0; i < amount; i++)
{
Item copy = DUPE(trigObject, (Item)toPut, false, 1, dupeContents);
if (copy == null)
{
continue;
}
point = GETVALIDSPAWNLOCATION(trigObject, target, range, true);
if (point == Point3D.Zero)
{
point = new Point3D(target);
}
copy.MoveToWorld(point, map);
}
}
else
{
throw new UberScriptException("PUTONNEARBY dupe can only be performed on Items or BaseCreature objects!");
}
}
else
{
toPut.MoveToWorld(point, map);
}
return true;
}
示例3: MOVETOSPAWNLOCATION
public static bool MOVETOSPAWNLOCATION(
TriggerObject trigObject,
IEntity mob,
Map map,
ArrayList rectangles,
ArrayList weightedProbabilities,
int zLevel,
bool requiresSurface)
{
if (mob == null || map == null || map == Map.Internal || rectangles == null || rectangles.Count == 0 ||
weightedProbabilities == null || weightedProbabilities.Count == 0)
{
return false;
}
// try up to 4 times
Point3D spawnLoc = GETVALIDSPAWNLOCATIONANDMAP(
trigObject, map, rectangles, weightedProbabilities, zLevel, requiresSurface);
if (spawnLoc == Point3D.Zero)
{
spawnLoc = GETVALIDSPAWNLOCATIONANDMAP(trigObject, map, rectangles, weightedProbabilities, zLevel, requiresSurface);
if (spawnLoc == Point3D.Zero)
{
LOG(trigObject, "MOVETOSPAWNLOCATION", trigObject.Script.ScriptFile + " failing to find spawn loc");
spawnLoc = GETVALIDSPAWNLOCATIONANDMAP(
trigObject, map, rectangles, weightedProbabilities, zLevel, requiresSurface);
if (spawnLoc == Point3D.Zero)
{
spawnLoc = GETVALIDSPAWNLOCATIONANDMAP(
trigObject, map, rectangles, weightedProbabilities, zLevel, requiresSurface);
if (spawnLoc == Point3D.Zero)
{
return false;
}
}
}
}
mob.MoveToWorld(spawnLoc, map);
if (mob is BaseCreature)
{
((BaseCreature)mob).Home = spawnLoc;
}
return true;
}