コード例 #1
0
		public override void OnDestroyed( WoodenBox lootbox )
		{
			Item book;

			if( Utility.RandomBool( ) )
			{
				book = new BlueBook( );
			}
			else
			{
				book = new BrownBook( );
			}

			if( book != null || !book.Deleted )
				lootbox.DropItem( book );

			if( Utility.RandomDouble( ) < 0.25 )
			{
				Item loot;

				if( Utility.RandomBool( ) )
				{
					loot = new ScribesPen( );
				}
				else
				{
					loot = new MapmakersPen( );
				}

				if( loot != null || !loot.Deleted )
					lootbox.DropItem( loot );
			}
		}
コード例 #2
0
        public override void OnDestroyed(WoodenBox lootbox)
        {
            Item book;

            if (Utility.RandomBool( ))
            {
                book = new BlueBook( );
            }
            else
            {
                book = new BrownBook( );
            }

            if (book != null || !book.Deleted)
            {
                lootbox.DropItem(book);
            }

            if (Utility.RandomDouble( ) < 0.25)
            {
                Item loot;

                if (Utility.RandomBool( ))
                {
                    loot = new ScribesPen( );
                }
                else
                {
                    loot = new MapmakersPen( );
                }

                if (loot != null || !loot.Deleted)
                {
                    lootbox.DropItem(loot);
                }
            }
        }
コード例 #3
0
ファイル: Inscribe.cs プロジェクト: Godkong/Origins
            protected override void OnTarget( Mobile from, object targeted )
            {
                BaseBook book = targeted as BaseBook;
                Container pack = from.Backpack;

                if (targeted is BlankScroll)
                {
                    Item item = (Item)targeted;

                    if (item.RootParent != from)
                        from.SendAsciiMessage("That must be in your pack for you to use it.");
                    else
                    {
                        if (pack != null)
                        {
                            if (pack.FindItemByType(typeof(Spellbook)) == null)
                                from.SendAsciiMessage("You don't have a spellbook.");
                            else if (((Spellbook)pack.FindItemByType(typeof(Spellbook))).SpellCount == 0)
                                from.SendAsciiMessage("You can't inscribe any spells.");
                            else
                            {
                                BaseTool m_Pen = new ScribesPen();
                                from.SendMenu(new InscriptionMenu(from, InscriptionMenu.Main(from), "Main", m_Pen));
                                if (m_Pen != null)
                                    m_Pen.Delete();
                            }
                        }
                    }
                }
                else
                {
                    if (book == null)
                        from.SendAsciiMessage("Can't inscribe that item.");
                    else if (Inscribe.IsEmpty(book))
                        from.SendAsciiMessage("Can't copy an empty book."); // Can't copy an empty book.
                    else if (Inscribe.GetUser(book) != null)
                        from.SendAsciiMessage("Someone else is inscribing that item."); // Someone else is inscribing that item.
                    else
                    {
                        Target target = new InternalTargetDst(book);
                        from.Target = target;
                        from.SendAsciiMessage("Select a book to copy this to."); // Select a book to copy this to.
                        target.BeginTimeout(from, TimeSpan.FromMinutes(1.0));
                        Inscribe.SetUser(book, from);
                    }
                }
            }
