예제 #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                Point3D p           = from.Location;
                bool    validtarget = false;

                if (targeted is StaticTarget)
                {
                    p           = new Point3D((IPoint3D)targeted);
                    validtarget = true;
                }
                else if (targeted is Item)
                {
                    p           = new Point3D(((Item)targeted).Location);
                    validtarget = true;
                }
                if (validtarget)
                {
                    BaseHouse house = BaseHouse.FindHouseAt(p, from.Map, p.Z);
                    // Must be owner or co-owner, and requires 1 vendor slot and 125 lockdowns
                    if (house != null && house.Owner == from && house.CanPlaceNewVendor() && house.CheckAosStorage(125))
                    {
                        Steward m =
                            (Steward)Activator.CreateInstance(typeof(Steward), new object[] { from });
                        m.MoveToWorld(p, from.Map);
                        m.Direction = Direction.South;
                        mDeed.Delete();
                    }
                    else
                    {
                        from.SendMessage(
                            "You must place this in a house to which you are an owner or co-owner, and have 1 free vendor slot and 125 available lockdowns.");
                    }
                }
            }
예제 #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                from.SendLocalizedMessage(503248);            // Your godly powers allow you to place this vendor whereever you wish.

                Mobile v = new AProvisioner();                //( from, BaseHouse.FindHouseAt( from ) );

                v.Direction = from.Direction & Direction.Mask;
                v.MoveToWorld(from.Location, from.Map);

                this.Delete();
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house == null)
                {
                    from.SendLocalizedMessage(503240);                       // Vendors can only be placed in houses.
                }
                else if (BaseHouse.NewVendorSystem && !house.IsOwner(from))
                {
                    from.SendLocalizedMessage(1062423);                       // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
                }
                else if (!house.Public || !house.CanPlaceNewVendor())
                {
                    from.SendLocalizedMessage(503241);                       // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
                }
                else
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor(from.Location, from.Map, out vendor, out contract);

                    if (vendor)
                    {
                        from.SendLocalizedMessage(1062677);                           // You cannot place a vendor or barkeep at this location.
                    }
                    else if (contract)
                    {
                        from.SendLocalizedMessage(1062678);                           // You cannot place a vendor or barkeep on top of a rental contract!
                    }
                    else
                    {
                        Mobile v = new AProvisioner();                        //( from, house );

                        v.Direction = from.Direction & Direction.Mask;
                        v.MoveToWorld(from.Location, from.Map);

                        //v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

                        this.Delete();
                    }
                }
            }
        }
예제 #3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house == null)
                {
                    from.SendLocalizedMessage(503240);                      //Vendors can only be placed in houses.
                }
                else if (!house.IsFriend(from) && (from.AccessLevel < AccessLevel.GameMaster))
                {
                    from.SendLocalizedMessage(503242);                       //You must ask the owner of this house to make you a friend in order to place this vendor here,
                }
                else if (!house.CanPlaceNewVendor())
                {
                    from.SendLocalizedMessage(503241);                       // You cannot place this vendor or barkeep.  Make sure the house is public or a shop and has sufficient storage available.
                }
                else
                {
                    Mobile v = new HouseSitter(from);
                    v.Direction = from.Direction & Direction.Mask;
                    v.MoveToWorld(from.Location, from.Map);

                    ((HouseSitter)v).SendStatusTo(from);

                    this.Delete();
                }
            }
        }
