144 lines
4.6 KiB
Go
144 lines
4.6 KiB
Go
package achievements
|
|
|
|
// Achievement system constants
|
|
|
|
const (
|
|
// Achievement completion status
|
|
AchievementStatusIncomplete = 0
|
|
AchievementStatusCompleted = 1
|
|
|
|
// Maximum values
|
|
MaxAchievementTitle = 255
|
|
MaxAchievementText = 500
|
|
MaxAchievementCategory = 100
|
|
MaxAchievementExpansion = 100
|
|
MaxRequirementName = 255
|
|
MaxRewardText = 255
|
|
|
|
// Default configuration values
|
|
DefaultMaxCachedPlayers = 1000
|
|
DefaultPointsPerLevel = 100
|
|
|
|
// Database query limits
|
|
MaxAchievementsPerQuery = 1000
|
|
QueryTimeoutSeconds = 30
|
|
|
|
// Packet opcodes for achievement system
|
|
OpCharacterAchievements = "CharacterAchievements"
|
|
OpAchievementUpdate = "AchievementUpdateMsg"
|
|
|
|
// Error messages
|
|
ErrAchievementNotFound = "achievement not found"
|
|
ErrPlayerAchievementNotFound = "player achievement not found"
|
|
ErrInvalidAchievementID = "invalid achievement ID"
|
|
ErrInvalidCharacterID = "invalid character ID"
|
|
ErrDatabaseConnectionRequired = "database connection required"
|
|
ErrAchievementAlreadyCompleted = "achievement already completed"
|
|
)
|
|
|
|
// Common achievement categories
|
|
const (
|
|
CategoryCombat = "Combat"
|
|
CategoryExploration = "Exploration"
|
|
CategoryCrafting = "Crafting"
|
|
CategorySocial = "Social"
|
|
CategoryQuesting = "Questing"
|
|
CategoryPvP = "PvP"
|
|
CategoryRaiding = "Raiding"
|
|
CategoryGeneral = "General"
|
|
)
|
|
|
|
// Common expansions
|
|
const (
|
|
ExpansionBase = "EverQuest II"
|
|
ExpansionDesertOfFlames = "Desert of Flames"
|
|
ExpansionKingdomOfSky = "Kingdom of Sky"
|
|
ExpansionEchosOfFaydwer = "Echoes of Faydwer"
|
|
ExpansionRiseOfKunark = "Rise of Kunark"
|
|
ExpansionShadowOdyssey = "The Shadow Odyssey"
|
|
ExpansionSentinelsFate = "Sentinel's Fate"
|
|
ExpansionDestinyOfVelious = "Destiny of Velious"
|
|
ExpansionAgeOfDiscovery = "Age of Discovery"
|
|
ExpansionChainsOfEternity = "Chains of Eternity"
|
|
ExpansionTearsOfVeeshan = "Tears of Veeshan"
|
|
ExpansionAltarsOfZek = "Altars of Zek"
|
|
ExpansionTerrorsOfThalumbra = "Terrors of Thalumbra"
|
|
ExpansionKunarkAscending = "Kunark Ascending"
|
|
ExpansionPlanesOfProphecy = "Planes of Prophecy"
|
|
ExpansionChaosDescending = "Chaos Descending"
|
|
ExpansionBloodOfLuclin = "Blood of Luclin"
|
|
ExpansionReignOfShadows = "Reign of Shadows"
|
|
ExpansionVisionsOfVetrovia = "Visions of Vetrovia"
|
|
)
|
|
|
|
// Achievement category display names
|
|
var CategoryNames = map[string]string{
|
|
CategoryCombat: "Combat",
|
|
CategoryExploration: "Exploration",
|
|
CategoryCrafting: "Crafting",
|
|
CategorySocial: "Social",
|
|
CategoryQuesting: "Questing",
|
|
CategoryPvP: "Player vs Player",
|
|
CategoryRaiding: "Raiding",
|
|
CategoryGeneral: "General",
|
|
}
|
|
|
|
// Expansion display names (for UI)
|
|
var ExpansionNames = map[string]string{
|
|
ExpansionBase: "EverQuest II",
|
|
ExpansionDesertOfFlames: "Desert of Flames",
|
|
ExpansionKingdomOfSky: "Kingdom of Sky",
|
|
ExpansionEchosOfFaydwer: "Echoes of Faydwer",
|
|
ExpansionRiseOfKunark: "Rise of Kunark",
|
|
ExpansionShadowOdyssey: "The Shadow Odyssey",
|
|
ExpansionSentinelsFate: "Sentinel's Fate",
|
|
ExpansionDestinyOfVelious: "Destiny of Velious",
|
|
ExpansionAgeOfDiscovery: "Age of Discovery",
|
|
ExpansionChainsOfEternity: "Chains of Eternity",
|
|
ExpansionTearsOfVeeshan: "Tears of Veeshan",
|
|
ExpansionAltarsOfZek: "Altars of Zek",
|
|
ExpansionTerrorsOfThalumbra: "Terrors of Thalumbra",
|
|
ExpansionKunarkAscending: "Kunark Ascending",
|
|
ExpansionPlanesOfProphecy: "Planes of Prophecy",
|
|
ExpansionChaosDescending: "Chaos Descending",
|
|
ExpansionBloodOfLuclin: "Blood of Luclin",
|
|
ExpansionReignOfShadows: "Reign of Shadows",
|
|
ExpansionVisionsOfVetrovia: "Visions of Vetrovia",
|
|
}
|
|
|
|
// Common achievement point values
|
|
const (
|
|
PointsEasy = 5
|
|
PointsMedium = 10
|
|
PointsHard = 25
|
|
PointsVeryHard = 50
|
|
PointsLegendary = 100
|
|
)
|
|
|
|
// GetCategoryDisplayName returns the display name for a category
|
|
func GetCategoryDisplayName(category string) string {
|
|
if name, exists := CategoryNames[category]; exists {
|
|
return name
|
|
}
|
|
return category
|
|
}
|
|
|
|
// GetExpansionDisplayName returns the display name for an expansion
|
|
func GetExpansionDisplayName(expansion string) string {
|
|
if name, exists := ExpansionNames[expansion]; exists {
|
|
return name
|
|
}
|
|
return expansion
|
|
}
|
|
|
|
// ValidateCategory checks if a category is valid
|
|
func ValidateCategory(category string) bool {
|
|
_, exists := CategoryNames[category]
|
|
return exists || category == ""
|
|
}
|
|
|
|
// ValidateExpansion checks if an expansion is valid
|
|
func ValidateExpansion(expansion string) bool {
|
|
_, exists := ExpansionNames[expansion]
|
|
return exists || expansion == ""
|
|
} |