Esempio n. 1
0
        /* The following is a list of files which a required for proper execution:
         *      Cliloc.enu
         *      map0.mul
         *      map1.mul
         *      map2.mul
         *      map3.mul
         *      map4.mul
         *      map5.mul
         *      multi.idx
         *      multi.mul
         *      staidx0.mul
         *      staidx1.mul
         *      staidx2.mul
         *      staidx3.mul
         *      staidx4.mul
         *      staidx5.mul
         *      statics0.mul
         *      statics1.mul
         *      statics2.mul
         *      statics3.mul
         *      statics4.mul
         *      statics5.mul
         *      tiledata.mul
         */

        public static void Configure()
        {
            if (CustomPath != null)
            {
                Core.DataDirectories.Add(CustomPath);
            }

            if (Core.DataDirectories.Count == 0 && !Core.Service)
            {
                Console.WriteLine("Enter the " + MyServerSettings.ServerName() + " directory:");
                Console.Write("> ");

                Core.DataDirectories.Add(Console.ReadLine());
            }
        }
Esempio n. 2
0
        public static void DropSpecialItem(Mobile from, Mobile killer, Container c)
        {
            BaseCreature bc = (BaseCreature)from;

            if (killer != null && c != null && !bc.IsStabled && !bc.Controlled && !bc.IsBonded)
            {
                if (killer is BaseCreature)
                {
                    killer = ((BaseCreature)killer).GetMaster();
                }

                if (killer is PlayerMobile)
                {
                    Region reg = Region.Find(from.Location, from.Map);

                    if (Server.Misc.Worlds.IsOnSpaceship(from.Location, from.Map))
                    {
                        int fameCycle = (int)(from.Fame / 2400);
                        if (fameCycle > 10)
                        {
                            fameCycle = 10;
                        }
                        if (fameCycle < 1)
                        {
                            fameCycle = 1;
                        }
                        fameCycle = Utility.RandomMinMax(0, fameCycle);
                        while (fameCycle > 0)
                        {
                            fameCycle--;
                            c.DropItem(DungeonLoot.RandomSpaceBag());
                        }
                    }

                    if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(1, 20) == 1)
                    {
                        int stuffedHue = 1;

                        if (from is ElderBrownBear)
                        {
                            stuffedHue = 0x840;
                        }
                        else if (from is SabretoothBear)
                        {
                            stuffedHue = 0x840;
                        }
                        else if (from is ElderPolarBear)
                        {
                            stuffedHue = 0;
                        }
                        else if (from is ElderBlackBear)
                        {
                            stuffedHue = 0x497;
                        }
                        else if (from is CaveBear)
                        {
                            stuffedHue = 0x6DE;
                        }
                        else if (from is ElderBrownBearRiding)
                        {
                            stuffedHue = 0x840;
                        }
                        else if (from is SabretoothBearRiding)
                        {
                            stuffedHue = 0x840;
                        }
                        else if (from is ElderPolarBearRiding)
                        {
                            stuffedHue = 0;
                        }
                        else if (from is ElderBlackBearRiding)
                        {
                            stuffedHue = 0x497;
                        }
                        else if (from is CaveBearRiding)
                        {
                            stuffedHue = 0x6DE;
                        }

                        if (stuffedHue != 1)
                        {
                            StuffedBear trophy = new StuffedBear();
                            trophy.Hue         = stuffedHue;
                            trophy.Name        = "stuffed trophy of " + from.Name;
                            trophy.AnimalWhere = "From " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location);
                            string trophyKiller = killer.Name + " the " + Server.Misc.GetPlayerInfo.GetSkillTitle(killer);
                            trophy.AnimalKiller = "Killed by " + trophyKiller;
                            c.DropItem(trophy);
                        }
                        else if (from is TigerRiding || from is SabretoothTigerRiding || from is Tiger || from is SabretoothTiger)
                        {
                            if (Utility.RandomBool())
                            {
                                c.DropItem(new TigerRugEastDeed());
                            }
                            else
                            {
                                c.DropItem(new TigerRugSouthDeed());
                            }
                        }
                        else if (from is WhiteTigerRiding || from is WhiteTiger)
                        {
                            if (Utility.RandomBool())
                            {
                                c.DropItem(new WhiteTigerRugEastDeed());
                            }
                            else
                            {
                                c.DropItem(new WhiteTigerRugSouthDeed());
                            }
                        }
                    }

                    if (from is ServiceDroid || from is BattleDroid || from is SecurityDroid || from is MaintenanceDroid || from is ExcavationDroid || from is CombatDroid)
                    {
                        if (Utility.RandomMinMax(1, 300) < (from.Fame / 100))
                        {
                            c.DropItem(new RobotSheetMetal(Utility.RandomMinMax(4, 10)));
                        }
                        if (Utility.RandomMinMax(1, 300) < (from.Fame / 100))
                        {
                            c.DropItem(new RobotBatteries());
                        }
                        if (Utility.RandomMinMax(1, 300) < (from.Fame / 100))
                        {
                            c.DropItem(new RobotEngineParts());
                        }
                        if (Utility.RandomMinMax(1, 300) < (from.Fame / 100))
                        {
                            c.DropItem(new RobotCircuitBoard());
                        }
                        if (Utility.RandomMinMax(1, 300) < (from.Fame / 100))
                        {
                            c.DropItem(new RobotTransistor());
                        }
                        if (Utility.RandomMinMax(1, 300) < (from.Fame / 100))
                        {
                            c.DropItem(new RobotBolt(Utility.RandomMinMax(1, 4)));
                        }
                        if (Utility.RandomMinMax(1, 300) < (from.Fame / 100))
                        {
                            c.DropItem(new RobotGears(Utility.RandomMinMax(1, 4)));
                        }
                        if (Utility.RandomMinMax(1, 300) < (from.Fame / 100))
                        {
                            c.DropItem(new RobotOil(Utility.RandomMinMax(1, 2)));
                        }
                    }

                    if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(0, 100) > 95)
                    {
                        int min = (int)(from.Fame / 2000); if (min < 1)
                        {
                            min = 1;
                        }
                        int max = (int)(from.Fame / 1000); if (max < 2)
                        {
                            max = 2;
                        }
                        int props = (int)(from.Fame / 3000); if (props < 1)
                        {
                            props = 1;
                        }

                        int    item  = 0;
                        int    color = 0;
                        string name  = "trinket";

                        if (from is Cyclops)
                        {
                            item = 0x2C86;          name = "eye of " + from.Name + " " + from.Title;
                        }
                        else if (from is ShamanicCyclops)
                        {
                            item = 0x2C86;          name = "eye of " + from.Name + " " + from.Title;
                        }
                        else if (from is Beholder)
                        {
                            item = 0x2C9A;          name = "eye of " + from.Name + " " + from.Title;
                        }
                        else if (from is Gazer)
                        {
                            item = 0x2C9A;          name = "eye of " + from.Name + " " + from.Title;
                        }
                        else if (from is ElderGazer)
                        {
                            item = 0x2C9A;          name = "eye of " + from.Name + " " + from.Title;
                        }
                        else if (from is Lich || from is Vordo || from is Nazghoul || from is LichLord || from is DemiLich || from is AncientLich || from is Surtaz || from is LichKing || from is UndeadDruid)
                        {
                            if (from.Backpack.FindItemByType(typeof(EvilSkull)) == null)
                            {
                                item = 0x2C95;          name = "skull of " + from.Name + " " + from.Title;
                            }
                        }

                        if (item > 0)
                        {
                            BaseJewel trinket = new MagicTalisman();
                            BaseRunicTool.ApplyAttributesTo(trinket, false, killer.Luck, props, min, max);
                            trinket.Hue    = color;
                            trinket.ItemID = item;
                            trinket.Name   = name;
                            c.DropItem(trinket);
                        }
                    }

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                    if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(0, 100) > 95)
                    {
                        if (from is Lich || from is Vordo || from is Nazghoul || from is LichLord || from is DemiLich || from is AncientLich || from is Surtaz || from is LichKing || from is UndeadDruid)
                        {
                            if (from.Backpack.FindItemByType(typeof(EvilSkull)) == null && from.Backpack.FindItemByType(typeof(MagicTalisman)) == null)
                            {
                                int min = (int)(from.Fame / 2000); if (min < 1)
                                {
                                    min = 1;
                                }
                                int max = (int)(from.Fame / 1000); if (max < 2)
                                {
                                    max = 2;
                                }
                                int props = (int)(from.Fame / 3000); if (props < 1)
                                {
                                    props = 1;
                                }

                                BaseHat cowl = new ReaperHood();
                                BaseRunicTool.ApplyAttributesTo(cowl, false, killer.Luck, props, min, max);
                                cowl.Hue  = Utility.RandomEvilHue();
                                cowl.Name = "mask of " + from.Name + " " + from.Title;
                                c.DropItem(cowl);
                            }
                        }
                    }

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                    if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomBool() && from is Syth)
                    {
                        int min = (int)(from.Fame / 2000); if (min < 1)
                        {
                            min = 1;
                        }
                        int max = (int)(from.Fame / 1000); if (max < 2)
                        {
                            max = 2;
                        }
                        int props = (int)(from.Fame / 3000); if (props < 1)
                        {
                            props = 1;
                        }

                        BaseJewel talisman = new MagicTalisman();
                        BaseRunicTool.ApplyAttributesTo(talisman, false, killer.Luck, props, min, max);
                        talisman.Hue    = Utility.RandomColor(0);
                        talisman.Name   = "Mysticron of " + from.Name + " " + from.Title;
                        talisman.ItemID = 0x4CDE;
                        c.DropItem(talisman);
                    }

                    ///////////////////////////////////////////////////////////////////////////////////////

                    SlayerEntry sythdemon = SlayerGroup.GetEntryByName(SlayerName.Exorcism);

                    Mobile syth = from.LastKiller;                                                      // SYTH AND JEDI GET CRYSTALS
                    if (sythdemon.Slays(from) && syth != null)
                    {
                        if (syth is BaseCreature)
                        {
                            syth = ((BaseCreature)syth).GetMaster();
                        }

                        if (syth is PlayerMobile && Utility.RandomBool())
                        {
                            int minhs = (int)(from.Fame / 600);
                            if (minhs < 1)
                            {
                                minhs = 1;
                            }
                            int maxhs = (int)(from.Fame / 400);
                            if (maxhs < 3)
                            {
                                maxhs = 3;
                            }

                            if (Server.Misc.GetPlayerInfo.isSyth(syth, false))
                            {
                                Item hellshard = new HellShard(Utility.RandomMinMax(minhs, maxhs));
                                c.DropItem(hellshard);
                            }
                            else if (Server.Misc.GetPlayerInfo.isJedi(syth, false))
                            {
                                Item karancrystal = new KaranCrystal(Utility.RandomMinMax(minhs, maxhs));
                                c.DropItem(karancrystal);
                            }
                        }
                    }

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                    if (GetPlayerInfo.LuckyKiller(killer.Luck) && Utility.RandomMinMax(0, 100) > 90 && from.Skills[SkillName.Inscribe].Base >= 20 && from.Skills[SkillName.Magery].Base >= 20)
                    {
                        SlayerEntry wizardkiller = SlayerGroup.GetEntryByName(SlayerName.WizardSlayer);
                        if (wizardkiller.Slays(from))
                        {
                            c.DropItem(new TomeOfWands());
                        }
                    }

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                    if (reg.IsPartOf("the Tower of Brass"))
                    {
                        int BrassFame = (int)(from.Fame / 1000);
                        BrassFame = 100 - BrassFame;

                        if (from is FireGiant && Utility.RandomMinMax(1, 100) >= BrassFame)
                        {
                            if (Utility.RandomMinMax(1, 2) == 1)
                            {
                                BaseArmor drop = Loot.RandomArmorOrShield();

                                if (drop.Resource == CraftResource.Iron)
                                {
                                    drop.Resource = CraftResource.Brass;
                                    c.DropItem(drop);
                                }
                                else
                                {
                                    drop.Delete();
                                }
                            }
                            else
                            {
                                BaseWeapon drop = Loot.RandomWeapon();

                                if (drop.Resource == CraftResource.Iron)
                                {
                                    drop.Resource = CraftResource.Brass;
                                    c.DropItem(drop);
                                }
                                else
                                {
                                    drop.Delete();
                                }
                            }
                        }
                        if (from is BloodDemon && Utility.RandomMinMax(1, 100) >= BrassFame)
                        {
                            if (Utility.RandomMinMax(1, 2) == 1)
                            {
                                BaseArmor drop = Loot.RandomArmorOrShield();

                                if (drop.Resource == CraftResource.Iron)
                                {
                                    MorphingItem.MorphMyItem(drop, "IGNORED", "brass", "IGNORED", MorphingTemplates.TemplateIceDemon("armors"));
                                    c.DropItem(drop);
                                }
                                else
                                {
                                    drop.Delete();
                                }
                            }
                            else
                            {
                                BaseWeapon drop = Loot.RandomWeapon();

                                if (drop.Resource == CraftResource.Iron)
                                {
                                    MorphingItem.MorphMyItem(drop, "IGNORED", "brass", "IGNORED", MorphingTemplates.TemplateIceDemon("weapons"));
                                    c.DropItem(drop);
                                }
                                else
                                {
                                    drop.Delete();
                                }
                            }
                        }
                    }

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                    if (reg.IsPartOf("the Ancient Elven Mine"))
                    {
                        if (from is ShamanicCyclops && Utility.RandomMinMax(1, 10) >= 9)
                        {
                            if (Utility.RandomMinMax(1, 2) == 1)
                            {
                                BaseArmor drop = Loot.RandomArmorOrShield();

                                if (drop.Resource == CraftResource.Iron)
                                {
                                    MorphingItem.MorphMyItem(drop, "IGNORED", "silver", "IGNORED", MorphingTemplates.TemplateSilver("armors"));
                                    c.DropItem(drop);
                                }
                                else
                                {
                                    drop.Delete();
                                }
                            }
                            else
                            {
                                BaseWeapon drop = Loot.RandomWeapon();

                                if (drop.Resource == CraftResource.Iron)
                                {
                                    MorphingItem.MorphMyItem(drop, "IGNORED", "silver", "IGNORED", MorphingTemplates.TemplateSilver("weapons"));
                                    c.DropItem(drop);
                                }
                                else
                                {
                                    drop.Delete();
                                }
                            }
                        }
                        if (Utility.RandomMinMax(1, 10) == 1 && from.Fame > 2000)
                        {
                            Item stone = new RareMetals(Utility.RandomMinMax(5, 15), "silver stones");
                            c.DropItem(stone);
                        }
                        else if (Utility.RandomMinMax(1, 10) == 1 && from.Fame > 2000)
                        {
                            Item ingot = new ShinySilverIngot(Utility.RandomMinMax(2, 8));
                            c.DropItem(ingot);
                        }
                    }

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                    if (reg.IsPartOf("the Daemon's Crag"))
                    {
                        if ((GetPlayerInfo.LuckyKiller(killer.Luck) || Utility.RandomMinMax(1, 20) == 1) && (from is EvilMage || from is EvilMageLord))
                        {
                            PaganArtifact pagan = new PaganArtifact(0);
                            pagan.PaganPoints = Utility.RandomMinMax(80, 100);
                            if (from is EvilMageLord)
                            {
                                pagan.PaganPoints = Utility.RandomMinMax(100, 120);
                            }
                            c.DropItem(pagan);
                        }
                    }

                    if (reg.IsPartOf("the Zealan Tombs"))
                    {
                        if ((GetPlayerInfo.LuckyKiller(killer.Luck) || Utility.RandomMinMax(1, 10) == 1) && from is KhumashGor)
                        {
                            PaganArtifact pagan = new PaganArtifact(16);
                            pagan.PaganPoints = Utility.RandomMinMax(100, 150);
                            c.DropItem(pagan);
                        }
                    }

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                    if ((from is DemonOfTheSea) ||
                        (from is BloodDemon) ||
                        (from is Devil) ||
                        (from is TitanPyros) ||
                        (from is Balron) ||
                        (from is Fiend) ||
                        (from is Archfiend) ||
                        (from is LesserDemon) ||
                        (from is Xurtzar) ||
                        (from is FireDemon) ||
                        (from is DeepSeaDevil) ||
                        (from is Daemon) ||
                        (from is DaemonTemplate) ||
                        (from is BlackGateDemon))
                    {
                        if (90 < Utility.Random(100))
                        {
                            c.DropItem(new DemonClaw());
                        }
                        if (90 < Utility.Random(100))
                        {
                            DemonSkin goods = new DemonSkin(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods);
                        }
                    }

                    if (from is Phoenix)
                    {
                        if (50 < Utility.Random(100))
                        {
                            c.DropItem(new PhoenixFeather());
                        }
                    }

                    if (from is Pegasus || from is Placeron)
                    {
                        if (75 < Utility.Random(100))
                        {
                            c.DropItem(new PegasusFeather());
                        }
                    }

                    if (90 < Utility.Random(100) && killer is PlayerMobile)
                    {
                        Server.Misc.Skulls.MakeSkull(from, c, killer, reg.Name);
                    }                                                                                                                                             // MAKE A SKULL //--------------------------

                    if ((from is Unicorn) || (from is Dreadhorn) || (from is DarkUnicorn) || (from is DarkUnicornRiding))
                    {
                        if (90 < Utility.Random(100))
                        {
                            c.DropItem(new UnicornHorn());
                        }
                        if (70 < Utility.Random(100))
                        {
                            UnicornSkin goods = new UnicornSkin(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods);
                        }
                    }
                    if (from is Nightmare || from is AncientNightmare || from is AncientNightmareRiding)
                    {
                        if (70 < Utility.Random(100))
                        {
                            NightmareSkin goods = new NightmareSkin(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods);
                        }
                    }
                    if (from is ObsidianElemental)
                    {
                        if (1 == Utility.Random(1000))
                        {
                            c.DropItem(new ObsidianStone());
                        }
                    }
                    if ((from is Troll) || (from is SeaTroll) || (from is SwampTroll) || (from is FrostTroll))
                    {
                        if (95 < Utility.Random(100))
                        {
                            TrollSkin goods = new TrollSkin(); goods.Amount = Utility.RandomMinMax(1, 2); c.DropItem(goods);
                        }
                    }
                    if ((from is GoldenSerpent) || (from is BloodSnake) || (from is SilverSerpent) || (from is JungleViper) || (from is IceSerpent) ||
                        (from is GiantSerpent) || (from is GiantSnake) || (from is SeaSnake) || (from is LavaSerpent) || (from is LargeSnake) || (from is GiantAdder))
                    {
                        if (95 < Utility.Random(100))
                        {
                            SerpentSkin goods = new SerpentSkin(); goods.Amount = Utility.RandomMinMax(1, 2); c.DropItem(goods);
                        }
                    }
                    if ((from is AncientWyrm) ||
                        (from is LavaDragon) ||
                        (from is BottleDragon) ||
                        (from is SeaDragon) ||
                        (from is DeepSeaDragon) ||
                        (from is Dragon) ||
                        (from is Dragons) ||
                        (from is RidingDragon) ||
                        (from is DeepSeaDragon) ||
                        (from is SeaDragon) ||
                        (from is BlackDragon) ||
                        (from is AsianDragon) ||
                        (from is PrimevalFireDragon) ||
                        (from is PrimevalGreenDragon) ||
                        (from is PrimevalNightDragon) ||
                        (from is PrimevalRedDragon) ||
                        (from is PrimevalRoyalDragon) ||
                        (from is PrimevalRunicDragon) ||
                        (from is PrimevalSeaDragon) ||
                        (from is ReanimatedDragon) ||
                        (from is VampiricDragon) ||
                        (from is PrimevalAbysmalDragon) ||
                        (from is PrimevalAmberDragon) ||
                        (from is PrimevalBlackDragon) ||
                        (from is PrimevalDragon) ||
                        (from is PrimevalSilverDragon) ||
                        (from is PrimevalVolcanicDragon) ||
                        (from is PrimevalStygianDragon) ||
                        (from is GemDragon) ||
                        (from is DragonKing) ||
                        (from is VolcanicDragon) ||
                        (from is RadiationDragon) ||
                        (from is CrystalDragon) ||
                        (from is VoidDragon) ||
                        (from is ElderDragon) ||
                        (from is BlueDragon) ||
                        (from is SlasherOfVoid) ||
                        (from is GreenDragon) ||
                        (from is WhiteDragon) ||
                        (from is ZombieDragon) ||
                        (from is NightWyrm) ||
                        (from is JungleWyrm) ||
                        (from is DesertWyrm) ||
                        (from is MountainWyrm) ||
                        (from is OnyxWyrm) ||
                        (from is EmeraldWyrm) ||
                        (from is AmethystWyrm) ||
                        (from is SapphireWyrm) ||
                        (from is GarnetWyrm) ||
                        (from is TopazWyrm) ||
                        (from is RubyWyrm) ||
                        (from is SpinelWyrm) ||
                        (from is Wyrms) ||
                        (from is QuartzWyrm) ||
                        (from is WhiteWyrm))
                    {
                        if (95 < Utility.Random(100))
                        {
                            DragonSkin goods = new DragonSkin(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods);
                        }
                        if (95 < Utility.Random(100))
                        {
                            DragonBlood goods = new DragonBlood(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods);
                        }
                        if ((75 < Utility.Random(100)) && (from is AshDragon || from is BottleDragon || from is CaddelliteDragon || from is CrystalDragon || from is ElderDragon || from is RadiationDragon || from is VoidDragon))
                        {
                            DragonTooth goods = new DragonTooth(); c.DropItem(goods);
                        }
                        if ((50 < Utility.Random(100)) && (
                                from is PrimevalAbysmalDragon ||
                                from is PrimevalAmberDragon ||
                                from is PrimevalBlackDragon ||
                                from is PrimevalDragon ||
                                from is PrimevalFireDragon ||
                                from is PrimevalGreenDragon ||
                                from is PrimevalNightDragon ||
                                from is PrimevalRedDragon ||
                                from is PrimevalRoyalDragon ||
                                from is PrimevalRunicDragon ||
                                from is PrimevalSeaDragon ||
                                from is PrimevalSilverDragon ||
                                from is PrimevalStygianDragon ||
                                from is PrimevalVolcanicDragon ||
                                from is ReanimatedDragon ||
                                from is VampiricDragon))
                        {
                            DragonTooth goods = new DragonTooth(); goods.Amount = Utility.RandomMinMax(1, 2); c.DropItem(goods);
                        }
                        if (from is DragonKing)
                        {
                            DragonTooth goods = new DragonTooth(); goods.Amount = Utility.RandomMinMax(1, 4); c.DropItem(goods);
                        }
                    }
                    if ((from is Lich) ||
                        (from is LichLord) ||
                        (from is Nazghoul) ||
                        (from is AncientLich) ||
                        (from is UndeadDruid) ||
                        (from is TitanLich) ||
                        (from is DemiLich) ||
                        (from is Surtaz))
                    {
                        if (from is AncientLich)
                        {
                            LichDust goods = new LichDust(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods);
                        }
                        else if (80 < Utility.Random(100))
                        {
                            LichDust goods = new LichDust(); goods.Amount = Utility.RandomMinMax(1, 3); c.DropItem(goods);
                        }
                    }
                    if ((from is MonstrousSpider) ||
                        (from is WhiteDragon) ||
                        (from is BlackDragon) ||
                        (from is PrimevalFireDragon) ||
                        (from is PrimevalGreenDragon) ||
                        (from is PrimevalNightDragon) ||
                        (from is PrimevalRedDragon) ||
                        (from is PrimevalRoyalDragon) ||
                        (from is PrimevalRunicDragon) ||
                        (from is PrimevalSeaDragon) ||
                        (from is ReanimatedDragon) ||
                        (from is VampiricDragon) ||
                        (from is PrimevalAbysmalDragon) ||
                        (from is PrimevalAmberDragon) ||
                        (from is PrimevalBlackDragon) ||
                        (from is PrimevalDragon) ||
                        (from is PrimevalSilverDragon) ||
                        (from is PrimevalVolcanicDragon) ||
                        (from is PrimevalStygianDragon) ||
                        (from is BlueDragon) ||
                        (from is SlasherOfVoid) ||
                        (from is Dragon) ||
                        (from is Dragons && from.Body == 59) ||
                        (from is RidingDragon && from.Body == 59) ||
                        (from is Wyrms && from.Body == 12) ||
                        (from is GreenDragon) ||
                        (from is MetalDragon) ||
                        (from is LavaDragon) ||
                        (from is BottleDragon) ||
                        (from is IceDragon) ||
                        (from is CaddelliteDragon) ||
                        (from is WhiteWyrm) ||
                        (from is GemDragon) ||
                        (from is NightWyrm) ||
                        (from is RadiationDragon) ||
                        (from is CrystalDragon) ||
                        (from is VoidDragon) ||
                        (from is ElderDragon) ||
                        (from is JungleWyrm) ||
                        (from is DesertWyrm) ||
                        (from is MountainWyrm) ||
                        (from is AntLion) ||
                        (from is MetalBeetle) ||
                        (from is OnyxWyrm) ||
                        (from is EmeraldWyrm) ||
                        (from is AmethystWyrm) ||
                        (from is SapphireWyrm) ||
                        (from is GarnetWyrm) ||
                        (from is TopazWyrm) ||
                        (from is RubyWyrm) ||
                        (from is SpinelWyrm) ||
                        (from is QuartzWyrm) ||
                        (from is ShadowWyrm) ||
                        (from is AncientWyrm) ||
                        (from is DragonKing) ||
                        (from is VolcanicDragon))
                    {
                        int nBodyChance = (int)(from.Fame * 0.002) + 2;
                        int nBodyLevel  = (int)(from.Fame * 0.0006);
                        if (nBodyLevel > 10)
                        {
                            nBodyLevel = 10;
                        }
                        if (nBodyLevel < 1)
                        {
                            nBodyLevel = 1;
                        }
                        if (nBodyChance > Utility.Random(100))
                        {
                            CorpseChest corpseBox = new CorpseChest(nBodyLevel);
                            c.DropItem(corpseBox);
                        }
                    }

                    SlayerEntry wizardrykiller = SlayerGroup.GetEntryByName(SlayerName.WizardSlayer);
                    if (wizardrykiller.Slays(from))
                    {
                        if (Utility.Random(4) == 1)
                        {
                            if (MyServerSettings.GetUnidentifiedChance() >= Utility.RandomMinMax(1, 100))
                            {
                                Item wand = new UnknownWand(); c.DropItem(wand);
                            }
                            else
                            {
                                Item wand = Loot.RandomWand(); Server.Misc.MaterialInfo.ColorMetal(wand, 0); string wandOwner = ""; if (Utility.RandomMinMax(1, 3) == 1)
                                {
                                    wandOwner = Server.LootPackEntry.MagicWandOwner() + " ";
                                }
                                wand.Name = wandOwner + wand.Name; c.DropItem(wand);
                            }
                        }

                        if (Utility.Random(20) == 1)
                        {
                            c.DropItem(Server.Items.DungeonLoot.RandomRuneMagic());
                        }

                        if (Utility.Random(4) == 1 && Server.Items.BaseWizardStaff.HasStaff(killer))
                        {
                            c.DropItem(new MageEye(Utility.RandomMinMax(1, Server.Misc.IntelligentAction.GetCreatureLevel(from))));
                        }
                    }

                    // HIGH SEAS /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    if ((from is DeepSeaSerpent) || (from is SeaDragon) || (from is GiantSquid) || (from is DeepSeaDragon) || (from is Megalodon) ||
                        (from is Jormungandr) || (from is Shark) || (from is GreatWhite) || (from is SeaSerpent) || (from is Kraken) || (from is Leviathan))
                    {
                        int nBodyChance = (int)(from.Fame * 0.002) + 2;
                        int nBodyLevel  = (int)(from.Fame * 0.0006);
                        if (nBodyLevel > 10)
                        {
                            nBodyLevel = 10;
                        }
                        if (nBodyLevel < 1)
                        {
                            nBodyLevel = 1;
                        }
                        if (nBodyChance > Utility.Random(100))
                        {
                            CorpseSailor corpseBox = new CorpseSailor(nBodyLevel);
                            c.DropItem(corpseBox);
                        }
                    }

                    SlayerEntry neptune = SlayerGroup.GetEntryByName(SlayerName.NeptunesBane);

                    if (neptune.Slays(from) && from.Fame >= 11500)
                    {
                        int nWeedChance = (int)(from.Fame * 0.002) + 2;
                        if (nWeedChance > Utility.Random(100))
                        {
                            EnchantedSeaweed goods = new EnchantedSeaweed();
                            goods.Amount = Utility.RandomMinMax(1, 3);
                            c.DropItem(goods);
                        }

                        int nPearlChance = (int)(from.Fame * 0.001) + 1;
                        if (nPearlChance > Utility.Random(100))
                        {
                            c.DropItem(new MysticalPearl());
                        }
                    }
                    //-------------------------------------------------------------------------

                    if ((neptune.Slays(from) && from.WhisperHue == 999) || (from is Jormungandr) ||
                        Server.Misc.Worlds.IsSeaDungeon(from.Location, from.Map))
                    // ONLY SEA CREATURES ON THE HIGH SEAS DROP from STUFF
                    {
                        int nWreckChance = (int)(from.Fame * 0.002) + 2;
                        if (nWreckChance > Utility.Random(100))
                        {
                            HighSeasRelic goods = new HighSeasRelic();
                            goods.RelicGoldValue = goods.RelicGoldValue + (int)(from.RawStatTotal / 3);
                            c.DropItem(goods);
                        }
                        int nBottleChance = (int)(from.Fame * 0.002) + 1;
                        if (nBottleChance > Utility.Random(100))
                        {
                            int messageLevel = 0;

                            if (from.Fame < 2500)
                            {
                                messageLevel = 1;
                            }
                            else if (from.Fame < 5000)
                            {
                                messageLevel = 2;
                            }
                            else if (from.Fame < 10000)
                            {
                                messageLevel = 3;
                            }
                            else
                            {
                                messageLevel = 4;
                            }

                            if (20 > Utility.Random(100))
                            {
                                messageLevel = 0;
                            }                                                                                   // 20% CHANCE FOR A RANDOM LEVEL BOTTLE

                            Item message = new MessageInABottle(killer.Map, messageLevel, killer.Location, killer.X, killer.Y);
                            c.DropItem(message);
                        }
                        int nBoxChance = (int)(from.Fame * 0.001) - 1;
                        if (nBoxChance > Utility.Random(100) && !(from is StormGiant))                             // STORM GIANTS ALREADY DROP A BOX
                        {
                            int boxLevel = 0;

                            if (from.Fame < 2500)
                            {
                                boxLevel = 1;
                            }
                            else if (from.Fame < 5000)
                            {
                                boxLevel = 2;
                            }
                            else if (from.Fame < 10000)
                            {
                                boxLevel = 3;
                            }
                            else if (from.Fame < 20000)
                            {
                                boxLevel = 4;
                            }
                            else
                            {
                                boxLevel = 5;
                            }

                            LootChest MyChest = new LootChest(boxLevel);
                            MyChest.Name   = "sea chest";
                            MyChest.Hue    = 0;
                            MyChest.ItemID = Utility.RandomList(0x52E2, 0x52E3, 0x507E, 0x507F, 0x4910, 0x4911, 0x3332, 0x3333, 0x4FF4, 0x4FF5);
                            c.DropItem(MyChest);
                        }
                    }
                }
            }
        }
        public static Item CreateArtifact(string arty)
        {
            Item artifact   = null;
            int  AddBonuses = 1;

            if (arty == "random")
            {
                arty = "any";
                int HighSearch = 300 + 3;                 // THERE ARE 300 ARTIFACTS SO CHANGE THE SECOND NUMBER TO THE NUMBER OF CATEGORIES LISTED BELOW...
                switch (Utility.RandomMinMax(1, HighSearch))
                {
                case 3:         arty = "invulnerable";  break;
                }
            }

            if (arty == "driftwood")               // ONLY FOR SEA TRAVELERS
            {
                artifact = CreateWoodItem();
                if (artifact != null)
                {
                    artifact.Hue = 0x5B2; artifact.Name = "runed driftwood " + artifact.Name;
                }
            }
            else if (arty == "kelp")               // ONLY FOR SEA TRAVELERS
            {
                artifact = CreateLeatherArmor("any");
                if (artifact != null)
                {
                    artifact.Hue = 0x483; artifact.Name = artifact.Name.Replace("leather", "kelp woven");
                }
            }
            else if (arty == "barnacle")               // ONLY FOR SEA TRAVELERS
            {
                artifact = CreatePlateArmor("any");
                if (Utility.RandomMinMax(1, 3) == 1)
                {
                    artifact = CreateMetalShield();
                }
                if (artifact != null)
                {
                    artifact.Name = "barnacled " + artifact.Name; artifact.Hue = 0xB91;
                }
            }
            else if (arty == "bronzed")               // ONLY FOR SEA TRAVELERS
            {
                artifact = CreateMetalItem("female");
                if (artifact != null)
                {
                    artifact.Name = "bronzed " + artifact.Name + " of the valkyrie"; artifact.Hue = 2418;
                }
            }
            else if (arty == "neptune")               // ONLY FOR SEA TRAVELERS
            {
                switch (Utility.RandomMinMax(0, 4))
                {
                case 1: artifact = CreateArmorItem("any"); break;

                case 2: artifact = CreateBowItem(); break;

                case 3: artifact = CreateMetalShield(); break;

                case 4: artifact = CreateMetalWeapon(); break;
                }
                if (artifact is PlateLegs)
                {
                    artifact.ItemID = 0x2B6B;
                }
                else if (artifact is PlateArms)
                {
                    artifact.ItemID = 0x2B6C;
                }
                else if (artifact is PlateChest)
                {
                    artifact.ItemID = 0x2B67;
                }
                else if (artifact is PlateHelm)
                {
                    artifact.ItemID = 0x140E; artifact.Name = "helm";
                }

                if (artifact != null)
                {
                    artifact.Name = artifact.Name + " of Neptune"; artifact.Hue = 0x84C;
                }
            }
            else if (arty == "invulnerable")
            {
                artifact = CreateMetalProtection("any");
                if (artifact != null)
                {
                    artifact.Hue = 0x4F2; artifact.Name = artifact.Name + " of invulnerability";
                }
            }
            else
            {
                artifact   = Loot.RandomArty();
                AddBonuses = 0;
            }

            while (artifact == null)
            {
                artifact = Loot.RandomArty();
            }

            if (AddBonuses == 1)
            {
                if (artifact is BaseWeapon)
                {
                    PowerArtifactWeapon(artifact, arty);
                }
                else if (artifact is BaseShield)
                {
                    PowerArtifactShield(artifact, arty);
                }
                else if (artifact is BaseArmor)
                {
                    PowerArtifactArmor(artifact, arty);
                }
                else if (artifact is BaseJewel)
                {
                    PowerArtifactJewel(artifact, arty);
                }
            }

            if (MyServerSettings.GetUnidentifiedChance() >= Utility.RandomMinMax(1, 100))
            {
                LockableContainer box = new UnidentifiedArtifact();
                box.DropItem(artifact);
                box.ItemID = artifact.ItemID;
                box.Hue    = artifact.Hue;
                box.Name   = RandomThings.GetOddityAdjective() + " artifact";
                return(box);
            }
            return(artifact);
        }
            protected override void OnTick()
            {
                int  z      = m_Map.GetAverageZ(m_X, m_Y);
                bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false);

                for (int i = -3; !canFit && i <= 3; ++i)
                {
                    canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false);

                    if (canFit)
                    {
                        z += i;
                    }
                }

                if (!canFit)
                {
                    return;
                }

                Item g = new Gold(100, 200); g.Delete();

                int r1 = (int)(Utility.RandomMinMax(80, 160) * (MyServerSettings.GetGoldCutRate() * .01));
                int r2 = (int)(Utility.RandomMinMax(200, 400) * (MyServerSettings.GetGoldCutRate() * .01));
                int r3 = (int)(Utility.RandomMinMax(400, 800) * (MyServerSettings.GetGoldCutRate() * .01));
                int r4 = (int)(Utility.RandomMinMax(800, 1200) * (MyServerSettings.GetGoldCutRate() * .01));
                int r5 = (int)(Utility.RandomMinMax(1200, 1600) * (MyServerSettings.GetGoldCutRate() * .01));

                switch (Utility.Random(21))
                {
                case 0: g = new Crystals(r1); break;

                case 1: g = new DDGemstones(r2); break;

                case 2: g = new DDJewels(r2); break;

                case 3: g = new DDGoldNuggets(r3); break;

                case 4: g = new Gold(r3); break;

                case 5: g = new Gold(r3); break;

                case 6: g = new Gold(r3); break;

                case 7: g = new DDSilver(r4); break;

                case 8: g = new DDSilver(r4); break;

                case 9: g = new DDSilver(r4); break;

                case 10: g = new DDSilver(r4); break;

                case 11: g = new DDSilver(r4); break;

                case 12: g = new DDSilver(r4); break;

                case 13: g = new DDCopper(r5); break;

                case 14: g = new DDCopper(r5); break;

                case 15: g = new DDCopper(r5); break;

                case 16: g = new DDCopper(r5); break;

                case 17: g = new DDCopper(r5); break;

                case 18: g = new DDCopper(r5); break;

                case 19: g = new DDCopper(r5); break;

                case 20: g = new DDCopper(r5); break;
                }

                g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map);

                if (0.5 >= Utility.RandomDouble())
                {
                    switch (Utility.Random(3))
                    {
                    case 0:                             // Fire column
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                        Effects.PlaySound(g, g.Map, 0x208);

                        break;
                    }

                    case 1:                             // Explosion
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);
                        Effects.PlaySound(g, g.Map, 0x307);

                        break;
                    }

                    case 2:                             // Ball of fire
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);

                        break;
                    }
                    }
                }
            }
