Пример #1
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 0 || !m_Stone.IsEmpty)
                {
                    return;
                }

                Mobile from = sender.Mobile;

                int iSkill = info.ButtonID - 1;

                if (iSkill < 0 || iSkill >= from.Skills.Length)
                {
                    return;
                }

                Skill skill = from.Skills[iSkill];

                if (skill.Base <= 0.0)
                {
                    return;
                }

                if (!m_Stone.CheckUse(from))
                {
                    return;
                }

                from.SendGump(new ConfirmSkillGump(m_Stone, skill));
            }
Пример #2
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 0 || !m_Stone.IsEmpty)
                {
                    return;
                }

                Mobile from = sender.Mobile;

                if (!m_Stone.CheckUse(from))
                {
                    return;
                }

                if (info.ButtonID == 1)                   // Is asking for another selection
                {
                    from.SendGump(new SelectSkillGump(m_Stone, from));
                    return;
                }

                if (m_Skill.Base <= 0.0)
                {
                    return;
                }

                if (m_Skill.Lock != SkillLock.Down)
                {
                    // <CENTER>Unable to Transfer Selected Skill to Soulstone</CENTER>

                    /* You cannot transfer the selected skill to the Soulstone at this time. The selected
                     * skill may be locked or set to raise in your skill menu. Click on "Skills" in your
                     * paperdoll menu to check your raise/locked/lower settings and your total skills.
                     * Make any needed adjustments, then click "Continue". If you do not wish to transfer
                     * the selected skill at this time, click "Cancel".
                     */

                    from.SendGump(new ErrorGump(m_Stone, 1070710, 1070711));
                    return;
                }

                m_Stone.Skill      = m_Skill.SkillName;
                m_Stone.SkillValue = m_Skill.Base;

                m_Skill.Base = 0.0;

                from.SendLocalizedMessage(1070712);                   // You have successfully transferred your skill points into the Soulstone.

                m_Stone.LastUserName = from.Name;

                Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0);
                Effects.PlaySound(from.Location, from.Map, 0x243);

                Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);

                Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100);
            }
Пример #3
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 0 || m_Stone.IsEmpty)
                {
                    return;
                }

                Mobile from = sender.Mobile;

                if (!m_Stone.CheckUse(from))
                {
                    return;
                }

                m_Stone.SkillValue = 0.0;
                from.SendLocalizedMessage(1070726);                   // You have successfully deleted the Soulstone's skill points.
            }
Пример #4
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 0)
                {
                    return;
                }

                Mobile from = sender.Mobile;

                if (!m_Stone.CheckUse(from))
                {
                    return;
                }

                if (m_Stone.IsEmpty)
                {
                    from.SendGump(new SelectSkillGump(m_Stone, from));
                }
                else
                {
                    from.SendGump(new ConfirmTransferGump(m_Stone, from));
                }
            }
Пример #5
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 0 || m_Stone.IsEmpty)
                {
                    return;
                }

                Mobile from = sender.Mobile;

                if (!m_Stone.CheckUse(from))
                {
                    return;
                }

                if (info.ButtonID == 1)                   // Remove skill points
                {
                    from.SendGump(new ConfirmRemovalGump(m_Stone));
                    return;
                }

                SkillName skill      = m_Stone.Skill;
                double    skillValue = m_Stone.SkillValue;
                Skill     fromSkill  = from.Skills[m_Stone.Skill];

                /* If we have, say, 88.4 in our skill and the stone holds 100, we need
                 * 11.6 free points. Also, if we're below our skillcap by, say, 8.2 points,
                 * we only need 11.6 - 8.2 = 3.4 points.
                 */
                int requiredAmount = (int)(skillValue * 10) - fromSkill.BaseFixedPoint - (from.SkillsCap - from.SkillsTotal);

                bool cannotAbsorb = false;

                if (fromSkill.Lock != SkillLock.Up)
                {
                    cannotAbsorb = true;
                }
                else if (requiredAmount > 0)
                {
                    int available = 0;

                    for (int i = 0; i < from.Skills.Length; ++i)
                    {
                        if (from.Skills[i].Lock != SkillLock.Down)
                        {
                            continue;
                        }

                        available += from.Skills[i].BaseFixedPoint;
                    }

                    if (requiredAmount > available)
                    {
                        cannotAbsorb = true;
                    }
                }

                if (cannotAbsorb)
                {
                    // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER>

                    /* You cannot absorb the selected skill from the Soulstone at this time. The selected
                     * skill may be locked or set to lower in your skill menu. You may also be at your
                     * total skill cap.  Click on "Skills" in your paperdoll menu to check your
                     * raise/locked/lower settings and your total skills.  Make any needed adjustments,
                     * then click "Continue". If you do not wish to transfer the selected skill at this
                     * time, click "Cancel".
                     */

                    from.SendGump(new ErrorGump(m_Stone, 1070717, 1070716));
                    return;
                }

                if (skillValue > fromSkill.Cap)
                {
                    // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER>

                    /* The amount of skill stored in this stone exceeds your individual skill cap for
                     * that skill.  In order to retrieve the skill points stored in this stone, you must
                     * obtain a Power Scroll of the appropriate type and level in order to increase your
                     * skill cap.  You cannot currently retrieve the skill points stored in this stone.
                     */

                    from.SendGump(new ErrorGump(m_Stone, 1070717, 1070715));
                    return;
                }

                if (fromSkill.Base >= skillValue)
                {
                    // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER>

                    /* You cannot transfer the selected skill to the Soulstone at this time. The selected
                     * skill has a skill level higher than what is stored in the Soulstone.
                     */

                    // Wrong message?!

                    from.SendGump(new ErrorGump(m_Stone, 1070717, 1070802));
                    return;
                }

                #region Scroll of Alacrity
                PlayerMobile pm = from as PlayerMobile;
                if (pm.AcceleratedStart > DateTime.Now)
                {
                    // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER>

                    /*You may not use a soulstone while your character is under the effects of a Scroll of Alacrity.*/

                    // Wrong message?!

                    from.SendGump(new ErrorGump(m_Stone, 1070717, 1078115));
                    return;
                }
                #endregion

                if (requiredAmount > 0)
                {
                    for (int i = 0; i < from.Skills.Length; ++i)
                    {
                        if (from.Skills[i].Lock != SkillLock.Down)
                        {
                            continue;
                        }

                        if (requiredAmount >= from.Skills[i].BaseFixedPoint)
                        {
                            requiredAmount     -= from.Skills[i].BaseFixedPoint;
                            from.Skills[i].Base = 0.0;
                        }
                        else
                        {
                            from.Skills[i].BaseFixedPoint -= requiredAmount;
                            break;
                        }
                    }
                }

                fromSkill.Base     = skillValue;
                m_Stone.SkillValue = 0.0;

                from.SendLocalizedMessage(1070713);                   // You have successfully absorbed the Soulstone's skill points.

                m_Stone.LastUserName = from.Name;

                Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0);
                Effects.PlaySound(from.Location, from.Map, 0x243);

                Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);

                Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100);

                if (m_Stone is SoulstoneFragment)
                {
                    SoulstoneFragment frag = m_Stone as SoulstoneFragment;

                    if (--frag.UsesRemaining <= 0)
                    {
                        from.SendLocalizedMessage(1070974);                           // You have used up your soulstone fragment.
                    }
                }
            }