예제 #4
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Offeree != null)
            {
                from.SendLocalizedMessage(1062343);                   // That item is currently in use.
            }
            else if (!IsLockedDown)
            {
                if (!IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1062334);                       // This item must be in your backpack to be used.
                    return;
                }

                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house == null || !house.IsOwner(from))
                {
                    from.SendLocalizedMessage(1062333);                       // You must be standing inside of a house that you own to make use of this contract.
                }

                /*else if ( !house.IsAosRules )
                 * {
                 *      from.SendMessage( "Rental contracts can only be placed in AOS-enabled houses." );
                 * }*/
                else if (!house.Public)
                {
                    from.SendLocalizedMessage(1062335);                       // Rental contracts can only be placed in public houses.
                }
                else if (!house.CanPlaceNewVendor())
                {
                    from.SendLocalizedMessage(1062352);                       // You do not have enought storage available to place this contract.
                }
                else
                {
                    from.SendLocalizedMessage(1062337);                       // Target the exact location you wish to rent out.
                    from.Target = new RentTarget(this);
                }
            }
            else if (IsLandlord(from))
            {
                if (from.InRange(this, 5))
                {
                    from.CloseGump(typeof(VendorRentalContractGump));
                    from.SendGump(new VendorRentalContractGump(this, from));
                }
                else
                {
                    from.SendLocalizedMessage(501853);                       // Target is too far away.
                }
            }
        }
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!m_Contract.IsUsableBy(from, false, true, true, true))
                {
                    return;
                }

                IPoint3D location = targeted as IPoint3D;

                if (location == null)
                {
                    return;
                }

                Point3D pLocation = new Point3D(location);
                Map     map       = from.Map;

                BaseHouse house = BaseHouse.FindHouseAt(pLocation, map, 0);

                if (house == null || !house.IsOwner(from))
                {
                    from.SendLocalizedMessage(1062338);                       // The location being rented out must be inside of your house.
                }
                else if (BaseHouse.FindHouseAt(from) != house)
                {
                    from.SendLocalizedMessage(1062339);                       // You must be located inside of the house in which you are trying to place the contract.
                }
                else if (!house.IsAosRules)
                {
                    from.SendMessage("Rental contracts can only be placed in AOS-enabled houses.");
                }
                else if (!house.Public)
                {
                    from.SendLocalizedMessage(1062335);                       // Rental contracts can only be placed in public houses.
                }
                else if (house.DecayType == DecayType.Condemned)
                {
                    from.SendLocalizedMessage(1062468);                       // You cannot place a contract in a condemned house.
                }
                else if (!house.CanPlaceNewVendor())
                {
                    from.SendLocalizedMessage(1062352);                       // You do not have enought storage available to place this contract.
                }
                else if (!map.CanFit(pLocation, 16, false, false))
                {
                    from.SendLocalizedMessage(1062486);                       // A vendor cannot exist at that location.  Please try again.
                }
                else
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor(pLocation, map, out vendor, out contract);

                    if (vendor)
                    {
                        from.SendLocalizedMessage(1062342);                           // You may not place a rental contract at this location while other beings occupy it.
                    }
                    else if (contract)
                    {
                        from.SendLocalizedMessage(1062341);                           // That location is cluttered.  Please clear out any objects there and try again.
                    }
                    else
                    {
                        m_Contract.MoveToWorld(pLocation, map);

                        if (!house.LockDown(from, m_Contract))
                        {
                            from.AddToBackpack(m_Contract);
                        }
                    }
                }
            }
예제 #6
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage("That must be in your pack for you to use it.");
            }
            else if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                from.SendAsciiMessage("Your godly powers allow you to place this vendor whereever you wish.");

                Mobile v = new PlayerVendor(from, BaseHouse.FindHouseAt(from));

                v.Direction = from.Direction & Direction.Mask;
                v.MoveToWorld(from.Location, from.Map);

                v.SayTo(from, 503246);                   // Ah! it feels good to be working again.

                this.Delete();
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house == null)
                {
                    from.SendAsciiMessage("Vendors can only be placed in houses.");
                }
                else if (!BaseHouse.NewVendorSystem && !house.IsFriend(from))
                {
                    from.SendAsciiMessage("You must ask the owner of this building to name you a friend of the household in order to place a vendor here.");
                }
                else if (BaseHouse.NewVendorSystem && !house.IsOwner(from))
                {
                    from.SendAsciiMessage("Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.");
                }
                else if (!house.Public || !house.CanPlaceNewVendor())
                {
                    from.SendAsciiMessage("You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.");
                }
                else
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor(from.Location, from.Map, out vendor, out contract);

                    if (vendor)
                    {
                        from.SendAsciiMessage("You cannot place a vendor or barkeep at this location.");
                    }
                    else if (contract)
                    {
                        from.SendAsciiMessage("You cannot place a vendor or barkeep on top of a rental contract!");
                    }
                    else
                    {
                        Mobile v = new PlayerVendor(from, house);

                        v.Direction = from.Direction & Direction.Mask;
                        v.MoveToWorld(from.Location, from.Map);

                        v.SayTo(from, 503246);                           // Ah! it feels good to be working again.

                        this.Delete();
                    }
                }
            }
        }
