Example #1
0
        public void SetupCube(Mobile from)
        {
            VortexCube cube = new VortexCube();

            cube.CubeOwner = from;

            cube.HasConvexLense  = 0;
            cube.HasConcaveLense = 0;

            cube.HasKeyLaw      = 0;
            cube.TextKeyLaw     = GetRumor();
            cube.LocationKeyLaw = PickDungeon();

            cube.HasKeyChaos      = 0;
            cube.TextKeyChaos     = GetRumor();
            cube.LocationKeyChaos = PickDungeon();

            cube.HasKeyBalance      = 0;
            cube.TextKeyBalance     = GetRumor();
            cube.LocationKeyBalance = PickDungeon();

            cube.HasCrystalRed    = 0;
            cube.HasCrystalBlue   = 0;
            cube.HasCrystalGreen  = 0;
            cube.HasCrystalYellow = 0;
            cube.HasCrystalWhite  = 0;
            cube.HasCrystalPurple = 0;

            cube.TextCrystal     = GetRumor();
            cube.LocationCrystal = PickDungeon();

            from.AddToBackpack(cube);
        }
Example #2
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m.Y < this.Y && m.InRange(this.GetWorldLocation(), 2))
            {
                DoTeleport(m);
            }
            else if (m.Y > this.Y && m.InRange(this.GetWorldLocation(), 2) && m.Backpack.FindItemByType(typeof(VortexCube)) != null)
            {
                Item square = m.Backpack.FindItemByType(typeof(VortexCube));

                if (square is VortexCube)
                {
                    VortexCube cube  = (VortexCube)square;
                    int        quest = cube.HasConvexLense + cube.HasConcaveLense + cube.HasKeyLaw + cube.HasKeyChaos + cube.HasKeyBalance + cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple;

                    if (cube.CubeOwner == m && quest > 10)
                    {
                        DoTeleport(m);
                    }
                    else
                    {
                        m.SendMessage("This door seems to be magically sealed.");
                    }
                }
            }
            else if (m.Y > this.Y && m.InRange(this.GetWorldLocation(), 2) && m.Backpack.FindItemByType(typeof(CodexWisdom)) != null)
            {
                Item book = m.Backpack.FindItemByType(typeof(CodexWisdom));

                if (book is CodexWisdom)
                {
                    CodexWisdom codex = (CodexWisdom)book;

                    if (codex.CodexOwner == m)
                    {
                        DoTeleport(m);
                    }
                    else
                    {
                        m.SendMessage("This door seems to be magically sealed.");
                    }
                }
            }
            else if (m.InRange(this.GetWorldLocation(), 2))
            {
                m.SendMessage("This door seems to be magically sealed.");
            }
            else
            {
                m.SendLocalizedMessage(502138);                   // That is too far away for you to use
            }
        }
Example #3
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is PlayerMobile)
            {
                if (m.Backpack.FindItemByType(typeof(VortexCube)) != null)
                {
                    Item square = m.Backpack.FindItemByType(typeof(VortexCube));

                    if (square is VortexCube)
                    {
                        VortexCube cube  = (VortexCube)square;
                        int        quest = cube.HasConvexLense + cube.HasConcaveLense + cube.HasKeyLaw + cube.HasKeyChaos + cube.HasKeyBalance + cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple;

                        if (cube.CubeOwner == m && quest > 10)
                        {
                            square.Delete();

                            ArrayList targets = new ArrayList();
                            foreach (Item item in World.Items.Values)
                            {
                                if (item is VortexCube)
                                {
                                    if (((VortexCube)item).CubeOwner == m)
                                    {
                                        targets.Add(item);
                                    }
                                }
                            }
                            for (int i = 0; i < targets.Count; ++i)
                            {
                                Item item = ( Item )targets[i];
                                item.Delete();
                            }

                            CodexWisdom book = new CodexWisdom();
                            book.CodexOwner      = m;
                            book.HasConvexLense  = 1;
                            book.HasConcaveLense = 1;
                            m.AddToBackpack(book);
                            m.SendMessage("You draw the Codex out from the Void!");
                            m.LocalOverheadMessage(MessageType.Emote, 1150, true, "You draw the Codex out from the Void");
                            m.SendSound(0x203);
                            LoggingFunctions.LogGeneric(m, "has obtained the Codex of Ultimate Wisdom.");
                        }
                    }
                }
            }

            return(true);
        }