Esempio n. 5
0
        public static void Gain(Mobile from, Skill skill)
        {
            if (from.Region.IsPartOf(typeof(Regions.Jail)))
            {
                return;
            }

            if (from is BaseCreature && ((BaseCreature)from).IsDeadPet)
            {
                return;
            }

            if (skill.SkillName == SkillName.Focus && from is BaseCreature)
            {
                return;
            }

            if (skill.Base < skill.Cap && skill.Lock == SkillLock.Up)
            {
                int toGain = 1;

                if (skill.Base <= 10.0)
                {
                    toGain = Utility.Random(4) + 1;
                }

                Skills skills = from.Skills;

                if (from.Player && (skills.Total / skills.Cap) >= Utility.RandomDouble())                    //( skills.Total >= skills.Cap )
                {
                    for (int i = 0; i < skills.Length; ++i)
                    {
                        Skill toLower = skills[i];

                        if (toLower != skill && toLower.Lock == SkillLock.Down && toLower.BaseFixedPoint >= toGain)
                        {
                            toLower.BaseFixedPoint -= toGain;
                            break;
                        }
                    }
                }

                #region Scroll of Alacrity
                PlayerMobile pm = from as PlayerMobile;

                if (from is PlayerMobile)
                {
                    if (pm != null && skill.SkillName == pm.AcceleratedSkill && pm.AcceleratedStart > DateTime.Now)
                    {
                        toGain *= Utility.RandomMinMax(2, 5);
                    }
                }
                #endregion

                if (!from.Player || (skills.Total + toGain) <= skills.Cap)
                {
                    skill.BaseFixedPoint += toGain;

                    if (skill.SkillName == SkillName.Focus && Utility.RandomMinMax(1, 20) == 1)
                    {
                        Server.Gumps.SkillListingGump.RefreshSkillList(from);
                    }

                    else if (skill.SkillName == SkillName.Meditation && Utility.RandomMinMax(1, 20) == 1)
                    {
                        Server.Gumps.SkillListingGump.RefreshSkillList(from);
                    }

                    else
                    {
                        Server.Gumps.SkillListingGump.RefreshSkillList(from);
                    }
                }
            }

            if (skill.Lock == SkillLock.Up)
            {
                SkillInfo info = skill.Info;

                if (from.StrLock == StatLockType.Up && (info.StrGain / MyServerSettings.StatGain()) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Str);
                }
                else if (from.DexLock == StatLockType.Up && (info.DexGain / MyServerSettings.StatGain()) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Dex);
                }
                else if (from.IntLock == StatLockType.Up && (info.IntGain / MyServerSettings.StatGain()) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Int);
                }
            }
        }