예제 #7
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                from.SendLocalizedMessage(503248);                   // Your godly powers allow you to place this vendor whereever you wish.

                CraftRequestVendor v = new CraftRequestVendor();

                v.Direction = from.Direction & Direction.Mask;
                v.MoveToWorld(from.Location, from.Map);
                v.Owner = from;

                v.Say("I am ready to take your orders!");

                this.Delete();
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house == null)
                {
                    from.SendLocalizedMessage(503240);                       // Vendors can only be placed in houses.
                }
                else if (!BaseHouse.NewVendorSystem && !house.IsFriend(from))
                {
                    from.SendLocalizedMessage(503242);                       // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
                }
                else if (BaseHouse.NewVendorSystem && !house.IsOwner(from))
                {
                    from.SendLocalizedMessage(1062423);                       // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
                }
                else if (!house.Public || !house.CanPlaceNewVendor())
                {
                    from.SendLocalizedMessage(503241);                       // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
                }
                else
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor(from.Location, from.Map, out vendor, out contract);

                    if (vendor)
                    {
                        from.SendLocalizedMessage(1062677);                           // You cannot place a vendor or barkeep at this location.
                    }
                    else if (contract)
                    {
                        from.SendLocalizedMessage(1062678);                           // You cannot place a vendor or barkeep on top of a rental contract!
                    }
                    else
                    {
                        CraftRequestVendor v = new CraftRequestVendor();

                        v.Direction = from.Direction & Direction.Mask;
                        v.MoveToWorld(from.Location, from.Map);
                        v.Owner = from;

                        v.Say("I am ready to take your orders!");

                        this.Delete();
                    }
                }
            }
        }
예제 #8
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                from.SendLocalizedMessage(503248);                   // Your godly powers allow you to place this vendor whereever you wish.

                Mobile v = new PlayerVendor(from, BaseHouse.FindHouseAt(from));

                v.Direction = from.Direction & Direction.Mask;
                v.MoveToWorld(from.Location, from.Map);

                v.SayTo(from, 503246);                   // Ah! it feels good to be working again.

                Delete();
            }
            else
            {
                bool         canplace = false;
                BaseHouse    house    = BaseHouse.FindHouseAt(from);
                CustomRegion cR;

                if ((cR = from.Region as CustomRegion) != null && !cR.Controller.CanPlaceVendors)
                {
                    if (house == null)
                    {
                        from.SendAsciiMessage("Vendors can only be placed in houses or specified areas.");
                    }
                    else
                    {
                        from.SendAsciiMessage("You cannot place a vendor in this region");
                    }
                }
                else if ((cR = from.Region as CustomRegion) != null && cR.Controller.CanPlaceVendors)
                {
                    canplace = true;

                    try
                    {
                        foreach (Mobile mob in cR.GetMobiles())
                        {
                            if (mob is PlayerVendor && (mob as PlayerVendor).Owner.Account == from.Account)
                            {
                                from.SendAsciiMessage("You alread have a vendor placed in this region.");
                                canplace = false;
                                return;
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.ToString());
                    }
                }
                else if (house == null)
                {
                    from.SendAsciiMessage("Vendors can only be placed in houses or specified areas.");
                }
                else if (!BaseHouse.NewVendorSystem && !house.IsFriend(from))
                {
                    from.SendLocalizedMessage(503242);                       // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
                }
                else if (BaseHouse.NewVendorSystem && !house.IsOwner(from))
                {
                    from.SendLocalizedMessage(1062423);                       // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
                }
                else if (!house.Public || !house.CanPlaceNewVendor())
                {
                    from.SendLocalizedMessage(503241);                       // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
                }
                else
                {
                    canplace = true;
                }

                if (canplace)
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor(from.Location, from.Map, out vendor, out contract);

                    if (vendor)
                    {
                        from.SendLocalizedMessage(1062677);                           // You cannot place a vendor or barkeep at this location.
                    }
                    else if (contract)
                    {
                        from.SendLocalizedMessage(1062678);                           // You cannot place a vendor or barkeep on top of a rental contract!
                    }
                    else
                    {
                        Mobile v = new PlayerVendor(from, house);

                        v.Direction = from.Direction & Direction.Mask;
                        v.MoveToWorld(from.Location, from.Map);

                        v.SayTo(from, 503246);                           // Ah! it feels good to be working again.

                        Delete();
                    }
                }
            }
        }
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("O item precisa estar na sua bag");                   // That must be in your pack for you to use it.
            }
            else if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                from.SendMessage("Voce e GM e pode colocar o vendedor onde quiser."); // Your godly powers allow you to place this vendor whereever you wish.

                Mobile v = new PlayerVendor(from, BaseHouse.FindHouseAt(from));

                v.Direction = from.Direction & Direction.Mask;
                v.MoveToWorld(from.Location, from.Map);

                v.SayTo(from, "Ah! Como e bom voltar ao trabalho...");                   // Ah! it feels good to be working again.

                this.Delete();
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house == null)
                {
                    from.SendMessage("Vendedores so podem ser colocados dentro de casa"); // Vendors can only be placed in houses.
                }
                else if (!BaseHouse.NewVendorSystem && !house.IsFriend(from))
                {
                    from.SendMessage("Apenas o dono, sócios e amigos podem colocar vendedores nesta casa"); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
                }
                else if (BaseHouse.NewVendorSystem && !house.IsOwner(from))
                {
                    from.SendMessage("Apenas o dono pode colocar vendedores diretamente."); // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
                }
                else if (!house.Public || !house.CanPlaceNewVendor())
                {
                    from.SendMessage("Voce nao pode colocar este vendedor aqui. Verifique se a casa e publica e tem espaco suficiente."); // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
                }
                else
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor(from.Location, from.Map, out vendor, out contract);

                    if (vendor)
                    {
                        from.SendMessage("Voce nao pode colocar um vendedor aqui"); // You cannot place a vendor or barkeep at this location.
                    }
                    else if (contract)
                    {
                        from.SendMessage("Voce nao pode colocar este vendedor aqui, verifique o contrato."); // You cannot place a vendor or barkeep on top of a rental contract!
                    }
                    else
                    {
                        Mobile v = new PlayerVendor(from, house);

                        v.Direction = from.Direction & Direction.Mask;
                        v.MoveToWorld(from.Location, from.Map);

                        v.SayTo(from, "Ah! Como e bom voltar ao trabalho...");                          // Ah! it feels good to be working again.

                        this.Delete();
                    }
                }
            }
        }
