world

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package world stores the current map model: actors, floor items, map resources, camera position, pathfinding, and movement interpolation. It answers what exists on the map, where it is, and how it moves; input, packets, UI, audio, and drawing policy belong in game, network, audio, and render.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	ID               uint32
	Name             string
	PartyName        string
	GuildID          uint32
	EmblemVersion    uint32
	GuildName        string
	X                int
	Y                int
	Dir              int
	Job              int16
	Head             int16
	Weapon           int16
	Shield           int16
	HeadTop          int16
	HeadMid          int16
	HeadLow          int16
	HeadPal          int16
	BodyPal          int16
	Sex              byte
	HeadDir          uint8
	IsAdmin          bool
	Appearance       bool
	Moving           bool
	FromX            int
	FromY            int
	ToX              int
	ToY              int
	MoveStartTick    uint32
	HasMoveStartTick bool
	MoveStarted      time.Time
	MoveDuration     time.Duration
	MovePath         []WalkStep
	MoveStartX       float64
	MoveStartY       float64
	HasMoveStart     bool
	WalkDistance     float64
	ObjectType       uint8
	HasObjectType    bool
	Speed            int
	AIMotion         int
	HasAIMotion      bool
	AIMotionExpires  time.Time
	AITargetID       uint32
	AttackRange      int
	Sitting          bool
	BodyState        uint16
	HealthState      uint16
	EffectState      uint32
	Opt3State        uint32
	HasState         bool
	Level            int
	HasLevel         bool
	HasCart          bool
	CartNum          int
	HasCartState     bool
	Vending          bool
	VendingName      string
	ChatRoom         bool
	ChatRoomID       uint32
	ChatRoomTitle    string
	ChatRoomCount    uint16
	ChatRoomLimit    uint16
	ChatRoomPublic   bool
	PvPRank          int
	PvPTotal         int
	HasPvPRanking    bool
}

type Camera

type Camera struct {
	X float64
	Y float64
}

type FloorItem

type FloorItem struct {
	ID         uint32
	ItemID     uint16
	Identified bool
	X          int
	Y          int
	SubX       uint8
	SubY       uint8
	Amount     uint16
	Falling    bool
	DroppedAt  time.Time
}

type MapProperty added in v0.7.0

type MapProperty uint16
const (
	MapPropertyNothing MapProperty = iota
	MapPropertyFreePvPZone
	MapPropertyEventPvPZone
	MapPropertyAgitZone
	MapPropertyPKServerZone
	MapPropertyPvPServerZone
	MapPropertyDenySkillZone
)

func (MapProperty) IsAutoReviveRestricted added in v0.10.0

func (p MapProperty) IsAutoReviveRestricted() bool

IsAutoReviveRestricted matches the classic client restrictions for using a Token of Siegfried.

func (MapProperty) IsGvG added in v0.8.0

func (p MapProperty) IsGvG() bool

IsGvG reports the legacy 2008 WoE map property. PvP and GvG deliberately remain separate because only PvP maps have the client-side ranking display.

func (MapProperty) IsPvP added in v0.8.0

func (p MapProperty) IsPvP() bool

func (MapProperty) IsSiege added in v0.8.0

func (p MapProperty) IsSiege() bool

func (MapProperty) PlayerCombatEnabled added in v0.7.0

func (p MapProperty) PlayerCombatEnabled() bool

func (MapProperty) PvPRankingEnabled added in v0.7.0

func (p MapProperty) PvPRankingEnabled() bool

type WalkStep

type WalkStep struct {
	X int
	Y int
}

type World

type World struct {
	MapName     string
	MapProperty MapProperty
	Player      Actor
	Actors      map[uint32]Actor
	Items       map[uint32]FloorItem
	Camera      Camera
	Dir         int
	GAT         *res.GAT
	GND         *res.GND
	RSW         *res.RSW
	RSM         map[string]*res.RSM
	RSMFail     int
}

func New

func New() *World

func (*World) ClearPvPRankings added in v0.7.0

func (w *World) ClearPvPRankings()

func (*World) RemoveActor

func (w *World) RemoveActor(id uint32)

func (*World) RemoveItem

func (w *World) RemoveItem(id uint32)

func (*World) ResetMapProperty added in v0.7.0

func (w *World) ResetMapProperty()

func (*World) SetPlayerPosition

func (w *World) SetPlayerPosition(x, y, dir int)

func (*World) UpsertActor

func (w *World) UpsertActor(actor Actor)

func (*World) UpsertItem

func (w *World) UpsertItem(item FloorItem)

Jump to

Keyboard shortcuts

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