Beispiel #1
0
        public void SetupVitrtue(Mobile from)
        {
            RuneBox box = new RuneBox();

            box.RuneBoxOwner = from;

            box.HasCompassion   = 0;
            box.HasHonesty      = 0;
            box.HasHonor        = 0;
            box.HasHumility     = 0;
            box.HasJustice      = 0;
            box.HasSacrifice    = 0;
            box.HasSpirituality = 0;
            box.HasValor        = 0;

            from.AddToBackpack(box);
        }
Beispiel #2
0
            public RuneBoxGump(RuneBox box, Mobile from) : base(25, 25)
            {
                m_Box = box;

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

                AddPage(0);

                int    theme   = 153;
                int    chamber = 10894;
                string room    = "Chamber of Virtue";
                string map     = "In the Land of Sosaria";
                string coor    = "148° 37'N, 113° 58'E";
                string hue     = "#33DA1C";

                if (((PlayerMobile)from).KarmaLocked)                   // THEY ARE ON AN EVIL PATH
                {
                    theme   = 154;
                    chamber = 10895;
                    room    = "Chamber of Corruption";
                    map     = "In the Underworld";
                    coor    = "17° 6'N, 120° 40'W";
                    hue     = "#FF0000";
                }

                AddImage(0, 0, theme);
                AddImage(300, 0, theme);
                AddImage(600, 0, theme);
                AddImage(0, 300, theme);
                AddImage(300, 300, theme);
                AddImage(600, 300, theme);

                AddImage(2, 2, 129);
                AddImage(298, 2, 129);
                AddImage(598, 2, 129);
                AddImage(2, 298, 129);
                AddImage(298, 298, 129);
                AddImage(598, 298, 129);
                AddImage(671, 7, 149);
                AddImage(7, 7, 145);
                AddImage(168, 8, 140);
                AddImage(314, 8, 140);
                AddImage(431, 8, 140);
                AddImage(8, 354, 142);
                AddImage(567, 354, 147);
                AddImage(207, 293, 129);
                AddImage(391, 290, 129);
                AddImage(199, 539, 156);
                AddImage(203, 525, 156);
                AddImage(672, 534, 156);
                AddImage(667, 523, 156);
                AddImage(201, 565, 140);
                AddImage(397, 565, 140);
                AddImage(296, 106, 132);
                AddImage(199, 67, 139);
                AddImage(486, 67, 134);
                AddItem(679, 32, 21245);
                AddItem(174, 32, 21243);

                AddHtml(226, 37, 445, 20, @"<BODY><BASEFONT Color=#FBFBFB><BIG><CENTER>RUNES OF VIRTUE</CENTER></BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddImage(573, 153, chamber);
                AddHtml(577, 395, 197, 20, @"<BODY><BASEFONT Color=" + hue + "><BIG>" + room + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(578, 435, 197, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>" + map + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(578, 474, 197, 20, @"<BODY><BASEFONT Color=#FCFF00><BIG>" + coor + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(99, 152, 460, 348, @"<BODY><BASEFONT Color=#FFA200><BIG>After the defeat of Exodus and the closing of the Age of Darkness, Lord British created 8 Runes of Virtue to mystically represent a new vision of life, for which people might strive. As most of the evil from outside had been vanquished, Lord British wanted people to start rooting out the evil that lurks within themselves. In order for this new philosophy to work, Lord British has taken the Runes and spread them far and wide. He challenges anyone to achieve enlightenment in all Virtues by finding the Runes and cleansing them in the Chamber of Virtue. Those that succeed would be a symbol of pure good and be famous throughout the land. There are those, however, that seek to corrupt the Virtues. They too search for the Runes and would meet their own nefarious ends by taking them to the Chamber of Corruption in the Underworld.<br><br>You may choose one of these paths. With the Chest of Virtue, you can search the many dungeons for these Runes and place the Runes within the chest. When you find another Chest of Virtue, you can open the chest where a creature will emerge that must be slain. Lord British has magical sentinels to protect the Runes and you must defeat them in battle to claim the Rune. You may look within your chest at any time to see what Runes you have. When you have collected all 8 Runes, you may then take your chest to the Chamber of your choice and open it, but the chest will only show you the location of the Chamber that best reflects your morality. If your karma is locked, then you will see the location for the Chamber of Corruption. Otherwise, you will see the location for the Chamber of Virtue.<br><br>Those that succeed will acquire a Chest of Virtue to use as a container. Within it, they will find the 8 Runes as souvenirs, banners that represent the virtues, and considerable wealth. You will also be granted a rune that can never be lost and will gain power as you wield it on your adventures. As it gains levels in this power, you can single click the rune and spend points to shape the rune to your will. You may also double click the rune to change its virtue symbol. If you have a Rune of Virtue, you can only equip it if your karma is positive. If you have a Rune of Corruption, you can only equip it if your karma is negative.<br><br>If you corrupt the Runes, you will lose a very large amount of karma and acquire the same types of items listed above, but their Virtues will be the opposite of what Lord British had established. If you cleanse the Runes, then your will gain a very large amount of karma and be absolved of all crimes. Either course will grant you a very large amount of fame throughout the land.</BIG></BASEFONT></BODY>", (bool)false, (bool)true);

                // RUNES
                if (m_Box.HasCompassion > 0)
                {
                    AddItem(220, 525, 21272);
                }
                if (m_Box.HasHonesty > 0)
                {
                    AddItem(280, 525, 21262);
                }
                if (m_Box.HasHonor > 0)
                {
                    AddItem(340, 525, 21274);
                }
                if (m_Box.HasHumility > 0)
                {
                    AddItem(400, 525, 21266);
                }
                if (m_Box.HasJustice > 0)
                {
                    AddItem(460, 525, 21264);
                }
                if (m_Box.HasSacrifice > 0)
                {
                    AddItem(520, 525, 21268);
                }
                if (m_Box.HasSpirituality > 0)
                {
                    AddItem(580, 525, 21260);
                }
                if (m_Box.HasValor > 0)
                {
                    AddItem(640, 525, 21270);
                }
            }
        public override void OnDoubleClick(Mobile from)
        {
            if (rSummoner != from)
            {
                from.SendMessage("The rune doesn't seem to budge.");
            }
            else if (from.InRange(this.GetWorldLocation(), 5))
            {
                string say = "If you had a chest of virtue to put the rune in, it wouldn't have vanished.";

                if (from.Backpack.FindItemByType(typeof(RuneBox)) != null)
                {
                    Item box = from.Backpack.FindItemByType(typeof(RuneBox));

                    if (box is RuneBox)
                    {
                        RuneBox chest = (RuneBox)box;
                        say = "You take possession of the " + Name + "!";
                        from.SendSound(0x3D);
                        LoggingFunctions.LogGeneric(from, "has found the " + Name + ".");

                        if (Name == "Rune of Compassion")
                        {
                            chest.HasCompassion = 1;
                        }
                        else if (Name == "Rune of Honesty")
                        {
                            chest.HasHonesty = 1;
                        }
                        else if (Name == "Rune of Honor")
                        {
                            chest.HasHonor = 1;
                        }
                        else if (Name == "Rune of Humility")
                        {
                            chest.HasHumility = 1;
                        }
                        else if (Name == "Rune of Justice")
                        {
                            chest.HasJustice = 1;
                        }
                        else if (Name == "Rune of Sacrifice")
                        {
                            chest.HasSacrifice = 1;
                        }
                        else if (Name == "Rune of Spirituality")
                        {
                            chest.HasSpirituality = 1;
                        }
                        else
                        {
                            chest.HasValor = 1;
                        }
                    }
                }
                from.SendMessage(say);
                this.Delete();
            }
            else
            {
                from.SendLocalizedMessage(502138);                   // That is too far away for you to use
            }
        }
Beispiel #4
0
        public override void OnComponentUsed(AddonComponent ac, Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.SendMessage("You will have to get closer to open that.");
            }
            else if (from is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)from;

                bool HasBox     = false;
                int  goal       = 0;
                int  nextVirtue = 0;

                RuneBox box = null;
                if (from.Backpack.FindItemByType(typeof(RuneBox)) != null)
                {
                    Item    boxx  = from.Backpack.FindItemByType(typeof(RuneBox));
                    RuneBox boxxx = (RuneBox)boxx;

                    if (boxxx.RuneBoxOwner == from)
                    {
                        HasBox = true;
                        box    = boxxx;
                        goal   = box.HasCompassion + box.HasHonesty + box.HasHonor + box.HasHumility + box.HasJustice + box.HasSacrifice + box.HasSpirituality + box.HasValor;
                        if (box.HasCompassion == 0)
                        {
                            nextVirtue = 1;
                        }
                        else if (box.HasHonesty == 0)
                        {
                            nextVirtue = 2;
                        }
                        else if (box.HasHonor == 0)
                        {
                            nextVirtue = 3;
                        }
                        else if (box.HasHumility == 0)
                        {
                            nextVirtue = 4;
                        }
                        else if (box.HasJustice == 0)
                        {
                            nextVirtue = 5;
                        }
                        else if (box.HasSacrifice == 0)
                        {
                            nextVirtue = 6;
                        }
                        else if (box.HasSpirituality == 0)
                        {
                            nextVirtue = 7;
                        }
                        else if (box.HasValor == 0)
                        {
                            nextVirtue = 8;
                        }
                    }
                }

                if (CharacterDatabase.GetKeys(from, "Virtue") || CharacterDatabase.GetKeys(from, "Corrupt"))                       // THEY ARE ALREADY DID THIS QUEST
                {
                    HasBox = true;
                    from.SendMessage("You don't need this chest as you already dealt with the runes.");
                }
                else if (goal < 8 && HasBox == true)
                {
                    RuneGuardian sentinel = new RuneGuardian();
                    sentinel.gVirtue   = nextVirtue;
                    sentinel.gSummoner = from;
                    sentinel.MoveToWorld(Location, Map);
                    sentinel.Combatant = from;
                    Effects.SendLocationParticles(EffectItem.Create(sentinel.Location, sentinel.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                    sentinel.PlaySound(0x1FE);

                    RunesBaseEmpty Pedul = new RunesBaseEmpty();
                    Pedul.MoveToWorld(new Point3D(this.X, this.Y, this.Z), this.Map);
                    from.SendMessage("You have awakened a sentinel.");
                    this.Delete();
                }
                else if (HasBox == true)
                {
                    from.SendMessage("Your virtue chest is already in your pack.");
                }
                else
                {
                    ArrayList targets = new ArrayList();
                    foreach (Item item in World.Items.Values)
                    {
                        if (item is RuneBox)
                        {
                            if (((RuneBox)item).RuneBoxOwner == from)
                            {
                                targets.Add(item);
                                HasBox = true;
                            }
                        }
                    }
                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Item item = ( Item )targets[i];

                        if (item is RuneBox)
                        {
                            from.AddToBackpack(item);
                            from.SendMessage("Your virtue chest is already in your pack.");
                        }
                    }
                }

                if (!HasBox)
                {
                    SetupVitrtue(from);
                    from.SendMessage("You take possession of the Chest of Virtue!");
                    from.SendSound(0x3D);
                    LoggingFunctions.LogGeneric(from, "has found the Chest of Virtue.");
                    CharacterDatabase.SetKeys(from, "Runes", true);
                    RunesBaseEmpty Pedul = new RunesBaseEmpty();
                    Pedul.MoveToWorld(new Point3D(this.X, this.Y, this.Z), this.Map);
                    this.Delete();
                }
            }
        }