当前位置: 首页>>代码示例>>C#>>正文


C# BaseCreature.Delete方法代码示例

本文整理汇总了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.
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:61,代码来源:SpellHelper.cs

示例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));
        }
开发者ID:ITLongwell,项目名称:ServUO,代码行数:30,代码来源:SpecialFishingNet.cs

示例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;
		}
开发者ID:greeduomacro,项目名称:uotitan,代码行数:43,代码来源:BaseCreature.cs

示例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.
        }
开发者ID:bittiez,项目名称:ServUO,代码行数:12,代码来源:BaseCollectionMobile.cs

示例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;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:51,代码来源:BaseCreature.cs

示例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.
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:88,代码来源:SpellHelper.cs

示例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.
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:16,代码来源:SummonCreature.cs

示例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() );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:30,代码来源:MysticFishingNet.cs

示例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();
			}
      		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:101,代码来源:ShrinkItem.cs

示例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();
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:13,代码来源:Dispel.cs


注:本文中的Server.Mobiles.BaseCreature.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。