data

package
v0.0.0-...-16d248a Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Belt

type Belt struct {
	Items []Item
	Name  item.Name
}

func (Belt) GetFirstPotion

func (b Belt) GetFirstPotion(potionType PotionType) (Position, bool)

func (Belt) Rows

func (b Belt) Rows() int

type Class

type Class uint
const (
	Amazon Class = iota
	Sorceress
	Necromancer
	Paladin
	Barbarian
	Druid
	Assassin
)

type Corpse

type Corpse struct {
	Found     bool
	IsHovered bool
	Position  Position
	States    state.States
}

func (Corpse) StateNotInteractable

func (c Corpse) StateNotInteractable() bool

type Data

type Data struct {
	AreaOrigin       Position
	Corpse           Corpse
	Monsters         Monsters
	Corpses          Monsters
	Game             OnlineGame
	PlayerUnit       PlayerUnit
	NPCs             NPCs
	Inventory        Inventory
	Objects          Objects
	Entrances        Entrances
	AdjacentLevels   []Level
	Rooms            []Room
	OpenMenus        OpenMenus
	Roster           Roster
	HoverData        HoverData
	TerrorZones      []area.ID
	Quests           quest.Quests
	KeyBindings      KeyBindings
	LegacyGraphics   bool
	IsIngame         bool
	HasMerc          bool
	ActiveWeaponSlot int
}

func (Data) MercHPPercent

func (d Data) MercHPPercent() int

type Drop

type Drop struct {
	Item         Item
	Rule         string
	RuleFile     string
	DropLocation string
}

type Entrance

type Entrance struct {
	ID UnitID
	entrance.Name
	IsHovered  bool
	Selectable bool
	Position   Position
}

type Entrances

type Entrances []Entrance

func (Entrances) FindByID

func (e Entrances) FindByID(id UnitID) (Entrance, bool)

func (Entrances) FindOne

func (e Entrances) FindOne(name entrance.Name) (Entrance, bool)

type HoverData

type HoverData struct {
	IsHovered bool
	UnitID
	UnitType int
}

type Inventory

type Inventory struct {
	Belt        Belt
	AllItems    []Item
	Gold        int
	StashedGold [4]int
}

func (Inventory) ByLocation

func (i Inventory) ByLocation(locations ...item.LocationType) []Item

func (Inventory) Find

func (i Inventory) Find(name item.Name, locations ...item.LocationType) (Item, bool)

func (Inventory) FindByID

func (i Inventory) FindByID(unitID UnitID) (Item, bool)

func (Inventory) Matrix

func (i Inventory) Matrix() [4][10]bool

type Item

type Item struct {
	ID int
	UnitID
	Name                 item.Name
	Quality              item.Quality
	IdentifiedName       string
	RunewordName         item.RunewordName
	LevelReq             int
	Position             Position
	Location             item.Location
	Ethereal             bool
	IsHovered            bool
	BaseStats            stat.Stats
	Stats                stat.Stats
	Affixes              ItemAffixes
	Sockets              []Item
	Identified           bool
	IsRuneword           bool
	IsNamed              bool
	IsStartItem          bool
	IsEar                bool
	IsBroken             bool
	HasBeenEquipped      bool
	HasSockets           bool
	InTradeOrStoreScreen bool
	IsInSocket           bool
	UniqueSetID          int32
}

func (Item) Desc

func (i Item) Desc() item.Description

func (Item) FindStat

func (i Item) FindStat(id stat.ID, layer int) (stat.Data, bool)

func (Item) GetSocketedItems

func (i Item) GetSocketedItems() []Item

func (Item) HasPrefix

func (i Item) HasPrefix(id int16) bool

func (Item) HasSocketedItems

func (i Item) HasSocketedItems() bool

func (Item) HasSuffix

func (i Item) HasSuffix(id int16) bool

func (Item) IsFromQuest

func (i Item) IsFromQuest() bool

func (Item) IsHealingPotion

func (i Item) IsHealingPotion() bool

func (Item) IsManaPotion

func (i Item) IsManaPotion() bool

func (Item) IsPotion

func (i Item) IsPotion() bool

func (Item) IsRejuvPotion

func (i Item) IsRejuvPotion() bool

func (Item) Type

func (i Item) Type() item.Type

type ItemAffixes

type ItemAffixes struct {
	Rare struct {
		Prefix int16
		Suffix int16
	}
	Magic struct {
		Prefixes [3]int16 // Prefix1, Prefix2, Prefix3
		Suffixes [3]int16 // Suffix1, Suffix2, Suffix3
	}
}

func (ItemAffixes) GetMagicPrefixes

func (a ItemAffixes) GetMagicPrefixes() []item.MagicPrefix

func (ItemAffixes) GetMagicSuffixes

