Beispiel #1
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.UtcNow)
                {
                    // <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(UltimaOnline.Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 9502, 1, 0, (EffectLayer)255, 0x100, 0x497, 0);

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

                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.
                    }
                }
            }
Beispiel #2
0
 public virtual void DoEffect(Point3D loc, Map map)
 {
     Effects.SendLocationParticles(EffectItem.Create(loc, map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
     Effects.PlaySound(loc, map, 0x225);
 }
Beispiel #3
0
        protected override TimeSpan Play(int step)
        {
            switch (step)
            {
            case 0:
            {
                Effects.PlaySound(Location, Map, 0x106);
                Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3735, 1, 182, 0xBE3);

                return(TimeSpan.FromSeconds(4.0));
            }

            case 1:
            {
                Effects.PlaySound(Location, Map, 0x222);

                return(TimeSpan.FromSeconds(4.0));
            }

            case 2:
            {
                Effects.PlaySound(Location, Map, 0x21F);

                return(TimeSpan.FromSeconds(5.0));
            }

            case 3:
            {
                EffectItem dummy = EffectItem.Create(Location, Map, TimeSpan.FromSeconds(20.0));
                dummy.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "* The ground erupts with chaotic growth! *");

                Effects.PlaySound(Location, Map, 0x12D);

                SpawnReagents();
                SpawnReagents();

                return(TimeSpan.FromSeconds(2.0));
            }

            case 4:
            {
                Effects.PlaySound(Location, Map, 0x12D);

                SpawnReagents();
                SpawnReagents();

                return(TimeSpan.FromSeconds(2.0));
            }

            case 5:
            {
                Effects.PlaySound(Location, Map, 0x12D);

                SpawnReagents();
                SpawnReagents();

                return(TimeSpan.FromSeconds(3.0));
            }

            default:
            {
                Effects.PlaySound(Location, Map, 0x12D);

                SpawnReagents();
                SpawnReagents();

                return(TimeSpan.Zero);
            }
            }
        }
