farm

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package farm lists the creatures and objects that drop an item, ranked for a captured character, from the dataset's loot_sources and npcs tables. The rules are in docs/farm.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crafted

func Crafted(ds store.DataStore, itemID int64) bool

Crafted is true when the dataset lists a crafting source for the item, which profession_plan covers instead.

func IsCrafted

func IsCrafted(kind string) bool

IsCrafted is true for a loot_sources kind that is a recipe or other crafting source, not a drop.

func Render

func Render(item string, spots []Spot, crafted bool, limit int) string

Render is the plain-text form of the first limit spots.

func Resolve

func Resolve(ds store.DataStore, text string) (id int64, name string, candidates []string)

Resolve turns an item id or name into an item id and name. A name is matched exactly, then by prefix, through the dataset's name index; otherwise it returns the candidate names and id 0.

Types

type Spot

type Spot struct {
	Kind string // creature or object
	ID   int64
	Name string // empty when the dataset has no name
	// Everloot is true when the name comes from Everloot's drop rows (npcs.name_source).
	Everloot bool
	MinLevel *int
	MaxLevel *int
	// InRange is true when the level range is known and overlaps the character's level window.
	InRange bool
	// Zone is empty when unknown; ZoneSource then is too.
	Zone       string
	ZoneSource string
	// Chance is 100 * drops / kills over the source's loot windows; nil when kills is zero or
	// unrecorded.
	Chance *float64
	Kills  int64
	Drops  int64
}

Spot is one creature or object that drops the item.

func Spots

func Spots(c character.Character, ds store.DataStore, itemID int64) []Spot

Spots returns the creatures and objects that drop itemID, one per source, in-range sources first, then by drop chance (unknown last), then by kind and id. Rows of one source are summed. Crafted sources are left out (see Crafted); a missing table or no rows gives none.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL