本文整理汇总了C#中BaseCreature.MoveToWorld方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.MoveToWorld方法的具体用法?C# BaseCreature.MoveToWorld怎么用?C# BaseCreature.MoveToWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.MoveToWorld方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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 );
SayTo( from, 1042559 ); // Here you go... and good day to you!
}
else
{
SayTo( from, 1049612, pet.Name ); // ~1_NAME~ remained in the stables because you have too many followers.
}
}
示例2: 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;
if ( Core.SE )
pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully Happy
}
示例3: 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;
}
示例4: 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 ) );
}
示例5: Summon
public static bool Summon( BaseCreature creature, bool controled, Mobile caster, Point3D p, int sound, TimeSpan duration )
{
if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
{
caster.SendAsciiMessage( "You have too many followers to summon that creature." );
creature.Delete();
return false;
}
m_Summoning = true;
if ( controled )
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;
((Item)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;
}
示例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: Spawn
//25JUL2008 Lord_Greywolf fix for bad X *** START ***
// protected void Spawn( Point2D p, Map map, BaseCreature spawn )
// {
// if ( map == null )
// {
// spawn.Delete();
// return;
// }
// int x = p.X, y = p.Y;
//// for ( int j = 0; j < 5; ++j )
//// {
//// int tx = p.X - 2 + Utility.Random( 5 );
//// int ty = p.Y - 2 + Utility.Random( 5 );
//// }
// spawn.MoveToWorld( new Point3D( x, y, 0 ), map );
// spawn.PackItem( new TreasureMessageChest() );
//}
protected void Spawn(Point2D p, Map map, BaseCreature spawn)
{
if (map == null) { spawn.Delete(); return; }
int x = p.X, y = p.Y;
if (map.CanSpawnMobile(x, y, 0))
{
spawn.MoveToWorld(new Point3D(x, y, 0), map);
}
else
{
int z = map.GetAverageZ(x, y);
if (map.CanSpawnMobile(x, y, z))
{
spawn.MoveToWorld(new Point3D(x, y, z), map);
}
else if (map.CanSpawnMobile(x, y, z + 10))
{
spawn.MoveToWorld(new Point3D(x, y, z + 10), map);
}
else if (map.CanSpawnMobile(x + 1, y + 1, z))
{
spawn.MoveToWorld(new Point3D(x + 1, y + 1, z), map);
}
else if (map.CanSpawnMobile(x + 1, y + 1, z + 10))
{
spawn.MoveToWorld(new Point3D(x + 1, y + 1, z + 10), map);
}
else
{
spawn.MoveToWorld(new Point3D(x - 1, y - 1, 100), map);
}
}
spawn.PackItem(new TreasureMessageChest(Utility.RandomMinMax((((m_Level - 1) * 400) + 100), (((m_Level - 1) * 400) + 500))));
}
示例8: 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);
//break;
}
}
示例9: 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();
}
}
#region Mondain's Legacy
creature.SetHits((int)Math.Floor(creature.HitsMax * (1 + ArcaneEmpowermentSpell.GetSpellBonus(caster, false) / 100.0)));
#endregion
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;
}
示例10: SpawnMobile
private bool SpawnMobile(BaseCreature bc, Rectangle2D spawnrec)
{
if (bc != null)
{
for (int i = 0; i < 25; i++)
{
Point3D p = spawnrec.GetRandomSpawnPoint(this.Map);
bool exempt = false;
if (spawnrec.X == 6444 && spawnrec.Y == 2446)
{
exempt = true;
p.Z = -2;
}
if (exempt || this.Map.CanFit(p.X, p.Y, p.Z, 16, false, false, true))
{
bc.MoveToWorld(p, this.Map);
bc.Home = Defs[CurrentInvasion].BeaconLoc;
bc.SeeksHome = true;
bc.RangeHome = Utility.RandomMinMax(5, 10);
bc.Tamable = false;
return true;
}
}
}
return false;
}
示例11: 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 );
Tile 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 );
}
示例12: 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 );
if (creature is BladeSpirits)
{
new BSTimer(creature).Start();
Effects.SendLocationParticles(EffectItem.Create(creature.Location, creature.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
}
m_Summoning = false;
return true;
}
示例13: SpawnMobile
public void SpawnMobile(BaseCreature bc)
{
if(this.Map == null || bc == null)
{
if(bc != null)
bc.Delete();
return;
}
int x = this.X;
int y = this.Y;
int z = this.Z;
Point3D p = new Point3D(x, y, z);
for(int i = 0; i < 25; i++)
{
x = Utility.RandomMinMax(this.X - 15, this.X + 15);
y = Utility.RandomMinMax(this.Y - 15, this.Y + 15);
z = this.Map.GetAverageZ(x, y);
if (this.Map.CanSpawnMobile(x, y, z))
{
p = new Point3D(x, y, z);
break;
}
}
bc.MoveToWorld(p, this.Map);
}
示例14: 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;
#region Kaltar, OnSummon
if (caster is Jogador)
{
SummonUtil.Instance.OnSummon((Jogador)caster, creature, ref p, ref duration);
}
#endregion
#region DeletarItensDaMochila
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();
}
}
#endregion
#region Duracao do summon
new UnsummonTimer( caster, creature, duration ).Start();
creature.m_SummonEnd = DateTime.Now + duration;
#endregion
creature.MoveToWorld( p, caster.Map );
Effects.PlaySound( p, creature.Map, sound );
m_Summoning = false;
return true;
}
示例15: SpawnHelper
public void SpawnHelper( BaseCreature helper, Point3D location )
{
if ( helper == null )
return;
helper.Home = location;
helper.RangeHome = 4;
if ( m_Altar != null )
m_Altar.AddHelper( helper );
helper.MoveToWorld( location, Map );
}