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


C# BaseCreature.PackItem方法代码示例

本文整理汇总了C#中Server.Mobiles.BaseCreature.PackItem方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.PackItem方法的具体用法?C# BaseCreature.PackItem怎么用?C# BaseCreature.PackItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.BaseCreature的用法示例。


在下文中一共展示了BaseCreature.PackItem方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GiveArtifact

		public static void GiveArtifact(BaseCreature bc)
		{

//**Begin Artifact Randomness**\\
			if ( percent > Utility.RandomDouble() ) // 0.7 = 70% = chance to drop

			bc.PackItem(ArtifactList.RandomArtifact());
			
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:9,代码来源:LootValidate.cs

示例2: PackPicnicBasket

        public static void PackPicnicBasket(BaseCreature solen)
        {
            if (1 > Utility.Random(100))
            {
                PicnicBasket basket = new PicnicBasket();

                basket.DropItem(new BeverageBottle(BeverageType.Wine));
                basket.DropItem(new CheeseWedge());

                solen.PackItem(basket);
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:12,代码来源:SolenHelper.cs

示例3: XmlAddChest

        // modify these custom conversion methods to create unique paragons for spawners with this attachment
        #region custom conversion methods

        public virtual void XmlAddChest(BaseCreature bc, int treasureLevel)
        {
            if (bc == null) return;

            bc.PackItem(new ParagonChest(bc.Name, treasureLevel));
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:9,代码来源:XmlParagon.cs

示例4: AddChest

        public static void AddChest(BaseCreature bc, int treasureLevel)
        {
            XmlParagon xa = GetXmlParagon(bc);

            if (xa != null)
            {
                xa.XmlAddChest(bc, treasureLevel);
            }
            else
            {
                bc.PackItem(new ParagonChest(bc.Name, treasureLevel));
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:13,代码来源:XmlParagon.cs

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

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

示例7: TryPossessCreature

 public static void TryPossessCreature(Mobile from, BaseCreature Subject)
 {
     if (from == null || Subject == null) return;
     if (HasPermissionsToPossess(from, Subject))
     {
         if (Subject.NetState != null)
         {
             from.SendMessage("Target creature is already under player control!");
             return;
         }
         if (from.AccessLevel < FullAccessStaffLevel)
         {
             if (IsInHouseOrBoat(Subject.Location, Map.Felucca))
             {
                 from.SendMessage("You cannot possess a creature in a house or boat.");
                 return;
             }
             if (Subject.Blessed == true)
             {
                 from.SendMessage("You cannot possess invulnerable mobs.");
                 return;
             }
         }
         if (Subject.Controlled && !IsAuthorizedStaff(from))
         {
             from.SendMessage("You cannot possess tamed or summoned creatures!");
             return;
         }
         //Subject.HasBeenPseudoseerControlled = true;
         if (Subject.Backpack == null)
         {
             // create a backpack for things like animals that have no backpack
             // ... this prevents client crash in case somebody has their pack auto-opening on login
             Subject.PackItem(new Gold(1)); 
         }
         LoggingCustom.LogPseudoseer(DateTime.Now + "\t" + from.Account + "\t" + from.Name + "\tpossessing\t" + Subject + "\tRegion: " + Subject.Region + "\tLocation: " + Subject.Location);
         ConnectClientToNPC(from.NetState, Subject);
     }
     else
     {
         from.SendMessage("You are not permitted to possess that creature type, only staff can grant this permission.");
     }
 }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:43,代码来源:CreaturePossession.cs

示例8: CheckBarding

        public static BaseInstrument CheckBarding(BaseCreature from)
        {
            BaseInstrument inst = BaseInstrument.GetInstrument(from);

            if (inst == null)
            {
                if (from.Backpack == null)
                    return null;

                inst = (BaseInstrument)from.Backpack.FindItemByType(typeof(BaseInstrument));

                if (inst == null)
                {
                    inst = new Harp();
                    inst.SuccessSound = 0x58B;
                    inst.FailureSound = 0x58C;
                    inst.Movable = false;
                    from.PackItem(inst);
                }
            }

            BaseInstrument.SetInstrument(from, inst);

            return inst;
        }
开发者ID:g4idrijs,项目名称:ServUO,代码行数:25,代码来源:DespiseCreature.cs

示例9: 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

示例10: HandleInvaderDeath

        public void HandleInvaderDeath(BaseCreature invader)
        {
            if (CurrentLevel.RewardItems != null && CurrentLevel.RewardItems.Count > 0)
            {
                Type selected = CurrentLevel.RewardItems.GetRandom();
                if (selected.IsEqualOrChildOf<Item>())
                {
                    var item = selected.CreateInstanceSafe<Item>();

                    if (item != null && Utility.RandomDouble() <= (CurrentLevel.DropChance/100))
                    {
                        invader.PackItem(item);
                    }
                }
            }
            CurrentLevelKills++;
            RemoveInvader(invader);
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:18,代码来源:Invasion.cs


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