Ejemplo n.º 1
0
 protected override void OnTargetFinish(Mobile from)
 {
     m_Owner.FinishSequence();
 }
Ejemplo n.º 2
0
            protected override void OnTarget(Mobile from, object o)
            {
                IPoint3D loc = o as IPoint3D;

                if (loc == null)
                {
                    return;
                }

                if (m_Owner.CheckSequence())
                {
                    SpellHelper.Turn(from, o);

                    Effects.SendLocationParticles(EffectItem.Create(new Point3D(loc), from.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5024);

                    Effects.PlaySound(loc, from.Map, 0x1FF);

                    if (o is Mobile)
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101);                           // That did not need to be unlocked.
                    }
                    else if (!(o is LockableContainer))
                    {
                        from.SendLocalizedMessage(501666);                           // You can't unlock that!
                    }
                    else
                    {
                        LockableContainer cont = (LockableContainer)o;

                        if (Multis.BaseHouse.CheckSecured(cont))
                        {
                            from.SendLocalizedMessage(503098);                               // You cannot cast this on a secure item.
                        }
                        else if (!cont.Locked)
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101);                               // That did not need to be unlocked.
                        }
                        else if (cont.LockLevel == 0)
                        {
                            from.SendLocalizedMessage(501666);                               // You can't unlock that!
                        }
                        else
                        {
                            int level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4;
                            level += (int)(from.Skills[SkillName.EvalInt].Value * 0.2);

                            if (level >= cont.RequiredSkill && !(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2))
                            {
                                cont.Locked = false;

                                if (cont.LockLevel == -255)
                                {
                                    cont.LockLevel = cont.RequiredSkill - 10;
                                }
                            }
                            else
                            {
                                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503099);                                   // My spell does not seem to have an effect on that lock.
                            }
                        }
                    }
                }

                m_Owner.FinishSequence();
            }
Ejemplo n.º 3
0
            protected override void OnTarget(Mobile from, object o)
            {
                IPoint3D loc = o as IPoint3D;

                if (loc == null)
                {
                    return;
                }

                if (m_Owner.CheckSequence())
                {
                    SpellHelper.Turn(from, o);

                    Effects.SendLocationParticles(EffectItem.Create(new Point3D(loc), from.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(from, 0), 0, 5024, 0);

                    Effects.PlaySound(loc, from.Map, 0x1FF);

                    if (o is Mobile)
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101); // That did not need to be unlocked.
                    }
                    else if (o is BaseHouseDoor)                                       // house door check
                    {
                        from.SendMessage("This spell is to unlock certain containers and other types of doors.");
                    }
                    else if (o is BookBox)                        // cursed box of books
                    {
                        from.SendMessage("This spell can never unlock this cursed box.");
                    }
                    else if (o is UnidentifiedArtifact || o is UnidentifiedItem || o is CurseItem)
                    {
                        from.SendMessage("This spell is used to unlock any container.");
                    }
                    else if (o is BaseDoor)
                    {
                        if (Server.Items.DoorType.IsDungeonDoor((BaseDoor)o))
                        {
                            if (((BaseDoor)o).Locked == false)
                            {
                                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101);                                   // That did not need to be unlocked.
                            }
                            else
                            {
                                ((BaseDoor)o).Locked = false;
                                Server.Items.DoorType.UnlockDoors((BaseDoor)o);
                            }
                        }
                        else
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101);                               // That did not need to be unlocked.
                        }
                    }
                    else if (!(o is LockableContainer))
                    {
                        from.SendLocalizedMessage(501666);                           // You can't unlock that!
                    }
                    else
                    {
                        LockableContainer cont = (LockableContainer)o;

                        if (Multis.BaseHouse.CheckSecured(cont))
                        {
                            from.SendLocalizedMessage(503098);                               // You cannot cast this on a secure item.
                        }
                        else if (!cont.Locked)
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101);                               // That did not need to be unlocked.
                        }
                        else if (cont.LockLevel == 0)
                        {
                            from.SendLocalizedMessage(501666);                               // You can't unlock that!
                        }
                        else if (this is TreasureMapChest)
                        {
                            from.SendMessage("A magical aura on this long lost treasure seems to negate your spell.");
                        }
                        else if (this is ParagonChest)
                        {
                            from.SendMessage("A magical aura on this long lost treasure seems to negate your spell.");
                        }
                        else if (this is PirateChest)
                        {
                            from.SendMessage("This seems to be protected from magic, but maybe a thief can get it open.");
                        }
                        else
                        {
                            int level = (int)(from.Skills[SkillName.Magery].Value) + 20;                             // WIZARD CHANGED FOR WANDS AND SUCH

                            if (level > 50)
                            {
                                level = 50;
                            }                                                            // WIZARD ADDED FOR A MAXIMUM SO THIEF IS SPECIAL

                            if (level >= cont.RequiredSkill && !(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2))
                            {
                                cont.Locked = false;

                                if (cont.LockLevel == -255)
                                {
                                    cont.LockLevel = cont.RequiredSkill - 10;
                                }
                            }
                            else
                            {
                                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503099);                                   // My spell does not seem to have an effect on that lock.
                            }
                        }
                    }
                }

                m_Owner.FinishSequence();
            }
Ejemplo n.º 4
0
            protected override void OnTarget(Mobile from, object o)
            {
                IEntity entity = o as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, m_Owner))
                {
                    return;
                }
                IPoint3D loc = o as IPoint3D;

                if (loc == null)
                {
                    return;
                }

                if (m_Owner.CheckSequence())
                {
                    SpellHelper.Turn(from, o);

                    if (o is Mobile)
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101);                           // That did not need to be unlocked.
                    }
                    else if (!(o is LockableContainer))
                    {
                        from.SendLocalizedMessage(501666);                           // You can't unlock that!
                    }
                    else
                    {
                        LockableContainer cont = (LockableContainer)o;

                        if (Multis.BaseHouse.CheckSecured(cont))
                        {
                            from.SendLocalizedMessage(503098);                               // You cannot cast this on a secure item.
                        }
                        else if (!cont.Locked)
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101);                               // That did not need to be unlocked.
                        }
                        else if (cont.LockLevel == 0)
                        {
                            from.SendLocalizedMessage(501666);                               // You can't unlock that!
                        }
                        else
                        {
                            Effects.SendLocationParticles(EffectItem.Create(new Point3D(loc), from.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5024);
                            Effects.PlaySound(loc, from.Map, 0x1FF);

                            int level = (int)(from.Skills[SkillName.Magery].Value * 0.55) - 4;                             // Note from Alan: I see why somebody changed this from below, so you can't magic unlock a GM tinker chest
                            // but it is also preventing you from picking that lock which is pretty silly
                            //int level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4; // <-- this is RunUO default

                            if (cont.LockLevel == -255) // it is magic locked so always succeed at unlocking
                            {
                                cont.Locked    = false;
                                cont.LockLevel = cont.RequiredSkill - 10;
                            }
                            else if (level >= cont.RequiredSkill && !(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2))   // this is basically a magery skill vs lock level check
                            {
                                cont.Locked = false;
                            }
                            else
                            {
                                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503099);                                   // My spell does not seem to have an effect on that lock.
                            }
                        }
                    }

                    m_Owner.FinishSequence();
                }
            }