本文整理汇总了C#中BaseCreature.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.Delete方法的具体用法?C# BaseCreature.Delete怎么用?C# BaseCreature.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.Delete方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DonatePet
public virtual void DonatePet( PlayerMobile player, BaseCreature pet )
{
for ( int i = 0; i < m_Donations.Count; i ++ )
if ( m_Donations[ i ].Type == pet.GetType() )
{
pet.Delete();
Donate( player, m_Donations[ i ], 1 );
return;
}
player.SendLocalizedMessage( 1073113 ); // This Collection is not accepting that type of creature.
}
示例2: Eject
public void Eject(BaseCreature bc, bool teleportOrStable)
{
if (bc == null || bc.Deleted)
{
return;
}
if (!teleportOrStable)
{
bc.Delete();
return;
}
if (bc.ControlMaster is PlayerMobile)
{
bc.Stable();
}
else
{
Teleport(bc, Options.Locations.Eject, Options.Locations.Eject.Map);
}
}
示例3: 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 ) );
}
示例4: 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;
}
示例5: Summon
public static void Summon( BaseCreature creature, Mobile caster, int sound, TimeSpan duration, bool scaleDuration, bool scaleStats )
{
Map map = caster.Map;
if( map == null )
return;
double scale = 1.0 + ((caster.Skills[SkillName.Magery].Value - 100.0) / 200.0);
if( scaleDuration )
duration = TimeSpan.FromSeconds( duration.TotalSeconds * scale );
if( scaleStats )
{
creature.RawStr = (int)(creature.RawStr * scale);
creature.Hits = creature.HitsMax;
creature.RawDex = (int)(creature.RawDex * scale);
creature.Stam = creature.StamMax;
creature.RawInt = (int)(creature.RawInt * scale);
creature.Mana = creature.ManaMax;
}
Point3D p = new Point3D( caster );
if( SpellHelper.FindValidSpawnLocation( map, ref p, true ) )
{
BaseCreature.Summon( creature, caster, p, sound, duration );
return;
}
/*
int offset = Utility.Random( 8 ) * 2;
for( int i = 0; i < m_Offsets.Length; i += 2 )
{
int x = caster.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = caster.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if( map.CanSpawnMobile( x, y, caster.Z ) )
{
BaseCreature.Summon( creature, caster, new Point3D( x, y, caster.Z ), sound, duration );
return;
}
else
{
int z = map.GetAverageZ( x, y );
if( map.CanSpawnMobile( x, y, z ) )
{
BaseCreature.Summon( creature, caster, new Point3D( x, y, z ), sound, duration );
return;
}
}
}
* */
creature.Delete();
caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
示例6: 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))));
}
示例7: 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 );
}
示例8: 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;
}
示例9: Summon
public static void Summon( BaseCreature creature, Mobile caster, int sound, TimeSpan duration, bool scaleDuration, bool scaleStats )
{
Map map = caster.Map;
if ( map == null )
return;
double scale = 1.0 + ( ( caster.Skills[SkillName.Magery].Value - 100.0 ) / 200.0 );
if ( scaleDuration )
duration = TimeSpan.FromSeconds( duration.TotalSeconds * scale );
if ( scaleStats )
{
creature.RawStr = (int) ( creature.RawStr * scale );
creature.Hits = creature.HitsMax;
creature.RawDex = (int) ( creature.RawDex * scale );
creature.Stam = creature.StamMax;
creature.RawInt = (int) ( creature.RawInt * scale );
creature.Mana = creature.ManaMax;
}
Point3D p = new Point3D( caster );
if ( SpellHelper.FindValidSpawnLocation( map, ref p, true ) )
{
BaseCreature.Summon( creature, caster, p, sound, duration );
return;
}
creature.Delete();
caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
示例10: SellPetForGold
//RUFO beginfunction
private void SellPetForGold(Mobile from, BaseCreature pet, int goldamount)
{
Item gold = new Gold(goldamount);
pet.ControlTarget = null;
pet.ControlOrder = OrderType.None;
pet.Internalize();
pet.SetControlMaster( null );
pet.SummonMaster = null;
pet.Delete();
Container backpack = from.Backpack;
if ( backpack == null || !backpack.TryDropItem( from, gold, false ) )
{
gold.MoveToWorld( from.Location, from.Map );
}
}
示例11: 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;
}
示例12: 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);
}
示例13: 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;
}