Beispiel #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (TentCheck(from) == false)
            {
                from.SendMessage("You Already own a Tent");
            }
            else
            {

                if (IsChildOf(from.Backpack))
                {
                    if (Validate(from) == true)
                    {
                        TentWalls v = new TentWalls();
                        v.Location = from.Location;
                        v.Map = from.Map;

                        TentRoof w = new TentRoof();
                        w.Location = from.Location;
                        w.Map = from.Map;

                        TentFloor y = new TentFloor();
                        y.Location = from.Location;
                        y.Map = from.Map;

                        TentTrim z = new TentTrim();
                        z.Location = from.Location;
                        z.Map = from.Map;

                        TentVerifier tentverifier = new TentVerifier();
                        from.AddToBackpack(tentverifier);

                        SecureTent chest = new SecureTent((PlayerMobile)from);
                        chest.Location = new Point3D(from.X + 2, from.Y - 1, from.Z);
                        chest.Map = from.Map;

                        TentDestroyer x = new TentDestroyer(v, w, y, z, (PlayerMobile)from, (SecureTent)chest, (TentVerifier)tentverifier);
                        x.Location = new Point3D(from.X + 4, from.Y - 2, from.Z);
                        x.Map = from.Map;

                        from.SendGump(new TentGump(from));
                        this.Delete();
                    }
                    else
                    {
                        from.SendMessage("You cannot errect your Tent in this area.");
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                }
            }
        }
Beispiel #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (TentCheck(from) == false)
            {
                from.SendMessage("You already have the max number of tents placed.");
            }
            else
            {
                if (IsChildOf(from.Backpack))
                {
                    if (Validate(from) == true)
                    {
                        TentWalls v = new TentWalls();
                        v.Location = from.Location;
                        v.Map      = from.Map;

                        TentRoof w = new TentRoof();
                        w.Location = from.Location;
                        w.Map      = from.Map;

                        TentFloor y = new TentFloor();
                        y.Location = from.Location;
                        y.Map      = from.Map;

                        TentTrim z = new TentTrim();
                        z.Location = from.Location;
                        z.Map      = from.Map;

                        //		TentVerifier tentverifier = new TentVerifier();
                        //		from.AddToBackpack (tentverifier);

                        SecureTent chest = new SecureTent((PlayerMobile)from);
                        chest.Location = new Point3D(from.X - 1, from.Y - 1, from.Z);
                        chest.Map      = from.Map;

                        TentDestroyer x = new TentDestroyer(v, w, y, z, (PlayerMobile)from, (SecureTent)chest); // ,(TentVerifier) tentverifier);
                        x.Location = new Point3D(from.X - 1, from.Y, from.Z);                                   // was x, y+1, z
                        x.Map      = from.Map;

                        from.SendGump(new TentGump(from));
                        this.Delete();
                    }
                    else
                    {
                        from.SendMessage("You cannot place your tent in this area.");
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001);                       // That must be in your pack for you to use it.
                }
            }
        }
Beispiel #3
0
 public TentDGump(TentDestroyer tentdestroyer, Mobile owner)
     : base(150, 75)
 {
     m_TentDestroyer = tentdestroyer;
     owner.CloseGump(typeof(TentDGump));
     this.Closable = false;
     this.Disposable = false;
     this.Dragable = true;
     this.Resizable = false;
     this.AddPage(0);
     this.AddBackground(0, 0, 445, 250, 9200);
     this.AddBackground(10, 10, 425, 160, 3500);
     this.AddLabel(95, 30, 195, @"* Do you want to RePack your Tent? *");
     this.AddLabel(107, 205, 172, @"RePack");
     this.AddLabel(270, 205, 32, @"Don't RePack");
     AddButton(115, 180, 4023, 4024, 1, GumpButtonType.Reply, 0);
     AddButton(295, 180, 4017, 4018, 0, GumpButtonType.Reply, 0);
 }
Beispiel #4
0
 public TentDGump(TentDestroyer tentdestroyer, Mobile owner)
     : base(150, 75)
 {
     m_TentDestroyer = tentdestroyer;
     owner.CloseGump(typeof(TentDGump));
     this.Closable = false;
     this.Disposable = false;
     this.Dragable = true;
     this.Resizable = false;
     this.AddPage(0);
     this.AddBackground(0, 0, 445, 250, 9200);
     this.AddBackground(10, 10, 425, 160, 3500);
     this.AddLabel(95, 30, 195, @"* Do you want to RePack your Tent? *");
     this.AddLabel(60, 70, 1359, @"I hope you took heed of my warning, and removed any");
     this.AddLabel(60, 90, 1359, @"items from your Secure Backpack before RePacking");
     this.AddLabel(60, 110, 1359, @"your tent.");
     this.AddLabel(107, 205, 172, @"RePack");
     this.AddLabel(270, 205, 32, @"Don't RePack");
     AddButton(115, 180, 4023, 4024, 1, GumpButtonType.Reply, 0);
     AddButton(295, 180, 4017, 4018, 0, GumpButtonType.Reply, 0);
 }
Beispiel #5
0
        public bool TentCheck(Mobile from)
        {
            PlayerMobile pm = (PlayerMobile)from;

            if (pm == null)
            {
                return(false);
            }

            int count = 0;

            foreach (Item verifier in World.Items.Values)             // from.Backpack.Items)
            {
                if (verifier != null && verifier is TentDestroyer)    // TentVerifier)
                {
                    TentDestroyer td = (TentDestroyer)verifier;

                    if (td == null)
                    {
                        continue;
                    }

                    if (td.Player == pm)
                    {
                        count = count + 1;
                    }
                }
            }

            if (count < 1)               //change this if you want players to own more than 1,2,3 etc.
            {
                return(true);
            }

            return(false);
        }
Beispiel #6
0
 public AutoDeleteTimer(TentDestroyer t)
     : base(TimeSpan.FromDays(1))
 {
     tent = t;
 }
Beispiel #7
0
 public AutoDeleteTimer(TentDestroyer t)
     : base(TimeSpan.FromDays(1))
 {
     tent = t;
 }