Beispiel #1
0
        public void Target(IPoint3D p)
        {
            if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

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

                Effects.PlaySound(p, Caster.Map, 0x1FF);

                if (p is Mobile)
                {
                    Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101); // That did not need to be unlocked.
                }
                else if (!(p is LockableContainer cont))
                {
                    Caster.SendLocalizedMessage(501666); // You can't unlock that!
                }
                else
                {
                    if (BaseHouse.CheckSecured(cont))
                    {
                        Caster.SendLocalizedMessage(503098); // You cannot cast this on a secure item.
                    }
                    else if (!cont.Locked)
                    {
                        Caster.LocalOverheadMessage(
                            MessageType.Regular,
                            0x3B2,
                            503101
                            ); // That did not need to be unlocked.
                    }
                    else if (cont.LockLevel == 0)
                    {
                        Caster.SendLocalizedMessage(501666); // You can't unlock that!
                    }
                    else
                    {
                        var level = (int)(Caster.Skills.Magery.Value * 0.8) - 4;

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

                            if (cont.LockLevel == -255)
                            {
                                cont.LockLevel = cont.RequiredSkill - 10;
                            }
                        }
Beispiel #2
0
        public void Target(LockableContainer targ)
        {
            if (BaseHouse.CheckSecured(targ))
            {
                // You cannot cast this on a secure item.
                Caster.SendLocalizedMessage(503098);
            }
            else if (CheckSequence())
            {
                Point3D loc = targ.GetWorldLocation();

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

                Effects.PlaySound(loc, targ.Map, Sound);

                if (targ.Locked && targ.LockLevel != 0)
                {
                    double magery = Caster.Skills[SkillName.Magery].Value;
                    int    level  = (int)(magery * 0.8) - 4;

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

                        if (targ.LockLevel == -255)
                        {
                            targ.LockLevel = targ.RequiredSkill - 10;
                        }

                        if (targ.LockLevel == 0)
                        {
                            targ.LockLevel = -1;
                        }
                    }
                    else
                    {
                        // My spell does not seem to have an effect on that lock.
                        Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503099);
                    }
                }
                else
                {
                    // That did not need to be unlocked.
                    Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101);
                }
            }

            FinishSequence();
        }
Beispiel #3
0
        public void CheckEggs_Callback()
        {
            if (!BaseHouse.CheckSecured(this))
            {
                return;
            }

            foreach (Item item in Items)
            {
                if (item is ChickenLizardEgg)
                {
                    ((ChickenLizardEgg)item).CheckStatus();
                }
            }
        }
Beispiel #4
0
        public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight)
        {
            if (!BaseHouse.CheckSecured(this))
            {
                m.SendLocalizedMessage(1113711); //The incubator must be secured for the egg to grow, not locked down.
                return(false);
            }
            if (!(item is ChickenLizardEgg))
            {
                m.SendMessage("This will only accept chicken eggs.");
                return(false);
            }

            if (MaxEggs > -1 && Items.Count >= MaxEggs)
            {
                m.SendMessage("You can only put {0} chicken eggs in the incubator at a time.", MaxEggs.ToString()); //TODO: Get Message
                return(false);
            }

            return(true);
        }
Beispiel #5
0
            protected override void OnTarget(Mobile from, object o)
            {
                var 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((Point3D)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
                    {
                        var cont = (LockableContainer)o;

                        if (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
                        {
                            var level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4;

                            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();
            }
Beispiel #6
0
        public override bool CheckItemUse(Mobile from, Item item)
        {
            Item rootItem = item.RootParent as Item;

            return(m_CanEat && !(BaseHouse.CheckLockedDown(item) || BaseHouse.CheckSecured(rootItem)));
        }