Exemple #1
0
        public SummonGump(SummonPrison item) : base(25, 25)
        {
            string sText = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(item.Prisoner.ToLower());

            sText = sText + "<br>To free them, you need:";

            sText = sText + "<br>" + System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(item.KeyA.ToLower());
            sText = sText + "<br>" + System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(item.KeyB.ToLower());
            sText = sText + "<br>" + System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(item.KeyC.ToLower());

            sText = sText + "<br>" + item.ReagentQtyA.ToString() + " " + System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(item.ReagentNameA.ToLower());
            sText = sText + "<br>" + item.ReagentQtyB.ToString() + " " + System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(item.ReagentNameB.ToLower());

            sText = sText + "<br>Then bring it to " + item.Dungeon;

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

            AddPage(0);
            AddImage(0, 0, 153);
            AddImage(300, 0, 153);
            AddImage(0, 146, 153);
            AddImage(300, 146, 153);
            AddImage(2, 2, 129);
            AddImage(298, 2, 129);
            AddImage(2, 144, 129);
            AddImage(300, 144, 129);
            AddImage(600, 0, 153);
            AddImage(600, 146, 153);
            AddImage(598, 2, 129);
            AddImage(598, 144, 129);
            AddImage(841, 8, 131);
            AddImage(382, 413, 132);
            AddImage(513, 9, 132);
            AddImage(834, 205, 162);
            AddImage(513, 413, 132);
            AddImage(382, 9, 132);
            AddImage(803, 20, 160);
            AddImage(376, 120, 160);
            AddImage(376, 20, 160);
            AddImage(803, 120, 160);
            AddImage(387, 20, 5595);
            AddImage(82, 46, 132);
            AddImage(6, 7, 133);
            AddHtml(471, 96, 261, 173, @"<BODY><BASEFONT Color=Black><BIG><CENTER>" + sText + "</CENTER></BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddItem(233, 230, 3629);
            AddItem(106, 316, 19086);
            AddItem(126, 84, 19091);
            AddItem(281, 205, 2169);
            AddItem(106, 205, 2221);
            AddItem(195, 251, 6819);
        }
Exemple #2
0
        public SummonTutorial(SummonPrison item) : base(25, 25)
        {
            string sEnding = "If one were to touch more than one such magical prisons, All but one would vanish into the void.";

            if (item.owner != null)
            {
                sEnding = "If " + item.owner.Name + " happens to touch another such magical prison, this sealed prison would vanish into the void.";
            }
            string sPrisoner = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(item.Prisoner.ToLower());

            string sText = "You have found a rare orb that contains the spirit of " + sPrisoner + ". Magically sealed here by " + item.Jailor + ", you have no clue as to how long they have been locked away. In order to free " + sPrisoner + " from this magical prison, you will need to find some special items. Once the items have been found, this crystal prison will need to be brought to " + item.Dungeon + " where which they were ensorcelled into the orb. If they are freed, they will surely seek to unleash wrath on all who stand before them, but what they held before their imprisonment may be worth the risk.<br><br>If you single click the orb and select 'Look At', you will be able to see into the ball and learn of what items you need to unlock the cell. When you have obtained all of the needed items, venture to the place of imprisonment and use the orb there. Be ready for battle in such a case, as you may not know what you truly face. They have been locked away for years, or maybe centuries, so madness has surely claimed them by now. Once they are freed, they will remain for one hour before they leave the area and go off elsewhere, forever. Be quick with the coming attack if this fight is truly the desired course you wish to take. " + sEnding;

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

            AddPage(0);
            AddImage(0, 0, 153);
            AddImage(300, 0, 153);
            AddImage(0, 300, 153);
            AddImage(300, 300, 153);
            AddImage(2, 2, 129);
            AddImage(298, 2, 129);
            AddImage(2, 298, 129);
            AddImage(298, 298, 129);
            AddImage(600, 0, 153);
            AddImage(600, 300, 153);
            AddImage(598, 2, 129);
            AddImage(598, 298, 129);
            AddImage(488, 364, 136);
            AddImage(841, 8, 131);
            AddImage(7, 355, 142);
            AddImage(6, 7, 133);
            AddImage(311, 554, 156);
            AddImage(236, 46, 132);
            AddImage(505, 46, 132);
            AddImage(798, 43, 143);
            AddImage(286, 543, 156);
            AddImage(288, 556, 156);
            AddImage(265, 558, 156);
            AddImage(240, 561, 156);
            AddImage(219, 576, 162);
            AddImage(230, 577, 162);
            AddImage(834, 205, 162);
            AddImage(488, 540, 162);
            AddHtml(172, 69, 662, 30, @"<BODY><BASEFONT Color=White><BIG>PRISONS OF WIZARDRY</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddHtml(108, 127, 711, 300, @"<BODY><BASEFONT Color=#FCFF00><BIG>" + sText + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            AddItem(115, 82, 3629);
        }
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1060640);                   // The item must be in your backpack to use it.
            }
            else if (QuestTomeOwner != from)
            {
                from.SendMessage("This book does not belong and it crumbles to dust!");
                bool remove = true;
                foreach (Account a in Accounts.GetAccounts())
                {
                    if (a == null)
                    {
                        break;
                    }

                    int index = 0;

                    for (int i = 0; i < a.Length; ++i)
                    {
                        Mobile m = a[i];

                        if (m == null)
                        {
                            continue;
                        }

                        if (m == QuestTomeOwner)
                        {
                            m.AddToBackpack(this);
                            remove = false;
                        }

                        ++index;
                    }
                }
                if (remove)
                {
                    this.Delete();
                }
            }
            else if (QuestTomeGoals > 2 && from.Region.Name == QuestTomeDungeon && QuestTomeCitizen != "")
            {
                QuestTomeCitizen = "";
                QuestTomeLand    = "";
                QuestTomeType    = 0;

                Type         mobType = ScriptCompiler.FindTypeByName(VillainType);
                Mobile       mob     = (Mobile)Activator.CreateInstance(mobType);
                BaseCreature monster = (BaseCreature)mob;

                SummonPrison.SetDifficultyForMonster(monster);

                Map map = from.Map;

                bool    validLocation = false;
                Point3D loc           = from.Location;

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = from.X + Utility.Random(3) - 1;
                    int y = from.Y + Utility.Random(3) - 1;
                    int z = map.GetAverageZ(x, y);

                    if (validLocation = map.CanFit(x, y, from.Z, 16, false, false))
                    {
                        loc = new Point3D(x, y, from.Z);
                    }
                    else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                    {
                        loc = new Point3D(x, y, z);
                    }
                }

                monster.NameHue = 0x22;
                monster.Hue     = VillainHue;
                if (VillainBody > 0)
                {
                    monster.Body = VillainBody;
                }
                monster.Title = VillainTitle;
                monster.Name  = VillainName;
                monster.MoveToWorld(loc, map);
                monster.Combatant = from;
                monster.Fame      = 0;
                monster.Karma     = 0;
                Effects.SendLocationParticles(EffectItem.Create(monster.Location, monster.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                monster.PlaySound(0x1FE);
            }
            else
            {
                from.SendSound(0x4A);
                from.CloseGump(typeof(QuestTomeGump));
                from.SendGump(new QuestTomeGump(this, from, 0));
            }
        }
