diff --git a/Source/ACE.Entity/Enum/Properties/RealmPropertyBool.cs b/Source/ACE.Entity/Enum/Properties/RealmPropertyBool.cs index 88315fd099..4d1e70712b 100644 --- a/Source/ACE.Entity/Enum/Properties/RealmPropertyBool.cs +++ b/Source/ACE.Entity/Enum/Properties/RealmPropertyBool.cs @@ -80,6 +80,10 @@ all landblocks will use the parent realm instead. Any players with a homeworld u [Description("If enabled, classical instances will be active regardless of the character's location. This is not recommended for realms other than true solo-self-found realms, and is considered an advanced feature.")] [RealmPropertyBool(false)] ClassicalInstances_EnableForAllLandblocks_Dangerous = 13, + + [Description("If enabled, players can purchase houses in instances other than the primary instance.")] + [RealmPropertyBool(false)] + IgnoreHousingInstanceRestrictions = 14, } public static class RealmPropertyBoolExtensions diff --git a/Source/ACE.Server/Entity/Landblock.cs b/Source/ACE.Server/Entity/Landblock.cs index 32733c8a37..6d7e4fb613 100644 --- a/Source/ACE.Server/Entity/Landblock.cs +++ b/Source/ACE.Server/Entity/Landblock.cs @@ -1492,7 +1492,8 @@ public ushort? ShortInstanceID public WorldRealm WorldRealm => WorldRealmID.HasValue ? RealmManager.GetRealm(WorldRealmID, includeRulesets: true) : null; public bool IsPrimaryForWorldRealm => ShortInstanceID == 0; - public bool IsHomeInstanceForPlayer(Player player) => IsPrimaryForWorldRealm && player.HomeRealm == WorldRealmID; + public bool IsHomeRealmForPlayer(Player player) => player.HomeRealm == WorldRealmID; + public bool IsHomeInstanceForPlayer(Player player) => IsPrimaryForWorldRealm && IsHomeRealmForPlayer(player); public class RealmShortcuts { diff --git a/Source/ACE.Server/WorldObjects/Player_House.cs b/Source/ACE.Server/WorldObjects/Player_House.cs index b9de0c9f64..16b0fd95e7 100644 --- a/Source/ACE.Server/WorldObjects/Player_House.cs +++ b/Source/ACE.Server/WorldObjects/Player_House.cs @@ -32,11 +32,20 @@ public void HandleActionBuyHouse(ObjectGuid slumlord_id, List item_ids) //Console.WriteLine($"\n{Name}.HandleActionBuyHouse()"); log.Info($"[HOUSE] {Name}.HandleActionBuyHouse()"); - if (!CurrentLandblock.IsHomeInstanceForPlayer(this)) - { - Session.Network.EnqueueSend(new GameMessageSystemChat("You may only purchase a house in your home realm.", ChatMessageType.Broadcast)); - log.Info($"[HOUSE] {Name}.HandleActionBuyHouse(): Failed pre-purchase requirement - Not in home realm instance"); - return; + if (RealmRuleset.GetProperty(RealmPropertyBool.IgnoreHousingInstanceRestrictions)){ + if (!CurrentLandblock.IsHomeRealmForPlayer(this)) + { + Session.Network.EnqueueSend(new GameMessageSystemChat("You may only purchase a house in your home realm.", ChatMessageType.Broadcast)); + log.Info($"[HOUSE] {Name}.HandleActionBuyHouse(): Failed pre-purchase requirement - Not in home realm"); + return; + } + }else{ + if (!CurrentLandblock.IsHomeInstanceForPlayer(this)) + { + Session.Network.EnqueueSend(new GameMessageSystemChat("You may only purchase a house in your home realm's primary instance.", ChatMessageType.Broadcast)); + log.Info($"[HOUSE] {Name}.HandleActionBuyHouse(): Failed pre-purchase requirement - Not in home realm instance"); + return; + } } // verify player doesn't already own a house