예제 #1
0
        public static void CreateTeleporter(int xFrom, int yFrom, int xTo, int yTo)
        {
            var locFrom = new Point3D(xFrom, yFrom, -1);
            var locTo   = new Point3D(xTo, yTo, -1);
            var map     = Map.Malas;

            if (!MythikStaticValues.UpdateLoc(ref locFrom, ref map))
            {
                return;
            }
            map = Map.Malas;
            if (!MythikStaticValues.UpdateLoc(ref locTo, ref map))
            {
                return;
            }

            Static     telePad  = new Static(0x1822);
            Teleporter teleItem = new Teleporter(locTo, map, false);

            telePad.Hue = 0x482;
            telePad.MoveToWorld(locFrom, map);

            teleItem.MoveToWorld(locFrom, map);

            teleItem.SourceEffect = true;
            teleItem.DestEffect   = true;
            teleItem.SoundID      = 0x1FE;
        }
예제 #2
0
        private static void CreateDoomPorter(int x, int y, int z, int itemid, int hue)
        {
            var loc = new Point3D(x, y, z);
            var map = Map.Malas;

            if (MythikStaticValues.UpdateLoc(ref loc, ref map))
            {
                CreateDoomPorter(loc, map, itemid, hue);
            }
        }
예제 #3
0
        private static void CreateDoor(int x, int y, int z)
        {
            var loc = new Point3D(x, y, z);
            var map = Map.Malas;

            if (MythikStaticValues.UpdateLoc(ref loc, ref map))
            {
                CreateDoor(loc, map);
            }
        }
예제 #4
0
        private static void CreateDoomStatue(int x, int y, int z, bool south)
        {
            var loc = new Point3D(x, y, z);
            var map = Map.Malas;

            if (MythikStaticValues.UpdateLoc(ref loc, ref map))
            {
                CreateDoomStatue(loc, map, south);
            }
        }
예제 #5
0
        private static void MakeSpawner(string[] types, int x, int y, Map map)
        {
            if (types.Length == 0)
            {
                return;
            }

            int z   = 0;
            var loc = new Point3D(x, y, z);

            if (!MythikStaticValues.UpdateLoc(ref loc, ref map))
            {
                return;
            }
            x = loc.X;
            y = loc.Y;
            z = GetSpawnerZ(x, y, map);
            ClearSpawners(x, y, z, map);

            for (int i = 0; i < types.Length; ++i)
            {
                bool isGuildmaster = (types[i].EndsWith("Guildmaster"));

                Spawner sp = new Spawner(types[i]);

                if (isGuildmaster)
                {
                    sp.Count = 1;
                }
                else
                {
                    sp.Count = NPCCount;
                }

                sp.MinDelay  = MinTime;
                sp.MaxDelay  = MaxTime;
                sp.Team      = Team;
                sp.HomeRange = HomeRange;

                sp.MoveToWorld(new Point3D(x, y, z), map);

                if (TotalRespawn)
                {
                    sp.Respawn();
                    sp.BringToHome();
                }

                ++m_Count;
            }
        }
예제 #6
0
        public static void CreateVarietyDealer(int x, int y)
        {
            var loc = new Point3D(x, y, -1);
            var map = Map.Malas;

            if (!MythikStaticValues.UpdateLoc(ref loc, ref map))
            {
                return;
            }
            VarietyDealer dealer = new VarietyDealer();

            /* Begin outfit */
            dealer.Name  = "Nix";
            dealer.Title = "the Variety Dealer";

            dealer.Body   = 400;
            dealer.Female = false;
            dealer.Hue    = 0x8835;

            List <Item> items = new List <Item>(dealer.Items);

            for (int i = 0; i < items.Count; ++i)
            {
                Item item = items[i];

                if (item.Layer != Layer.ShopBuy && item.Layer != Layer.ShopResale && item.Layer != Layer.ShopSell)
                {
                    item.Delete();
                }
            }

            dealer.HairItemID = 0x2049;             // Pig Tails
            dealer.HairHue    = 0x482;

            dealer.FacialHairItemID = 0x203E;
            dealer.FacialHairHue    = 0x482;

            dealer.AddItem(new FloppyHat(1));
            dealer.AddItem(new Robe(1));

            dealer.AddItem(new LanternOfSouls());

            dealer.AddItem(new Sandals(0x482));
            /* End outfit */

            dealer.MoveToWorld(loc, map);

            dealer.Home      = dealer.Location;
            dealer.RangeHome = 2;
        }