Esempio n. 6
0
        public static void AddCustomers(Mobile from, BaseShoppe shoppe, int customer)
        {
            string client = shoppe.Customer01;

            if (customer == 1)
            {
                client = shoppe.Customer01;
            }
            else if (customer == 2)
            {
                client = shoppe.Customer02;
            }
            else if (customer == 3)
            {
                client = shoppe.Customer03;
            }
            else if (customer == 4)
            {
                client = shoppe.Customer04;
            }
            else if (customer == 5)
            {
                client = shoppe.Customer05;
            }
            else if (customer == 6)
            {
                client = shoppe.Customer06;
            }
            else if (customer == 7)
            {
                client = shoppe.Customer07;
            }
            else if (customer == 8)
            {
                client = shoppe.Customer08;
            }
            else if (customer == 9)
            {
                client = shoppe.Customer09;
            }
            else if (customer == 10)
            {
                client = shoppe.Customer10;
            }
            else if (customer == 11)
            {
                client = shoppe.Customer11;
            }
            else if (customer == 12)
            {
                client = shoppe.Customer12;
            }

            int exist = Convert.ToInt32(GetDataElement(client, 3));

            if (from != null && exist == 0)
            {
                int repMax = (int)(GetReputation(from, shoppe) / 10);
                int repMin = (int)(repMax / 5);
                if (repMin < 10)
                {
                    repMin = 10;
                }
                if (repMin >= repMax)
                {
                    repMax = repMin + 10;
                }

                int gold = Utility.RandomMinMax(repMin, repMax);

                gold = (int)((gold * 4) * (MyServerSettings.GetGoldCutRate() * .01));

                int fame = Utility.RandomMinMax(((int)(gold / 20)), ((int)(gold / 20) + Utility.RandomMinMax(0, 3)));
                if (fame < 5)
                {
                    fame = 5;
                }
                else if (fame > 50)
                {
                    fame = 50;
                }

                int skill = Utility.RandomMinMax(((int)((gold / 125) + 35)), ((int)((gold / 125) + 35) + Utility.RandomMinMax(0, 5)));
                if (skill < 30)
                {
                    skill = 30;
                }
                else if (skill > 120)
                {
                    skill = 120;
                }

                int tools = Utility.RandomMinMax(((int)(gold / 100)), ((int)(gold / 100) + Utility.RandomMinMax(0, 2)));
                if (tools < 1)
                {
                    tools = 1;
                }
                else if (tools > 10)
                {
                    tools = 10;
                }

                int resource = Utility.RandomMinMax(((int)(gold / 20)), ((int)(gold / 20) + Utility.RandomMinMax(0, 5)));
                if (resource < 5)
                {
                    resource = 5;
                }

                string customerName = NameList.RandomName("male");
                if (Utility.RandomBool())
                {
                    customerName = NameList.RandomName("female");
                }

                string customerTitle = HenchmanFunctions.GetTitle();

                string customerTask = Server.Items.BaseShoppe.MakeTask(shoppe);

                string finalCustomer = customerTask + "#" + customerName + " " + customerTitle + "#";
                finalCustomer = finalCustomer + "1" + "#" + gold + "#" + tools + "#" + resource + "#" + skill + "#" + fame + "";

                if (customer == 1)
                {
                    shoppe.Customer01 = finalCustomer;
                }
                else if (customer == 2)
                {
                    shoppe.Customer02 = finalCustomer;
                }
                else if (customer == 3)
                {
                    shoppe.Customer03 = finalCustomer;
                }
                else if (customer == 4)
                {
                    shoppe.Customer04 = finalCustomer;
                }
                else if (customer == 5)
                {
                    shoppe.Customer05 = finalCustomer;
                }
                else if (customer == 6)
                {
                    shoppe.Customer06 = finalCustomer;
                }
                else if (customer == 7)
                {
                    shoppe.Customer07 = finalCustomer;
                }
                else if (customer == 8)
                {
                    shoppe.Customer08 = finalCustomer;
                }
                else if (customer == 9)
                {
                    shoppe.Customer09 = finalCustomer;
                }
                else if (customer == 10)
                {
                    shoppe.Customer10 = finalCustomer;
                }
                else if (customer == 11)
                {
                    shoppe.Customer11 = finalCustomer;
                }
                else if (customer == 12)
                {
                    shoppe.Customer12 = finalCustomer;
                }
            }
        }