Full Version : BaseHouse How to make it have 2 houses
xmlspawner >>Scripting Support >>BaseHouse How to make it have 2 houses


<< Prev | Next >>

Erica- 09-17-2007
Hi ArteGordon was wondering how would i add on BaseHouse Script of SVN Which im using SVN 259 and the BaseHouse Script Has Been changed in the pass few SVN to make it where regular players can have max 2 houses . heres the script which i would code but its way to long so im going to put the script if you got any ideas what i need to add please tell me and where on what line to add it Thank You.

ArteGordon- 09-17-2007
replace this
CODE

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

  if ( a == null )
   return false;

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

  return false;
 }


with this

CODE

       public static bool HasAccountHouse(Mobile m)
       {
           // ARTEGORDONMOD
           // 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;

           // ARTEGORDONMOD
           // allow for a limited number of houses for the rest
           int nHouses = 0;

           for (int i = 0; i < a.Length; ++i)
           {
               Mobile mob = a[i];

               if (mob != null)
                   nHouses += GetHouses(mob).Count;
           }

           // 4 houses per account limit
           if (nHouses >= 2) return true;

           return false;
       }


You could take out the line with the unlimited staff housing mod if you wanted.

This mod has worked on all versions of RunUO including 1.0, 2.0 RC1, and all SVNs