Example #1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            Point3D fireLoc = new Point3D(from.X + 5, from.Y + 2, from.Z);

            bool deconstruct = info.IsSwitched(2);
            bool logout      = info.IsSwitched(3);

            if (deconstruct)
            {
                m_Bedroll.Delete();

                from.AddToBackpack(new TravelTent());

                Campfire fire = new Campfire();
                fire.Status = CampfireStatus.Off;
                fire.MoveToWorld(fireLoc, from.Map);
            }

            if (logout)
            {
                m_Bedroll.Delete();

                if (from.Backpack != null && from.Backpack.GetAmount(typeof(TentValidator)) > 0)
                {
                    from.Backpack.ConsumeTotal(typeof(TentValidator), 1);
                }

                from.AddToBackpack(new TravelTent());

                Campfire fire = new Campfire();
                fire.Status = CampfireStatus.Off;
                fire.MoveToWorld(fireLoc, from.Map);

                ((PlayerMobile)from).BedrollLogout = true;
                state.Dispose();
            }

            switch (info.ButtonID)
            {
            default:
            case 0:
            {
                from.CloseGump(typeof(TentManagementGump));
                break;
            }
            }
        }
Example #2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            switch (info.ButtonID)
            {
            default:
            case 0:
            {
                from.CloseGump(typeof(ConfirmTentPlacementGump));

                if (m_Tent != null)
                {
                    m_Tent.Delete();
                }
                if (m_Flap != null)
                {
                    m_Flap.Delete();
                }
                if (m_Bedroll != null)
                {
                    m_Bedroll.Delete();
                }
                if (m_Chest != null)
                {
                    m_Chest.Delete();
                }

                m_Owner.AddToBackpack(new TravelTent());

                break;
            }

            case 1:
            {
                from.CloseGump(typeof(ConfirmTentPlacementGump));

                m_Region = new TravelTentRegion(m_Owner, m_Chest, m_Owner.Map, m_RegionBounds, m_Owner.Z);
                m_Region.Register();

                m_Owner.AddToBackpack(new TentValidator(m_Owner, m_Tent, m_Bedroll, m_Chest, m_Region, m_RegionBounds));

                break;
            }
            }
        }