Пример #1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_GumpTarget == null || m_Weapon == null)
            {
                return;
            }
            if (m_Weapon.Deleted)
            {
                return;
            }

            if (m_Weapon.TierLevel == 0)
            {
                return;
            }
            if (m_Weapon.Dungeon == DungeonEnum.None)
            {
                return;
            }

            bool closeGump = true;

            if (info.ButtonID == 1)
            {
                DungeonWeaponDetail weaponDetail = DungeonWeapon.GetDungeonWeaponDetail(m_Weapon.Dungeon);

                m_GumpTarget.SendMessage(weaponDetail.m_EffectDisplayName + ": " + weaponDetail.m_EffectDescription);

                closeGump = false;
            }

            if (!closeGump)
            {
                m_GumpTarget.CloseGump(typeof(DungeonWeaponGump));
                m_GumpTarget.SendGump(new DungeonWeaponGump(m_GumpTarget, m_Weapon, m_ArmsLoreSuccess));
            }
        }
Пример #2
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                #region Validate Mobiles Involved

                //Validate Mobiles
                bool crafterValid      = true;
                bool mobileTargetValid = true;

                if (m_Crafter == null)
                {
                    crafterValid = false;
                }

                else if (m_Crafter.Deleted || !m_Crafter.Alive)
                {
                    crafterValid = false;
                }

                if (m_MobileTarget == null)
                {
                    mobileTargetValid = false;
                }

                else if (m_MobileTarget.Deleted || !m_MobileTarget.Alive)
                {
                    mobileTargetValid = false;
                }

                if (!crafterValid || !mobileTargetValid)
                {
                    if (m_Crafter != null)
                    {
                        if (m_Crafter.HasGump(typeof(DungeonMouldWeaponGump)))
                        {
                            m_Crafter.CloseGump(typeof(DungeonMouldWeaponGump));
                        }

                        m_Crafter.SendMessage("You can no longer proceed with the crafting of that dungeon weapon.");
                    }

                    if (m_MobileTarget != null && m_Crafter != m_MobileTarget)
                    {
                        if (m_MobileTarget.HasGump(typeof(DungeonMouldWeaponGump)))
                        {
                            m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                        }

                        m_MobileTarget.SendMessage("You can no longer proceed with the crafting of that dungeon weapon.");
                    }

                    return;
                }

                if (crafterValid && mobileTargetValid && m_Crafter != m_MobileTarget)
                {
                    if (Utility.GetDistance(m_Crafter.Location, m_MobileTarget.Location) > 2)
                    {
                        if (m_Crafter.HasGump(typeof(DungeonMouldWeaponGump)))
                        {
                            m_Crafter.CloseGump(typeof(DungeonMouldWeaponGump));
                        }

                        m_Crafter.SendMessage("You are too far away from the target to proceed with the crafting.");

                        if (m_MobileTarget.HasGump(typeof(DungeonMouldWeaponGump)))
                        {
                            m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                        }

                        m_MobileTarget.SendMessage("You are too far away from the crafter to proceed with the crafting.");

                        return;
                    }

                    if (!m_Crafter.InLOS(m_MobileTarget))
                    {
                        if (m_Crafter.HasGump(typeof(DungeonMouldWeaponGump)))
                        {
                            m_Crafter.CloseGump(typeof(DungeonMouldWeaponGump));
                        }

                        m_Crafter.SendMessage("You are out of sight of the target and cannot continue crafting.");

                        if (m_MobileTarget.HasGump(typeof(DungeonMouldWeaponGump)))
                        {
                            m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                        }

                        m_MobileTarget.SendMessage("You are out of sight of the crafter and cannot continue crafting.");

                        return;
                    }
                }

                #endregion

                bool selfCraft    = (m_Crafter == m_MobileTarget);
                bool attemptCraft = false;

                //Close Gumps For Other Player if One Party Closes Theirs
                if (info.ButtonID == 0)
                {
                    if (!selfCraft)
                    {
                        if (m_GumpTarget == m_Crafter)
                        {
                            if (m_MobileTarget.HasGump(typeof(DungeonMouldWeaponGump)))
                            {
                                m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                                m_MobileTarget.SendMessage("They have canceled the offer.");

                                return;
                            }
                        }

                        if (m_GumpTarget == m_MobileTarget)
                        {
                            if (m_Crafter.HasGump(typeof(DungeonMouldWeaponGump)))
                            {
                                m_Crafter.CloseGump(typeof(DungeonMouldWeaponGump));
                                m_Crafter.SendMessage("They have declined the offer.");

                                return;
                            }
                        }
                    }
                }

                //Confirm / Accept
                if (info.ButtonID == 1)
                {
                    if (selfCraft)
                    {
                        attemptCraft = true;
                    }

                    else if (m_GumpTarget == m_MobileTarget)
                    {
                        if (!m_Confirmed)
                        {
                            if (m_Crafter != null)
                            {
                                m_MobileTarget.SendMessage(m_Crafter.Name + " has not confirmed their offer price yet.");
                            }

                            m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                            m_MobileTarget.SendGump(new DungeonMouldWeaponGump(m_MobileTarget, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));

                            return;
                        }

                        else
                        {
                            attemptCraft = true;
                        }
                    }

                    else
                    {
                        m_GumpTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                        m_GumpTarget.SendGump(new DungeonMouldWeaponGump(m_Crafter, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));

                        return;
                    }
                }

                //Ready
                if (info.ButtonID == 2)
                {
                    if (!selfCraft && m_GumpTarget == m_Crafter)
                    {
                        m_Confirmed = !m_Confirmed;

                        m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                        m_MobileTarget.SendGump(new DungeonMouldWeaponGump(m_MobileTarget, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));
                    }

                    m_GumpTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                    m_GumpTarget.SendGump(new DungeonMouldWeaponGump(m_Crafter, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));

                    return;
                }

                //Adjust Price
                if (info.ButtonID == 3)
                {
                    if (!selfCraft && m_GumpTarget == m_Crafter)
                    {
                        //Set Gold Amount
                        TextRelay demandAmountTextRelay = info.GetTextEntry(4);
                        string    demandAmountText      = demandAmountTextRelay.Text.Trim();

                        try { m_AmountDemanded = Convert.ToInt32(demandAmountText); }
                        catch (Exception e) { m_AmountDemanded = 0; }

                        if (m_AmountDemanded > 500000)
                        {
                            m_AmountDemanded = 500000;
                        }

                        if (m_AmountDemanded < 0)
                        {
                            m_AmountDemanded = 0;
                        }

                        m_Confirmed = false;

                        m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                        m_MobileTarget.SendGump(new DungeonMouldWeaponGump(m_MobileTarget, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));

                        m_MobileTarget.SendMessage("They have changed the asking price for their service.");
                        m_GumpTarget.SendMessage("You change the asking price for your services. Click 'Confirm' to proceed.");
                    }

                    m_GumpTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                    m_GumpTarget.SendGump(new DungeonMouldWeaponGump(m_Crafter, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));

                    return;
                }

                //Special Effect
                if (info.ButtonID == 4)
                {
                    DungeonWeaponDetail weaponDetail = DungeonWeapon.GetDungeonWeaponDetail(m_Dungeon);

                    m_GumpTarget.SendMessage(weaponDetail.m_EffectDisplayName + ": " + weaponDetail.m_EffectDescription);

                    m_GumpTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                    m_GumpTarget.SendGump(new DungeonMouldWeaponGump(m_Crafter, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));

                    return;
                }

                //Dungeon Selection
                if (info.ButtonID >= 10 && info.ButtonID <= 18)
                {
                    if (m_NewWeapon)
                    {
                        if (selfCraft || m_GumpTarget == m_MobileTarget)
                        {
                            switch (info.ButtonID)
                            {
                            case 10: m_Dungeon = DungeonEnum.Covetous; break;

                            case 11: m_Dungeon = DungeonEnum.Deceit; break;

                            case 12: m_Dungeon = DungeonEnum.Despise; break;

                            case 13: m_Dungeon = DungeonEnum.Destard; break;

                            case 14: m_Dungeon = DungeonEnum.Fire; break;

                            case 15: m_Dungeon = DungeonEnum.Hythloth; break;

                            case 16: m_Dungeon = DungeonEnum.Ice; break;

                            case 17: m_Dungeon = DungeonEnum.Shame; break;

                            case 18: m_Dungeon = DungeonEnum.Wrong; break;
                            }
                        }
                    }

                    m_Crafter.CloseGump(typeof(DungeonMouldWeaponGump));
                    m_Crafter.SendGump(new DungeonMouldWeaponGump(m_Crafter, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));

                    if (m_Crafter != m_MobileTarget)
                    {
                        m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                        m_MobileTarget.SendGump(new DungeonMouldWeaponGump(m_MobileTarget, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));
                    }

                    return;
                }

                //Attempt Crafting
                if (attemptCraft)
                {
                    bool mouldValid = true;

                    if (m_DungeonMould == null)
                    {
                        mouldValid = false;
                    }

                    else if (m_DungeonMould.Deleted)
                    {
                        mouldValid = false;
                    }

                    if (m_DungeonMould.RootParent != m_Crafter)
                    {
                        mouldValid = false;
                    }

                    if (!mouldValid)
                    {
                        m_Crafter.CloseGump(typeof(DungeonMouldWeaponGump));
                        m_Crafter.SendMessage("The dungeon mould being used is no longer accessible.");

                        if (m_Crafter != m_MobileTarget)
                        {
                            m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                            m_MobileTarget.SendMessage("The dungeon mould being used is no longer accessible.");
                        }

                        return;
                    }

                    bool weaponValid = true;

                    if (m_Weapon == null)
                    {
                        weaponValid = false;
                    }

                    else if (m_Weapon.Deleted)
                    {
                        weaponValid = false;
                    }

                    if (selfCraft)
                    {
                        if (m_Weapon.RootParent != m_Crafter)
                        {
                            weaponValid = false;
                        }
                    }

                    else
                    {
                        if (m_Weapon.RootParent != m_MobileTarget)
                        {
                            weaponValid = false;
                        }
                    }

                    if (m_Weapon.TierLevel == DungeonWeapon.MaxDungeonTier)
                    {
                        weaponValid = false;
                    }

                    if (m_NewWeapon)
                    {
                        if (m_Weapon.TierLevel > 0)
                        {
                            weaponValid = false;
                        }

                        if (m_Weapon.CrafterName == "" || m_Weapon.Quality != Quality.Exceptional)
                        {
                            weaponValid = false;
                        }

                        if (m_Weapon.DamageLevel != WeaponDamageLevel.Regular || m_Weapon.AccuracyLevel != WeaponAccuracyLevel.Regular || m_Weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                        {
                            weaponValid = false;
                        }
                    }

                    if (!weaponValid)
                    {
                        m_Crafter.CloseGump(typeof(DungeonMouldWeaponGump));
                        m_Crafter.SendMessage("The weapon being targeted is no longer accessible.");

                        if (m_Crafter != m_MobileTarget)
                        {
                            m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                            m_MobileTarget.SendMessage("The weapon being targeted is no longer accessible.");
                        }

                        return;
                    }

                    if (!selfCraft && m_AmountDemanded > 0)
                    {
                        if (Banker.GetBalance(m_MobileTarget) < m_AmountDemanded)
                        {
                            m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                            m_MobileTarget.SendGump(new DungeonMouldWeaponGump(m_MobileTarget, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));

                            m_MobileTarget.SendMessage("You do not have the gold amount requested for this transaction in your bankbox.");

                            return;
                        }
                    }

                    if (!HasRequiredMaterials(m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Dungeon))
                    {
                        m_MobileTarget.CloseGump(typeof(DungeonMouldWeaponGump));
                        m_MobileTarget.SendGump(new DungeonMouldWeaponGump(m_MobileTarget, m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Weapon, m_Dungeon, m_AmountDemanded, m_Confirmed));

                        if (m_NewWeapon)
                        {
                            m_MobileTarget.SendMessage("You must have " + DungeonWeapon.CoresNeededForCreation.ToString() + " dungeon cores and " + DungeonWeapon.DistillationNeededForCreation.ToString() + " dungeon distillation of the matching dungeon in your backpack to create this dungeon weapon.");
                        }

                        else
                        {
                            m_MobileTarget.SendMessage("You must have " + DungeonWeapon.CoresNeededForUpgrade.ToString() + " dungeon cores and " + DungeonWeapon.DistillationNeededForUpgrade.ToString() + " dungeon distillation of the matching dungeon in your backpack to upgrade it's tier.");
                        }

                        return;
                    }

                    ConsumeMaterials(m_Crafter, m_MobileTarget, m_DungeonMould, m_NewWeapon, m_Dungeon);

                    if (!selfCraft && m_AmountDemanded > 0)
                    {
                        Banker.Withdraw(m_MobileTarget, m_AmountDemanded);
                        Banker.Deposit(m_Crafter, m_AmountDemanded);

                        m_MobileTarget.SendSound(0x037);

                        if (m_NewWeapon)
                        {
                            m_Crafter.SendMessage("You convert their weapon into a dungeon weapon and receive " + m_AmountDemanded.ToString() + " gold for your services.");
                            m_MobileTarget.SendMessage("You pay " + m_AmountDemanded.ToString() + " gold for them to create a dungeon weapon for you.");
                        }

                        else
                        {
                            m_Crafter.SendMessage("You upgrade their dugneon weapon's tier and receive " + m_AmountDemanded.ToString() + " gold for your services.");
                            m_MobileTarget.SendMessage("You pay " + m_AmountDemanded.ToString() + " gold for them to upgrade your dungeon weapon.");
                        }
                    }

                    else
                    {
                        if (selfCraft)
                        {
                            if (m_NewWeapon)
                            {
                                m_Crafter.SendMessage("You convert your weapon into a dungeon weapon.");
                            }

                            else
                            {
                                m_Crafter.SendMessage("You upgrade your dungeon weapon's tier.");
                            }
                        }

                        else
                        {
                            if (m_NewWeapon)
                            {
                                m_Crafter.SendMessage("You convert their weapon into a dungeon weapon.");
                                m_MobileTarget.SendMessage("They create a dungeon weapon for you.");
                            }

                            else
                            {
                                m_Crafter.SendMessage("You upgrade their dungeon weapon's tier.");
                                m_MobileTarget.SendMessage("They upgrade your dungeon weapon's tier for you.");
                            }
                        }
                    }

                    m_Crafter.PlaySound(0x2A);

                    if (m_NewWeapon)
                    {
                        m_Weapon.Quality          = Quality.Regular;
                        m_Weapon.ArcaneCharges    = DungeonWeapon.ArcaneMaxCharges;
                        m_Weapon.ArcaneChargesMax = DungeonWeapon.ArcaneMaxCharges;
                        m_Weapon.Dungeon          = m_Dungeon;
                        m_Weapon.TierLevel        = 1;
                    }

                    else
                    {
                        m_Weapon.TierLevel++;
                    }

                    m_Weapon.Experience = 0;

                    m_Weapon.MaxHitPoints = DungeonWeapon.BaselineDurability + (DungeonWeapon.IncreasedDurabilityPerTier * m_Weapon.TierLevel);
                    m_Weapon.HitPoints    = m_Weapon.MaxHitPoints;

                    return;
                }
            }
