Ejemplo n.º 1
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.");
            }
        }
Ejemplo n.º 2
0
            public DragonEggGump(Mobile from, DragonEgg egg) : base(25, 25)
            {
                string sDragon = "dragon";

                if (egg.DragonBody == 59)
                {
                    sDragon = "wyrm";
                }

                string sText = "This egg contains the embryo of a " + sDragon + ". Dwarves would take these eggs and brew the potions of the four elements to pour over the shell. The elixir of the flame, the potion of the earth, the mixture of the sea, and the oil of the winds are the four alchemical potions used in this process. Once these liquids are poured onto the shell, it could be broken by the young " + sDragon + " and the power of all the elements combined would mature the " + sDragon + " to almost be fully grown. These alchemical skills died off with the dwarven race, but you did hear rumors of these potions being seen in various places. If you could get them, and bring the egg to an animal expert, they may be able to help you hatch it. The animal expert will require some gold as you will need the help of a particular animal expert and they will require payment for their services. This animal expert is at the location shown below. If you have any veterinary skill, they may refund some of the gold for the help you may provide in the birth. When hatched and almost fully grown, these " + sDragon + "s will become your bonded pet. You will have to feed it and stable it when required. You can also perform some animal lore on it without having any proficiency in the skill. This will help you with information about them, like what they want to eat.";

                string sRumor = egg.PieceRumor + " " + egg.PieceLocation;

                if (egg.HavePotionA == 0)
                {
                    sRumor = "The elixir of the flame " + sRumor;
                }
                else if (egg.HavePotionB == 0)
                {
                    sRumor = "The potion of the earth " + sRumor;
                }
                else if (egg.HavePotionC == 0)
                {
                    sRumor = "The mixture of the sea " + sRumor;
                }
                else if (egg.HavePotionD == 0)
                {
                    sRumor = "The oil of the winds " + sRumor;
                }
                else if (egg.HaveGold < egg.NeedGold)
                {
                    sRumor = "You have obtained everything except the gold.";
                }
                else
                {
                    sRumor = "You have obtained everything you need.";
                }

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

                AddPage(0);
                AddImage(0, 0, 154);
                AddImage(300, 0, 154);
                AddImage(600, 0, 154);
                AddImage(300, 300, 154);
                AddImage(600, 300, 154);
                AddImage(0, 300, 154);
                AddImage(2, 2, 129);
                AddImage(300, 2, 129);
                AddImage(598, 2, 129);
                AddImage(2, 298, 129);
                AddImage(300, 298, 129);
                AddImage(598, 298, 129);
                AddImage(7, 9, 150);
                AddImage(696, 9, 146);
                AddImage(711, 21, 156);
                AddImage(410, 37, 132);
                AddImage(156, 23, 156);
                AddImage(180, 25, 156);
                AddImage(195, 37, 132);
                AddImage(697, 34, 143);
                AddImage(175, 34, 159);

                AddItem(708, 130, 11665, egg.Hue);

                AddItem(191, 59, 10124, egg.Hue);
                AddHtml(240, 66, 454, 20, @"<BODY><BASEFONT Color=White><BIG>" + (egg.Name).ToUpper() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(77, 127, 3823);
                AddHtml(122, 130, 362, 20, @"<BODY><BASEFONT Color=#FCFF00><BIG>" + egg.HaveGold.ToString() + "/" + egg.NeedGold.ToString() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddHtml(87, 171, 593, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>" + sRumor + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(93, 210, 13042);
                AddItem(273, 210, 13042);
                AddItem(453, 210, 13042);
                AddItem(633, 210, 13042);

                if (egg.HavePotionA > 0)
                {
                    AddItem(105, 210, 10279, 0xB54);
                }
                if (egg.HavePotionB > 0)
                {
                    AddItem(285, 210, 10279, 0xB27);
                }
                if (egg.HavePotionC > 0)
                {
                    AddItem(465, 210, 10279, 0xB46);
                }
                if (egg.HavePotionD > 0)
                {
                    AddItem(645, 210, 10279, 0xB49);
                }

                AddHtml(50, 303, 796, 235, @"<BODY><BASEFONT Color=#FCFF00><BIG>" + sText + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(3, 553, 3000);
                AddHtml(47, 559, 624, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>Bring Gathered Materials to the Animal Expert in " + egg.AnimalTrainerLocation + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            }
Ejemplo n.º 3
0
 public EvolutionTimer(DragonEgg owner, TimeSpan duration) : base(duration)
 {
     de = owner;
 }
Ejemplo n.º 4
0
        public static bool ProcessDragonEgg(Mobile m, Mobile vet, Item dropped)
        {
            DragonEgg egg = (DragonEgg)dropped;

            if (Server.Misc.Worlds.GetRegionName(vet.Map, vet.Location) != egg.AnimalTrainerLocation)
            {
                return(false);
            }

            int vetSkill = (int)(m.Skills[SkillName.Veterinary].Value);

            if (vetSkill > 100)
            {
                vetSkill = 100;
            }

            int GoldReturn = 0;

            if (vetSkill > 0)
            {
                GoldReturn = (int)(egg.NeedGold * (vetSkill * 0.005));
            }

            int HaveIngredients = 0;

            if (egg.HavePotionB >= 0)
            {
                HaveIngredients++;
            }
            if (egg.HavePotionC >= 0)
            {
                HaveIngredients++;
            }
            if (egg.HavePotionD >= 0)
            {
                HaveIngredients++;
            }
            if (egg.HaveGold >= egg.NeedGold)
            {
                HaveIngredients++;
            }
            if (egg.HavePotionA >= 0)
            {
                HaveIngredients++;
            }

            if (HaveIngredients < 5)
            {
                return(false);
            }

            int followers = 3;

            if ((dropped.Name).Contains(" dragon"))
            {
                followers = 2;
            }

            if ((m.Followers + followers) > m.FollowersMax)
            {
                vet.Say("You have too many followers with you to hatch this egg.");
                return(false);
            }

            if (GoldReturn > 0)
            {
                m.AddToBackpack(new Gold(GoldReturn)); vet.Say("Here is " + GoldReturn.ToString() + " gold back for all of your help.");
            }

            BaseCreature dragon = new Dragons(egg.DragonBody, egg.DragonType);

            dragon.OnAfterSpawn();
            dragon.Controlled    = true;
            dragon.ControlMaster = m;
            dragon.IsBonded      = true;
            dragon.MoveToWorld(m.Location, m.Map);
            dragon.ControlTarget = m;
            dragon.YellHue       = 1;
            dragon.ControlOrder  = OrderType.Follow;

            string style = "dragon";

            if (followers == 3)
            {
                style = "wyrm"; dragon.Name = (dragon.Name).Replace(" dragon", " wyrm");
            }

            LoggingFunctions.LogGenericQuest(m, "has hatched a " + style + "");
            m.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Your " + style + " has hatched.", m.NetState);

            m.PlaySound(0x041);

            dropped.Delete();

            return(true);
        }