Rochaven

Initiate
Does anyone know which .cs files i need to modify to change the number of accounts per ip and number of houses allowed per account ? Simple lol question but has yet to be captured by my never ending search . Thanks as always for everyone's input. :D
 
Scripts/Accounting/AccountHandler.cs
Code:
private static readonly int MaxAccountsPerIP = 1;

For the houses you would have to do a bit of coding in BaseHouse.cs. There are few examples on RunUO forums for this but I don't have any code handy for it.
 
Basehouse.cs

Code:
public static bool HasHouse( Mobile m )
        {
            if ( m == null )
                return false;
            List<BaseHouse> list = null;
            m_Table.TryGetValue( m, out list );
            if ( list == null )
                return false;
            // # of Houses per Account 0=1, 1=2, 2=3 per account etc etc
            for ( int i = 2; i < list.Count; ++i )
            {
                BaseHouse h = list[i];
                if ( !h.Deleted )
                    return true;
            }
            return false;
        }
 
Does anyone know which .cs files i need to modify to change the number of accounts per ip and number of houses allowed per account ? Simple lol question but has yet to be captured by my never ending search . Thanks as always for everyone's input. :D
http://lmgtfy.com/?q=site:runuo.com house limit
http://lmgtfy.com/?q=site:runuo.com houses per account
http://www.runuo.com/community/threads/how-to-change-house-limit.92393/

Remember ServUO use to be ForkUO which was a fork of Runuo. You can still find tons of information about how to do this kind of stuff on the runuo forums.
Edit: of course I'm not saying it should not be here. Just that this information is already readily available if you know how to use a 'search engine'.
EditEdit: So now that this thread is established. We should not see this question get asked ever again in the future here on servuo... right?
 
Last edited by a moderator:
Maybe, or maybe someone else who's completely new to the forums will drop in. LOL But to be honest, the format you just used is awesome, easy and very professional. I am nominating you for the "Forurm Professional Of the Year" award ! Do they give those here?:D
 
I've always done it in the HasAccountHouse method.

@Tresdni
Yeah, that might be the better way, depending on your goal.
I think that will allow the account to have more houses but not the character. If you want a single character to be able to own more than one house, you use the HasHouse method. My shard only allowed one character per account and therefore I had to use the HasHouse method to let them have more than one house.
 
I just wish the account which is allowed to have the normal char count to have a total of 4 per account total. I think the link above worked, it had me add alot of lines to HasHouse .cs we'll see lol, thank you all again, very much
 
hi, i have a problem with the houses if you can have more than one house.
the first house didint decay...if i refresh. but all the others decay after 24 hours.

i didnt know, wich line in the basehouse.cs i have to edit, to fix the problem.

can anybody help please?

Greetings Döschl
 
but this will set all houses for decay=false. that isnt waht i want.
i dont know, if you understand it.... the first house decay routine works fine. but i set the number of houses up to 4 .... after this, the second, third and fourth house cant be refreshed more than 24 hours....there get a status named "Grandfatherd".... cant find that string in the script. and all these houses 2., 3., 4. will decay after 24 hours...not the same routine that works with the first house.
 
so does anyone know how this works with the new config file as i have set it and still players cant have two houses per account.
i went into basehouse script but i got a little frustrated at that point,as i could not pin down what i was looking for. does anyone have any ideas?
the first few lines has the line for the config and i set to two but it still did not work with both edits basehouse and config.
 
in BaseHouse.cs in the HasAccountHouse function you can either remove or change
Code:
if(HasHouse(m))
{
	return true;
}
to
Code:
if(m_AccountHouseLimit == 1 && HasHouse(m))
{
	return true;
}
 
oh wait I even misread it as that you want to remove the limit / extend it so you can have more on one character.
I dont see why it wouldnt allow to have more houses per account if you changed the config file to allow so with AccountHouseLimit
 
i changed it in the config and base house in the line for the config got no results. so do i need to reedit what you sent to original?
and all i wanted was two houses per account.
[doublepost=1479927357][/doublepost]also i am using the newest svn
 
yes sorry about that, like I said thought you ment more than one per character. Would need to look into why it does not work, seems odd.
 
public static bool HasAccountHouse(Mobile m)
{
Account a = m.Account as Account;

if (a == null)
return false;

if(HasHouse(m))
{
return true;
}

int count = 0;
for (int i = 0; i < a.Length; ++i)
{
if (a != null && HasHouse(a))
{
++count;
}
}

return count >= m_AccountHouseLimit;
}
 
if i am not mistaken the int count = 0; should be changed to one?
[doublepost=1479928695][/doublepost]house placement tool
 
and does it stop you right away? or on placement?
[doublepost=1479929079][/doublepost]Look for

Code:
public override void OnResponse(Server.Network.NetState sender, RelayInfo info)

        {

            if (!this.m_From.CheckAlive() || this.m_From.Backpack == null || this.m_From.Backpack.FindItemByType(typeof(HousePlacementTool)) == null)

                return;



            int index = info.ButtonID - 1;



            if (index >= 0 && index < this.m_Entries.Length)

            {

                if (this.m_From.AccessLevel < AccessLevel.GameMaster && BaseHouse.HasAccountHouse(this.m_From))

                    this.m_From.SendLocalizedMessage(501271); // You already own a house, you may not place another!

                else

                    this.m_From.Target = new NewHousePlacementTarget(this.m_Entries, this.m_Entries[index]);

            }

            else

            {

                this.m_From.SendGump(new HousePlacementCategoryGump(this.m_From));

            }

        }

