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


C# Spellbook.Delete方法代码示例

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


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

示例1: OnDoubleClick

        /// <summary>
        /// Overrides the Double-Click option on the item. Supplies the
        /// player that double-clicks on the stone with appropriate gear
        /// based upon their skill levels.
        /// </summary>
        /// <param name="m">PlayerMobile to be supplied</param>
        public override void OnDoubleClick(Mobile m)
        {
            if (m.Backpack != null)
            {
                if (((m.X) == this.X || (m.X - 1) == this.X || (m.X + 1) == this.X) && ((m.Y) == this.Y || (m.Y - 1) == this.Y || (m.Y + 1) == this.Y))
                {
                    if (!Tourney)
                    {
                        Supply(new BagOfPots(8, 8, 4, 4, 5), m, typeof(BagOfPots));
                        for (int i = 1; i <= 5; i++)
                        {
                            TrapableContainer con = new Pouch();
                            con.TrapType = TrapType.MagicTrap;
                            con.TrapLevel = 1;
                            con.TrapPower = 1;

                            if (!m.AddToBackpack(con))
                                con.Delete();
                        }
                    }
                    else
                    {
                        for (int i = 1; i <= 10; i++)
                        {
                            Item item = new TotalRefreshPotion();

                            if (!m.AddToBackpack(item))
                                item.Delete();
                        }
                    }

                    if (m.Skills[SkillName.Magery].Value >= 50.0 || m.Str <= 50)
                    {
                        EquipArmor(new LeatherLegs(), true, m, typeof(LeatherLegs), m_EquipHue);
                        EquipArmor(new LeatherGorget(), true, m, typeof(LeatherGorget), m_EquipHue);
                        EquipArmor(new LeatherGloves(), true, m, typeof(LeatherGloves), m_EquipHue);
                        EquipArmor(new LeatherChest(), true, m, typeof(LeatherChest), m_EquipHue);
                        EquipArmor(new LeatherArms(), true, m, typeof(LeatherArms), m_EquipHue);
                        EquipArmor(new LeatherCap(), true, m, typeof(LeatherCap), m_EquipHue);
                    }
                    else
                    {
                        EquipArmor(new ChainLegs(), true, m, typeof(ChainLegs), m_EquipHue);
                        EquipArmor(new LeatherGorget(), true, m, typeof(LeatherGorget), m_EquipHue);
                        EquipArmor(new RingmailGloves(), true, m, typeof(RingmailGloves), m_EquipHue);
                        EquipArmor(new ChainChest(), true, m, typeof(ChainChest), m_EquipHue);
                        EquipArmor(new RingmailArms(), true, m, typeof(RingmailArms), m_EquipHue);
                        EquipArmor(new CloseHelm(), true, m, typeof(CloseHelm), m_EquipHue);
                    }

                    if (m.Skills[SkillName.Magery].Value >= 50.0)
                    {
                        Container pack = m.Backpack;
                        if (pack.FindItemByType(typeof(Spellbook)) == null)
                        {
                            Spellbook book = new Spellbook();
                            book.Content = ulong.MaxValue;
                            book.LootType = LootType.Regular;

                            if (!m.AddToBackpack(book))
                                book.Delete();
                        }

                        Supply(new BagOfReagents(50), m, typeof(BagOfReagents));
                    }

                    if (m.Skills[SkillName.Healing].Value >= 50.0 || m.Skills[SkillName.Veterinary].Value >= 50)
                    {
                        Supply(new Bandage(50), m, typeof(Bandage));
                    }

                    if (m.Skills[SkillName.Swords].Value >= 50.0)
                    {

                        EquipItem(new Katana(), true, m, typeof(Katana));
                        EquipItem(new Halberd(), false, m, typeof(Halberd));
                        EquipItem(new BattleAxe(), false, m, typeof(BattleAxe));
                    }

                    if (m.Skills[SkillName.Fencing].Value >= 50.0)
                    {

                        EquipItem(new Kryss(), true, m, typeof(Kryss));
                        EquipItem(new ShortSpear(), false, m, typeof(ShortSpear));
                        EquipItem(new Spear(), false, m, typeof(Spear));
                    }

                    if (m.Skills[SkillName.Macing].Value >= 50.0)
                    {
                        EquipItem(new Mace(), true, m, typeof(Mace));
                        EquipItem(new QuarterStaff(), false, m, typeof(QuarterStaff));
                        EquipItem(new WarHammer(), false, m, typeof(WarHammer));
                    }

//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:RunUO-1,代码行数:101,代码来源:SupplyStone.cs

示例2: OnResponse

        public override void OnResponse(Server.Network.NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;
            int index = info.ButtonID; //note: 0==exit
            if (from == null || index < 1 || index > ms_entryCount) return; //Avoid crashing the server with faked buttonIDs
            if (m_deed == null || m_deed.Deleted || from.Backpack == null || !m_deed.IsChildOf(from.Backpack))
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            else
            {
                string name = "";
                switch (index)
                {
                    case 1: name = "Britain's Book of Compassion"; break;
                    case 2: name = "Buccaneer's Den's Book of Chaos"; break;
                    case 3: name = "Cove's Book of Love"; break;
                    case 4: name = "Jhelom's Book of Valor"; break;
                    case 5: name = "Magincia's Book of Pride"; break;
                    case 6: name = "Minoc's Book of Sacrifice"; break;
                    case 7: name = "Moonglow's Book of Honesty"; break;
                    case 8: name = "Nujel'm's Book of Pleasure"; break;
                    case 9: name = "Occlo's Book of the Mountain"; break;
                    case 10: name = "Serpents Hold's Book of Order"; break;
                    case 11: name = "Skara Brae's Book of Spirituality"; break;
                    case 12: name = "Trinsic's Book of Honor"; break;
                    case 13: name = "Vesper's Book of Industry"; break;
                    case 14: name = "Wind's Book of Magicka"; break;
                    case 15: name = "Yew's Book of Justice"; break;
                    case 16: name = "Delucia's Book of the Lost Lands"; break;
                    case 17: name = "Papua's Book of the Swamp"; break;
                }
                if (name != "") //Check if valid name has been set
                {
                    Spellbook book = new Spellbook();
                    book.Content = ulong.MaxValue; //Fill with all spells
					book.Layer = Layer.Neck; //Layer
                    book.Name = String.Format("{0} (layered)", name);
                    book.Hue = m_selectedHue;

                    if (from.AddToBackpack(book))
                    {
                        from.SendMessage("The book has been placed in your backpack.");
                        m_deed.Delete();
                    }
                    else
                    {
                        book.Delete();
                        from.SendMessage("An error occured while creating the book.");
                    }
                }
            }
        }
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:51,代码来源:LayeredSpellbookTicket.cs


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