go-tibia: badc0de.net/pkg/go-tibia/otb/map Index | Files

package otbm

import "badc0de.net/pkg/go-tibia/otb/map"

Package otbm implements an OTBM map file format reader and a gameworld map data source.


Package Files


type ItemAttribute Uses

type ItemAttribute uint8
const (
    OTBM_ATTR_DESCRIPTION    ItemAttribute = 0x01
    OTBM_ATTR_EXT_FILE       ItemAttribute = 0x02
    OTBM_ATTR_TILE_FLAGS     ItemAttribute = 0x03
    OTBM_ATTR_ACTION_ID      ItemAttribute = 0x04
    OTBM_ATTR_UNIQUE_ID      ItemAttribute = 0x05
    OTBM_ATTR_TEXT           ItemAttribute = 0x06
    OTBM_ATTR_DESC           ItemAttribute = 0x07
    OTBM_ATTR_TELE_DEST      ItemAttribute = 0x08
    OTBM_ATTR_ITEM           ItemAttribute = 0x09
    OTBM_ATTR_DEPOT_ID       ItemAttribute = 0x0A
    OTBM_ATTR_EXT_SPAWN_FILE ItemAttribute = 0x0B
    OTBM_ATTR_RUNE_CHARGES   ItemAttribute = 0x0C
    OTBM_ATTR_EXT_HOUSE_FILE ItemAttribute = 0x0D
    OTBM_ATTR_HOUSEDOORID    ItemAttribute = 0x0E
    OTBM_ATTR_COUNT          ItemAttribute = 0x0F
    OTBM_ATTR_DURATION       ItemAttribute = 0x10
    OTBM_ATTR_DECAYING_STATE ItemAttribute = 0x11
    OTBM_ATTR_WRITTENDATE    ItemAttribute = 0x12
    OTBM_ATTR_WRITTENBY      ItemAttribute = 0x13
    OTBM_ATTR_SLEEPERGUID    ItemAttribute = 0x14
    OTBM_ATTR_SLEEPSTART     ItemAttribute = 0x15
    OTBM_ATTR_CHARGES        ItemAttribute = 0x16

    OTBM_ATTR_ATTRIBUTE_MAP ItemAttribute = 128

func (ItemAttribute) String Uses

func (a ItemAttribute) String() string

type Map Uses

type Map struct {
    // contains filtered or unexported fields

func New Uses

func New(r io.ReadSeeker, t *things.Things) (*Map, error)

New reads an OTB file from a given reader.

func (*Map) AddCreature Uses

func (m *Map) AddCreature(c gameworld.Creature) error

func (*Map) GetCreatureByID Uses

func (m *Map) GetCreatureByID(id gameworld.CreatureID) (gameworld.Creature, error)

func (*Map) GetCreatureByIDBytes Uses

func (m *Map) GetCreatureByIDBytes(idBytes [4]byte) (gameworld.Creature, error)

func (*Map) GetMapTile Uses

func (m *Map) GetMapTile(x, y uint16, z uint8) (gameworld.MapTile, error)

func (*Map) Private_And_Temp__DefaultPlayerSpawnPoint Uses

func (m *Map) Private_And_Temp__DefaultPlayerSpawnPoint(c gameworld.CreatureID) tnet.Position

func (*Map) RemoveCreatureByID Uses

func (m *Map) RemoveCreatureByID(id gameworld.CreatureID) error

func (*Map) String Uses

func (m *Map) String() string

type MapData Uses

type MapData interface{}

type MapNodeType Uses

type MapNodeType uint8

Implementation detail: iota is not used primarily for easier referencing in case of an error.

const (
    OTBM_ROOT        MapNodeType = 0x00
    OTBM_ROOTV1      MapNodeType = 0x01
    OTBM_MAP_DATA    MapNodeType = 0x02
    OTBM_ITEM_DEF    MapNodeType = 0x03
    OTBM_TILE_AREA   MapNodeType = 0x04
    OTBM_TILE        MapNodeType = 0x05
    OTBM_ITEM        MapNodeType = 0x06
    OTBM_TILE_SQUARE MapNodeType = 0x07
    OTBM_TILE_REF    MapNodeType = 0x08
    OTBM_SPAWNS      MapNodeType = 0x09
    OTBM_SPAWN_AREA  MapNodeType = 0x0A
    OTBM_MONSTER     MapNodeType = 0x0B
    OTBM_TOWNS       MapNodeType = 0x0C
    OTBM_TOWN        MapNodeType = 0x0D
    OTBM_HOUSETILE   MapNodeType = 0x0E
    OTBM_WAYPOINTS   MapNodeType = 0x0F
    OTBM_WAYPOINT    MapNodeType = 0x10

Package otbm imports 11 packages (graph) and is imported by 2 packages. Updated 2020-11-28. Refresh now. Tools for package owners.