예제 #7
0
        public static void CreateMorphItem(int x, int y, int inactiveItemID, int activeItemID, int range, int hue)
        {
            var loc = new Point3D(x, y, -1);
            var map = Map.Malas;

            if (!MythikStaticValues.UpdateLoc(ref loc, ref map))
            {
                return;
            }
            MorphItem item = new MorphItem(inactiveItemID, activeItemID, range);

            item.Hue = hue;
            item.MoveToWorld(loc, map);
        }
예제 #8
0
        public static void Add_Static(int itemID, Point3D location, Map map, string name)
        {
            IPooledEnumerable eable = map.GetItemsInRange(location, 0);

            foreach (Item item in eable)
            {
                if (item is Sign && item.Z == location.Z && item.ItemID == itemID)
                {
                    m_ToDelete.Enqueue(item);
                }
            }

            eable.Free();

            while (m_ToDelete.Count > 0)
            {
                m_ToDelete.Dequeue().Delete();
            }

            Item sign;

            if (name.StartsWith("#"))
            {
                sign = new LocalizedSign(itemID, Utility.ToInt32(name.Substring(1)));
            }
            else
            {
                sign      = new Sign(itemID);
                sign.Name = name;
            }

            if (map == Map.Malas)
            {
                if (location.X >= 965 && location.Y >= 502 && location.X <= 1012 && location.Y <= 537)
                {
                    sign.Hue = 0x47E;
                }
                else if (location.X >= 1960 && location.Y >= 1278 && location.X < 2106 && location.Y < 1413)
                {
                    sign.Hue = 0x44E;
                }
            }
            if (!MythikStaticValues.UpdateLoc(ref location, ref map))
            {
                return;
            }

            sign.MoveToWorld(location, map);
        }
예제 #9
0
        public static void CreatePricedHealer(int price, int x, int y)
        {
            var loc = new Point3D(x, y, -1);
            var map = Map.Malas;

            if (!MythikStaticValues.UpdateLoc(ref loc, ref map))
            {
                return;
            }
            PricedHealer healer = new PricedHealer(price);

            healer.MoveToWorld(loc, map);

            healer.Home      = healer.Location;
            healer.RangeHome = 5;
        }
예제 #10
0
        private static void LoadLocations()
        {
            string filePath = Path.Combine(Core.BaseDirectory, "Data/treasure.cfg");

            List <Point2D> list      = new List <Point2D>();
            List <Point2D> havenList = new List <Point2D>();

            if (File.Exists(filePath))
            {
                using (StreamReader ip = new StreamReader(filePath))
                {
                    string line;

                    while ((line = ip.ReadLine()) != null)
                    {
                        try
                        {
                            string[] split = line.Split(' ');

                            int x = Convert.ToInt32(split[0]), y = Convert.ToInt32(split[1]);
                            //update loc's from old fel to new fel/ilsh
                            var map = Map.Felucca;
                            MythikStaticValues.UpdateLoc(ref x, ref y, ref map);

                            Point2D loc = new Point2D(x, y);

                            list.Add(loc);

                            if (IsInHavenIsland(loc))
                            {
                                havenList.Add(loc);
                            }
                        }
                        catch
                        {
                        }
                    }
                }
            }

            m_Locations      = list.ToArray();
            m_HavenLocations = havenList.ToArray();
        }
예제 #11
0
        public static void Initialize()
        {
            string filePath = Path.Combine(Core.BaseDirectory, "Data/treasure.cfg");
            int    i = 0, x = 0, y = 0;

            if (File.Exists(filePath))
            {
                using (StreamReader ip = new StreamReader(filePath))
                {
                    string line;

                    while ((line = ip.ReadLine()) != null)
                    {
                        i++;

                        try
                        {
                            string[] split = line.Split(' ');

                            x = Convert.ToInt32(split[0]);
                            y = Convert.ToInt32(split[1]);
                            //update loc's from old fel to new fel/ilsh
                            var map = Map.Felucca;
                            MythikStaticValues.UpdateLoc(ref x, ref y, ref map);
                            try
                            {
                                new TreasureRegion(x, y, Map.Felucca);
                                new TreasureRegion(x, y, Map.Trammel);
                            }
                            catch (Exception e)
                            {
                                Console.WriteLine("{0} {1} {2} {3}", i, x, y, e);
                            }
                        }
                        catch
                        {
                            Console.WriteLine("Warning: Error in Line '{0}' of Data/treasure.cfg", line);
                        }
                    }
                }
            }
        }