func (a ItemAffixes) GetMagicSuffixes() []item.MagicSuffix

func (ItemAffixes) GetRarePrefix

func (a ItemAffixes) GetRarePrefix() (item.RarePrefix, bool)

func (ItemAffixes) GetRareSuffix

func (a ItemAffixes) GetRareSuffix() (item.RareSuffix, bool)

type KeyBinding

type KeyBinding struct {
	Key1 [2]byte
	Key2 [2]byte
}

type KeyBindings

type KeyBindings struct {
	CharacterScreen KeyBinding
	Inventory       KeyBinding
	HoradricCube    KeyBinding
	PartyScreen     KeyBinding
	MercenaryScreen KeyBinding
	MessageLog      KeyBinding
	QuestLog        KeyBinding
	HelpScreen      KeyBinding

	SkillTree           KeyBinding
	SkillSpeedBar       KeyBinding
	Skills              [16]SkillBinding
	SelectPreviousSkill KeyBinding
	SelectNextSkill     KeyBinding

	ShowBelt    KeyBinding
	UseBelt     [4]KeyBinding
	SwapWeapons KeyBinding

	Chat          KeyBinding
	Run           KeyBinding
	ToggleRunWalk KeyBinding
	StandStill    KeyBinding
	ForceMove     KeyBinding
	ShowItems     KeyBinding
	ShowPortraits KeyBinding

	Automap        KeyBinding
	CenterAutomap  KeyBinding
	FadeAutomap    KeyBinding
	PartyOnAutomap KeyBinding
	NamesOnAutomap KeyBinding
	ToggleMiniMap  KeyBinding

	SayHelp         KeyBinding
	SayFollowMe     KeyBinding
	SayThisIsForYou KeyBinding
	SayThanks       KeyBinding
	SaySorry        KeyBinding
	SayBye          KeyBinding
	SayNowYouDie    KeyBinding
	SayRetreat      KeyBinding

	ClearScreen   KeyBinding
	ClearMessages KeyBinding
	Zoom          KeyBinding
	LegacyToggle  KeyBinding
}

func (KeyBindings) KeyBindingForSkill

func (kb KeyBindings) KeyBindingForSkill(skillID skill.ID) (KeyBinding, bool)

func (KeyBindings) MustKBForSkill

func (kb KeyBindings) MustKBForSkill(skillID skill.ID) KeyBinding

type Level

type Level struct {
	Area       area.ID
	Position   Position
	IsEntrance bool // This means the area can not be accessed just walking through it, needs to be clicked
}

type Monster

type Monster struct {
	UnitID
	Name      npc.ID
	IsHovered bool
	Position  Position
	Stats     map[stat.ID]int
	Type      MonsterType
	States    state.States
	Mode      mode.NpcMode
}

func (Monster) IsElite

func (m Monster) IsElite() bool

func (Monster) IsEscapingType

func (m Monster) IsEscapingType() bool

IsEscapingType Monster cannot be attacked when airborne or hide in water (NpcMode 8)

func (Monster) IsGoodNPC

func (m Monster) IsGoodNPC() bool

func (Monster) IsImmune

func (m Monster) IsImmune(resist stat.Resist) bool

func (Monster) IsMerc

func (m Monster) IsMerc() bool

func (Monster) IsMonsterRaiser

func (m Monster) IsMonsterRaiser() bool

IsMonsterRaiser returns true if the monster is able to spawn new monsters.

func (Monster) IsPet

func (m Monster) IsPet() bool

func (Monster) IsSealBoss

func (m Monster) IsSealBoss() bool

func (Monster) IsSkip

func (m Monster) IsSkip() bool

IsSkip monster can not be killed as a normal enemy, for example can not be targeted

type MonsterFilter

type MonsterFilter func(m Monsters) []Monster

func MonsterAnyFilter

func MonsterAnyFilter() MonsterFilter

func MonsterEliteFilter

func MonsterEliteFilter() MonsterFilter

type MonsterType

type MonsterType string
const (

	// Monster Types
	MonsterTypeNone        MonsterType = "None"
	MonsterTypeChampion    MonsterType = "Champion"
	MonsterTypeMinion      MonsterType = "Minion"
	MonsterTypeUnique      MonsterType = "Unique"
	MonsterTypeSuperUnique MonsterType = "SuperUnique"
)

type Monsters

type Monsters []Monster

func (Monsters) Enemies

func (m Monsters) Enemies(filters ...MonsterFilter) []Monster

func (Monsters) FindByID

func (m Monsters) FindByID(id UnitID) (Monster, bool)

func (Monsters) FindOne

func (m Monsters) FindOne(id npc.ID, t MonsterType) (Monster, bool)

type NPC