in houseplacementtool.cs
[doublepost=1479929194][/doublepost]change it to this, let me know if this will stop at 2 though, or allow for unlimited.

Code:
public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (!this.m_From.CheckAlive() || this.m_From.Backpack == null || this.m_From.Backpack.FindItemByType(typeof(HousePlacementTool)) == null)
                return;

            int index = info.ButtonID - 1;

            if (index >= 0 && index < this.m_Entries.Length)
            {
                    this.m_From.Target = new NewHousePlacementTarget(this.m_Entries, this.m_Entries[index]);
            }
            else
            {
                this.m_From.SendGump(new HousePlacementCategoryGump(this.m_From));
            }
        }
 
right away says cant give to co-owner or house owner or what
[doublepost=1479929289][/doublepost]tool seems to work fine otherwise
 
got same result wether i placed and traded or they tried to place it
[doublepost=1479929452][/doublepost]trying now
 
one last idea.

Houseplacementtool.cs

Search for

case HousePlacementResult.Valid: (the last result on the bottom)

replace
Code:
 if (from.AccessLevel > AccessLevel.GameMaster && BaseHouse.HasAccountHouse(from))
                        {
                            from.SendLocalizedMessage(501271); // You already own a house, you may not place another!
                        }

with

Code:
if (from.AccessLevel < AccessLevel.GameMaster && BaseHouse.HasAccountHouse(from))
                        {
                            //from.SendLocalizedMessage(501271); // You already own a house, you may not place another!
                            BaseHouse house = this.ConstructHouse(from);
                        }
[doublepost=1479929633][/doublepost]If not that then it is a problem in your basehouse.cs

Make sure you are not a co-owner to any houses when you test this.
 
so no luck so far it should not be this hard others have this implemented
i am using vanilla files from the repo from like three weeks ago.
seems all the config file related stuff does not work
am i missing something i had the same issues with ip and port config not registering.
 
I have it working fine on mine, but I made a lot of edits and I allow unlimited houses, they just decay if not refreshed in 4 months. I would need to re-write the code I made to allow JUST two.
[doublepost=1479931846][/doublepost]I have not touched either of those config files.
 
you would need to turn on Decay in BaseHouse, edit Placement, edit DynamicDecay, and edit house placement tool.

I could send you my 3 files. They are updated to newest SVN

Code:
BaseHouse.cs CHANGES
// turn on decay for ALL

Change

            if (!Core.AOS)
                 return DecayType.ManualRefresh;

to

            if (Core.AOS)
                    return DecayType.ManualRefresh;

// unlimited houses
public static bool HasAccountHouse(Mobile m)
        {
            Account a = m.Account as Account;

            if (a == null)
                return false;

            if(HasHouse(m))
            {
                return false; // changed from true to false
            }

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

            return count >= m_AccountHouseLimit;
        }
 
that would be great as all i would have to do is drag and drop =life saver lol
[doublepost=1479938869][/doublepost]was that a hypothetical could lol
 
Having an issue with the Basehouse.cs file.
Due to a still low population, I have house limits set for 6 total houses per account.. I will paste the snip from the script at the end.
I have a player who has informed me that he was able to place 8 and was able to continue placing with no issues. Would someone be able to take a look at the script and please advise me as to where i goofed up please?

Code:
        public static bool HasHouse(Mobile m)
        {
            if (m == null)
                return false;

            List<BaseHouse> list = null;
            m_Table.TryGetValue(m, out list);

            if (list == null)
                return false;

            // # of Houses per Account 0=1, 1=2, 2=3 per account etc etc

            for ( int i = 5; i < list.Count; ++i )
            {
                BaseHouse h = list[i];

                if (!h.Deleted)
                    return true;
            }

            return false;
        }

        public static bool HasAccountHouse(Mobile m)
        {
           // unlimited housing for the specified staff level and above
            if(m.AccessLevel >= AccessLevel.GameMaster) return false;

            Account a = m.Account as Account;

            if (a == null)
                return false;
            // allow for a limited number of houses for the rest
            int nHouses = 5;
            for ( int i = 5; i < a.Length; ++i )
            {
                Mobile mob = a[i];
                if ( mob != null )
                    nHouses += GetHouses( mob ).Count;
            }
            // 6 houses per account limit
            if(nHouses >= 6) return true;
            return false;
        }
 
I dont mean the BaseHouse.cs script, I mean the Config file itself. When you open the server folder there is a folder labeled Config. Inside that is a CFG file labeled Housing. If I'm not mistaken, thats the one that should be used to change how many houses per account.
 
Thank you Hammerhand for clarifying. In attempts to locate this file, i have done a full search on my server file even typing in house/hous/housing in the search bar for the folder, nothing came up except Houses.cs in this script, it only defines the sizes and prices of the houses. theres also gump, placement, tool, demolish etc. also searched for the Config file itself, turned up nothing. I'm rather perplexed now:confused:
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back