Beispiel #4
0
 private void DoEffect()
 {
     Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
     Effects.PlaySound(Location, Map, 0x225);
 }
        public override void OnDoubleClick(Mobile from)
        {
            if (from.Talisman != this)
            {
                from.SendLocalizedMessage(502641); // You must equip this item to use it.
            }
            else if (m_ChargeTime > 0)
            {
                from.SendLocalizedMessage(1074882, m_ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge.
            }
            else if (m_Charges == 0 && m_MaxCharges > 0)
            {
                from.SendLocalizedMessage(1042544); // This item is out of charges.
            }
            else
            {
                Type type = GetSummoner();

                if (m_Summoner != null && !m_Summoner.IsEmpty)
                {
                    type = m_Summoner.Type;
                }

                if (type != null)
                {
                    object obj;

                    try { obj = Activator.CreateInstance(type); }
                    catch { obj = null; }

                    if (obj is Item)
                    {
                        Item item  = (Item)obj;
                        int  count = 1;

                        if (m_Summoner != null && m_Summoner.Amount > 1)
                        {
                            if (item.Stackable)
                            {
                                item.Amount = m_Summoner.Amount;
                            }
                            else
                            {
                                count = m_Summoner.Amount;
                            }
                        }

                        if (from.Backpack == null || count * item.Weight > from.Backpack.MaxWeight ||
                            from.Backpack.Items.Count + count > from.Backpack.MaxItems)
                        {
                            from.SendLocalizedMessage(500720); // You don't have enough room in your backpack!
                            item.Delete();
                            item = null;
                            return;
                        }

                        for (int i = 0; i < count; i++)
                        {
                            from.PlaceInBackpack(item);

                            if (i + 1 < count)
                            {
                                item = Activator.CreateInstance(type) as Item;
                            }
                        }

                        if (item is Board)
                        {
                            from.SendLocalizedMessage(1075000); // You have been given some wooden boards.
                        }
                        else if (item is IronIngot)
                        {
                            from.SendLocalizedMessage(1075001); // You have been given some ingots.
                        }
                        else if (item is Bandage)
                        {
                            from.SendLocalizedMessage(1075002); // You have been given some clean bandages.
                        }
                        else if (m_Summoner != null && m_Summoner.Name != null)
                        {
                            from.SendLocalizedMessage(1074853, m_Summoner.Name.ToString()); // You have been given ~1_name~
                        }
                    }
                    else if (obj is BaseCreature)
                    {
                        BaseCreature mob = (BaseCreature)obj;

                        if ((m_Creature != null && !m_Creature.Deleted) || from.Followers + mob.ControlSlots > from.FollowersMax)
                        {
                            from.SendLocalizedMessage(1074270); // You have too many followers to summon another one.
                            mob.Delete();
                            return;
                        }

                        BaseCreature.Summon(mob, from, from.Location, mob.BaseSoundID, TimeSpan.FromMinutes(10));
                        Effects.SendLocationParticles(EffectItem.Create(mob.Location, mob.Map, EffectItem.DefaultDuration), 0x3728, 1, 10, 0x26B6);

                        mob.Summoned     = false;
                        mob.ControlOrder = OrderType.Friend;

                        m_Creature = mob;
                    }

                    OnAfterUse(from);
                }

                if (m_Removal != TalismanRemoval.None)
                {
                    from.Target = new TalismanTarget(this);
                }
            }
        }
            protected override void OnTarget(Mobile from, object o)
            {
                if (m_Talisman == null || m_Talisman.Deleted)
                {
                    return;
                }

                Mobile target = o as Mobile;

                if (from.Talisman != m_Talisman)
                {
                    from.SendLocalizedMessage(502641); // You must equip this item to use it.
                }
                else if (target == null)
                {
                    from.SendLocalizedMessage(1046439); // That is not a valid target.
                }
                else if (m_Talisman.ChargeTime > 0)
                {
                    from.SendLocalizedMessage(1074882, m_Talisman.ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge.
                }
                else if (m_Talisman.Charges == 0 && m_Talisman.MaxCharges > 0)
                {
                    from.SendLocalizedMessage(1042544); // This item is out of charges.
                }
                else
                {
                    switch (m_Talisman.Removal)
                    {
                    case TalismanRemoval.Curse:
                        target.PlaySound(0xF6);
                        target.PlaySound(0x1F7);
                        target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                        IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map);
                        IEntity mto   = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map);
                        Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 9501, 1, 0, EffectLayer.Head, 0x100, 13, 3);

                        StatMod mod;

                        mod = target.GetStatMod("[Magic] Str Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Str Offset");
                        }

                        mod = target.GetStatMod("[Magic] Dex Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Dex Offset");
                        }

                        mod = target.GetStatMod("[Magic] Int Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Int Offset");
                        }

                        target.Paralyzed = false;

                        EvilOmenSpell.TryEndEffect(target);
                        StrangleSpell.RemoveCurse(target);
                        CorpseSkinSpell.RemoveCurse(target);
                        CurseSpell.RemoveEffect(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Clumsy);
                        BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind);
                        BuffInfo.RemoveBuff(target, BuffIcon.Weaken);
                        BuffInfo.RemoveBuff(target, BuffIcon.MassCurse);

                        target.SendLocalizedMessage(1072408);     // Any curses on you have been lifted

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072409);     // Your targets curses have been lifted
                        }
                        break;

                    case TalismanRemoval.Damage:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        BleedAttack.EndBleed(target, true);
                        MortalStrike.EndWound(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Bleed);
                        BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike);

                        target.SendLocalizedMessage(1072405);     // Your lasting damage effects have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072406);     // Your Targets lasting damage effects have been removed!
                        }
                        break;

                    case TalismanRemoval.Ward:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        MagicReflectSpell.EndReflect(target);
                        ReactiveArmorSpell.EndArmor(target);
                        ProtectionSpell.EndProtection(target);

                        target.SendLocalizedMessage(1072402);     // Your wards have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072403);     // Your target's wards have been removed!
                        }
                        break;

                    case TalismanRemoval.Wildfire:
                        // TODO
                        break;
                    }

                    m_Talisman.OnAfterUse(from);
                }
            }