RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

houseing question

Ishya Perata

Wanderer
ok here is the thing the shard me and a friend are working on is set to only 1 house per account I have look every where and can not find where to change that we want to allow players to have more then one house and anyone tel me or walk me threw how to find the right script to change this please?
 

Shino90

Sorceror
The one house per account thing is pretty much what the housing scripts are built for, there's no simple customizable "limit = 1" variable. However, you can change the way this works with some more effort.

The "HasAccountHouse" function in BaseHouse.cs is being used to check whether a person already has a house. If it returns true, placing/receiving a house is disallowed. By looking for the string "HasAccountHouse" in HousePlacementTool.cs, Deeds.cs, BaseHouse.cs and HouseSign.cs you can see where changes are necessary to increase the limit.

I suggest adding a new function to BaseHouse.cs, similar to the following:
Code:
public static bool IsAtHouseLimit( Mobile m )
{
    Account a = m.Account as Account;

    if ( a == null )
        return false;

    int houses = 0;

    for ( int i = 0; i < a.Length; ++i )
        if ( a[i] != null && HasHouse( a[i] ) )
            houses++;

    return (houses >= MaxHouses);
}

With the following added constant:
Code:
public const int MaxHouses = 4;

Then, look for sections that use the HasAccountHouse function in the previously mentioned scripts, and change it to IsAtHouseLimit. You may want to change the responses that are given. For example, change:
Code:
from.SendLocalizedMessage( 501271 ); // You already own a house, you may not place another!

To:
Code:
from.SendMessage( "You are already at the house limit, you may not place another!" );
 
Top