Exemplo n.º 1
0
        public static void MakeTwin(Mobile m_From)
        {
            List <Item> m_Items = new List <Item>();

            if (CheckMobile(m_From))
            {
                Mobile twin = new NaughtyTwin(m_From);

                if (twin != null && !twin.Deleted)
                {
                    foreach (Item item in m_From.Items)
                    {
                        if (item.Layer != Layer.Backpack && item.Layer != Layer.Mount && item.Layer != Layer.Bank)
                        {
                            m_Items.Add(item);
                        }
                    }

                    if (m_Items.Count > 0)
                    {
                        for (int i = 0; i < m_Items.Count; i++) /* dupe exploits start out like this ... */
                        {
                            Item item = null;

                            try
                            {
                                item = Activator.CreateInstance(m_Items[i].GetType()) as Item;
                            }
                            catch { continue; }

                            if (item != null)
                            {
                                item.Hue      = m_Items[i].Hue;
                                item.Name     = m_Items[i].Name;
                                item.ItemID   = m_Items[i].ItemID;
                                item.LootType = m_Items[i].LootType;

                                twin.AddItem(item);

                                if (item.Layer != Layer.Backpack && item.Layer != Layer.Mount && item.Layer != Layer.Bank)
                                {
                                    item.Movable = false;
                                }
                            }
                        }
                    }

                    twin.Hue       = m_From.Hue;
                    twin.BodyValue = m_From.BodyValue;
                    twin.Kills     = m_From.Kills;

                    Point3D point = RandomPointOneAway(m_From.X, m_From.Y, m_From.Z, m_From.Map);

                    twin.MoveToWorld(m_From.Map.CanSpawnMobile(point) ? point : m_From.Location, m_From.Map);

                    Timer.DelayCall(TimeSpan.FromSeconds(5), new TimerStateCallback <Mobile>(DeleteTwin), twin);
                }
            }
        }
Exemplo n.º 2
0
        public static void MakeTwin(Mobile m_From)
        {
            var m_Items = new List <Item>();

            if (CheckMobile(m_From))
            {
                Mobile twin = new NaughtyTwin(m_From);

                if (twin.Deleted)
                {
                    return;
                }

                foreach (var item in m_From.Items)
                {
                    if (item.Layer != Layer.Backpack && item.Layer != Layer.Mount && item.Layer != Layer.Bank)
                    {
                        m_Items.Add(item);
                    }
                }

                if (m_Items.Count > 0)
                {
                    for (var i = 0; i < m_Items.Count; i++) /* dupe exploits start out like this ... */
                    {
                        twin.AddItem(Mobile.LiftItemDupe(m_Items[i], 1));
                    }

                    foreach (var item in twin.Items) /* ... and end like this */
                    {
                        if (item.Layer != Layer.Backpack && item.Layer != Layer.Mount && item.Layer != Layer.Bank)
                        {
                            item.Movable = false;
                        }
                    }
                }

                twin.Hue       = m_From.Hue;
                twin.BodyValue = m_From.BodyValue;
                twin.Kills     = m_From.Kills;

                var point = RandomPointOneAway(m_From.X, m_From.Y, m_From.Z, m_From.Map);

                twin.MoveToWorld(m_From.Map.CanSpawnMobile(point) ? point : m_From.Location, m_From.Map);

                Timer.DelayCall(TimeSpan.FromSeconds(5), DeleteTwin, twin);
            }
        }
Exemplo n.º 3
0
        public static void MakeTwin(Mobile m_From)
        {
            List<Item> m_Items = new List<Item>();

            if (CheckMobile(m_From))
            {
                Mobile twin = new NaughtyTwin(m_From);

                if (twin != null && !twin.Deleted)
                {
                    foreach (Item item in m_From.Items)
                    {
                        if (item.Layer != Layer.Backpack && item.Layer != Layer.Mount && item.Layer != Layer.Bank)
                        {
                            m_Items.Add(item);
                        }
                    }

                    if (m_Items.Count > 0)
                    {
                        for (int i = 0; i < m_Items.Count; i++) /* dupe exploits start out like this ... */
                        {
                            twin.AddItem(Mobile.LiftItemDupe(m_Items[i], 1));
                        }

                        foreach (Item item in twin.Items) /* ... and end like this */
                        {
                            if (item.Layer != Layer.Backpack && item.Layer != Layer.Mount && item.Layer != Layer.Bank)
                            {
                                item.Movable = false;
                            }
                        }
                    }

                    twin.Hue = m_From.Hue;
                    twin.BodyValue = m_From.BodyValue;
                    twin.Kills = m_From.Kills;

                    Point3D point = RandomPointOneAway(m_From.X, m_From.Y, m_From.Z, m_From.Map);

                    twin.MoveToWorld(m_From.Map.CanSpawnMobile(point) ? point : m_From.Location, m_From.Map);

                    Timer.DelayCall(TimeSpan.FromSeconds(5), new TimerStateCallback<Mobile>(DeleteTwin), twin);
                }
            }
        }