예제 #1
0
        public static void PrepareServerWar()
        {
            m_ServerWars = true;
            FactionReset();

            Map[] maps = Map.Maps;

            foreach (GuardedRegion region in maps.Where(m => m != null).SelectMany(m => m.Regions.Values.OfType <GuardedRegion>())
                     )
            {
                region.Disabled = true;
            }

            foreach (
                PlayerMobile mob in World.Mobiles.Values.OfType <PlayerMobile>().Where(mob => mob.AccessLevel == AccessLevel.Player))
            {
                mob.BankBox.Credit = 10000000;                 //10 mill in the bank!

                Bag bag = new BagOfReagents(10000);
                bag.Name = "Bag of Reagents (10K)";
                bag.Hue  = RandomHue();

                mob.BankBox.DropItem(bag);
                ResurrectGump.ClearSkillLoss(mob);

                bag = new Bag
                {
                    Hue  = RandomHue(),
                    Name = "Bag of PVP Supplies"
                };

                mob.BankBox.DropItem(bag);

                if (mob.Skills[SkillName.Magery].Value > 0.0)
                {
                    mob.Backpack.DropItem(
                        BaseCreature.Rehued(BaseCreature.ChangeLootType(new BagOfReagents(150), LootType.Blessed), RandomHue()));

                    Spellbook book = Spellbook.FindRegular(mob);

                    if (book != null)
                    {
                        book.Content  = ulong.MaxValue;
                        book.LootType = LootType.Blessed;
                        book.Hue      = Utility.Random(1000);
                    }
                    else
                    {
                        book = new Spellbook
                        {
                            Content  = ulong.MaxValue,
                            LootType = LootType.Blessed,
                            Hue      = Utility.Random(1000)
                        };

                        mob.Backpack.DropItem(book);
                    }
                }

                //if ( mob.Skills[SkillName.Healing].Value > 0.0 )
                //{
                mob.BankBox.DropItem(BaseCreature.ChangeLootType(new Bandage(150), LootType.Blessed));
                //}

                //if ( mob.Skills[SkillName.Fencing].Value > 0.0 )
                //{
                bag.DropItem(SetWeapon(new ShortSpear()));
                bag.DropItem(SetWeapon(new Kryss()));
                bag.DropItem(SetWeapon(new Spear()));
                //}

                //if ( mob.Skills[SkillName.Parry].Value > 0.0 )
                //{
                bag.DropItem(
                    BaseCreature.ChangeLootType(
                        BaseCreature.Resourced(new MetalKiteShield(), CraftResource.Valorite), LootType.Blessed));
                //}

                //if ( mob.Skills[SkillName.Swords].Value > 0.0 )
                //{
                if (mob.Skills[SkillName.Lumberjacking].Value > 0.0)
                {
                    bag.DropItem(SetWeapon(new Hatchet()));
                    bag.DropItem(SetWeapon(new LargeBattleAxe()));
                }

                bag.DropItem(SetWeapon(new Halberd()));
                bag.DropItem(SetWeapon(new Katana()));
                //}

                //if ( mob.Skills[SkillName.Macing].Value > 0.0 )
                //{
                bag.DropItem(SetWeapon(new WarAxe()));
                bag.DropItem(SetWeapon(new WarHammer()));
                //}

                //if ( mob.Skills[SkillName.Archery].Value > 0.0 )
                //{
                bag.DropItem(SetWeapon(new Bow()));
                bag.DropItem(SetWeapon(new Crossbow()));
                bag.DropItem(SetWeapon(new HeavyCrossbow()));

                var quiver = new ElvenQuiver
                {
                    Hue = RandomHue()
                };
                quiver.DropItem(new Arrow(300));

                bag.DropItem(new Bolt(300));
                mob.BankBox.DropItem(BaseCreature.ChangeLootType(quiver, LootType.Blessed));
                //}

                //if ( mob.Skills[SkillName.Poisoning].Value > 0.0 )
                //{
                for (int i = 0; i < 5; i++)
                {
                    bag.DropItem(BaseCreature.ChangeLootType(new DeadlyPoisonPotion(), LootType.Blessed));
                }
                //}

                mob.Kills = mob.ShortTermMurders = 0;

                var horse = new EtherealHorse
                {
                    IsDonationItem = true,
                    Hue            = RandomHue()
                };

                mob.Backpack.DropItem(horse);
                mob.Backpack.DropItem(BaseCreature.ChangeLootType(new StatsBall(), LootType.Blessed));

                bag = new Bag
                {
                    Hue  = 1437,
                    Name = "Bag of Barbed Leather Armor"
                };

                bag.DropItem(
                    BaseCreature.Rehued(
                        BaseCreature.ChangeLootType(
                            BaseCreature.Resourced(new LeatherChest(), CraftResource.BarbedLeather), LootType.Blessed),
                        RandomHue()));
                bag.DropItem(
                    BaseCreature.Rehued(
                        BaseCreature.ChangeLootType(
                            BaseCreature.Resourced(new LeatherLegs(), CraftResource.BarbedLeather), LootType.Blessed),
                        RandomHue()));
                bag.DropItem(
                    BaseCreature.Rehued(
                        BaseCreature.ChangeLootType(
                            BaseCreature.Resourced(new LeatherGorget(), CraftResource.BarbedLeather), LootType.Blessed),
                        RandomHue()));
                bag.DropItem(
                    BaseCreature.Rehued(
                        BaseCreature.ChangeLootType(
                            BaseCreature.Resourced(new LeatherGloves(), CraftResource.BarbedLeather), LootType.Blessed),
                        RandomHue()));
                bag.DropItem(
                    BaseCreature.Rehued(
                        BaseCreature.ChangeLootType(
                            BaseCreature.Resourced(new LeatherArms(), CraftResource.BarbedLeather), LootType.Blessed),
                        RandomHue()));
                bag.DropItem(
                    BaseCreature.Rehued(
                        BaseCreature.ChangeLootType(
                            BaseCreature.Resourced(new LeatherCap(), CraftResource.BarbedLeather), LootType.Blessed),
                        RandomHue()));

                mob.Backpack.DropItem(bag);

                Skills skills = mob.Skills;

                foreach (Skill s in skills.Where(t => t.SkillName != SkillName.ItemID))
                {
                    s.BaseFixedPoint = 1000;
                }
            }
        }