예제 #12
0
        private static int MoonGen(PMList list)
        {
            foreach (PMEntry entry in list.Entries)
            {
                Item item = new PublicMoongate();
                var  loc  = entry.Location;
                var  map  = list.Map;
                if (!MythikStaticValues.UpdateLoc(ref loc, ref map))
                {
                    continue;
                }
                item.MoveToWorld(loc, map);

                if (entry.Number == 1060642)                   // Umbra
                {
                    item.Hue = 0x497;
                }
            }

            return(list.Entries.Length);
        }
예제 #13
0
        public static GauntletSpawner CreateSpawner(string typeName, int xSpawner, int ySpawner, int xDoor, int yDoor, int xPentagram, int yPentagram, bool doorEastToWest, int xStart, int yStart, int xWidth, int yHeight)
        {
            var spawnLoc = new Point3D(xSpawner, ySpawner, -1);
            var map      = Map.Malas;

            if (!MythikStaticValues.UpdateLoc(ref spawnLoc, ref map))
            {
                return(null);
            }

            GauntletSpawner spawner = new GauntletSpawner(typeName);

            spawner.MoveToWorld(spawnLoc, map);

            if (xDoor > 0 && yDoor > 0)
            {
                spawner.Door = CreateDoorSet(xDoor, yDoor, doorEastToWest, 0);
            }

            spawner.RegionBounds = MythikStaticValues.UpdateDoomBounds(new Rectangle2D(xStart, yStart, xWidth, yHeight));

            if (xPentagram > 0 && yPentagram > 0)
            {
                var PentagramLoc = new Point3D(xPentagram, yPentagram, -1);
                var mapPenta     = Map.Malas;
                if (!MythikStaticValues.UpdateLoc(ref PentagramLoc, ref mapPenta))
                {
                    return(null);
                }
                PentagramAddon pentagram = new PentagramAddon();

                pentagram.MoveToWorld(PentagramLoc, mapPenta);

                spawner.Addon = pentagram;
            }

            return(spawner);
        }
예제 #14
0
        public static BaseDoor CreateDoorSet(int xDoor, int yDoor, bool doorEastToWest, int hue)
        {
            var spawnLoc = new Point3D(xDoor, yDoor, -1);
            var map      = Map.Malas;

            if (!MythikStaticValues.UpdateLoc(ref spawnLoc, ref map))
            {
                return(null);
            }

            BaseDoor hiDoor = new MetalDoor(doorEastToWest ? DoorFacing.NorthCCW : DoorFacing.WestCW);
            BaseDoor loDoor = new MetalDoor(doorEastToWest ? DoorFacing.SouthCW : DoorFacing.EastCCW);

            hiDoor.MoveToWorld(spawnLoc, map);
            loDoor.MoveToWorld(new Point3D(spawnLoc.X + (doorEastToWest ? 0 : 1), spawnLoc.Y + (doorEastToWest ? 1 : 0), -1), map);

            hiDoor.Link = loDoor;
            loDoor.Link = hiDoor;

            hiDoor.Hue = hue;
            loDoor.Hue = hue;

            return(hiDoor);
        }
예제 #15
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 0)               // Cancel
            {
                return;
            }
            else if (m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null)
            {
                return;
            }

            int[] switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            int switchID  = switches[0];
            int listIndex = switchID / 100;
            int listEntry = switchID % 100;

            if (listIndex < 0 || listIndex >= m_Lists.Length)
            {
                return;
            }

            PMList list = m_Lists[listIndex];

            if (listEntry < 0 || listEntry >= list.Entries.Length)
            {
                return;
            }

            PMEntry entry = list.Entries[listEntry];

            if (!m_Mobile.InRange(m_Moongate.GetWorldLocation(), 1) || m_Mobile.Map != m_Moongate.Map)
            {
                m_Mobile.SendLocalizedMessage(1019002);                   // You are too far away to use the gate.
            }
            else if (m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca)
            {
                m_Mobile.SendLocalizedMessage(1019004);                   // You are not allowed to travel there.
            }
            else if (Factions.Sigil.ExistsOn(m_Mobile) && list.Map != Factions.Faction.Facet)
            {
                m_Mobile.SendLocalizedMessage(1019004);                   // You are not allowed to travel there.
            }
            else if (m_Mobile.Criminal)
            {
                m_Mobile.SendLocalizedMessage(1005561, "", 0x22);                   // Thou'rt a criminal and cannot escape so easily.
            }
            else if (SpellHelper.CheckCombat(m_Mobile))
            {
                m_Mobile.SendLocalizedMessage(1005564, "", 0x22);                   // Wouldst thou flee during the heat of battle??
            }
            else if (m_Mobile.Spell != null)
            {
                m_Mobile.SendLocalizedMessage(1049616);                   // You are too busy to do that at the moment.
            }
            else if (m_Mobile.Map == list.Map && m_Mobile.InRange(entry.Location, 1))
            {
                m_Mobile.SendLocalizedMessage(1019003);                   // You are already there.
            }
            else
            {
                var loc = entry.Location;
                var map = list.Map;
                MythikStaticValues.UpdateLoc(ref loc, ref map);

                BaseCreature.TeleportPets(m_Mobile, loc, map);

                m_Mobile.Combatant = null;
                m_Mobile.Warmode   = false;
                m_Mobile.Hidden    = true;
                m_Mobile.MoveToWorld(loc, map);

                Effects.PlaySound(loc, map, 0x1FE);
            }
        }
