Beispiel #1
0
            public DungeonMouldWeaponGump(Mobile gumpTarget, Mobile crafter, Mobile mobileTarget, DungeonMould mould, bool newWeapon, BaseWeapon weapon, DungeonEnum dungeon, int amountDemanded, bool confirmed) : base(10, 10)
            {
                m_GumpTarget   = gumpTarget;
                m_Crafter      = crafter;
                m_MobileTarget = mobileTarget;
                m_DungeonMould = mould;
                m_NewWeapon    = newWeapon;
                m_Weapon       = weapon;
                m_Dungeon      = dungeon;

                m_AmountDemanded = amountDemanded;
                m_Confirmed      = confirmed;

                bool selfCraft = (m_Crafter == m_MobileTarget);

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

                AddImage(70, 100, 103);
                AddImage(5, 100, 103);
                AddImage(70, 5, 103);
                AddImage(5, 5, 103);
                AddImage(200, 100, 103);
                AddImage(200, 5, 103);
                AddImage(70, 281, 103);
                AddImage(5, 281, 103);
                AddImage(70, 186, 103);
                AddImage(5, 186, 103);
                AddImage(200, 281, 103);
                AddImage(200, 186, 103);
                AddImage(70, 374, 103);
                AddImage(5, 374, 103);
                AddImage(200, 374, 103);
                AddImage(17, 18, 3604, 2052);
                AddImage(76, 18, 3604, 2052);
                AddImage(204, 18, 3604, 2052);
                AddImage(17, 140, 3604, 2052);
                AddImage(76, 140, 3604, 2052);
                AddImage(204, 140, 3604, 2052);
                AddImage(17, 262, 3604, 2052);
                AddImage(76, 262, 3604, 2052);
                AddImage(204, 262, 3604, 2052);
                AddImage(17, 335, 3604, 2052);
                AddImage(76, 335, 3604, 2052);
                AddImage(204, 335, 3604, 2052);

                //-----
                int WhiteTextHue = 2655;
                int EffectHue    = WhiteTextHue;

                string offerText = "";

                if (!selfCraft)
                {
                    if (m_GumpTarget == m_MobileTarget)
                    {
                        offerText = "Offer from " + m_Crafter.Name;
                        AddLabel(Utility.CenteredTextOffset(175, offerText), 17, 149, offerText);
                    }
                }

                if (m_NewWeapon)
                {
                    offerText = "Create Dungeon Weapon";

                    if (selfCraft || m_GumpTarget == m_Crafter)
                    {
                        AddLabel(Utility.CenteredTextOffset(175, offerText), 17, WhiteTextHue, offerText);
                    }
                    else
                    {
                        AddLabel(Utility.CenteredTextOffset(175, offerText), 37, WhiteTextHue, offerText);
                    }
                }

                else
                {
                    offerText = "Upgrade Dungeon Weapon";

                    if (selfCraft || m_GumpTarget == m_Crafter)
                    {
                        AddLabel(Utility.CenteredTextOffset(175, offerText), 17, WhiteTextHue, offerText);
                    }
                    else
                    {
                        AddLabel(Utility.CenteredTextOffset(175, offerText), 37, WhiteTextHue, offerText);
                    }
                }

                //Weapon Info
                int    weaponTier  = m_Weapon.TierLevel;
                string dungeonName = GetDungeonName(m_Dungeon) + " Dungeon";
                string weaponName  = m_Weapon.Name;

                if (weaponName == null)
                {
                    weaponName = "";
                }

                weaponName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(weaponName);
                int newDurability = DungeonWeapon.BaselineDurability + (DungeonWeapon.IncreasedDurabilityPerTier * weaponTier);

                int adjustedBlessedCharges = DungeonWeapon.ArcaneMaxCharges;

                double accuracy = 100 * (DungeonWeapon.BaseAccuracy + (DungeonWeapon.AccuracyPerTier * (double)weaponTier));
                double tactics  = DungeonWeapon.BaseTactics + (DungeonWeapon.TacticsPerTier * (double)weaponTier);

                double effectChance = DungeonWeapon.BaseEffectChance + (DungeonWeapon.BaseEffectChancePerTier * (double)weaponTier);

                effectChance *= DungeonWeapon.GetSpeedScalar(m_Weapon.Speed);

                DungeonArmor.DungeonArmorDetail detail = new DungeonArmor.DungeonArmorDetail(m_Dungeon, 1);

                EffectHue = detail.Hue - 1;

                int itemId  = weapon.ItemID;
                int itemHue = EffectHue;
                int offsetX = 0;
                int offsetY = 0;

                AddLabel(Utility.CenteredTextOffset(120, dungeonName), 60, EffectHue, dungeonName);
                AddLabel(Utility.CenteredTextOffset(120, weaponName), 80, EffectHue, weaponName);
                AddItem(103 + m_Weapon.IconOffsetX, 115 + m_Weapon.IconOffsetY, m_Weapon.IconItemId, itemHue);
                AddLabel(97, 165, EffectHue, "Tier " + weaponTier.ToString());

                AddLabel(71, 190, WhiteTextHue, "Charges:");
                AddLabel(135, 190, EffectHue, adjustedBlessedCharges.ToString());

                AddLabel(55, 210, WhiteTextHue, "Experience:");
                AddLabel(135, 210, EffectHue, "0/" + DungeonWeapon.MaxDungeonExperience.ToString());

                AddLabel(60, 230, WhiteTextHue, "Durability:");
                AddLabel(135, 230, EffectHue, newDurability.ToString() + "/" + newDurability.ToString());

                AddLabel(65, 250, WhiteTextHue, "Accuracy:");
                AddLabel(135, 250, EffectHue, "+" + accuracy.ToString() + "%");

                AddLabel(74, 270, WhiteTextHue, "Tactics:");
                AddLabel(135, 270, EffectHue, "+" + tactics.ToString());

                AddLabel(31, 290, WhiteTextHue, "Effect Chance:");
                AddLabel(135, 290, EffectHue, Utility.CreateDecimalPercentageString(effectChance, 1));
                AddLabel(30, 310, WhiteTextHue, "(scaled for weapon speed)");

                DungeonWeaponDetail weaponDetail = DungeonWeapon.GetDungeonWeaponDetail(m_Dungeon);

                AddLabel(70, 335, WhiteTextHue, "Special Effect:");
                AddButton(78, 359, 1210, 1209, 4, GumpButtonType.Reply, 0);
                AddLabel(98, 355, EffectHue, weaponDetail.m_EffectDisplayName);

                //-----

                if (newWeapon)
                {
                    if (selfCraft || m_GumpTarget == m_MobileTarget)
                    {
                        AddLabel(225, 60, WhiteTextHue, "Choose Dungeon");

                        AddLabel(265, 95, WhiteTextHue, "Covetous");
                        AddLabel(265, 130, WhiteTextHue, "Deceit");
                        AddLabel(265, 165, WhiteTextHue, "Despise");
                        AddLabel(265, 200, WhiteTextHue, "Destard");
                        AddLabel(265, 235, WhiteTextHue, "Fire");
                        AddLabel(265, 270, WhiteTextHue, "Hythloth");
                        AddLabel(265, 305, WhiteTextHue, "Ice");
                        AddLabel(265, 340, WhiteTextHue, "Shame");
                        AddLabel(265, 375, WhiteTextHue, "Wrong");

                        if (m_Dungeon == DungeonEnum.Covetous)
                        {
                            AddButton(228, 90, 9724, 9721, 10, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(228, 90, 9721, 9724, 10, GumpButtonType.Reply, 0);
                        }

                        if (m_Dungeon == DungeonEnum.Deceit)
                        {
                            AddButton(228, 125, 9724, 9721, 11, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(228, 125, 9721, 9724, 11, GumpButtonType.Reply, 0);
                        }

                        if (m_Dungeon == DungeonEnum.Despise)
                        {
                            AddButton(228, 160, 9724, 9721, 12, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(228, 160, 9721, 9724, 12, GumpButtonType.Reply, 0);
                        }

                        if (m_Dungeon == DungeonEnum.Destard)
                        {
                            AddButton(228, 195, 9724, 9721, 13, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(228, 195, 9721, 9724, 13, GumpButtonType.Reply, 0);
                        }

                        if (m_Dungeon == DungeonEnum.Fire)
                        {
                            AddButton(228, 230, 9724, 9721, 14, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(228, 230, 9721, 9724, 14, GumpButtonType.Reply, 0);
                        }

                        if (m_Dungeon == DungeonEnum.Hythloth)
                        {
                            AddButton(228, 265, 9724, 9721, 15, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(228, 265, 9721, 9724, 15, GumpButtonType.Reply, 0);
                        }

                        if (m_Dungeon == DungeonEnum.Ice)
                        {
                            AddButton(228, 300, 9724, 9721, 16, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(228, 300, 9721, 9724, 16, GumpButtonType.Reply, 0);
                        }

                        if (m_Dungeon == DungeonEnum.Shame)
                        {
                            AddButton(228, 335, 9724, 9721, 17, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(228, 335, 9721, 9724, 17, GumpButtonType.Reply, 0);
                        }

                        if (m_Dungeon == DungeonEnum.Wrong)
                        {
                            AddButton(228, 370, 9724, 9721, 18, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(228, 370, 9721, 9724, 18, GumpButtonType.Reply, 0);
                        }
                    }
                }

                if (!selfCraft)
                {
                    if (m_GumpTarget == m_Crafter)
                    {
                        AddLabel(26, 388, 149, "Price");
                        AddItem(57, 386, 3823);
                        AddImage(103, 387, 2445);
                        AddTextEntry(108, 388, 95, 20, WhiteTextHue, 4, m_AmountDemanded.ToString());
                        AddButton(214, 392, 1209, 1210, 3, GumpButtonType.Reply, 0);
                    }

                    else
                    {
                        AddLabel(26, 388, 149, "Price");
                        AddItem(57, 386, 3823);
                        AddLabel(103, 388, WhiteTextHue, m_AmountDemanded.ToString());
                    }
                }

                if (selfCraft)
                {
                    AddButton(24, 423, 2151, 2154, 1, GumpButtonType.Reply, 0);
                    AddLabel(57, 426, WhiteTextHue, "Confirm");
                }

                else
                {
                    if (m_GumpTarget == m_Crafter)
                    {
                        if (m_Confirmed)
                        {
                            AddButton(191, 423, 2154, 2151, 2, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(191, 423, 2151, 2154, 2, GumpButtonType.Reply, 0);
                        }

                        AddLabel(227, 427, WhiteTextHue, "Confirm Offer");
                    }

                    else
                    {
                        AddButton(24, 423, 2151, 2154, 1, GumpButtonType.Reply, 0);
                        AddLabel(57, 426, WhiteTextHue, "Accept Their Offer");

                        if (m_Confirmed)
                        {
                            AddImage(191, 423, 9729);
                        }
                        else
                        {
                            AddImage(191, 423, 9731);
                        }

                        AddLabel(227, 427, WhiteTextHue, "They Are Ready");
                    }
                }
            }
Beispiel #2
0
        public DungeonWeaponGump(Mobile gumpTarget, BaseWeapon weapon, bool armsLoreSuccess) : base(10, 10)
        {
            m_GumpTarget      = gumpTarget;
            m_Weapon          = weapon;
            m_ArmsLoreSuccess = armsLoreSuccess;

            if (weapon == null)
            {
                return;
            }
            if (weapon.TierLevel == 0 || weapon.Dungeon == DungeonEnum.None)
            {
                return;
            }

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

            int WhiteTextHue = 2655;
            int DetailHue    = 149;

            int    weaponTier  = m_Weapon.TierLevel;
            string dungeonName = BaseWeapon.GetDungeonName(m_Weapon.Dungeon) + " Dungeon";
            string weaponName  = m_Weapon.Name;

            if (weaponName == null)
            {
                weaponName = "";
            }

            weaponName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(weaponName);
            int newDurability = DungeonWeapon.BaselineDurability + (DungeonWeapon.IncreasedDurabilityPerTier * weaponTier);

            int adjustedBlessedCharges = DungeonWeapon.ArcaneMaxCharges;

            double accuracy = 100 * (DungeonWeapon.BaseAccuracy + (DungeonWeapon.AccuracyPerTier * (double)weaponTier));
            double tactics  = DungeonWeapon.BaseTactics + (DungeonWeapon.TacticsPerTier * (double)weaponTier);

            double effectChance = DungeonWeapon.BaseEffectChance + (DungeonWeapon.BaseEffectChancePerTier * (double)weaponTier);

            effectChance *= DungeonWeapon.GetSpeedScalar(m_Weapon.Speed);

            DungeonArmor.DungeonArmorDetail detail = new DungeonArmor.DungeonArmorDetail(m_Weapon.Dungeon, m_Weapon.TierLevel);

            int itemId  = weapon.ItemID;
            int itemHue = detail.Hue - 1;
            int offsetX = 0;
            int offsetY = 0;

            DetailHue = itemHue;

            AddPage(0);

            AddImage(220, 123, 103);
            AddImage(220, 65, 103);
            AddImage(220, 4, 103);
            AddImage(98, 124, 103);
            AddImage(98, 65, 103);
            AddImage(98, 4, 103);
            AddImage(5, 124, 103);
            AddImage(5, 65, 103);
            AddImage(5, 4, 103);
            AddImage(18, 16, 3604, 2052);
            AddImage(18, 85, 3604, 2052);
            AddImage(102, 16, 3604, 2052);
            AddImage(102, 85, 3604, 2052);
            AddImage(222, 16, 3604, 2052);
            AddImage(222, 85, 3604, 2052);

            AddLabel(Utility.CenteredTextOffset(90, dungeonName), 25, DetailHue, dungeonName);
            AddLabel(Utility.CenteredTextOffset(90, weaponName), 45, DetailHue, weaponName);
            AddItem(75 + weapon.IconOffsetX, 85 + weapon.IconOffsetY, weapon.IconItemId, itemHue);
            AddLabel(69, 140, DetailHue, "Tier 1");

            string chargesText      = adjustedBlessedCharges.ToString();
            string experienceText   = weapon.Experience + "/" + DungeonWeapon.MaxDungeonExperience.ToString();
            string durabilityText   = weapon.HitPoints + "/" + weapon.MaxHitPoints;
            string accuracyText     = "+" + accuracy.ToString() + "%";
            string tacticsText      = "+" + tactics.ToString();
            string effectChanceText = Utility.CreateDecimalPercentageString(effectChance, 1);

            if (!armsLoreSuccess)
            {
                durabilityText = "?" + "/" + weapon.MaxHitPoints;
            }

            AddLabel(217, 25, WhiteTextHue, "Charges:");
            AddLabel(280, 25, DetailHue, chargesText);

            AddLabel(201, 45, WhiteTextHue, "Experience:");
            AddLabel(280, 45, DetailHue, experienceText);

            AddLabel(206, 65, WhiteTextHue, "Durability:");
            AddLabel(280, 65, DetailHue, durabilityText);

            AddLabel(209, 85, WhiteTextHue, "Accuracy:");
            AddLabel(280, 85, DetailHue, accuracyText);

            AddLabel(220, 105, WhiteTextHue, "Tactics:");
            AddLabel(280, 105, DetailHue, tacticsText);

            AddLabel(176, 125, WhiteTextHue, "Effect Chance:");
            AddLabel(280, 125, DetailHue, effectChanceText);
            AddLabel(176, 145, WhiteTextHue, "(scaled for weapon speed)");

            DungeonWeaponDetail weaponDetail = DungeonWeapon.GetDungeonWeaponDetail(weapon.Dungeon);

            AddLabel(70, 185, WhiteTextHue, "Special Effect:");
            AddButton(170, 188, 1210, 1209, 1, GumpButtonType.Reply, 0);
            AddLabel(190, 185, DetailHue, weaponDetail.m_EffectDisplayName);
        }