Exemple #4
0
        public static void WellTheyDied(Mobile m, BaseCreature b)
        {
            if (m.EmoteHue == 505)
            {
                Mobile killer = m.LastKiller;
                if (killer != null)
                {
                    if (killer is BaseCreature)
                    {
                        killer = ((BaseCreature)killer).GetMaster();
                    }

                    if (!(killer is PlayerMobile))
                    {
                        killer = m.FindMostRecentDamager(true);

                        if (killer != null)
                        {
                            if (killer is BaseCreature)
                            {
                                killer = ((BaseCreature)killer).GetMaster();
                            }
                        }
                    }
                }

                Map map = m.Map;

                if (map != null)
                {
                    for (int x = -12; x <= 12; ++x)
                    {
                        for (int y = -12; y <= 12; ++y)
                        {
                            double dist = Math.Sqrt(x * x + y * y);

                            if (dist <= 12)
                            {
                                new GoodiesTimer(map, m.X + x, m.Y + y).Start();
                            }
                        }
                    }

                    SummonChest MyChest = new SummonChest(killer);
                    MyChest.Prisoner = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase((m.Name).ToLower());

                    string myName = GetFirstName(m.Name);
                    int    myHue  = m.Hue;

                    Item        reward     = new SummonReward();
                    List <Item> belongings = new List <Item>();
                    foreach (Item i in m.Backpack.Items)
                    {
                        if (i is SummonPrison)
                        {
                            SummonPrison prison = (SummonPrison)i;
                            reward.Hue    = prison.RewardHue;
                            reward.ItemID = prison.RewardID;
                            reward.Name   = prison.RewardName;
                            MyChest.AddItem(reward);

                            if (prison.PrisonerFullNameUsed > 0)
                            {
                                myName = m.Name;
                            }
                            if (prison.PrisonerClothColorUsed > 0)
                            {
                                for (int c = 0; c < m.Items.Count; ++c)
                                {
                                    Item item = m.Items[c];

                                    if (!(item is Cloak) && !(item is BaseWeapon) && !(item is WornHumanDeco))
                                    {
                                        myHue = item.Hue;
                                    }
                                }

                                if (myHue == 0)
                                {
                                    myHue = prison.RewardHue;
                                }
                            }
                        }
                    }

                    if (killer is PlayerMobile)
                    {
                        Party p = Engines.PartySystem.Party.Get(killer);
                        if (p != null)
                        {
                            foreach (PartyMemberInfo pmi in p.Members)
                            {
                                if (pmi.Mobile is PlayerMobile && pmi.Mobile.InRange(m.Location, 20))
                                {
                                    LoggingFunctions.LogSlayingLord(pmi.Mobile, m.Name + " from the Magical Prison");
                                    Titles.AwardFame(pmi.Mobile, 300, true);
                                    if (((PlayerMobile)(pmi.Mobile)).KarmaLocked == true)
                                    {
                                        Titles.AwardKarma(pmi.Mobile, -300, true);
                                    }
                                    else
                                    {
                                        Titles.AwardKarma(pmi.Mobile, 300, true);
                                    }

                                    ManualOfItems book = new ManualOfItems();
                                    book.Hue        = myHue;
                                    book.Name       = "Tome of " + myName + " Relics";
                                    book.m_Charges  = 1;
                                    book.m_Skill_1  = 99;
                                    book.m_Skill_2  = 0;
                                    book.m_Skill_3  = 0;
                                    book.m_Skill_4  = 0;
                                    book.m_Skill_5  = 0;
                                    book.m_Value_1  = 10.0;
                                    book.m_Value_2  = 0.0;
                                    book.m_Value_3  = 0.0;
                                    book.m_Value_4  = 0.0;
                                    book.m_Value_5  = 0.0;
                                    book.m_Slayer_1 = 5;
                                    book.m_Slayer_2 = 0;
                                    book.m_Owner    = pmi.Mobile;
                                    book.m_Extra    = "of " + myName;
                                    book.m_FromWho  = "From " + m.Name;
                                    book.m_HowGiven = "Won by";
                                    book.m_Points   = 300;
                                    book.m_Hue      = myHue;
                                    MyChest.AddItem(book);
                                }
                            }
                        }
                        else
                        {
                            LoggingFunctions.LogSlayingLord(killer, m.Name + " from the Magical Prison");
                            Titles.AwardFame(killer, 300, true);
                            if (((PlayerMobile)killer).KarmaLocked == true)
                            {
                                Titles.AwardKarma(killer, -300, true);
                            }
                            else
                            {
                                Titles.AwardKarma(killer, 300, true);
                            }

                            ManualOfItems book = new ManualOfItems();
                            book.Hue        = myHue;
                            book.Name       = "Tome of " + myName + " Relics";
                            book.m_Charges  = 1;
                            book.m_Skill_1  = 99;
                            book.m_Skill_2  = 0;
                            book.m_Skill_3  = 0;
                            book.m_Skill_4  = 0;
                            book.m_Skill_5  = 0;
                            book.m_Value_1  = 10.0;
                            book.m_Value_2  = 0.0;
                            book.m_Value_3  = 0.0;
                            book.m_Value_4  = 0.0;
                            book.m_Value_5  = 0.0;
                            book.m_Slayer_1 = 5;
                            book.m_Slayer_2 = 0;
                            book.m_Owner    = killer;
                            book.m_Extra    = "of " + myName;
                            book.m_FromWho  = "From " + m.Name;
                            book.m_HowGiven = "Won by";
                            book.m_Points   = 300;
                            book.m_Hue      = myHue;
                            MyChest.AddItem(book);
                        }
                    }

                    MyChest.MoveToWorld(m.Location, m.Map);
                }

                if (!(m is PlayerMobile))
                {
                    Server.Misc.IntelligentAction.BurnAway(m);
                    m.Delete();
                }
            }
        }