type NPC struct {
	ID        npc.ID
	Name      string
	Positions []Position
}

type NPCs

type NPCs []NPC

func (NPCs) FindOne

func (n NPCs) FindOne(npcid npc.ID) (NPC, bool)

type Object

type Object struct {
	ID UnitID
	object.Name
	IsHovered    bool
	Selectable   bool
	InteractType object.InteractType
	Shrine       object.ShrineData
	Position     Position
	Owner        string
	Mode         mode.ObjectMode
	PortalData   object.PortalData
}

func (Object) IsChest

func (o Object) IsChest() bool

func (Object) IsDoor

func (o Object) IsDoor() bool

func (Object) IsPortal

func (o Object) IsPortal() bool

func (Object) IsRedPortal

func (o Object) IsRedPortal() bool

func (Object) IsShrine

func (o Object) IsShrine() bool

func (Object) IsSuperChest

func (o Object) IsSuperChest() bool

func (Object) IsWaypoint

func (o Object) IsWaypoint() bool

type Objects

type Objects []Object

func (Objects) FindByID

func (o Objects) FindByID(id UnitID) (Object, bool)

func (Objects) FindOne

func (o Objects) FindOne(name object.Name) (Object, bool)

type OnlineGame

type OnlineGame struct {
	LastGameName     string
	LastGamePassword string
	FPS              int
	Ping             int
}

type OpenMenus

type OpenMenus struct {
	Inventory      bool
	LoadingScreen  bool
	NPCInteract    bool
	NPCShop        bool
	Stash          bool
	Waypoint       bool
	MapShown       bool
	NewSkills      bool
	NewStats       bool
	SkillTree      bool
	Character      bool
	QuitMenu       bool
	Cube           bool
	SkillSelect    bool
	Anvil          bool
	MercInventory  bool
	BeltRows       bool
	QuestLog       bool
	PortraitsShown bool
	ChatOpen       bool
}

func (OpenMenus) IsMenuOpen

func (om OpenMenus) IsMenuOpen() bool

type Panel

type Panel struct {
	PanelPtr      uintptr
	PanelName     string
	PanelEnabled  bool
	PanelVisible  bool
	PtrChild      uintptr
	NumChildren   int
	ExtraText     string
	ExtraText2    string
	ExtraText3    string
	PanelParent   string
	PanelChildren map[string]Panel
	Depth         int
}

type PlayerUnit

type PlayerUnit struct {
	Address            uintptr
	Name               string
	ID                 UnitID
	Area               area.ID
	Position           Position
	Stats              stat.Stats
	BaseStats          stat.Stats
	Skills             map[skill.ID]skill.Points
	States             state.States
	Class              Class
	LeftSkill          skill.ID
	RightSkill         skill.ID
	AvailableWaypoints []area.ID // Is only filled when WP menu is open and only for the specific selected tab
	Mode               mode.PlayerMode
}

func (PlayerUnit) CastingFrames

func (pu PlayerUnit) CastingFrames() int

func (PlayerUnit) FindStat

func (pu PlayerUnit) FindStat(id stat.ID, layer int) (stat.Data, bool)

func (PlayerUnit) HPPercent

func (pu PlayerUnit) HPPercent() int

func (PlayerUnit) HasDebuff

func (pu PlayerUnit) HasDebuff() bool

func (PlayerUnit) MPPercent

func (pu PlayerUnit) MPPercent() int

func (PlayerUnit) MaxGold

func (pu PlayerUnit) MaxGold() int

func (PlayerUnit) TotalPlayerGold

func (pu PlayerUnit) TotalPlayerGold() int

TotalPlayerGold returns the amount of gold, including inventory and player stash (excluding shared stash)

type PointOfInterest

type PointOfInterest struct {
	Name     string
	Position Position
}

type Position

type Position struct {
	X int
	Y int
}

type PotionType

type PotionType string
const (
	HealingPotion      PotionType = "HealingPotion"
	ManaPotion         PotionType = "ManaPotion"
	RejuvenationPotion PotionType = "RejuvenationPotion"
)

type Room

type Room struct {
	Position
	Width  int
	Height int
}

func (Room) GetCenter

func (r Room) GetCenter() Position

func (Room) IsInside

func (r Room) IsInside(p Position) bool

type Roster

type Roster []RosterMember

func (Roster) FindByName

func (r Roster) FindByName(name string) (RosterMember, bool)

type RosterMember

type RosterMember struct {
	Name     string
	Area     area.ID
	Position Position
}

type SkillBinding

type SkillBinding struct {
	SkillID skill.ID
	KeyBinding
}

type UnitID

type UnitID int

Directories

Path Synopsis
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.
Code generated by cmd/txttocode.

Jump to

Keyboard shortcuts

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