Server.Items.Spellbook.FindRegular C# (CSharp) Méthode

FindRegular() public static méthode

public static FindRegular ( Server.Mobile from ) : Spellbook
from Server.Mobile
Résultat Spellbook
        public static Spellbook FindRegular( Mobile from )
        {
            return Find( from, -1, SpellbookType.Regular );
        }

Usage Example

        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InLOS(this.GetWorldLocation()))
            {
                from.SendLocalizedMessage(502800);                   // You can't see that.
                return;
            }

            if (from.GetDistanceToSqrt(this.GetWorldLocation()) > 4)
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }

            from.SendMessage("You have been given some supplies based on your skills.");

            //4 pouches
            for (int i = 0; i < 4; ++i)
            {
                Pouch p = new Pouch();
                p.TrapType  = TrapType.MagicTrap;
                p.TrapPower = 1;
                p.Hue       = 0x25;
                PackItem(from, p);
            }

            PackItem(from, new GreaterExplosionPotion());
            PackItem(from, new TotalRefreshPotion());
            PackItem(from, new GreaterCurePotion());
            GiveLeatherArmor(from);

            if (from.Skills[SkillName.Magery].Value >= 50.0)
            {
                PackItem(from, new BagOfReagents(100));
                Spellbook book = Spellbook.FindRegular(from);                  //Spellbook book = from.GetSpellbook( typeof( Spellbook ) ) as Spellbook;
                if (book != null)
                {
                    if (book.Content != ulong.MaxValue)
                    {
                        book.Content = ulong.MaxValue;
                    }
                }
                else
                {
                    book         = new Spellbook();
                    book.Content = ulong.MaxValue;                    //all spells
                    GiveItem(from, book);
                }
            }
            else
            {
                for (int i = 0; i < 3; i++)
                {
                    PackItem(from, new GreaterHealPotion());
                }
            }

            if (from.Skills[SkillName.Healing].Value >= 50.0)
            {
                PackItem(from, new Bandage(100));
            }

            if (from.Skills[SkillName.Fencing].Value >= 50.0)
            {
                PackItem(from, new ShortSpear());
                if (from.Skills[SkillName.Parry].Value >= 50.0)
                {
                    GiveItem(from, new Kryss());
                    GiveItem(from, new MetalKiteShield());
                }
                else
                {
                    GiveItem(from, new Spear());
                }
            }

            if (from.Skills[SkillName.Swords].Value >= 50.0)
            {
                if (from.Skills[SkillName.Parry].Value >= 50.0)
                {
                    GiveItem(from, new MetalKiteShield());
                }

                if (from.Skills[SkillName.Lumberjacking].Value >= 50.0)
                {
                    GiveItem(from, new Hatchet());
                    PackItem(from, new LargeBattleAxe());
                }

                PackItem(from, new Halberd());
                GiveItem(from, new Katana());
            }

            if (from.Skills[SkillName.Macing].Value >= 50.0)
            {
                if (from.Skills[SkillName.Parry].Value >= 50.0)
                {
                    GiveItem(from, new MetalKiteShield());
                }
                GiveItem(from, new WarAxe());
                PackItem(from, new WarHammer());
            }

            if (from.Skills[SkillName.Archery].Value >= 50.0)
            {
                GiveItem(from, new Bow());
                PackItem(from, new Crossbow());
                PackItem(from, new HeavyCrossbow());

                PackItem(from, new Bolt(100));
                PackItem(from, new Arrow(100));
            }

            if (from.Skills[SkillName.Tailoring].Value >= 50.0)
            {
                PackItem(from, new SewingKit());
                PackItem(from, new Cloth(25));
                PackItem(from, new Leather(100));
            }

            if (from.Skills[SkillName.Blacksmith].Value >= 50.0)
            {
                PackItem(from, new Tongs());
                PackItem(from, new IronIngot(300));
            }

            if (from.Skills[SkillName.Poisoning].Value >= 50.0)
            {
                for (int i = 0; i < 5; i++)
                {
                    PackItem(from, new GreaterPoisonPotion());
                }
            }
        }
All Usage Examples Of Server.Items.Spellbook::FindRegular