コード例 #4
0
ファイル: RewardGump.cs プロジェクト: FreeReign/imaginenation
		private void Process( Mobile from )
		{
			Item rewardItem;

            switch( m_Skill.SkillID )
			{
				case 0: // alchemy
					rewardItem = new MortarPestle();
					break;
				case 7: // Blacksmithy
					rewardItem = new GMSmithHammer();
					break;
				case 8: // Bowcraft/fletching
					rewardItem = new Bow();
					break;
				case 11: // Carpentry
                    switch (m_Itemid)
                    {
                        case 4138:
                            rewardItem = new Hammer();
                            break;
                        case 4148:
                            rewardItem = new Saw();
                            break;
                        case 4146:
                            rewardItem = new SmoothingPlane();
                            break;
                        case 4325:
                            rewardItem = new Froe();
                            break;
                        case 4326:
                            rewardItem = new Inshave();
                            break;
                        case 4324:
                            rewardItem = new DrawKnife();
                            break;
                        default:
                            return;
                    }
			        break;
				case 23: // Inscription
					rewardItem = new ScribesPen();
					break;
				case 25: // Magery
					rewardItem = new Spellbook();
					( rewardItem as Spellbook ).Content = ulong.MaxValue;
                    (rewardItem as Spellbook).LootType = LootType.Blessed;
					break;
				case 34: // Tailoring
					rewardItem = new RewardDyeTub();
					break;
				case 35: // Animal Taming
					rewardItem = new ShepherdsCrook();
					break;
                case 44: //Lumberjacking
			        rewardItem = new Hatchet();
			        break;
                case 45: // Mining
                    rewardItem = new Pickaxe();
                    break;
                //Bardic skills
                case 9:
                case 15:
                case 22:
                case 29:
                    switch (m_Itemid)
                    {
                        case 3740:
                            rewardItem = new Drums();
                            break;
                        case 3761:
                            rewardItem = new Harp();
                            break;
                        case 3762:
                            rewardItem = new LapHarp();
                            break;
                        case 3763:
                            rewardItem = new Lute();
                            break;
                        case 3741:
                            rewardItem = new Tambourine();
                            break;
                        case 3742:
                            rewardItem = new TambourineTassel();
                            break;
                        default:
                            return;
                    }
			        break;
                //"Thieving" skills
                case 21:
                case 28:
                case 33:
                case 47:
			        rewardItem = new Cloak();
			        break;
				default:
					return;
			}

			rewardItem.Hue = m_CurrentHue;
			rewardItem.LootType = LootType.Blessed;

			if( m_Name != "" )
				rewardItem.Name = m_Name;

			if( rewardItem is RewardDyeTub )
			{
				var tub = (RewardDyeTub)rewardItem;
				tub.DyedHue = rewardItem.Hue;
                tub.Redyable = false;
                tub.LootType = LootType.Blessed;
                tub.Owner = from;

			}
			else if( rewardItem is GMSmithHammer )
			{
				var hammer = (GMSmithHammer)rewardItem;
				hammer.Owner = from;
			}

			from.AddToBackpack( rewardItem );

			// Log
			RewardLogging.WriteLine( from, m_Skill, m_Name, m_CurrentHue );
		}
コード例 #5
0
		public override void OnResponse( NetState state, RelayInfo info )
		{
			PlayerMobile m = m_user; ToolBox box = i_box; BaseTool tool; BaseHarvestTool toola; Container pack = m.Backpack;

			switch ( info.ButtonID ) {
				default: { break; }
				case 1: { break; }
				case 2: { box.OW( m ); break; }
				case 3: { tool = new Tongs(); tool.UsesRemaining = box.i_S; pack.DropItem( tool ); box.i_S = 0; break; }
				case 4: { tool = new MouldingPlane(); tool.UsesRemaining = box.i_C; pack.DropItem( tool ); box.i_C = 0; break; }
				case 5: { tool = new TinkerTools(); tool.UsesRemaining = box.i_Ti; pack.DropItem( tool ); box.i_Ti = 0; break; }
				case 6: { tool = new SewingKit(); tool.UsesRemaining = box.i_T; pack.DropItem( tool ); box.i_T = 0; break; }
				case 7: { tool = new Blowpipe(); tool.UsesRemaining = box.i_G; pack.DropItem( tool ); box.i_G = 0; break; }
				case 8: { tool = new ScribesPen(); tool.UsesRemaining = box.i_Sc; pack.DropItem( tool ); box.i_Sc = 0; break; }
				case 9: { toola = new Shovel(); toola.UsesRemaining = box.i_M; pack.DropItem( toola ); box.i_M = 0; break; }
				case 10: { tool = new Skillet(); tool.UsesRemaining = box.i_Co; pack.DropItem( tool ); box.i_Co = 0; break; }
				case 11: { tool = new FletcherTools(); tool.UsesRemaining = box.i_F; pack.DropItem( tool ); box.i_F = 0; break; }
				case 12: { tool = new MortarPestle(); tool.UsesRemaining = box.i_A; pack.DropItem( tool ); box.i_A = 0; break; }
				case 13: { tool = new MalletAndChisel(); tool.UsesRemaining = box.i_St; pack.DropItem( tool ); box.i_St = 0; break; }
				case 14: { tool = new MapmakersPen(); tool.UsesRemaining = box.i_Ca; pack.DropItem( tool ); box.i_Ca = 0; break; } } if ( info.ButtonID > 2 ) { box.NG( m, box ); } } } }