Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Source/ACE.Entity/Enum/Properties/RealmPropertyBool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Source/ACE.Server/Entity/Landblock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
19 changes: 14 additions & 5 deletions Source/ACE.Server/WorldObjects/Player_House.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,20 @@ public void HandleActionBuyHouse(ObjectGuid slumlord_id, List<uint> 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
Expand Down