otbm

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeMapData   = 2
	NodeTileArea  = 4
	NodeTile      = 5
	NodeItem      = 6
	NodeTowns     = 12
	NodeTown      = 13
	NodeHouseTile = 14
	NodeWaypoints = 15
	NodeWaypoint  = 16
)
View Source
const (
	AttrDescription = 1
	AttrExtFile     = 2
	AttrTileFlags   = 3
	AttrActionID    = 4
	AttrUniqueID    = 5
	AttrText        = 6
	AttrDesc        = 7
	AttrTeleDest    = 8
	AttrItem        = 9
	AttrDepotID     = 10
	AttrSpawnFile   = 11
	AttrRuneCharges = 12
	AttrHouseFile   = 13
	AttrDoorID      = 14
	AttrCount       = 15
	AttrDuration    = 16
	AttrDecayState  = 17
	AttrWrittenDate = 18
	AttrWrittenBy   = 19
	AttrSleeperGUID = 20
	AttrSleepStart  = 21
	AttrCharges     = 22
	AttrAttrMap     = 128
)
View Source
const (
	TileFlagProtectionZone = 0x0001
	TileFlagNoPVP          = 0x0004
	TileFlagNoLogout       = 0x0008
	TileFlagPVPZone        = 0x0010
	TileFlagRefresh        = 0x0020
)

Variables

This section is empty.

Functions

func PackPos

func PackPos(x, y uint16, z uint8) uint64

Types

type FloorBounds

type FloorBounds struct {
	MinX, MinY, MaxX, MaxY uint16
}

type GameMap

type GameMap struct {
	Tiles       map[uint64]*MapTile
	MinX, MinY  uint16
	MaxX, MaxY  uint16
	Floors      []uint8
	Towns       []Town
	Waypoints   []Waypoint
	FloorBounds map[uint8]*FloorBounds
}

func ParseOTBM

func ParseOTBM(path string) (*GameMap, error)

type MapItem added in v1.17.0

type MapItem struct {
	ID          uint16
	ActionID    uint16
	UniqueID    uint16
	TeleDest    *TeleportDest
	DoorID      uint8
	DepotID     uint16
	Text        string
	Description string
	Charges     uint16
	RuneCharges uint8
	Count       uint8
}

type MapTile

type MapTile struct {
	Items     []uint16
	RichItems []MapItem
	Flags     uint32
	HouseID   uint32
}

type Node

type Node struct {
	Type     uint8
	Data     []byte
	Children []*Node
	// contains filtered or unexported fields
}

func ParseFile

func ParseFile(path string) (*Node, error)

func (*Node) GetString

func (n *Node) GetString() (string, error)

func (*Node) GetU8

func (n *Node) GetU8() (uint8, error)

func (*Node) GetU16

func (n *Node) GetU16() (uint16, error)

func (*Node) GetU32

func (n *Node) GetU32() (uint32, error)

func (*Node) Remaining

func (n *Node) Remaining() int

func (*Node) ResetPos

func (n *Node) ResetPos()

func (*Node) Skip

func (n *Node) Skip(count int) error

type OTB

type OTB struct {
	ServerToClient map[uint16]uint16
}

func ParseOTB

func ParseOTB(path string) (*OTB, error)

type TeleportDest added in v1.17.0

type TeleportDest struct {
	X, Y uint16
	Z    uint8
}

type Town

type Town struct {
	ID   uint32
	Name string
	X, Y uint16
	Z    uint8
}

type Waypoint added in v1.17.0

type Waypoint struct {
	Name string
	X, Y uint16
	Z    uint8
}

Jump to

Keyboard shortcuts

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