How to make houses decay for players?

Discussion in 'Server Support on Windows' started by adamg6284, May 27, 2011.

  1. adamg6284

    adamg6284 Sorceror

    Messages:
    312
    currently my shards set up is that all houses are automatically refreshed. How do i make it decay for players and players only?
  2. Legate

    Legate Wanderer

    Messages:
    14
    In your basehouse.cs, around line 27, it should read
    Code:
    public const bool DecayEnabled = true;
    yours sounds like it is most likely set to false.
  3. adamg6284

    adamg6284 Sorceror

    Messages:
    312
    yeah i tried that and it didnt work :(
  4. Legate

    Legate Wanderer

    Messages:
    14
    Do newly placed houses have any kind of decay status to them, or is it just older houses?
  5. adamg6284

    adamg6284 Sorceror

    Messages:
    312
    none :( i tried placing new ones and nothing
  6. Stygian Stalker

    Stygian Stalker Sorceror

    Messages:
    2,422
    i use runuo 2.0 so this may or may not apply

    basehouse.cs

    public const bool DecayEnabled = true;

    make sure that says true

    ................................................

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

    change to below

    if ( Core.AOS )
    return DecayType.ManualRefresh;

    ........................................................................

    if ( this == newest )
    return DecayType.AutoRefresh;

    change to below

    if ( this == newest )
    return DecayType.ManualRefresh;

    ................................................................................

    adjust total time from placement to collapse here

    if ( (acct.LastLogin + TimeSpan.FromDays( 90.0 )) < DateTime.Now )
    return DecayType.Condemned;

    ....................................................................................

    to remove the reference of grandfathered from the sign gump go to housegumpaos.cs edit or comment out the section like below...

    switch ( house.DecayType )
    {
    case DecayType.Ageless:
    case DecayType.AutoRefresh:
    {
    AddHtmlLocalized( 20, 250, 380, 20, 1062209, SelectedColor, false, false ); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed.
    break;
    }
    //case DecayType.ManualRefresh:
    //{
    // AddHtmlLocalized( 20, 250, 380, 20, 1062208, SelectedColor, false, false ); // This house is <a href = "?ForceTopic97">Grandfathered</a>.
    // break;
    //}
    case DecayType.Condemned:
    {
    AddHtmlLocalized( 20, 250, 380, 20, 1062207, WarningColor, false, false ); // This house is <a href = "?ForceTopic97">Condemned</a>.
    break;
    }
    }

    .........................................................................................

    gdluck
  7. adamg6284

    adamg6284 Sorceror

    Messages:
    312
    thank you man. i will try this i hope this works
  8. Stygian Stalker

    Stygian Stalker Sorceror

    Messages:
    2,422
    this part

    .....................................................

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

    change to below

    if ( Core.AOS )
    return DecayType.ManualRefresh;

    .........................................................

    may not need editing. but i think my shard "started" out AOS or ML I edited it along with the other tweaks. Hope this helps.

    I did not find a way to make the door refresh the house when opened like double clicking the sign but it seems to work thus far. players just need to know to double click the sign to refresh.
  9. adamg6284

    adamg6284 Sorceror

    Messages:
    312
    yeah i was wondering about that, thank you btw the way. thanks a LOT! hey, one more thing. i can't seem to find where you edit the amount of time it takes to decay. i want to set it to like 3 months. am i looking in the right file???
  10. pepper170

    pepper170 Squire

    Messages:
    480
    did someone find the answer yet? really need this fixed for my T2A shard :(
  11. David Chester

    David Chester Squire

    Messages:
    32
    To have double clicking the door refresh a house you are friended to even if you have no key on you:

    In BaseDoor.cs change the OnDoubleClick method from this:
    Code:
     public override void OnDoubleClick( Mobile from )
     {
     if ( from.AccessLevel == AccessLevel.Player && (/*!from.InLOS( this ) || */!from.InRange( GetWorldLocation(), 2 )) )
     from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
     else
     Use( from );
     }
    
    To this:

    Code:
     public override void OnDoubleClick( Mobile from )
     {
     if ( from.AccessLevel == AccessLevel.Player && (/*!from.InLOS( this ) || */!from.InRange( GetWorldLocation(), 2 )) )
     from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
    // David: Refresh house just by doubleclicking door even without key if friended
     else
     { 
     BaseHouse house = BaseHouse.FindHouseAt( this );
     if ( house != null && house.IsFriend( from ) && from.AccessLevel == AccessLevel.Player && house.RefreshDecay() )
     from.SendLocalizedMessage( 1043293 ); // Your house's age and contents have been refreshed.
     Use( from );
     }
     }
    

Share This Page