Esempio n. 1
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);
        }
Esempio n. 2
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();
            }
Esempio n. 3
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();
        }
Esempio n. 4
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);
        }
Esempio n. 5
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();
            }
        }
Esempio n. 6
0
 public BodyTimer(Mobile m, TimeSpan duration, SleepingBody body) : base(duration)
 {
     m_Mobile = m;
     m_Body   = body;
 }
Esempio n. 7
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);
        }
Esempio n. 8
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);
        }
Esempio n. 9
0
 public BodyTimer(Mobile m, TimeSpan duration, SleepingBody body)
     : base(duration)
 {
     m_Mobile = m;
     m_Body = body;
 }
Esempio n. 10
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();
            }
Esempio n. 11
0
        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();
        }