Example #4
0
        public override void OnComponentUsed(AddonComponent ac, Mobile from)
        {
            int monsters = 0;

            foreach (Mobile monster in this.GetMobilesInRange(5))
            {
                if (monster is BaseCreature)
                {
                    Mobile leader = ((BaseCreature)monster).GetMaster();
                    if (leader is PlayerMobile)
                    {
                    }
                    else
                    {
                        ++monsters;
                    }
                }
            }

            if (from.Blessed)
            {
                from.SendMessage("You cannot open that while in this state.");
            }
            else if (!from.InRange(GetWorldLocation(), 2))
            {
                from.SendMessage("You will have to get closer to open that.");
            }
            else if (monsters > 0)
            {
                from.SendMessage("You cannot open this with too many creatures around.");
            }
            else if (from.Backpack.FindItemByType(typeof(SearchPage)) != null ||
                     from.Backpack.FindItemByType(typeof(DDRelicTablet)) != null ||
                     from.Backpack.FindItemByType(typeof(VortexCube)) != null ||
                     from.Backpack.FindItemByType(typeof(AlienEgg)) != null ||
                     from.Backpack.FindItemByType(typeof(ResearchBag)) != null ||
                     from.Backpack.FindItemByType(typeof(DragonEgg)) != null ||
                     from.Backpack.FindItemByType(typeof(DracolichSkull)) != null ||
                     from.Backpack.FindItemByType(typeof(MuseumBook)) != null ||
                     from.Backpack.FindItemByType(typeof(QuestTome)) != null ||
                     from.Backpack.FindItemByType(typeof(DemonPrison)) != null ||
                     from.Backpack.FindItemByType(typeof(CourierMail)) != null)
            {
                int EmptyBox = 1;

                if (from.Backpack.FindItemByType(typeof(MuseumBook)) != null)
                {
                    if (MuseumBook.FoundItem(from, 2))
                    {
                        EmptyBox = 0;
                    }
                }

                if (from.Backpack.FindItemByType(typeof(QuestTome)) != null)
                {
                    if (QuestTome.FoundItem(from, 2, null))
                    {
                        EmptyBox = 0;
                    }
                }

                if (from.Backpack.FindItemByType(typeof(CourierMail)) != null)
                {
                    Item        mail     = from.Backpack.FindItemByType(typeof(CourierMail));
                    CourierMail envelope = (CourierMail)mail;

                    if (envelope.SearchDungeon == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && envelope.owner == from && envelope.DungeonMap == from.Map && envelope.MsgComplete == 0)
                    {
                        envelope.MsgComplete = 1;
                        from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the " + envelope.SearchItem + ".");
                        from.SendSound(0x3D);
                        EmptyBox = 0;
                    }
                }

                if (from.Backpack.FindItemByType(typeof(ResearchBag)) != null)
                {
                    ResearchBag bag = (ResearchBag)from.Backpack.FindItemByType(typeof(ResearchBag));

                    if (bag.BagOwner == from)
                    {
                        if (Server.Misc.Research.SearchResult(from, bag))
                        {
                            EmptyBox = 0;
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(VortexCube)) != null)
                {
                    Item       cubes = from.Backpack.FindItemByType(typeof(VortexCube));
                    VortexCube cube  = (VortexCube)cubes;

                    if (cube.CubeOwner == from)
                    {
                        if (cube.LocationKeyLaw == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && cube.HasKeyLaw == 0)
                        {
                            cube.HasKeyLaw = 1;
                            from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the Key of Law!");
                            from.SendSound(0x3D);
                            LoggingFunctions.LogGeneric(from, "has found the Key of Law.");
                            EmptyBox = 0;
                        }
                        if (cube.LocationKeyBalance == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && cube.HasKeyBalance == 0)
                        {
                            cube.HasKeyBalance = 1;
                            from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the Key of Balance!");
                            from.SendSound(0x3D);
                            LoggingFunctions.LogGeneric(from, "has found the Key of Balance.");
                            EmptyBox = 0;
                        }
                        if (cube.LocationKeyChaos == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && cube.HasKeyChaos == 0)
                        {
                            cube.HasKeyChaos = 1;
                            from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the Key of Chaos!");
                            from.SendSound(0x3D);
                            LoggingFunctions.LogGeneric(from, "has found the Key of Chaos.");
                            EmptyBox = 0;
                        }

                        int crystals = cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple;

                        if (crystals < 6 && cube.LocationCrystal == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                        {
                            if (cube.HasCrystalRed == 0)
                            {
                                cube.HasCrystalRed = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the red Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the red Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalBlue == 0)
                            {
                                cube.HasCrystalBlue = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the blue Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the blue Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalBlue == 0)
                            {
                                cube.HasCrystalBlue = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the blue Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the blue Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalGreen == 0)
                            {
                                cube.HasCrystalGreen = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the green Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the green Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalYellow == 0)
                            {
                                cube.HasCrystalYellow = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the yellow Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the yellow Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalWhite == 0)
                            {
                                cube.HasCrystalWhite = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the white Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the white Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalPurple == 0)
                            {
                                cube.HasCrystalPurple = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the purple Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the purple Void Crystal.");
                                EmptyBox = 0;
                            }

                            cube.TextCrystal     = Server.Items.CubeOnCorpse.GetRumor();
                            cube.LocationCrystal = Server.Items.CubeOnCorpse.PickDungeon();

                            int crystal = cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple;

                            if (crystal > 5)
                            {
                                cube.TextCrystal     = "";
                                cube.LocationCrystal = "";
                            }
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(AlienEgg)) != null)
                {
                    Item     eggs = from.Backpack.FindItemByType(typeof(AlienEgg));
                    AlienEgg egg  = (AlienEgg)eggs;

                    if (egg.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                    {
                        bool pickNewEggSpot = false;
                        if (egg.HaveRod < 1)
                        {
                            pickNewEggSpot = true; egg.HaveRod = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the rod of amber!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HaveYellowCrystal < 1)
                        {
                            pickNewEggSpot = true; egg.HaveYellowCrystal = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the sun crystal!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HaveRedCrystal < 1)
                        {
                            pickNewEggSpot = true; egg.HaveRedCrystal = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the blood crystal!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HavePotion < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotion = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the potion of growth!"); from.SendSound(0x3D); EmptyBox = 0;
                        }

                        if (pickNewEggSpot)
                        {
                            egg.PieceRumor    = Server.Items.CubeOnCorpse.GetRumor();
                            egg.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon();
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(DragonEgg)) != null)
                {
                    Item      eggs = from.Backpack.FindItemByType(typeof(DragonEgg));
                    DragonEgg egg  = (DragonEgg)eggs;

                    if (egg.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                    {
                        bool pickNewEggSpot = false;
                        if (egg.HavePotionA < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotionA = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the elixir of the flame!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HavePotionB < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotionB = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the potion of the earth!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HavePotionC < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotionC = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the mixture of the sea!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HavePotionD < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotionD = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the oil of the winds!"); from.SendSound(0x3D); EmptyBox = 0;
                        }

                        if (pickNewEggSpot)
                        {
                            egg.PieceRumor    = Server.Items.CubeOnCorpse.GetRumor();
                            egg.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon();
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(DracolichSkull)) != null)
                {
                    Item           skulls = from.Backpack.FindItemByType(typeof(DracolichSkull));
                    DracolichSkull skull  = (DracolichSkull)skulls;

                    if (skull.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                    {
                        bool pickNewSpot = false;
                        if (skull.HavePotionA < 1)
                        {
                            pickNewSpot = true; skull.HavePotionA = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the heart of the dead god!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (skull.HavePotionB < 1)
                        {
                            pickNewSpot = true; skull.HavePotionB = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the eye of the mad king!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (skull.HavePotionC < 1)
                        {
                            pickNewSpot = true; skull.HavePotionC = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the orb of the astral lich!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (skull.HavePotionD < 1)
                        {
                            pickNewSpot = true; skull.HavePotionD = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the mind of the planar ghost!"); from.SendSound(0x3D); EmptyBox = 0;
                        }

                        if (pickNewSpot)
                        {
                            skull.PieceRumor    = Server.Items.CubeOnCorpse.GetRumor();
                            skull.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon();
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(DemonPrison)) != null)
                {
                    Item        prisons = from.Backpack.FindItemByType(typeof(DemonPrison));
                    DemonPrison prison  = (DemonPrison)prisons;

                    if (prison.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                    {
                        bool pickNewprisonSpot = false;
                        if (prison.HaveShardA < 1)
                        {
                            pickNewprisonSpot = true; prison.HaveShardA = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the shard of hellfire!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (prison.HaveShardB < 1)
                        {
                            pickNewprisonSpot = true; prison.HaveShardB = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the shard of the abyss!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (prison.HaveShardC < 1)
                        {
                            pickNewprisonSpot = true; prison.HaveShardC = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the shard of souls!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (prison.HaveShardD < 1)
                        {
                            pickNewprisonSpot = true; prison.HaveShardD = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the shard of the void!"); from.SendSound(0x3D); EmptyBox = 0;
                        }

                        if (pickNewprisonSpot)
                        {
                            prison.PieceRumor    = Server.Items.CubeOnCorpse.GetRumor();
                            prison.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon();
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(DDRelicTablet)) != null)
                {
                    Container pack = from.Backpack;

                    List <DDRelicTablet> rock = pack.FindItemsByType <DDRelicTablet>();

                    for (int i = 0; i < rock.Count; ++i)
                    {
                        DDRelicTablet stone = rock[i];

                        if (stone.SearchDungeon == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                        {
                            if (stone.SearchReal >= Utility.RandomMinMax(1, 100))
                            {
                                Item   item     = null;
                                string itemName = stone.SearchType;
                                Type   itemType = ScriptCompiler.FindTypeByName(itemName);

                                if (itemType != null)
                                {
                                    item = (Item)Activator.CreateInstance(itemType);
                                    from.AddToBackpack(item);
                                    LoggingFunctions.LogFoundItemQuest(from, stone.SearchItem);
                                    from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the " + stone.SearchItem + ".");
                                    from.SendSound(0x3D);
                                }
                            }
                            else if (1 == Utility.RandomMinMax(1, 2))
                            {
                                Item   item     = null;
                                string itemName = stone.SearchType;
                                Type   itemType = ScriptCompiler.FindTypeByName(itemName);

                                if (itemType != null)
                                {
                                    item = (Item)Activator.CreateInstance(itemType);
                                    Item fake = new BrokenGear();
                                    fake.ItemID = item.ItemID;
                                    fake.Hue    = item.Hue;
                                    fake.Weight = item.Weight;
                                    fake.Name   = "Fake " + stone.SearchItem;
                                    item.Delete();
                                    from.AddToBackpack(fake);
                                }
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "The " + stone.SearchItem + " appears to be a fake.");
                                from.SendSound(0x5B3);
                            }
                            else
                            {
                                from.SendMessage("");
                                from.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "The tablet for the " + stone.SearchItem + " seems to be false.");
                                from.PlaySound(0x5B3);
                            }

                            from.SendMessage("The tablet crumbles to dust!");
                            stone.Delete();
                            EmptyBox = 0;
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(SearchPage)) != null)
                {
                    Item       scroll = from.Backpack.FindItemByType(typeof(SearchPage));
                    SearchPage page   = (SearchPage)scroll;

                    int LeadToAnotherSpot = 100 - page.LegendPercent;

                    if (page.SearchDungeon == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && page.owner == from && page.DungeonMap == from.Map)
                    {
                        if (LeadToAnotherSpot >= Utility.RandomMinMax(1, 100))
                        {
                            from.PlaySound(0x249);
                            SearchPage.PickSearchLocation(page, page.SearchDungeon, from);
                            from.SendMessage("You didn't find it, but you did get another clue.");
                            from.SendMessage("so you update your notes for the new place to search.");
                            EmptyBox = 0;
                        }
                        else
                        {
                            if (page.LegendReal == 1)
                            {
                                Item   item     = null;
                                string itemName = page.SearchType;
                                Type   itemType = ScriptCompiler.FindTypeByName(itemName);

                                if (itemType != null)
                                {
                                    item = (Item)Activator.CreateInstance(itemType);
                                    from.AddToBackpack(item);
                                    LoggingFunctions.LogFoundItemQuest(from, page.SearchItem);
                                    from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the " + page.SearchItem + ".");
                                    from.SendSound(0x3D);
                                }
                            }
                            else if (page.LegendPercent >= Utility.RandomMinMax(1, 200))
                            {
                                int    nGold = page.LegendPercent * 100;
                                string sGold = nGold.ToString();
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "The legend was false, but there was " + sGold + " gold in here.");
                                from.SendSound(0x2E6);
                                from.AddToBackpack(new Gold(nGold));
                            }
                            else if (1 == Utility.RandomMinMax(1, 2))
                            {
                                Item   item     = null;
                                string itemName = page.SearchType;
                                Type   itemType = ScriptCompiler.FindTypeByName(itemName);

                                if (itemType != null)
                                {
                                    item = (Item)Activator.CreateInstance(itemType);
                                    Item fake = new BrokenGear();
                                    fake.ItemID = item.ItemID;
                                    fake.Hue    = item.Hue;
                                    fake.Weight = item.Weight;
                                    fake.Name   = "Fake " + page.SearchItem;
                                    item.Delete();
                                    from.AddToBackpack(fake);
                                }
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "The " + page.SearchItem + " appears to be a fake.");
                                from.SendSound(0x3D);
                            }
                            else
                            {
                                from.SendMessage("");
                                from.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "The legends of the " + page.SearchItem + " seemed to be false.");
                                from.PlaySound(0x249);
                            }
                            scroll.Delete();
                            SearchPage.ArtifactQuestTimeAllowed(from);
                            EmptyBox = 0;
                        }
                    }
                }

                if (EmptyBox == 1)
                {
                    from.SendMessage("The chest appears to be empty.");
                }
            }
            else
            {
                from.SendMessage("The chest appears to be empty.");
            }
        }
Example #5
0
        public override void OnDoubleClick(Mobile from)
        {
            int remove = 0;

            if (from.InRange(this.GetWorldLocation(), 5))
            {
                string say = "You find nothing useful on the corpse";

                if (from.Backpack.FindItemByType(typeof(VortexCube)) != null)
                {
                    Item square = from.Backpack.FindItemByType(typeof(VortexCube));

                    if (square is VortexCube)
                    {
                        VortexCube cube = (VortexCube)square;
                        if (this.Name == "Lor-wis-lem's corpse")
                        {
                            if (cube.HasConvexLense == 0)
                            {
                                cube.HasConvexLense = 1;
                                say = "You take possession of the Convex Lense!";
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the Convex Lense.");
                                remove = 1;
                            }
                        }
                        else
                        {
                            if (cube.HasConcaveLense == 0)
                            {
                                cube.HasConcaveLense = 1;
                                say = "You take possession of the Concave Lense!";
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the Concave Lense.");
                                remove = 1;
                            }
                        }
                    }
                }
                else if (from.Backpack.FindItemByType(typeof(CodexWisdom)) != null)
                {
                    Item codex = from.Backpack.FindItemByType(typeof(CodexWisdom));

                    if (codex is CodexWisdom)
                    {
                        CodexWisdom book = (CodexWisdom)codex;
                        if (this.Name == "Lor-wis-lem's corpse")
                        {
                            if (book.HasConvexLense == 0)
                            {
                                book.HasConvexLense = 1;
                                say = "You take possession of the Convex Lense!";
                                from.SendSound(0x3D);
                                remove = 1;
                            }
                        }
                        else
                        {
                            if (book.HasConcaveLense == 0)
                            {
                                book.HasConcaveLense = 1;
                                say = "You take possession of the Concave Lense!";
                                from.SendSound(0x3D);
                                remove = 1;
                            }
                        }
                    }
                }
                else if (from.FindItemOnLayer(Layer.Talisman) != null)
                {
                    Item codex = from.FindItemOnLayer(Layer.Talisman);

                    if (codex is CodexWisdom)
                    {
                        CodexWisdom book = (CodexWisdom)codex;
                        if (this.Name == "Lor-wis-lem's corpse")
                        {
                            if (book.HasConvexLense == 0)
                            {
                                book.HasConvexLense = 1;
                                say = "You take possession of the Convex Lense!";
                                from.SendSound(0x3D);
                                remove = 1;
                            }
                        }
                        else
                        {
                            if (book.HasConcaveLense == 0)
                            {
                                book.HasConcaveLense = 1;
                                say = "You take possession of the Concave Lense!";
                                from.SendSound(0x3D);
                                remove = 1;
                            }
                        }
                    }
                }
                from.SendMessage(say);
            }
            else
            {
                from.SendLocalizedMessage(502138);                   // That is too far away for you to use
            }

            if (remove > 0)
            {
                this.Delete();
            }
        }
Example #6
0
            public VortexGump(VortexCube cube) : base(25, 25)
            {
                m_Cube = cube;

                this.Closable   = true;
                this.Disposable = true;
                this.Dragable   = true;
                this.Resizable  = false;

                AddPage(0);
                AddImage(0, 0, 153);
                AddImage(300, 0, 153);
                AddImage(600, 0, 153);
                AddImage(0, 300, 153);
                AddImage(300, 300, 153);
                AddImage(600, 300, 153);
                AddImage(900, 0, 153);
                AddImage(900, 300, 153);
                AddImage(0, 600, 153);
                AddImage(300, 600, 153);
                AddImage(600, 600, 153);
                AddImage(900, 600, 153);
                AddImage(2, 2, 129);
                AddImage(300, 2, 129);
                AddImage(600, 2, 129);
                AddImage(898, 2, 129);
                AddImage(2, 302, 129);
                AddImage(300, 302, 129);
                AddImage(600, 302, 129);
                AddImage(898, 302, 129);
                AddImage(2, 598, 129);
                AddImage(300, 598, 129);
                AddImage(600, 598, 129);
                AddImage(898, 598, 129);
                AddImage(6, 7, 145);
                AddImage(8, 653, 142);
                AddImage(328, 862, 140);
                AddImage(594, 862, 140);
                AddImage(850, 680, 144);
                AddImage(166, 8, 140);
                AddImage(464, 8, 140);
                AddImage(996, 8, 146);
                AddImage(993, 22, 156);
                AddImage(1027, 36, 162);
                AddImage(1006, 18, 156);
                AddImage(699, 8, 140);
                AddImage(1004, 10, 143);

                // BOOK AND ANKH
                AddItem(107, 170, 2076);
                AddItem(1060, 129, 4);
                AddItem(1082, 129, 5);

                AddHtml(176, 32, 307, 20, @"<BODY><BASEFONT Color=#FBFBFB><BIG>CODEX OF ULTIMATE WISDOM</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(177, 73, 857, 165, @"<BODY><BASEFONT Color=#FCFF00><BIG>Those that wield the Codex of Ultimate Wisdom, can use the knowledge within to become more intelligent (+25) and a grandmaster in two skills of their choice (+100 in 2 chosen skills). The Codex lies within the Ethereal Void and can only be drawn out from within the Chamber of the Codex. To do this, you must obtain the 3 Keys of Infinity in order to enter the chamber. To see into the Void, where the Codex lies, you will need the Convex and Concave Lenses. Finally, this Cube has the power to draw things out from the Void. In order to do that, you will need to find the 6 void crystals to power the cube. If you manage to find all of these items, you can enter the Chamber of the Codex and approach the Void. The Codex will then be yours to do with what you wish, but it will be yours alone to use. Make sure to bring this cube with you when doing this quest.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

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

                // PEDESTALS
                AddItem(85, 246, 4643);
                AddItem(85, 346, 4643);
                AddItem(85, 446, 4643);

                AddHtml(140, 252, 181, 20, @"<BODY><BASEFONT Color=#FCFF00><BIG>The Vortex Cube</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(140, 279, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>Found!</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddItem(80, 245, 1493);

                AddHtml(140, 355, 181, 20, @"<BODY><BASEFONT Color=#FCFF00><BIG>The Concave Lense</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                if (m_Cube.HasConcaveLense > 0)
                {
                    AddHtml(140, 382, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>Found!</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                    AddItem(80, 343, 1517);
                }
                else
                {
                    AddHtml(140, 382, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>Naxatilor " + GargoyleLocation("Naxatilor") + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }

                AddHtml(140, 458, 181, 20, @"<BODY><BASEFONT Color=#FCFF00><BIG>The Convex Lense</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                if (m_Cube.HasConvexLense > 0)
                {
                    AddHtml(140, 485, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>Found!</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                    AddItem(80, 443, 1518);
                }
                else
                {
                    AddHtml(140, 485, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>Lor-wis-lem " + GargoyleLocation("Lor-wis-lem") + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }

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

                // PEDESTAL
                AddItem(84, 552, 13042);

                if (m_Cube.HasKeyLaw > 0)
                {
                    AddItem(89, 551, 13519);                     // KEY OF LAW
                    AddHtml(140, 538, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The Key of Law has been found!</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }
                else
                {
                    AddHtml(140, 538, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The Key of Law " + m_Cube.TextKeyLaw + " " + m_Cube.LocationKeyLaw + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }

                if (m_Cube.HasKeyBalance > 0)
                {
                    AddItem(98, 542, 13516);                     // KEY OF BALANCE
                    AddHtml(140, 568, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The Key of Balance has been found!</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }
                else
                {
                    AddHtml(140, 568, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The Key of Balance " + m_Cube.TextKeyBalance + " " + m_Cube.LocationKeyBalance + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }

                if (m_Cube.HasKeyChaos > 0)
                {
                    AddItem(109, 550, 13520);                     // KEY OF CHAOS
                    AddHtml(140, 598, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The Key of Chaos has been found!</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }
                else
                {
                    AddHtml(140, 598, 1016, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The Key of Chaos " + m_Cube.TextKeyChaos + " " + m_Cube.LocationKeyChaos + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }

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

                AddHtml(99, 656, 1016, 20, @"<BODY><BASEFONT Color=#FCFF00><BIG>The Void Crystals are scattered throughout the land. The Vortex Cube can draw you toward the dungeons they may be in.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                if ((m_Cube.HasCrystalRed + m_Cube.HasCrystalBlue + m_Cube.HasCrystalGreen + m_Cube.HasCrystalYellow + m_Cube.HasCrystalWhite + m_Cube.HasCrystalPurple) > 5)
                {
                    AddHtml(116, 715, 976, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>All of the Void Crystals have been found!</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }
                else if (m_Cube.HasCrystalRed == 0)
                {
                    AddHtml(116, 715, 976, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The red Void Crystal " + m_Cube.TextCrystal + " " + m_Cube.LocationCrystal + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }
                else if (m_Cube.HasCrystalBlue == 0)
                {
                    AddHtml(116, 715, 976, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The blue Void Crystal " + m_Cube.TextCrystal + " " + m_Cube.LocationCrystal + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }
                else if (m_Cube.HasCrystalGreen == 0)
                {
                    AddHtml(116, 715, 976, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The green Void Crystal " + m_Cube.TextCrystal + " " + m_Cube.LocationCrystal + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }
                else if (m_Cube.HasCrystalYellow == 0)
                {
                    AddHtml(116, 715, 976, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The yellow Void Crystal " + m_Cube.TextCrystal + " " + m_Cube.LocationCrystal + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }
                else if (m_Cube.HasCrystalWhite == 0)
                {
                    AddHtml(116, 715, 976, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The white Void Crystal " + m_Cube.TextCrystal + " " + m_Cube.LocationCrystal + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }
                else if (m_Cube.HasCrystalPurple == 0)
                {
                    AddHtml(116, 715, 976, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>The purple Void Crystal " + m_Cube.TextCrystal + " " + m_Cube.LocationCrystal + ".</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                }

                // PEDESTALS
                AddItem(382, 788, 4643);
                AddItem(462, 788, 4643);
                AddItem(542, 788, 4643);
                AddItem(622, 788, 4643);
                AddItem(702, 788, 4643);
                AddItem(782, 788, 4643);

                if (m_Cube.HasCrystalRed > 0)
                {
                    AddItem(379, 782, 6284);
                }
                if (m_Cube.HasCrystalBlue > 0)
                {
                    AddItem(459, 782, 6286);
                }
                if (m_Cube.HasCrystalGreen > 0)
                {
                    AddItem(539, 782, 6288);
                }
                if (m_Cube.HasCrystalYellow > 0)
                {
                    AddItem(619, 782, 6290);
                }
                if (m_Cube.HasCrystalWhite > 0)
                {
                    AddItem(699, 782, 6496);
                }
                if (m_Cube.HasCrystalPurple > 0)
                {
                    AddItem(779, 782, 6498);
                }
            }