Ejemplo n.º 1
0
                public HeldStuff(PlayerMobile pm)
                {
                    // Init the contents
                    Contents = new ArrayList();

                    // Drop to pack any held items
                    Item held = pm.Holding;

                    if (held != null)
                    {
                        held.ClearBounce();
                        if (pm.Backpack != null)
                        {
                            pm.Backpack.DropItem(held);
                        }
                    }
                    pm.Holding = null;

                    // Populate from PlayerMobile's pack + equipped items
                    ArrayList PackItems = new ArrayList(pm.Items);

                    foreach (Item pi in PackItems)
                    {
                        AddItem(pi);
                    }

                    // Now populated!
                }
Ejemplo n.º 2
0
        public override bool OnMoveOver(Mobile m)
        {
            // prisoners get out free during server wars.
            bool bServerWars = Server.Misc.AutoSave.SavesEnabled == true;

            if (m_Active)
            {
                if (!m.Player)
                {
                    return(true);
                }

                if (m.AccessLevel == AccessLevel.Player)
                {
                    // SavesEnabled(false) means we are in Server Wars and all prisoners go free
                    if (m.ShortTermMurders > 4 && bServerWars == true)
                    {
                        // We don't want people leaving on parole if they've not worked out of stat-loss
                        m.SendMessage("You must have less than 5 short term murder counts to be paroled.");
                        return(true);
                    }

                    if (!m.Alive)
                    {
                        // and we don't want them leaving as a ghost either.
                        m.SendMessage("You must be alive to use this.");
                        return(true);
                    }

                    Item held = m.Holding;
                    if (held != null)
                    {
                        held.ClearBounce();
                        if (m.Backpack != null)
                        {
                            m.Backpack.DropItem(held);
                        }
                    }
                    m.Holding = null;

                    Container backpack = m.Backpack;
                    if (backpack != null)
                    {
                        Item[] lhpasses = backpack.FindItemsByType(typeof(AILHPass), true);
                        if (lhpasses.Length > 0)
                        {
                            for (int i = 0; i < lhpasses.Length; i++)
                            {
                                lhpasses[i].Delete();
                            }
                        }
                    }
                }
                StartTeleport(m);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m_Active)
            {
                if (!m.Player)
                {
                    return(true);
                }

                if (m.AccessLevel == AccessLevel.Player)
                {
                    if (m.ShortTermMurders < 5)
                    {
                        // We want to make sure we're teleporting a PK and not some random blubie.
                        m.SendMessage("You must have at least five short term murder counts to use this.");
                        return(true);
                    }

                    Item held = m.Holding;
                    if (held != null)
                    {
                        held.ClearBounce();
                        if (m.Backpack != null)
                        {
                            m.Backpack.DropItem(held);
                        }
                    }
                    m.Holding = null;

                    // attempt to move items to bank.
                    bool result;
                    result = MoveItemsToBank(m);
                    if (result == false)
                    {
                        m.SendMessage("You carry to many possessions to enter Angel Island at this time.");
                        return(true);
                    }
                    else
                    {
                        m.SendMessage("Your worldly possessions have been placed in your bank for safekeeping.");
                    }
                }

                StartTeleport(m);

                if (!m.Alive)
                {
                    m.CloseGump(typeof(ResurrectGump));
                    m.SendGump(new ResurrectGump(m, ResurrectMessage.Healer));
                }

                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
        public virtual void DoTeleport(Mobile m)
        {
            Server.Point3D location = new Point3D(5750, 350, 5);
            m.MoveToWorld(location, Map.Felucca);

            if (m_DestEffect)
            {
                Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
            }

            if (m_SoundID > 0)
            {
                Effects.PlaySound(m.Location, m.Map, m_SoundID);
            }

            // not sure if this is needed
            Item held = m.Holding;

            if (held != null)
            {
                held.ClearBounce();
                if (m.Backpack != null)
                {
                    m.Backpack.DropItem(held);
                }
            }
            m.Holding = null;

            // okay, delete the lighthouse passes
            Container backpack = m.Backpack;

            if (backpack != null)
            {
                Item[] lhpasses = backpack.FindItemsByType(typeof(AILHPass), true);
                if (lhpasses != null && lhpasses.Length > 0)
                {
                    for (int i = 0; i < lhpasses.Length; i++)
                    {                           // 1 in 5000 chance to keep this puppy
                        if (lhpasses[i] is AILHPass && Utility.Random(5000) != 1)
                        {
                            lhpasses[i].Delete();
                        }
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public virtual void DoTeleport(Mobile m)
        {
            if (m_SourceEffect)
            {
                Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
            }

            Server.Point3D location = new Point3D(5671, 2391, 50);
            m.MoveToWorld(location, Map.Felucca);

            if (m_DestEffect)
            {
                Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);
            }

            if (m_SoundID > 0)
            {
                Effects.PlaySound(m.Location, m.Map, m_SoundID);
            }

            if (m.Player && m.AccessLevel == AccessLevel.Player)
            {
                Item held = m.Holding;
                if (held != null)
                {
                    held.ClearBounce();
                    if (m.Backpack != null)
                    {
                        m.Backpack.DropItem(held);
                    }
                }
                m.Holding = null;

                //set all AIStingers to non-blessed
                Container backpack = m.Backpack;
                if (backpack != null)
                {
                    Item[] stingers = backpack.FindItemsByType(typeof(AIStinger), true);
                    if (stingers.Length > 0)
                    {
                        for (int i = 0; i < stingers.Length; i++)
                        {
                            stingers[i].LootType = LootType.Regular;
                        }
                    }
                }
                Item oneHanded = m.FindItemOnLayer(Layer.OneHanded);
                Item twoHanded = m.FindItemOnLayer(Layer.TwoHanded);
                if (oneHanded is AIStinger)
                {
                    oneHanded.LootType = LootType.Regular;
                }
                if (twoHanded is AIStinger)
                {
                    twoHanded.LootType = LootType.Regular;
                }


                ((PlayerMobile)m).Inmate = false;
                // Adam: The following code prohibits the STC from dropping below 5
                //	as per design.
                int oldSTC = ((PlayerMobile)m).ShortTermMurders;
                int newSTC = ((PlayerMobile)m).ShortTermMurders;

                if (((PlayerMobile)m).ShortTermMurders >= 10)
                {
                    newSTC = ((PlayerMobile)m).ShortTermMurders / 2;
                }
                else if (((PlayerMobile)m).ShortTermMurders > 5)
                {
                    newSTC = 5;
                }

                ((PlayerMobile)m).ShortTermMurders = newSTC;

                if (oldSTC - newSTC > 0)
                {
                    ((PlayerMobile)m).SendMessage("Your short term murders have been reduced to {0}", ((PlayerMobile)m).ShortTermMurders);
                }

                ((PlayerMobile)m).ResetKillTime();
            }
        }
Ejemplo n.º 6
0
        public override bool OnMoveOver(Mobile m)
        {
            bool HasPass = false;

            //ArrayList items = m.Backpack.Items;

            if (m_Active)
            {
                if (!m.Player)
                {
                    return(true);
                }

                if (m.AccessLevel == AccessLevel.Player)
                {
                    if (!m.Alive)
                    {
                        // no ghosts are allowed into the escape route
                        m.SendMessage("You must be alive to use this.");
                        return(true);
                    }

                    /* OLD CODE
                     * ArrayList toDelete = new ArrayList();
                     * foreach ( Item i in items )
                     *      if ( i is AILHPass )
                     *              toDelete.Add(i);
                     *
                     * if ( toDelete.Count > 0 )
                     * {
                     *      HasPass = true;
                     *      for ( int i = toDelete.Count - 1; i >= 0; i-- )
                     *              ((Item)toDelete[i]).Delete();
                     * }
                     */
                    Item held = m.Holding;
                    if (held != null)
                    {
                        held.ClearBounce();
                        if (m.Backpack != null)
                        {
                            m.Backpack.DropItem(held);
                        }
                    }
                    m.Holding = null;

                    Container backpack = m.Backpack;
                    if (backpack != null)
                    {
                        Item[] lhpasses = backpack.FindItemsByType(typeof(AILHPass), true);
                        if (lhpasses.Length > 0)
                        {
                            HasPass = true;
                            for (int i = 0; i < lhpasses.Length; i++)
                            {
                                lhpasses[i].Delete();
                            }
                        }
                    }

                    if (!HasPass)
                    {
                        m.SendMessage("You require a lighthouse pass to go there");
                        return(true);
                    }
                    else
                    {
                        m.SendMessage("Your lighthouse pass disappears as you're teleported");
                    }
                }

                StartTeleport(m);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 7
0
        public static void EmptyPackOnExit(Mobile m, bool DeletePasses, bool KeepStartup)
        {
            Container backpack = m.Backpack;

            if (backpack == null)
            {
                return;
            }

            // put whatever you are holding in you backpack
            // (the 'drag' kind of holding)
            Item held = m.Holding;

            if (held != null)
            {
                held.ClearBounce();
                if (m.Backpack != null)
                {
                    m.Backpack.DropItem(held);
                }
            }
            m.Holding = null;

            // put whatever you are holding in your backpack
            // (actually in your hand kind of holding)
            Item weapon = m.Weapon as Item;

            if (weapon != null && weapon.Parent == m && !(weapon is Fists))
            {
                backpack.DropItem(weapon);
            }

            ArrayList stuff = backpack.FindAllItems();

            if (stuff != null && stuff.Count > 0)
            {
                for (int ix = 0; ix < stuff.Count; ix++)
                {
                    Item item = stuff[ix] as Item;
                    // process items as follows
                    //	delete weapons (except stinger) and reagents
                    //	change stinger to regular loot
                    //	delete reagents
                    //	Oprional delete lighthouse passes - (they were handled on entrance to the escape cave)
                    //	delete spellbook
                    // we don't delete EVERYTHING because we may allow some rares to be found here in the future

                    if (item is BaseWeapon && item is AIStinger == false)
                    {
                        item.Delete();
                    }

                    if (item is AIStinger && KeepStartup == false)
                    {
                        item.LootType = LootType.Regular;
                    }

                    if (item is BaseReagent)
                    {
                        item.Delete();
                    }

                    if (item is AILHPass && DeletePasses)
                    {
                        item.Delete();
                    }

                    if (item is Spellbook && KeepStartup == false)
                    {
                        item.Delete();
                    }
                }
            }

            return;
        }