Beispiel #1
0
            public void ApplySleepTo(Mobile m)
            {
                m.Hidden    = true;
                m.Frozen    = true;
                m.Squelched = true;

                SleepingBody body = new SleepingBody(m, m.Blessed);

                body.Map      = m.Map;
                body.Location = m.Location;
                m_Body        = body;
                m.Z          -= 100;


                m.SendMessage("You fall asleep");

                RemoveTimer(m);

                TimeSpan duration = TimeSpan.FromSeconds(m_Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery

                Timer t = new BodyTimer(m, duration, m_Body);

                m_Table[m] = t;

                t.Start();
            }
Beispiel #2
0
        public void Target(SleepingBody slumber)
        {
            if (!Caster.CanSee(slumber))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }

            else if (CheckSequence())
            {
                if (slumber != null)
                {
                    if (slumber.Owner != null)
                    {
                        slumber.Owner.RevealingAction();
                        slumber.Owner.Frozen    = false;
                        slumber.Owner.Squelched = false;
                        slumber.Owner.Map       = slumber.Map;
                        slumber.Owner.Location  = slumber.Location;
                        slumber.Owner.Animate(21, 6, 1, false, false, 0);;


                        slumber.Delete();
                        slumber.Owner.SendMessage("You wake up!");
                        Caster.SendMessage("You awaken them!");
                    }
                    else
                    {
                        Caster.SendMessage("They are beyond your power to awaken...");
                    }
                }
            }

            FinishSequence();
        }
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);


                ArrayList targets = new ArrayList();
                if (this.Scroll != null)
                {
                    Scroll.Consume();
                }
                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetItemsInRange(new Point3D(p), 3);

                    foreach (Item m in eable)
                    {
                        if (Caster.CanSee(m) && m is SleepingBody)
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                for (int i = 0; i < targets.Count; ++i)
                {
                    SleepingBody m = (SleepingBody)targets[i];


                    if (m != null)
                    {
                        m.Owner.RevealingAction();
                        m.Owner.Frozen    = false;
                        m.Owner.Squelched = false;
                        m.Owner.Map       = m.Map;
                        m.Owner.Location  = m.Location;
                        m.Owner.Animate(21, 6, 1, false, false, 0);

                        m.Owner.SendMessage("You wake up!");

                        m.Delete();
                    }
                    Caster.SendMessage("You awaken them!");
                }
            }

            FinishSequence();
        }
Beispiel #4
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else
            {
                SpellHelper.Turn(Caster, m);
                if (this.Scroll != null)
                {
                    Scroll.Consume();
                }
                Effects.SendLocationParticles(EffectItem.Create(new Point3D(m.X, m.Y, m.Z + 16), Caster.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045);
                m.PlaySound(0x3C4);

                m.Hidden    = true;
                m.Frozen    = true;
                m.Squelched = true;

                ArrayList sleepequip = new ArrayList();

                Item hat = m.FindItemOnLayer(Layer.Helm);
                if (hat != null)
                {
                    sleepequip.Add(hat);
                }
                SleepingBody body = new SleepingBody(m, false);
                body.Map      = m.Map;
                body.Location = m.Location;
                m_Body        = body;
                m.Z          -= 100;

                m.SendMessage("You fall asleep");

                RemoveTimer(m);

                TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery

                Timer t = new InternalTimer(m, duration, m_Body);

                m_Table[m] = t;

                t.Start();
            }
        }
Beispiel #5
0
        public SleepingBodyEquip(Mobile beholder, SleepingBody beheld)
            : base(0x89)
        {
            ArrayList list = beheld.EquipItems;

            EnsureCapacity(8 + (list.Count * 5));

            m_Stream.Write((int)beheld.Serial);

            for (int i = 0; i < list.Count; ++i)
            {
                Item item = (Item)list[i];

                if (!item.Deleted && beholder.CanSee(item) && item.Parent == beheld)
                {
                    m_Stream.Write((byte)(item.Layer + 1));
                    m_Stream.Write((int)item.Serial);
                }
            }

            m_Stream.Write((byte)Layer.Invalid);
        }
Beispiel #6
0
        public SleepingBodyContent(Mobile beholder, SleepingBody beheld)
            : base(0x3C)
        {
            ArrayList items = beheld.EquipItems;
            int       count = items.Count;

            EnsureCapacity(5 + (count * 19));

            long pos = m_Stream.Position;

            int written = 0;

            m_Stream.Write((ushort)0);

            for (int i = 0; i < count; ++i)
            {
                Item child = (Item)items[i];

                if (!child.Deleted && child.Parent == beheld && beholder.CanSee(child))
                {
                    m_Stream.Write((int)child.Serial);
                    m_Stream.Write((ushort)child.ItemID);
                    m_Stream.Write((byte)0); // signed, itemID offset
                    m_Stream.Write((ushort)child.Amount);
                    m_Stream.Write((short)child.X);
                    m_Stream.Write((short)child.Y);
                    m_Stream.Write((int)beheld.Serial);
                    m_Stream.Write((ushort)child.Hue);

                    ++written;
                }
            }

            m_Stream.Seek(pos, SeekOrigin.Begin);
            m_Stream.Write((ushort)written);
        }
Beispiel #7
0
 public BodyTimer(Mobile m, TimeSpan duration, SleepingBody body)
     : base(duration)
 {
     m_Mobile = m;
     m_Body   = body;
 }
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckSequence())
            {
                if (this.Scroll != null)
                {
                    Scroll.Consume();
                }
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);

                    foreach (Mobile m in eable)
                    {
                        if (m != Caster && m.AccessLevel <= Caster.AccessLevel)
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                if (targets.Count > 0)
                {
                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        Effects.SendLocationParticles(EffectItem.Create(new Point3D(m.X, m.Y, m.Z + 16), Caster.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045);
                        m.PlaySound(0x3C4);

                        m.Hidden    = true;
                        m.Frozen    = true;
                        m.Squelched = true;

                        SleepingBody body = new SleepingBody(m, m.Blessed);
                        body.Map      = m.Map;
                        body.Location = m.Location;
                        m_Body        = body;
                        m.Z          -= 100;

                        m.SendMessage("You fall asleep");

                        RemoveTimer(m);

                        TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery

                        Timer t = new InternalTimer(m, duration, m_Body);

                        m_Table[m] = t;

                        t.Start();
                    }
                }
            }

            FinishSequence();
        }