예제 #16
0
        public static void GenGauntlet_OnCommand(CommandEventArgs e)
        {
            /* Begin healer room */
            CreatePricedHealer(5000, 387, 400);
            CreateTeleporter(390, 407, 394, 405);

            BaseDoor healerDoor = CreateDoorSet(393, 404, true, 0x44E);

            healerDoor.Locked   = true;
            healerDoor.KeyValue = Key.RandomValue();

            if (healerDoor.Link != null)
            {
                healerDoor.Link.Locked   = true;
                healerDoor.Link.KeyValue = Key.RandomValue();
            }
            /* End healer room */

            /* Begin supply room */
            CreateMorphItem(433, 371, 0x29F, 0x116, 3, 0x44E);
            CreateMorphItem(433, 372, 0x29F, 0x115, 3, 0x44E);

            CreateVarietyDealer(492, 369);

            for (int x = 434; x <= 478; ++x)
            {
                for (int y = 371; y <= 372; ++y)
                {
                    var loc = new Point3D(x, y, -1);
                    var map = Map.Malas;
                    if (!MythikStaticValues.UpdateLoc(ref loc, ref map))
                    {
                        continue;
                    }
                    Static item = new Static(0x524);

                    item.Hue = 1;
                    item.MoveToWorld(loc, map);
                }
            }
            /* End supply room */

            /* Begin gauntlet cycle */
            CreateTeleporter(471, 428, 474, 428);
            CreateTeleporter(462, 494, 462, 498);
            CreateTeleporter(403, 502, 399, 506);
            CreateTeleporter(357, 476, 356, 480);
            CreateTeleporter(361, 433, 357, 434);

            GauntletSpawner sp1 = CreateSpawner("DarknightCreeper", 491, 456, 473, 432, 417, 426, true, 473, 412, 39, 60);
            GauntletSpawner sp2 = CreateSpawner("FleshRenderer", 482, 520, 468, 496, 426, 422, false, 448, 496, 56, 48);
            GauntletSpawner sp3 = CreateSpawner("Impaler", 406, 538, 408, 504, 432, 430, false, 376, 504, 64, 48);
            GauntletSpawner sp4 = CreateSpawner("ShadowKnight", 335, 512, 360, 478, 424, 439, false, 300, 478, 72, 64);
            GauntletSpawner sp5 = CreateSpawner("AbysmalHorror", 326, 433, 360, 429, 416, 435, true, 300, 408, 60, 56);
            GauntletSpawner sp6 = CreateSpawner("DemonKnight", 423, 430, 0, 0, 423, 430, true, 392, 392, 72, 96);

            sp1.Sequence = sp2;
            sp2.Sequence = sp3;
            sp3.Sequence = sp4;
            sp4.Sequence = sp5;
            sp5.Sequence = sp6;
            sp6.Sequence = sp1;

            sp1.State = GauntletSpawnerState.InProgress;
            /* End gauntlet cycle */

            /* Begin exit gate */
            ConfirmationMoongate gate = new ConfirmationMoongate();

            gate.Dispellable = false;

            gate.Target    = MythikStaticValues.NeutralZone;// new Point3D( 2350, 1270, -85 );
            gate.TargetMap = Map.Felucca;

            gate.GumpWidth  = 420;
            gate.GumpHeight = 280;

            gate.MessageColor  = 0x7F00;
            gate.MessageNumber = 1062109;             // You are about to exit Dungeon Doom.  Do you wish to continue?

            gate.TitleColor  = 0x7800;
            gate.TitleNumber = 1062108;             // Please verify...

            gate.Hue = 0x44E;
            var gateloc = new Point3D(433, 326, -1);
            var gatemap = Map.Malas;

            if (!MythikStaticValues.UpdateLoc(ref gateloc, ref gatemap))
            {
                return;
            }
            gate.MoveToWorld(gateloc, gatemap);
            /* End exit gate */
        }
