本文整理汇总了C#中Server.Mobiles.BaseCreature.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.Delete方法的具体用法?C# BaseCreature.Delete怎么用?C# BaseCreature.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.Delete方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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.
}
示例2: 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));
}
示例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: DonatePet
public virtual void DonatePet(PlayerMobile player, BaseCreature pet)
{
for (int i = 0; i < this.m_Donations.Count; i ++)
if (this.m_Donations[i].Type == pet.GetType())
{
pet.Delete();
this.Donate(player, this.m_Donations[i], 1);
return;
}
player.SendLocalizedMessage(1073113); // This Collection is not accepting that type of creature.
}
示例5: 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;
}
示例6: 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 ( creature != null && creature.ControlMaster != null && creature.ControlMaster is Player)
{
Summoner sum = Perk.GetByType<Summoner>((Player)creature.ControlMaster);
if (sum != null && sum.Remanence())
{
duration += TimeSpan.FromSeconds(90.0);
}
}
Point3D p = new Point3D(caster);
if( SpellHelper.FindValidSpawnLocation(map, ref p, true) )
{
BaseCreature.Summon(creature, caster, p, sound, duration);
if (creature != null && creature.ControlMaster != null && creature.ControlMaster is Player)
{
Summoner sum = Perk.GetByType<Summoner>((Player)creature.ControlMaster);
if (sum != null && sum.IntelligentDesign())
{
creature.SetSkill(SkillName.Wrestling, creature.Skills.Wrestling.Value + Utility.RandomMinMax(15, 20));
creature.SetSkill(SkillName.Tactics, creature.Skills.Tactics.Value + Utility.RandomMinMax(20, 25));
creature.SetSkill(SkillName.MagicResist, creature.Skills.MagicResist.Value + Utility.RandomMinMax(30, 40));
creature.SetSkill(SkillName.Meditation, creature.Skills.Meditation.Value + Utility.RandomMinMax(30, 40));
creature.SetSkill(SkillName.Magery, creature.Skills.Magery.Value + Utility.RandomMinMax(15, 20));
creature.SetSkill(SkillName.EvalInt, creature.Skills.EvalInt.Value + Utility.RandomMinMax(15, 20));
}
if (sum != null && sum.SecondNature())
{
creature.HitsMaxSeed += (int)(creature.HitsMaxSeed * 0.33) + Utility.RandomMinMax(20, 40);
creature.Hits = creature.HitsMax;
}
if (sum != null && sum.Horde())
{
for(int x = 1; x <= 3; x ++)
{
if (creature.ControlMaster.Followers + creature.ControlSlots <= creature.ControlMaster.FollowersMax)
{
BaseCreature newSummon;
newSummon = Activator.CreateInstance(creature.GetType()) as BaseCreature;
if (SpellHelper.FindValidSpawnLocation(map, ref p, true))
BaseCreature.Summon(newSummon, caster, p, sound, duration);
if (sum != null && sum.IntelligentDesign())
{
newSummon.SetSkill(SkillName.Wrestling, creature.Skills.Wrestling.Value + Utility.RandomMinMax(15, 20));
newSummon.SetSkill(SkillName.Tactics, creature.Skills.Tactics.Value + Utility.RandomMinMax(20, 25));
newSummon.SetSkill(SkillName.MagicResist, creature.Skills.MagicResist.Value + Utility.RandomMinMax(30, 40));
newSummon.SetSkill(SkillName.Meditation, creature.Skills.Meditation.Value + Utility.RandomMinMax(30, 40));
newSummon.SetSkill(SkillName.Magery, creature.Skills.Magery.Value + Utility.RandomMinMax(15, 20));
newSummon.SetSkill(SkillName.EvalInt, creature.Skills.EvalInt.Value + Utility.RandomMinMax(15, 20));
}
if (sum != null && sum.SecondNature())
{
newSummon.HitsMaxSeed += (int)(newSummon.HitsMaxSeed * 0.33) + Utility.RandomMinMax(20, 40);
newSummon.Hits = newSummon.HitsMax;
}
}
}
}
}
return;
}
creature.Delete();
caster.SendLocalizedMessage(501942); // That location is blocked.
}
示例7: Summon
public void Summon(BaseCreature creature, Mobile caster, int sound, TimeSpan duration, Point3D spawnAt)
{
Map map = caster.Map;
if (map == null)
return;
if (map.CanFit(spawnAt.X, spawnAt.Y, spawnAt.Z, 1, true, false, true))
{
BaseCreature.Summon(creature, caster, spawnAt, sound, duration);
return;
}
creature.Delete();
caster.SendLocalizedMessage(501942); // That location is blocked.
}
示例8: 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() );
}
示例9: Deserialize
//.........这里部分代码省略.........
goto case 7;
}
case 7: // Sheep Wool Fix
{
m_SheepWool = reader.ReadDeltaTime();
goto case 6;
}
case 6: // Disable Command Addon
{
m_Disabled = reader.ReadBool();
goto case 5;
}
case 5: // Evo Pet Fix
{
m_PetS1 = reader.ReadBool();
m_PetS2 = reader.ReadBool();
m_PetS3 = reader.ReadBool();
m_PetS4 = reader.ReadBool();
m_PetS5 = reader.ReadBool();
m_PetS6 = reader.ReadBool();
goto case 4;
}
case 4: // Evo Pet Fix
{
m_IsFemale = reader.ReadBool();
goto case 3;
}
case 3: // Insta Heal On Shrink Fix
{
m_PetHitsNow = reader.ReadInt();
m_PetStamNow = reader.ReadInt();
m_PetManaNow = reader.ReadInt();
goto case 2;
}
case 2: // Mount Fix
{
m_MountID = reader.ReadInt();
goto case 1;
}
case 1: // Evo Dragon Addon
{
m_PetKP = reader.ReadInt();
m_PetStage = reader.ReadInt();
m_PetHasEgg = reader.ReadBool();
m_PetAllowMating = reader.ReadBool();
m_PetPregnant = reader.ReadBool();
goto case 0;
}
case 0: // Initial Release
{
m_IsDeed = reader.ReadBool();
m_Mob = (BaseCreature)reader.ReadMobile();
m_PetHue = reader.ReadInt();
m_PetBonded = reader.ReadBool();
m_PetOwner = reader.ReadMobile();
m_MobTypeString = reader.ReadString();
m_Locked = reader.ReadBool();
m_PetMinTame = reader.ReadDouble();
m_PetControlSlots = reader.ReadInt();
m_PetName = reader.ReadString();
m_PetMinDamage = reader.ReadInt();
m_PetMaxDamage = reader.ReadInt();
m_PetBody = reader.ReadInt();
m_PetSound = reader.ReadInt();
m_PetVArmor = reader.ReadInt();
m_PetStr = reader.ReadInt();
m_PetDex = reader.ReadInt();
m_PetInt = reader.ReadInt();
m_PetHits = reader.ReadInt();
m_PetStam = reader.ReadInt();
m_PetMana = reader.ReadInt();
m_PetPhysicalResist = reader.ReadInt();
m_PetColdResist = reader.ReadInt();
m_PetFireResist = reader.ReadInt();
m_PetPoisonResist = reader.ReadInt();
m_PetEnergyResist = reader.ReadInt();
m_PetPhysicalDamage = reader.ReadInt();
m_PetColdDamage = reader.ReadInt();
m_PetFireDamage = reader.ReadInt();
m_PetPoisonDamage = reader.ReadInt();
m_PetEnergyDamage = reader.ReadInt();
m_PetWrestling = reader.ReadDouble();
m_PetTactics = reader.ReadDouble();
m_PetResist = reader.ReadDouble();
m_PetAnatomy = reader.ReadDouble();
m_PetPoisoning = reader.ReadDouble();
m_PetMagery = reader.ReadDouble();
m_PetEvalInt = reader.ReadDouble();
m_PetMed = reader.ReadDouble();
break;
}
}
if ( m_Mob != null && !m_Mob.Tamable )
{
m_Mob.Delete();
this.Delete();
}
}
示例10: RemoveAllEffects
public static void RemoveAllEffects(BaseCreature target, Mobile caster)
{
//We need to make sure that the creature has no timers on before we delete it
RemoveAllEffects((Mobile)target, caster);
if (target.Summoned && !target.IsAnimatedDead)
{
Effects.PlaySound(target, target.Map, 513);
Effects.PlaySound(target, target.Map, 510);
Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 20, 20, 2023);
target.Delete();
}
}