本文整理汇总了C#中Server.Mobiles.BaseCreature.MoveToWorld方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.MoveToWorld方法的具体用法?C# BaseCreature.MoveToWorld怎么用?C# BaseCreature.MoveToWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.MoveToWorld方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpawnAnt
public void SpawnAnt( BaseCreature ant )
{
m_Spawned.Add( ant );
Map map = Map;
Point3D p = Location;
for ( int i = 0; i < 5; i++ )
if ( SpellHelper.FindValidSpawnLocation( map, ref p, false ) )
break;
ant.MoveToWorld( p, map );
ant.Home = Location;
ant.RangeHome = 10;
}
示例2: EndClaimList
public void EndClaimList(Mobile from, BaseCreature pet)
{
if (pet == null || pet.Deleted || from.Map != this.Map || !from.InRange(this, 14) || !from.Stabled.Contains(pet) || !from.CheckAlive())
return;
if ((from.Followers + pet.ControlSlots) <= from.FollowersMax)
{
pet.SetControlMaster(from);
if (pet.Summoned)
pet.SummonMaster = from;
pet.ControlTarget = from;
pet.ControlOrder = OrderType.Follow;
pet.MoveToWorld(from.Location, from.Map);
pet.IsStabled = false;
from.Stabled.Remove(pet);
from.SendLocalizedMessage(1042559); // Here you go... and good day to you!
}
else
{
from.SendLocalizedMessage(1049612, pet.Name); // ~1_NAME~ remained in the stables because you have too many followers.
}
}
示例3: Summon
public static bool Summon( BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration )
{
if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
{
caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
creature.Delete();
return false;
}
m_Summoning = true;
if ( controlled )
creature.SetControlMaster( caster );
creature.RangeHome = 10;
creature.Summoned = true;
creature.SummonMaster = caster;
Container pack = creature.Backpack;
if ( pack != null )
{
for ( int i = pack.Items.Count - 1; i >= 0; --i )
{
if ( i >= pack.Items.Count )
continue;
pack.Items[i].Delete();
}
}
new UnsummonTimer( caster, creature, duration ).Start();
creature.m_SummonEnd = DateTime.Now + duration;
creature.MoveToWorld( p, caster.Map );
Effects.PlaySound( p, creature.Map, sound );
m_Summoning = false;
return true;
}
示例4: DoClaim
private void DoClaim(Mobile from, BaseCreature pet)
{
pet.SetControlMaster(from);
if (pet.Summoned)
{
pet.SummonMaster = from;
}
pet.ControlTarget = from;
pet.ControlOrder = OrderType.Follow;
pet.MoveToWorld(from.Location, from.Map);
pet.IsStabled = false;
pet.Loyalty = MaxLoyalty; // Wonderfully Happy
}
示例5: Spawn
protected void Spawn(Point3D p, Map map, BaseCreature spawn)
{
if (map == null)
{
spawn.Delete();
return;
}
int x = p.X, y = p.Y;
for (int j = 0; j < 20; ++j)
{
int tx = p.X - 2 + Utility.Random(5);
int ty = p.Y - 2 + Utility.Random(5);
LandTile t = map.Tiles.GetLandTile(tx, ty);
if (t.Z == p.Z && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, p.Z), map))
{
x = tx;
y = ty;
break;
}
}
spawn.MoveToWorld(new Point3D(x, y, p.Z), map);
if (spawn is Kraken && 0.2 > Utility.RandomDouble())
spawn.PackItem(new MessageInABottle(map == Map.Felucca ? Map.Felucca : Map.Trammel));
}
示例6: SpawnCreature
protected bool SpawnCreature( BaseCreature creature )
{
for ( int i = 0; i < 5; i++ ) // Try 5 times
{
int x = Location.X + Utility.RandomMinMax( -1, 1 );
int y = Location.Y + Utility.RandomMinMax( -1, 1 );
int z = Map.GetAverageZ( x, y );
if ( Map.CanSpawnMobile( x, y, Location.Z ) )
{
creature.MoveToWorld( new Point3D( x, y, Location.Z ), Map );
creature.Combatant = From;
return true;
}
else if ( Map.CanSpawnMobile( x, y, z ) )
{
creature.MoveToWorld( new Point3D( x, y, z ), Map );
creature.Combatant = From;
return true;
}
}
return false;
}
示例7: Summon
public static bool Summon( BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration )
{
if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
{
caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
creature.Delete();
return false;
}
m_Summoning = true;
creature.RangeHome = 10;
creature.Summoned = true;
if ( controlled )
creature.SetControlMaster( caster );
creature.SummonMaster = caster;
Container pack = creature.Backpack;
if ( pack != null )
{
for ( int i = pack.Items.Count - 1; i >= 0; --i )
{
if ( i >= pack.Items.Count )
continue;
( (Item) pack.Items[i] ).Delete();
}
}
double hitsScalar = 1.0 + ( ArcaneEmpowermentSpell.GetSummonHitsBonus( caster ) / 100 );
if ( hitsScalar != 1.0 )
creature.SetHits( (int) ( creature.HitsMax * hitsScalar ) );
new UnsummonTimer( caster, creature, duration ).Start();
creature.m_SummonEnd = DateTime.Now + duration;
creature.MoveToWorld( p, caster.Map );
Effects.PlaySound( p, creature.Map, sound );
if ( creature is EnergyVortex || creature is BladeSpirits )
SpellHelper.CheckSummonLimits( creature );
m_Summoning = false;
return true;
}
示例8: Summon
public static void Summon( Mobile caster, BaseCreature summoned, int duration, int sound, bool cooldown )
{
summoned.Controlled = true;
summoned.ControlMaster = caster;
Map map = caster.Map;
bool validLocation = false;
Point3D loc = caster.Location;
for ( int j = 0; !validLocation && j < 10; ++j )
{
int x = caster.X + Utility.Random( 3 ) - 1;
int y = caster.Y + Utility.Random( 3 ) - 1;
int z = map.GetAverageZ( x, y );
if ( validLocation = map.CanFit( x, y, caster.Z, 16, false, false ) )
loc = new Point3D( x, y, caster.Z );
else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
loc = new Point3D( x, y, z );
}
summoned.MoveToWorld( loc, map );
summoned.VanishTime = DateTime.Now + TimeSpan.FromHours( 1 );
caster.PlaySound( sound );
if( caster is PlayerMobile && cooldown )
((PlayerMobile)caster).NextSummoningAllowed = DateTime.Now + TimeSpan.FromMinutes( duration );
else if( caster is BaseCreature )
((BaseCreature)caster).NextFeatUse = DateTime.Now + TimeSpan.FromMinutes( 1 );
summoned.m_SummoningTimer = new SummoningTimer( summoned, duration );
summoned.m_SummoningTimer.Start();
summoned.Lives = -100;
}
示例9: UnStablePet
public static void UnStablePet(Mobile from, BaseCreature pet, Mobile gm)
{
if (from == null || from.Deleted || pet == null || pet.Deleted || gm == null || gm.Deleted)
{
return;
}
if (from.Stabled.Contains(pet))
{
gm.SendMessage("Warning: This is a force claiming. Followers count will not be checked!");
pet.SetControlMaster(from);
if (pet.Summoned)
{
pet.SummonMaster = from;
}
pet.ControlTarget = from;
pet.ControlOrder = OrderType.Follow;
if (from.Map == Map.Internal)
{
gm.MoveToWorld(from.Location, from.Map);
}
else
{
pet.MoveToWorld(from.Location, from.Map);
}
pet.IsStabled = false;
from.Stabled.Remove(pet);
}
}
示例10: Spawn
protected static void Spawn( Point3D p, Map map, BaseCreature spawn )
{
if ( map == null )
{
spawn.Delete();
return;
}
int x = p.X, y = p.Y;
for ( int j = 0; j < 20; ++j )
{
int tx = p.X - 2 + Utility.Random( 5 );
int ty = p.Y - 2 + Utility.Random( 5 );
LandTile t = map.Tiles.GetLandTile( tx, ty );
if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
{
x = tx;
y = ty;
break;
}
}
spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );
if ( spawn is AncientLich && 0.1 > Utility.RandomDouble() )
spawn.PackItem( new MysticFishingNet() );
}
示例11: SpawnHelper
public void SpawnHelper(BaseCreature helper, Point3D location)
{
if (helper == null)
return;
helper.Home = location;
helper.RangeHome = 4;
if (this.m_Altar != null)
this.m_Altar.AddHelper(helper);
helper.MoveToWorld(location, this.Map);
}
示例12: DoClaim
private void DoClaim( Mobile from, BaseCreature pet )
{
pet.SetControlMaster( from );
if ( pet.Summoned )
pet.SummonMaster = from;
pet.ControlTarget = from;
pet.ControlOrder = OrderType.Follow;
pet.MoveToWorld( from.Location, from.Map );
pet.IsStabled = false;
pet.StabledBy = null;
}