예제 #17
0
        private static void InvokeReward(Mobile from, SkillInfo skillInfo)
        {
            //Gump is problematic, would need to track if they have recieved their
            //reward for each skill, and recheck each login incase they closed the gump without accepting etc
            //Just give them a reward directly for now.
            Item rewardItem = null;

            switch (skillInfo.SkillID)
            {
            case 0:     // alchemy
                rewardItem = new MortarPestle();
                break;

            case 7:     // Blacksmithy
                rewardItem = new SmithHammer();
                break;

            case 8:     // Bowcraft/fletching
                rewardItem = new Bow();
                break;

            case 11:     // Carpentry
                rewardItem = new SmoothingPlane();
                break;

            case 23:     // Inscription
                rewardItem = new ScribesPen();
                break;

            case 25:     // Magery
                rewardItem = new Spellbook();
                (rewardItem as Spellbook).Content = ulong.MaxValue;
                break;

            case 34:     // Tailoring
                rewardItem = new SewingKit();
                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:
                rewardItem = new Drums();
                break;

            //"Thieving" skills
            case 21:
            case 28:
            case 33:
            case 47:
                rewardItem = new Cloak();
                break;
            }
            if (rewardItem != null)
            {
                rewardItem.Hue      = MythikStaticValues.GetGMRewardHue();
                rewardItem.LootType = LootType.Blessed;
                if (rewardItem.DefaultName != null)
                {
                    rewardItem.Name = from.RawName + "'s " + rewardItem.DefaultName;
                }
                from.PlaceInBackpack(rewardItem);
                from.SendAsciiMessage("You have recieved an item for becoming a Grand Master.");
            }
            else
            {
                from.SendAsciiMessage("You have recieved nothing but a sense of self worth for your efforts becoming a Grand Master.");
            }
        }
예제 #18
0
 public SkinDye() : base(0x1847)
 {
     Name = "Rare Skin Dye";
     Hue  = MythikStaticValues.GetRandomRareSkinDyeHue();
 }
예제 #19
0
파일: HairDye.cs 프로젝트: MythikGN/Mythik
 public RareHairDye() : base(0xEFF)
 {
     Name = "Rare Hair Dye";
     Hue  = MythikStaticValues.GetRandomRareSkinDyeHue();
 }
예제 #20
0
 public PoisonRoomRegion() : base("Poison Room Region", Map.Felucca, 80, new Rectangle2D[] { MythikStaticValues.UpdateDoomBounds(new Rectangle2D(356, 6, 18, 18)) }, 3)
 {
 }
예제 #21
0
 public SecretRoomRegion() : base("Secret Room", Map.Felucca, 80, new Rectangle2D[] { MythikStaticValues.UpdateDoomBounds(new Rectangle2D(465, 92, 9, 9)) }, 4)
 {
 }
예제 #22
0
파일: Decorate.cs 프로젝트: MythikGN/Mythik
        public int Generate(Map[] maps)
        {
            int count = 0;

            Item item = null;

            for (int i = 0; i < m_Entries.Count; ++i)
            {
                DecorationEntry entry = (DecorationEntry)m_Entries[i];
                Point3D         loc   = entry.Location;
                string          extra = entry.Extra;

                for (int j = 0; j < maps.Length; ++j)
                {
                    if (item == null)
                    {
                        item = Construct();
                    }

                    if (item == null)
                    {
                        continue;
                    }

                    if (FindItem(loc.X, loc.Y, loc.Z, maps[j], item))
                    {
                    }
                    else
                    {
                        var map = Map.Felucca;
                        if (!MythikStaticValues.UpdateLoc(ref loc, ref map))
                        {
                            continue;
                        }
                        if (map == Map.Ilshenar)
                        {
                            item.MoveToWorld(loc, Map.Felucca);
                        }
                        else
                        {
                            item.MoveToWorld(loc, maps[j]);
                        }
                        ++count;

                        if (item is BaseDoor)
                        {
                            IPooledEnumerable eable = maps[j].GetItemsInRange(loc, 1);

                            Type itemType = item.GetType();

                            foreach (Item link in eable)
                            {
                                if (link != item && link.Z == item.Z && link.GetType() == itemType)
                                {
                                    ((BaseDoor)item).Link = (BaseDoor)link;
                                    ((BaseDoor)link).Link = (BaseDoor)item;
                                    break;
                                }
                            }

                            eable.Free();
                        }
                        else if (item is MarkContainer)
                        {
                            try{ ((MarkContainer)item).Target = Point3D.Parse(extra); }
                            catch {}
                        }

                        item = null;
                    }
                }
            }

            if (item != null)
            {
                item.Delete();
            }

            return(count);
        }