267 lines
8.0 KiB
Go
267 lines
8.0 KiB
Go
package housing
|
|
|
|
// Housing System Constants
|
|
const (
|
|
// Access levels for housing
|
|
AccessLevelOwner = iota
|
|
AccessLevelFriend
|
|
AccessLevelVisitor
|
|
AccessLevelGuildMember
|
|
AccessLevelBanned
|
|
|
|
// House alignment requirements
|
|
AlignmentAny = 0
|
|
AlignmentGood = 1
|
|
AlignmentEvil = 2
|
|
AlignmentNeutral = 3
|
|
|
|
// Transaction types for house history
|
|
TransactionPurchase = 1
|
|
TransactionUpkeep = 2
|
|
TransactionDeposit = 3
|
|
TransactionWithdrawal = 4
|
|
TransactionAmenity = 5
|
|
TransactionVaultExpansion = 6
|
|
TransactionRent = 7
|
|
TransactionForeclosure = 8
|
|
TransactionTransfer = 9
|
|
TransactionRepair = 10
|
|
|
|
// History position flags
|
|
HistoryFlagPositive = 1
|
|
HistoryFlagNegative = 0
|
|
|
|
// Upkeep periods (in seconds)
|
|
UpkeepPeriodWeekly = 604800 // 7 days
|
|
UpkeepPeriodMonthly = 2592000 // 30 days
|
|
UpkeepGracePeriod = 259200 // 3 days
|
|
|
|
// House status flags
|
|
HouseStatusActive = 0
|
|
HouseStatusUpkeepDue = 1
|
|
HouseStatusForeclosed = 2
|
|
HouseStatusAbandoned = 3
|
|
|
|
// Maximum values
|
|
MaxHouseName = 64
|
|
MaxReasonLength = 255
|
|
MaxDepositHistory = 100
|
|
MaxTransactionHistory = 500
|
|
MaxVaultSlots = 200
|
|
MaxAmenities = 50
|
|
MaxAccessEntries = 100
|
|
|
|
// Database retry settings
|
|
MaxDatabaseRetries = 3
|
|
DatabaseTimeout = 30 // seconds
|
|
|
|
// Escrow limits
|
|
MaxEscrowCoins = 1000000000 // 1 billion copper
|
|
MaxEscrowStatus = 10000000 // 10 million status
|
|
|
|
// Visit permissions
|
|
VisitPermissionPublic = 0
|
|
VisitPermissionFriends = 1
|
|
VisitPermissionGuild = 2
|
|
VisitPermissionInviteOnly = 3
|
|
VisitPermissionPrivate = 4
|
|
|
|
// Housing opcodes/packet types
|
|
OpHousePurchase = "PlayerHousePurchase"
|
|
OpHousingList = "CharacterHousingList"
|
|
OpBaseHouseWindow = "PlayerHouseBaseScreen"
|
|
OpHouseVisitWindow = "PlayerHouseVisit"
|
|
OpBuyHouse = "BuyHouse"
|
|
OpEnterHouse = "EnterHouse"
|
|
OpUpdateHouseAccess = "UpdateHouseAccessDataMsg"
|
|
OpHouseDeposit = "HouseDeposit"
|
|
OpHouseWithdrawal = "HouseWithdrawal"
|
|
OpPlaceItem = "PlaceItemInHouse"
|
|
OpRemoveItem = "RemoveItemFromHouse"
|
|
OpUpdateAmenities = "UpdateHouseAmenities"
|
|
|
|
// Error messages
|
|
ErrHouseNotFound = "house not found"
|
|
ErrInsufficientFunds = "insufficient funds"
|
|
ErrInsufficientStatus = "insufficient status points"
|
|
ErrAccessDenied = "access denied"
|
|
ErrHouseNotOwned = "house not owned by player"
|
|
ErrAlignmentRestriction = "alignment requirement not met"
|
|
ErrGuildLevelRestriction = "guild level requirement not met"
|
|
ErrUpkeepOverdue = "house upkeep is overdue"
|
|
ErrHouseForeclosed = "house has been foreclosed"
|
|
ErrInvalidHouseType = "invalid house type"
|
|
ErrDuplicateHouse = "player already owns this house type"
|
|
ErrMaxHousesReached = "maximum number of houses reached"
|
|
|
|
// Default upkeep costs (can be overridden per house type)
|
|
DefaultUpkeepCoins = 10000 // 1 gold
|
|
DefaultUpkeepStatus = 100
|
|
|
|
// Item placement constants
|
|
MaxItemsPerHouse = 1000
|
|
MaxItemStackSize = 100
|
|
ItemPlacementRadius = 50.0 // Maximum distance from spawn point
|
|
|
|
// House zones configuration
|
|
DefaultInstanceLifetime = 3600 // 1 hour in seconds
|
|
MaxHouseVisitors = 50 // Maximum concurrent visitors
|
|
|
|
// Amenity types
|
|
AmenityVaultExpansion = 1
|
|
AmenityPortal = 2
|
|
AmenityMerchant = 3
|
|
AmenityRepairNPC = 4
|
|
AmenityBroker = 5
|
|
AmenityBanker = 6
|
|
AmenityManagedItems = 7
|
|
AmenityTeleporter = 8
|
|
|
|
// Foreclosure settings
|
|
ForeclosureWarningDays = 7 // Days before foreclosure
|
|
ForeclosureNoticeDays = 3 // Days of final notice
|
|
|
|
// Deposit limits
|
|
MinDepositAmount = 1
|
|
MaxDepositAmount = 10000000 // 1000 gold
|
|
|
|
// Search and filtering
|
|
MaxSearchResults = 100
|
|
SearchTimeout = 5 // seconds
|
|
)
|
|
|
|
// House type constants for common house types
|
|
const (
|
|
HouseTypeInn = 1
|
|
HouseTypeCottage = 2
|
|
HouseTypeApartment = 3
|
|
HouseTypeHouse = 4
|
|
HouseTypeMansion = 5
|
|
HouseTypeKeep = 6
|
|
HouseTypeGuildHall = 7
|
|
HouseTypePrestigeHome = 8
|
|
)
|
|
|
|
// Access permission flags (bitwise)
|
|
const (
|
|
PermissionEnter = 1 << iota // Can enter the house
|
|
PermissionPlace = 1 << iota // Can place items
|
|
PermissionRemove = 1 << iota // Can remove items
|
|
PermissionMove = 1 << iota // Can move items
|
|
PermissionVault = 1 << iota // Can access vault
|
|
PermissionDeposit = 1 << iota // Can make deposits
|
|
PermissionWithdraw = 1 << iota // Can make withdrawals
|
|
PermissionInvite = 1 << iota // Can invite others
|
|
PermissionKick = 1 << iota // Can kick visitors
|
|
PermissionAdmin = 1 << iota // Full administrative access
|
|
)
|
|
|
|
// Default permission sets
|
|
const (
|
|
PermissionsOwner = PermissionEnter | PermissionPlace | PermissionRemove |
|
|
PermissionMove | PermissionVault | PermissionDeposit |
|
|
PermissionWithdraw | PermissionInvite | PermissionKick | PermissionAdmin
|
|
|
|
PermissionsFriend = PermissionEnter | PermissionPlace | PermissionMove |
|
|
PermissionVault | PermissionDeposit
|
|
|
|
PermissionsVisitor = PermissionEnter
|
|
|
|
PermissionsGuildMember = PermissionEnter | PermissionPlace | PermissionDeposit
|
|
|
|
PermissionsBanned = 0
|
|
)
|
|
|
|
// Alignment names for display
|
|
var AlignmentNames = map[int8]string{
|
|
AlignmentAny: "Any",
|
|
AlignmentGood: "Good",
|
|
AlignmentEvil: "Evil",
|
|
AlignmentNeutral: "Neutral",
|
|
}
|
|
|
|
// Transaction reason descriptions
|
|
var TransactionReasons = map[int]string{
|
|
TransactionPurchase: "House Purchase",
|
|
TransactionUpkeep: "Upkeep Payment",
|
|
TransactionDeposit: "Escrow Deposit",
|
|
TransactionWithdrawal: "Escrow Withdrawal",
|
|
TransactionAmenity: "Amenity Purchase",
|
|
TransactionVaultExpansion: "Vault Expansion",
|
|
TransactionRent: "Rent Payment",
|
|
TransactionForeclosure: "Foreclosure",
|
|
TransactionTransfer: "House Transfer",
|
|
TransactionRepair: "House Repair",
|
|
}
|
|
|
|
// Amenity names for display
|
|
var AmenityNames = map[int]string{
|
|
AmenityVaultExpansion: "Vault Expansion",
|
|
AmenityPortal: "Portal",
|
|
AmenityMerchant: "Merchant",
|
|
AmenityRepairNPC: "Repair NPC",
|
|
AmenityBroker: "Broker",
|
|
AmenityBanker: "Banker",
|
|
AmenityManagedItems: "Managed Items",
|
|
AmenityTeleporter: "Teleporter",
|
|
}
|
|
|
|
// House type names for display
|
|
var HouseTypeNames = map[int]string{
|
|
HouseTypeInn: "Inn Room",
|
|
HouseTypeCottage: "Cottage",
|
|
HouseTypeApartment: "Apartment",
|
|
HouseTypeHouse: "House",
|
|
HouseTypeMansion: "Mansion",
|
|
HouseTypeKeep: "Keep",
|
|
HouseTypeGuildHall: "Guild Hall",
|
|
HouseTypePrestigeHome: "Prestige Home",
|
|
}
|
|
|
|
// Default costs for house types (in copper coins)
|
|
var DefaultHouseCosts = map[int]int64{
|
|
HouseTypeInn: 50000, // 5 gold
|
|
HouseTypeCottage: 200000, // 20 gold
|
|
HouseTypeApartment: 500000, // 50 gold
|
|
HouseTypeHouse: 1000000, // 100 gold
|
|
HouseTypeMansion: 5000000, // 500 gold
|
|
HouseTypeKeep: 10000000, // 1000 gold
|
|
HouseTypeGuildHall: 50000000, // 5000 gold
|
|
HouseTypePrestigeHome: 100000000, // 10000 gold
|
|
}
|
|
|
|
// Default status costs for house types
|
|
var DefaultHouseStatusCosts = map[int]int64{
|
|
HouseTypeInn: 0,
|
|
HouseTypeCottage: 0,
|
|
HouseTypeApartment: 100,
|
|
HouseTypeHouse: 500,
|
|
HouseTypeMansion: 2500,
|
|
HouseTypeKeep: 5000,
|
|
HouseTypeGuildHall: 25000,
|
|
HouseTypePrestigeHome: 50000,
|
|
}
|
|
|
|
// Default upkeep costs (in copper coins per week)
|
|
var DefaultHouseUpkeepCosts = map[int]int64{
|
|
HouseTypeInn: 5000, // 50 silver
|
|
HouseTypeCottage: 10000, // 1 gold
|
|
HouseTypeApartment: 25000, // 2.5 gold
|
|
HouseTypeHouse: 50000, // 5 gold
|
|
HouseTypeMansion: 100000, // 10 gold
|
|
HouseTypeKeep: 200000, // 20 gold
|
|
HouseTypeGuildHall: 500000, // 50 gold
|
|
HouseTypePrestigeHome: 1000000, // 100 gold
|
|
}
|
|
|
|
// Default vault slots per house type
|
|
var DefaultVaultSlots = map[int]int{
|
|
HouseTypeInn: 4,
|
|
HouseTypeCottage: 6,
|
|
HouseTypeApartment: 8,
|
|
HouseTypeHouse: 12,
|
|
HouseTypeMansion: 16,
|
|
HouseTypeKeep: 20,
|
|
HouseTypeGuildHall: 24,
|
|
HouseTypePrestigeHome: 32,
|
|
} |