function ADVR.onLoad() achievement.psvrID = 8 achievement.hideDescription = false achievement.unlocksItem = relics.THRESHING_BLADE achievement.predecessors = {achievements.THE_BLACKSMITHS_ANVIL} achievement.category = "collection" ValidNpcIds = { "blacksmith_crossbowdagger_primary", "blacksmith_crossbowdagger_secondary", "blacksmith_swordknife_primary", "blacksmith_swordknife_secondary", "blacksmith_magicwand_primary", "blacksmith_magicwand_secondary", "blacksmith_flailbomb_primary", "blacksmith_flailbomb_secondary" } end function ADVR.onProgressBought(npcId) local isValidNpc = false for _, validId in ipairs(ValidNpcIds) do if npcId == validId then isValidNpc = true break end end if isValidNpc == false then return end UnlockAchievement() end function UnlockAchievement() achievement.Unlock() -- Refresh the achievement UI. game.RefreshHomeBaseUIs() end -- Failsafe as there are bug reports... function ADVR.onSpawnInHomeBase() for _, npcIdKey in ipairs(ValidNpcIds) do if HasBoughtOneUpgrades(npcIdKey) == true then achievement.Unlock() -- Refresh the achievement UI. game.RefreshHomeBaseUIs() return end end end function HasBoughtOneUpgrades(npcIdKey) for progressRepresentation in game.progressHandler.GetProgressesByNpc(npcIdKey) do if progressRepresentation.IsBought() == true then return true end end return false end