예제 #10
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                from.SendLocalizedMessage(503248);                  //Your godly powers allow you to place this vendor whereever you wish.

                Mobile v = new PlayerVendor(from, BaseHouse.FindHouseAt(from));
                v.Direction = from.Direction & Direction.Mask;
                v.MoveToWorld(from.Location, from.Map);

                v.SayTo(from, 503246);                   // Ah! it feels good to be working again.

                this.Delete();
            }
            else
            {
                //find the house there at
                BaseHouse house = BaseHouse.FindHouseAt(from);

                // wea: allow placement within tents
                if (house == null)
                {
                    if (from.Region != null)
                    {
                        // is there a tent belonging to the person's account here though?
                        if (from.Region is HouseRegion)
                        {
                            HouseRegion hr = (HouseRegion)from.Region;

                            if ((hr.House is Tent || hr.House is SiegeTent) && hr.House.Owner.Account == from.Account)
                            {
                                house = ((HouseRegion)from.Region).House;
                            }
                        }
                    }
                }

                if (house == null)
                {
                    from.SendLocalizedMessage(503240);                      //Vendors can only be placed in houses.
                }
                else if (!house.IsFriend(from))
                {
                    from.SendLocalizedMessage(503242);                       //You must ask the owner of this house to make you a friend in order to place this vendor here,
                }
                else if (!house.Public)
                {
                    from.SendLocalizedMessage(503241);                      //You cannot place this vendor.  Make sure the building is public and you have not reached your vendor limit.
                }
                else if (!house.CanPlaceNewVendor())
                {
                    from.SendLocalizedMessage(503241);                       // You cannot place this vendor or barkeep.  Make sure the house is public or a shop and has sufficient storage available.
                }
                //else if (house.FindTownshipNPC() != null)
                else if (house.CanPlacePlayerVendorInThisTownshipHouse() == false)
                {
                    from.SendMessage("You cannot place a vendor in a house with the township NPCs present.");
                }
                else
                {
                    Mobile v = new PlayerVendor(from, house);
                    v.Direction = from.Direction & Direction.Mask;
                    v.MoveToWorld(from.Location, from.Map);

                    v.SayTo(from, 503246);                     // Ah! it feels good to be working again.

                    this.Delete();
                }
            }
        }