Пример #3
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");
                    }
                }
            }
Пример #4
0
        public static DungeonWeaponDetail GetDungeonWeaponDetail(DungeonEnum dungeon)
        {
            DungeonWeaponDetail detail = new DungeonWeaponDetail();

            switch (dungeon)
            {
            case DungeonEnum.Covetous:
                detail.m_SpecialEffect     = SpecialEffectType.PoisonWind;
                detail.m_EffectDisplayName = "Poison Wind";
                detail.m_EffectDescription = "";
                break;

            case DungeonEnum.Deceit:
                detail.m_SpecialEffect     = SpecialEffectType.ShockStorm;
                detail.m_EffectDisplayName = "Shock Storm";
                detail.m_EffectDescription = "";
                break;

            case DungeonEnum.Despise:
                detail.m_SpecialEffect     = SpecialEffectType.Command;
                detail.m_EffectDisplayName = "Command";
                detail.m_EffectDescription = "";
                break;

            case DungeonEnum.Destard:
                detail.m_SpecialEffect     = SpecialEffectType.Whirlwind;
                detail.m_EffectDisplayName = "Whirlwind";
                detail.m_EffectDescription = "";
                break;

            case DungeonEnum.Fire:
                detail.m_SpecialEffect     = SpecialEffectType.Firestorm;
                detail.m_EffectDisplayName = "Firestorm";
                detail.m_EffectDescription = "";
                break;

            case DungeonEnum.Hythloth:
                detail.m_SpecialEffect     = SpecialEffectType.Execute;
                detail.m_EffectDisplayName = "Execute";
                detail.m_EffectDescription = "";
                break;

            case DungeonEnum.Ice:
                detail.m_SpecialEffect     = SpecialEffectType.FrostNova;
                detail.m_EffectDisplayName = "Frost Nova";
                detail.m_EffectDescription = "";
                break;

            case DungeonEnum.Shame:
                detail.m_SpecialEffect     = SpecialEffectType.ArcaneSurge;
                detail.m_EffectDisplayName = "Arcane Surge";
                detail.m_EffectDescription = "";
                break;

            case DungeonEnum.Wrong:
                detail.m_SpecialEffect     = SpecialEffectType.Shadows;
                detail.m_EffectDisplayName = "Shadows";
                detail.m_EffectDescription = "";
                break;
            }

            return(detail);
        }
Пример #5
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);
        }