uo

package
v0.0.0-...-b0deb01 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinWalkRequestDelayMS int64 = 250
	FastWalkDelayMS       int64 = 175
)

Wall clock constants

View Source
const (
	MinStackAmount            int   = 1
	MaxStackAmount            int   = 60000
	MinViewRange              int16 = 5
	MaxViewRange              int16 = 18
	MaxUpdateRange            int16 = 24
	ChunkWidth                int   = 8
	ChunkHeight               int   = 8
	MapWidth                  int   = 7168
	MapHeight                 int   = 4096
	MapOverworldWidth         int   = 5120
	MapChunksWidth            int   = MapWidth / ChunkWidth
	MapChunksHeight           int   = MapHeight / ChunkHeight
	MapMinZ                   int8  = -128
	MapMaxZ                   int8  = 127
	StatsCapDefault           int   = 225
	MaxFollowers              int   = 5
	MaxUseRange               int16 = 3
	MaxLiftRange              int16 = 3
	MaxDropRange              int16 = 3
	MaxContainerViewRange     int16 = 3
	MaxItemStackHeight        int8  = 18
	DefaultMaxContainerWeight int   = 400
	DefaultMaxContainerItems  int   = 125
	RandomDropX               int16 = -1
	RandomDropY               int16 = -1
	TargetCanceledX           int16 = -1
	TargetCanceledY           int16 = -1
	ContainerOpenLowerLimit   int8  = -8
	ContainerOpenUpperLimit   int8  = 16
	PlayerHeight              int8  = 16
	StepHeight                int8  = 2
	SpeechWhisperRange        int16 = 1
	SpeechNormalRange         int16 = 12
	SpeechEmoteRange          int16 = SpeechNormalRange
	SpeechYellRange           int16 = MaxViewRange
	WalkDelay                 Time  = 6
	RunDelay                  Time  = 3
	MountedWalkDelay          Time  = 4
	MountedRunDelay           Time  = 2
)

Random constants

Variables

View Source
var BoundsFullMap = Bounds{
	Z: MapMinZ,
	W: int16(MapWidth),
	H: int16(MapHeight),
	D: int16(MapMaxZ) - int16(MapMinZ),
}
View Source
var BoundsZero = Bounds{} // Bounds zero value
View Source
var DoorOffsets = []Location{
	{X: -1, Y: 1},
	{X: 1, Y: 1},
	{X: -1, Y: 0},
	{X: 1, Y: -1},
	{X: 1, Y: 1},
	{X: 1, Y: -1},
	{X: 0, Y: 0},
	{X: 0, Y: -1},
}

Door location offsets

View Source
var ErrIncompletePacket = errors.New("incomplete packet")

ErrIncompletePacket is used to flag incomplete decompression of a packet.

View Source
var SkillInfo = []*SkillDefinition{
	{SkillAlchemy, "Alchemy", "Alchemist", 0.0, 0.5, 0.5, StatIntelligence, StatDexterity},
	{SkillAnatomy, "Anatomy", "Biologist", 0.15, 0.15, 0.7, StatIntelligence, StatStrength},
	{SkillAnimalLore, "Animal Lore", "Naturalist", 0.0, 0.0, 1.0, StatIntelligence, StatStrength},
	{SkillItemID, "Item Identification", "Merchant", 0.0, 0.0, 1.0, StatIntelligence, StatDexterity},
	{SkillArmsLore, "Arms Lore", "Weapon Master", 0.75, 0.15, 0.1, StatIntelligence, StatStrength},
	{SkillParrying, "Parrying", "Duelist", 0.75, 0.25, 0.0, StatDexterity, StatStrength},
	{SkillBegging, "Begging", "Beggar", 0.0, 0.0, 0.0, StatDexterity, StatIntelligence},
	{SkillBlacksmithing, "Blacksmithy", "Blacksmith", 1.0, 0.0, 0.0, StatStrength, StatDexterity},
	{SkillBowcraft, "Bowcraft/Fletching", "Bowyer", 0.6, 1.6, 0.0, StatDexterity, StatStrength},
	{SkillPeacemaking, "Peacemaking", "Pacifier", 0.0, 0.0, 0.0, StatIntelligence, StatDexterity},
	{SkillCamping, "Camping", "Explorer", 2.0, 1.5, 1.5, StatDexterity, StatIntelligence},
	{SkillCarpentry, "Carpentry", "Carpenter", 2.0, 0.5, 0.0, StatStrength, StatDexterity},
	{SkillCartography, "Cartography", "Cartographer", 0.0, 0.75, 0.75, StatIntelligence, StatDexterity},
	{SkillCooking, "Cooking", "Chef", 0.0, 2.0, 3.0, StatIntelligence, StatDexterity},
	{SkillDetectHidden, "Detecting Hidden", "Scout", 0.0, 0.4, 0.6, StatIntelligence, StatDexterity},
	{SkillEnticement, "Discordance", "Demoralizer", 0.0, 0.25, 0.25, StatDexterity, StatIntelligence},
	{SkillEvaluateIntelligence, "Evaluating Intelligence", "Scholar", 0.0, 0.0, 1.0, StatIntelligence, StatStrength},
	{SkillHealing, "Healing", "Healer", 0.6, 0.6, 0.8, StatIntelligence, StatDexterity},
	{SkillFishing, "Fishing", "Fisherman", 0.5, 0.5, 0.0, StatDexterity, StatStrength},
	{SkillForensicEvaluation, "Forensic Evaluation", "Detective", 0.0, 0.2, 0.8, StatIntelligence, StatDexterity},
	{SkillHerding, "Herding", "Shepherd", 1.625, 0.625, 0.25, StatIntelligence, StatDexterity},
	{SkillHiding, "Hiding", "Shade", 0.0, 0.8, 0.2, StatDexterity, StatIntelligence},
	{SkillProvocation, "Provocation", "Rouser", 0.0, 0.45, 0.05, StatIntelligence, StatDexterity},
	{SkillInscription, "Inscription", "Scribe", 0.0, 0.2, 0.8, StatIntelligence, StatDexterity},
	{SkillLockpicking, "Lockpicking", "Infiltrator", 0.0, 2.0, 0.0, StatDexterity, StatIntelligence},
	{SkillMagery, "Magery", "Mage", 0.0, 0.0, 1.5, StatIntelligence, StatStrength},
	{SkillMagicResistance, "Resisting Spells", "Warder", 0.25, 0.25, 0.5, StatStrength, StatDexterity},
	{SkillTactics, "Tactics", "Tactician", 0.0, 0.0, 0.0, StatStrength, StatDexterity},
	{SkillSnooping, "Snooping", "Spy", 0.0, 2.5, 0.0, StatDexterity, StatIntelligence},
	{SkillMusicianship, "Musicianship", "Bard", 0.0, 0.8, 0.2, StatDexterity, StatIntelligence},
	{SkillPoisoning, "Poisoning", "Assassin", 0.0, 0.4, 1.6, StatIntelligence, StatDexterity},
	{SkillArchery, "Archery", "Archer", 0.25, 0.75, 0.0, StatDexterity, StatStrength},
	{SkillSpiritSpeak, "Spirit Speak", "Medium", 0.0, 0.0, 1.0, StatIntelligence, StatStrength},
	{SkillStealing, "Stealing", "Pickpocket", 0.0, 1.0, 0.0, StatDexterity, StatIntelligence},
	{SkillTailoring, "Tailoring", "Tailor", 0.38, 1.63, 0.5, StatDexterity, StatIntelligence},
	{SkillAnimalTaming, "Animal Taming", "Tamer", 1.4, 0.2, 0.4, StatStrength, StatIntelligence},
	{SkillTasteIdentification, "Taste Identification", "Praegustator", 0.2, 0.0, 0.8, StatIntelligence, StatStrength},
	{SkillTinkering, "Tinkering", "Tinker", 0.5, 0.2, 0.3, StatDexterity, StatIntelligence},
	{SkillTracking, "Tracking", "Ranger", 0.0, 1.25, 1.25, StatIntelligence, StatDexterity},
	{SkillVeterinary, "Veterinary", "Veterinarian", 0.8, 0.4, 0.8, StatIntelligence, StatDexterity},
	{SkillSwordsmanship, "Swordsmanship", "Swordsman", 0.75, 0.25, 0.0, StatStrength, StatDexterity},
	{SkillMaceFighting, "Mace Fighting", "Armsman", 0.9, 0.1, 0.0, StatStrength, StatDexterity},
	{SkillFencing, "Fencing", "Fencer", 0.45, 0.55, 0.0, StatDexterity, StatStrength},
	{SkillWrestling, "Wrestling", "Wrestler", 0.9, 0.1, 0.0, StatStrength, StatDexterity},
	{SkillLumberjacking, "Lumberjacking", "Lumberjack", 2.0, 0.0, 0.0, StatStrength, StatDexterity},
	{SkillMining, "Mining", "Miner", 2.0, 0.0, 0.0, StatStrength, StatDexterity},
	{SkillMeditation, "Meditation", "Stoic", 0.0, 0.0, 0.0, StatIntelligence, StatStrength},
	{SkillStealth, "Stealth", "Rogue", 0.0, 0.0, 0.0, StatDexterity, StatIntelligence},
	{SkillRemoveTrap, "Remove Trap", "Trap Specialist", 0.0, 0.0, 0.0, StatDexterity, StatIntelligence},
	{SkillNecromancy, "Necromancy", "Necromancer", 0.0, 0.0, 0.0, StatIntelligence, StatStrength},
	{SkillFocus, "Focus", "Driven", 0.0, 0.0, 0.0, StatDexterity, StatIntelligence},
	{SkillChivalry, "Chivalry", "Paladin", 0.0, 0.0, 0.0, StatStrength, StatIntelligence},
	{SkillBushido, "Bushido", "Samurai", 0.0, 0.0, 0.0, StatStrength, StatIntelligence},
	{SkillNinjitsu, "Ninjitsu", "Ninja", 0.0, 0.0, 0.0, StatDexterity, StatIntelligence},
	{SkillSpellweaving, "Spellweaving", "Arcanist", 0.0, 0.0, 0.0, StatIntelligence, StatStrength},
	{SkillMysticism, "Mysticism", "Mystic", 0.0, 0.0, 0.0, StatStrength, StatIntelligence},
	{SkillImbuing, "Imbuing", "Artificer", 0.0, 0.0, 0.0, StatIntelligence, StatStrength},
	{SkillThrowing, "Throwing", "Bladeweaver", 0.0, 0.0, 0.0, StatDexterity, StatStrength},
}
View Source
var SkillNames = []string{
	"Alchemy",
	"Anatomy",
	"Animal Lore",
	"Item ID",
	"Arms Lore",
	"Parrying",
	"Begging",
	"Blacksmithing",
	"Bowcraft",
	"Peacemaking",
	"Camping",
	"Carpentry",
	"Cartography",
	"Cooking",
	"Detect Hidden",
	"Enticement",
	"Evaluate Intelligence",
	"Healing",
	"Fishing",
	"Forensic Evaluation",
	"Herding",
	"Hiding",
	"Provocation",
	"Inscription",
	"Lockpicking",
	"Magery",
	"Magic Resistance",
	"Tactics",
	"Snooping",
	"Musicianship",
	"Poisoning",
	"Archery",
	"Spirit Speak",
	"Stealing",
	"Tailoring",
	"Animal Taming",
	"Taste Identification",
	"Tinkering",
	"Tracking",
	"Veterinary",
	"Swordsmanship",
	"Mace Fighting",
	"Fencing",
	"Wrestling",
	"Lumberjacking",
	"Mining",
	"Meditation",
	"Stealth",
	"Remove Trap",
	"Necromancy",
	"Focus",
	"Chivalry",
	"Bushido",
	"Ninjitsu",
	"Spellweaving",
	"Mysticism",
	"Imbuing",
	"Throwing",
}

SkillNames is a list of names of the skills in order

Functions

func BoundUpdateRange

func BoundUpdateRange(r int16) int16

BoundUpdateRange bounds an update range between MinViewRange and MaxUpdateRange

func BoundViewRange

func BoundViewRange(r int16) int16

BoundViewRange bounds a view range value

func HuffmanDecodePacket

func HuffmanDecodePacket(in io.ByteReader, out io.ByteWriter) error

HuffmanDecodePacket decodes the bytes of in as Huffman-encoded Ultima Online packet and appends it to out. ErrIncompletePacket is returned on a fragmented packet.

func HuffmanEncodePacket

func HuffmanEncodePacket(in io.Reader, out io.Writer) error

HuffmanEncodePacket encodes the bytes of in as an Ultima Online packet and appends it to out until in is closed or error is encountered (like EOF).

Types

type AnimationAction

type AnimationAction uint16

AnimationAction is a second parameter to animations which selects between different sub-animations.

const (
	AnimationActionSlash1H   AnimationAction = 9
	AnimationActionPierce1H  AnimationAction = 10
	AnimationActionBash1H    AnimationAction = 11
	AnimationActionBash2H    AnimationAction = 12
	AnimationActionSlash2H   AnimationAction = 13
	AnimationActionPierce2H  AnimationAction = 14
	AnimationActionShootBow  AnimationAction = 18
	AnimationActionShootXBow AnimationAction = 19
	AnimationActionWrestle   AnimationAction = 31
	AnimationActionThrowing  AnimationAction = 32
)

AnimationAction values for weapon animations

type AnimationType

type AnimationType uint16

AnimationType indicates which animation type to play on the client side

const (
	AnimationTypeAttack      AnimationType = 0
	AnimationTypeParry       AnimationType = 1
	AnimationTypeBlock       AnimationType = 2
	AnimationTypeDie         AnimationType = 3
	AnimationTypeImpact      AnimationType = 4
	AnimationTypeFidget      AnimationType = 5
	AnimationTypeEat         AnimationType = 6
	AnimationTypeEmote       AnimationType = 7
	AnimationTypeAlert       AnimationType = 8
	AnimationTypeTakeOff     AnimationType = 9
	AnimationTypeLand        AnimationType = 10
	AnimationTypeSpell       AnimationType = 11
	AnimationTypeStartCombat AnimationType = 12
	AnimationTypeEndCombat   AnimationType = 13
	AnimationTypePillage     AnimationType = 14
	AnimationTypeSpawn       AnimationType = 15
)

AnimationType values

type Body

type Body uint16

A Body is a 16-bit value that describes the set of animations to use for a mobile. Body values used by UO range 1-999.

const (
	BodyNone        Body = 0
	BodyHuman       Body = 400 // Human male body
	BodyHumanMale   Body = 400
	BodyHumanFemale Body = 401
	BodyGhost       Body = 970
	BodyCounselor   Body = 987 // GM body
	BodyDefault     Body = 991 // Blackthorne
	BodySystem      Body = 0x7fff
)

Pre-defined values for Body

type Bounds

type Bounds struct {
	// X location of the top-left corner
	X int16
	// Y location of the top-left corner
	Y int16
	// Z location of the floor
	Z int8
	// Width of the bounds (X-axis)
	W int16
	// Height of the bounds (Y-axis)
	H int16
	// Depth of the bounds (Z-axis)
	D int16
}

Bounds represents a 3D bounding box in the world.

func BoundsFit

func BoundsFit(a, b Bounds) Bounds

BoundsFit returns a bounds value that fits both bounds tightly.

func BoundsOf

func BoundsOf(s, e Location) Bounds

BoundsOf returns a bounds value that fits both locations tightly. This can be used to create a bounds value from a start and end position.

func (Bounds) Contains

func (b Bounds) Contains(l Location) bool

Contains returns true if the location is contained within these bounds.

func (Bounds) East

func (b Bounds) East() int16

East returns the east-most point within these bounds.

func (Bounds) Overlaps

func (b Bounds) Overlaps(a Bounds) bool

Overlaps returns true if the two bound values overlap

func (Bounds) RandomLocation

func (b Bounds) RandomLocation(rng RandomSource) Location

RandomLocation returns a random location within these bounds.

func (Bounds) South

func (b Bounds) South() int16

South returns the south-most point within these bounds.

func (Bounds) Top

func (b Bounds) Top() int8

Top returns the top-most point within these bounds.

type Cliloc

type Cliloc uint32

Cliloc is a code for the localized client messages

type CommonObject

type CommonObject interface {
	// BaseGraphic returns the item graphic of the object
	BaseGraphic() Graphic
	// Z returns the permanent Z location of the lowest point of the object
	Z() int8
	// Height returns the height of the object.
	Height() int8
	// Highest returns the highest elevation of the object.
	Highest() int8
	// StandingHeight returns the height at which other objects rest above this
	// object's position. For solid objects this is equal to Z()+Height(). For
	// Bridge() type objects - typically stairs - this is Z()+Height()/2 rounded
	// down. For all non-solid objects the return value will be Z().
	StandingHeight() int8
	// Flag accessors
	Background() bool
	Weapon() bool
	Transparent() bool
	Translucent() bool
	Wall() bool
	Damaging() bool
	Impassable() bool
	Wet() bool
	Surface() bool
	Bridge() bool
	Generic() bool
	Window() bool
	NoShoot() bool
	ArticleA() bool
	ArticleAn() bool
	Internal() bool
	Foliage() bool
	PartialHue() bool
	NoHouse() bool
	Map() bool
	Container() bool
	Wearable() bool
	LightSource() bool
	Animation() bool
	NoDiagonal() bool
	Armor() bool
	Roof() bool
	Door() bool
	StairBack() bool
	StairRight() bool
	AlphaBlend() bool
	UseNewArt() bool
	ArtUsed() bool
	NoShadow() bool
	PixelBleed() bool
	PlayAnimOnce() bool
	MultiMovable() bool
}

CommonObject represents an object that can be queried for it's item graphic, it's permanent Z location, and tile flags.

type CursorType

type CursorType uint8

CursorType describes what the cursor should look like

const (
	CursorTypeNeutral CursorType = 0
	CursorTypeHarmful CursorType = 1
	CursorTypeHelpful CursorType = 2
	CursorTypeCancel  CursorType = 3
)

All CursorType values

type Direction

type Direction uint8

A Dir is a 3-bit value indicating the direction a mobile is facing

const (
	DirectionNorth       Direction = 0
	DirectionNorthEast   Direction = 1
	DirectionEast        Direction = 2
	DirectionSouthEast   Direction = 3
	DirectionSouth       Direction = 4
	DirectionSouthWest   Direction = 5
	DirectionWest        Direction = 6
	DirectionNorthWest   Direction = 7
	DirectionRunningFlag Direction = 0x80
)

Direction value meanings

func (Direction) Bound

func (d Direction) Bound() Direction

Bound returns the direction code bounded to valid values while preserving the running flag.

func (Direction) IsDiagonal

func (d Direction) IsDiagonal() bool

IsDiagonal returns true if the direction refers to a non-cardinal direction.

func (Direction) IsRunning

func (d Direction) IsRunning() bool

IsRunning returns true if the running flag is set

func (Direction) Left

func (d Direction) Left() Direction

Left returns the next direction counter-clockwise on the compass rose.

func (Direction) Right

func (d Direction) Right() Direction

Right returns the next direction clockwise on the compass rose.

func (Direction) RotateClockwise

func (d Direction) RotateClockwise(n int) Direction

RotateClockwise rotates the direction clockwise by n steps while preserving the running flag.

func (Direction) RotateCounterclockwise

func (d Direction) RotateCounterclockwise(n int) Direction

RotateCounterclockwise rotates the direction counterclockwise by n steps while preserving the running flag.

func (Direction) SetRunningFlag

func (d Direction) SetRunningFlag() Direction

SetRunningFlag sets the running flag of a Direction

func (Direction) StripRunningFlag

func (d Direction) StripRunningFlag() Direction

StripRunningFlag strips the running flag off of a Direction if present

type FeatureFlag

type FeatureFlag uint32

FeatureFlag represents the client features flags sent in packet 0xA9

const (
	FeatureFlagNone                 FeatureFlag = 0x00000000
	FeatureFlagSiege                FeatureFlag = 0x00000004
	FeatureFlagLeftClickMenus       FeatureFlag = 0x00000008
	FeatureFlagAOS                  FeatureFlag = 0x00000020
	FeatureFlagSixthCharacterSlot   FeatureFlag = 0x00000040
	FeatureFlagAOSProfessions       FeatureFlag = 0x00000080
	FeatureFlagElvenRace            FeatureFlag = 0x00000100
	FeatureFlagSeventhCharacterSlot FeatureFlag = 0x00001000
	FeatureFlagNewMovementPackets   FeatureFlag = 0x00004000
	FeatureFlagNewFeluccaAreas      FeatureFlag = 0x00008000
)

All documented flags

type Font

type Font uint16

Font represents one of the built-in fonts in the client.

const (
	FontBold         Font = 0
	FontShadow       Font = 1
	FontBoldShadow   Font = 2
	FontNormal       Font = 3
	FontGothic       Font = 4
	FontScript       Font = 5
	FontSmallScript  Font = 6
	FontScriptShadow Font = 7
	FontRune         Font = 8
	FontSmallNormal  Font = 9
)

All Font values

type GFXBlendMode

type GFXBlendMode uint32

GFXBlendMode is a code that indicates how a graphical effect is rendered.

const (
	GFXBlendModeNormal          GFXBlendMode = 0 // Normal blending, black is transparent
	GFXBlendModeMultiply        GFXBlendMode = 1 // Darken
	GFXBlendModeScreen          GFXBlendMode = 2 // Lighten
	GFXBlendModeScreenMore      GFXBlendMode = 3 // Lighten more
	GFXBlendModeScreenLess      GFXBlendMode = 4 // Lighten less
	GFXBlendModeHalfTransparent GFXBlendMode = 5 // Transparent with black edges
	GFXBlendModeShadowBlue      GFXBlendMode = 6 // Complete shadow with blue edges
	GFXBlendModeScreenRed       GFXBlendMode = 7 // Transparent but more red?
)

type GFXType

type GFXType byte

GFXType is a code that indicates how a graphical effect behaves.

const (
	GFXTypeMoving    GFXType = 0 // Moves from source to target
	GFXTypeLightning GFXType = 1 // Lightning strike at source
	GFXTypeFixed     GFXType = 2 // Moves toward the absolute target location
	GFXTypeTrack     GFXType = 3 // Moves toward and tracks the source object
)

type GUMP

type GUMP uint16

GUMP represents a gump graphic.

const (
	GUMPNone             GUMP = 0x0000
	GUMPDefault          GUMP = 0x0046 // Partial skull with glowing eyes
	GUMPContainerDefault GUMP = 0x03E8 // Huge chest, old login gump
)

Constant values for Gump

type Graphic

type Graphic uint16

Graphic is a reference number to an item graphic.

const (
	GraphicDefault      Graphic = 0x0000
	GraphicNone         Graphic = 0x0000
	GraphicNoDraw       Graphic = 0x0002
	GraphicCaveEntrance Graphic = 0x01DB
	GraphicNoDrawStart  Graphic = 0x01AE
	GraphicNoDrawEnd    Graphic = 0x01B5
	GraphicHueFlag      Graphic = 0x8000
	GraphicHueMask      Graphic = 0x7fff
)

Item number values

func (Graphic) HasHueFlag

func (i Graphic) HasHueFlag() bool

HasHueFlag returns true if the hue flag is present

func (Graphic) IsNoDraw

func (i Graphic) IsNoDraw() bool

IsNoDraw tries to determine if this is one of the common no-draw tiles. Please note that this is NOT 100% accurate.

func (Graphic) RemoveHueFlag

func (i Graphic) RemoveHueFlag() Graphic

RemoveHueFlag removes the hue flag and returns the new Body value

func (Graphic) SetHueFlag

func (i Graphic) SetHueFlag() Graphic

SetHueFlag sets the hue flag and returns the new Body value

type Hue

type Hue uint16

A Hue is a 17-bit value that describes the rendering mode of an object. Hues have the following characteristics: The zero value means "default rendering mode" Values 1-3000 inclusive select a set of 16 colors from the file "hues.mul"

that replace the first 16 color indexes (the gray-scales).

The special value -1 (0xffff) will do the shadow dragon alpha effect.

const (
	HueDefault     Hue = 0
	HueMin         Hue = 1
	HueBlack       Hue = 1
	HueDyeMin      Hue = 2
	HueDyeMax      Hue = 1001
	HueSkinMin     Hue = 1002
	HueSkinMax     Hue = 1058
	HueIce5        Hue = 1150
	HueIce4        Hue = 1151
	HueIce1        Hue = 1152
	HueIce2        Hue = 1153
	HueIce3        Hue = 1154
	HueMax         Hue = 3000
	HueHidden      Hue = 0x4000
	HueAlpha       Hue = 0xffff
	HuePartialFlag Hue = 0x8000
	HuePartialMask Hue = 0x7fff
)

Important hue values

func RandomDyeHue

func RandomDyeHue(r RandomSource) Hue

RandomDyeHue returns a random normal dye hue

func RandomSkinHue

func RandomSkinHue(r RandomSource) Hue

RandomSkinHue returns a random skin hue

func (Hue) ClearPartial

func (h Hue) ClearPartial() Hue

ClearPartial returns the hue value with the partial hue flag removed

func (Hue) IsPartial

func (h Hue) IsPartial() bool

IsPartial returns true if the hue value has the partial hue flag set

func (Hue) SetPartial

func (h Hue) SetPartial() Hue

SetPartial returns the hue value with the partial hue flag set

type Layer

type Layer byte

A Layer is a 6-bit value that indicates at which rendering layer a given animation body is rendered. It is also used in paper doll gumps to layer the equipment gump images. The zero value is invalid.

const (
	LayerInvalid                  Layer = 0
	LayerWeapon                   Layer = 1
	LayerShield                   Layer = 2
	LayerShoes                    Layer = 3
	LayerPants                    Layer = 4
	LayerShirt                    Layer = 5
	LayerHat                      Layer = 6
	LayerGloves                   Layer = 7
	LayerRing                     Layer = 8
	LayerNeckArmor                Layer = 10
	LayerHair                     Layer = 11
	LayerBelt                     Layer = 12
	LayerChestArmor               Layer = 13
	LayerBracelet                 Layer = 14
	LayerBeard                    Layer = 16
	LayerCoat                     Layer = 17
	LayerEarrings                 Layer = 18
	LayerArmArmor                 Layer = 19
	LayerCloak                    Layer = 20
	LayerBackpack                 Layer = 21
	LayerRobe                     Layer = 22
	LayerSkirt                    Layer = 23
	LayerLegArmor                 Layer = 24
	LayerMount                    Layer = 25
	LayerNPCBuyRestockContainer   Layer = 26
	LayerNPCBuyNoRestockContainer Layer = 27
	LayerNPCSellContainer         Layer = 28
	LayerBankBox                  Layer = 29
	LayerFirstValid               Layer = LayerWeapon
	LayerLastValid                Layer = LayerBankBox
	LayerLastVisible              Layer = LayerLegArmor
)

Layer constants

type Light

type Light uint16

Light represents a light graphic

type LightLevel

type LightLevel byte

LightLevel indicates how bright a light is.

const (
	LightLevelDay   LightLevel = 0    // Brightest light level
	LightLevelNight LightLevel = 9    // OSI night
	LightLevelBlack LightLevel = 0x1F // Lowest light level
)

type Location

type Location struct {
	// Absolute X position on the map [0-)
	X int16
	// Absolute Y position on the map
	Y int16
	// Absolute Z position on the map
	Z int8
}

Location identifies an absolute location in the universe.

var RandomContainerLocation Location = Location{X: RandomDropX, Y: RandomDropY}

This Location value indicates to a container that the item should be placed at a random location.

func (Location) Bound

func (l Location) Bound() Location

Bound bounds the spacial portion of the location to the absolute dimensions of the map.

func (Location) BoundsByRadius

func (l Location) BoundsByRadius(r int) Bounds

BoundsByRadius returns a Bounds value that contains this location and the locations within the radius r. The Z portion of the bounds will be maximized.

func (Location) DirectionTo

func (l Location) DirectionTo(a Location) Direction

DirectionTo returns the direction code that most closely matches the direction of the argument location.

func (Location) Forward

func (l Location) Forward(d Direction) Location

Forward moves the location in the given direction, affecting only the X and Y coordinates.

func (Location) WrapAndBound

func (l Location) WrapAndBound(ref Location) Location

WrapAndBound wraps and bounds the spacial portion of the location to the map dimensions relative to a reference point. UpdateAndBound will handle map wrapping as appropriate based on the reference location.

func (Location) WrapToDungeonServer

func (l Location) WrapToDungeonServer() Location

WrapToDungeonServer returns the location wrapped to the dungeon server section of the map.

func (Location) WrapToOverworld

func (l Location) WrapToOverworld() Location

WrapToOverworld returns the location wrapped to the overworld portion of the map.

func (Location) XYDistance

func (l Location) XYDistance(d Location) int16

XYDistance returns the maximum distance from l to d along either the X or Y axis.

type LoginDeniedReason

type LoginDeniedReason byte

LoginDeniedReason represents the reason for refusing login

const (
	LoginDeniedReasonBadPass        LoginDeniedReason = 0 // Password invalid for user
	LoginDeniedReasonAccountInUse   LoginDeniedReason = 1 // The account already has an active season
	LoginDeniedReasonAccountBlocked LoginDeniedReason = 2 // The account has been blocked for some reason
)

All LoginDeniedReason values

type LootType

type LootType uint8

LootType is a code that indicates what happens to items when a player dies with them in their inventory as well as how quickly the item decays.

const (
	LootTypeNormal  LootType = 0 // Drops on death, decays in 1 hour
	LootTypeBlessed LootType = 1 // Does not drop on death, decays in 1 hour
	LootTypeNewbied LootType = 2 // Does not drop on death, decays in 15 seconds
	LootTypeSystem  LootType = 3 // Does not drop on death, never decays
)

type MacroType

type MacroType uint8

MacroType is a code indicating what type of macro is requested in a client packet 0x12.

const (
	MacroTypeSkill    MacroType = 0 // Skill use request
	MacroTypeSpell    MacroType = 1 // Spell cast request
	MacroTypeOpenDoor MacroType = 2 // Open door request
	MacroTypeAction   MacroType = 3 // 0 = bow, 1 = salute
	MacroTypeInvalid  MacroType = 4 // Parsing error
)

type MobileFlags

type MobileFlags uint8

MobileFlags represent the flags for a mobile

const (
	MobileFlagNone          MobileFlags = 0x00
	MobileFlagFrozen        MobileFlags = 0x01
	MobileFlagFemale        MobileFlags = 0x02
	MobileFlagPoisoned      MobileFlags = 0x04
	MobileFlagFlying        MobileFlags = 0x04
	MobileFlagYellowBar     MobileFlags = 0x08
	MobileFlagIgnoreMobiles MobileFlags = 0x10
	MobileFlagMovable       MobileFlags = 0x20
	MobileFlagWarMode       MobileFlags = 0x40
	MobileFlagHidden        MobileFlags = 0x80
)

All MobileFlags flag values

type MoveItemRejectReason

type MoveItemRejectReason byte

MoveItemRejectReason represents the reasons that an item move request might be rejected.

const (
	MoveItemRejectReasonCannotLift         MoveItemRejectReason = 0
	MoveItemRejectReasonOutOfRange         MoveItemRejectReason = 1
	MoveItemRejectReasonOutOfSight         MoveItemRejectReason = 2
	MoveItemRejectReasonBelongsToAnother   MoveItemRejectReason = 3
	MoveItemRejectReasonAlreadyHoldingItem MoveItemRejectReason = 4
	MoveItemRejectReasonUnspecified        MoveItemRejectReason = 5
)

All known values for MoveItemRejectReason

type MoveSpeed

type MoveSpeed byte

MoveSpeed represents one of the available movement speeds.

const (
	MoveSpeedNormal   MoveSpeed = 0
	MoveSpeedFast     MoveSpeed = 1
	MoveSpeedSlow     MoveSpeed = 2
	MoveSpeedTeleport MoveSpeed = 3
)

All valid values for MovementSpeed

type Music

type Music uint16

Music is a code that describes which music track to play on the client side.

const (
	MusicApproach  Music = 0  // approach
	MusicBritain1  Music = 1  // britain1
	MusicBritain2  Music = 2  // britain2
	MusicBtcastle  Music = 3  // btcastle
	MusicBucsden   Music = 4  // bucsden
	MusicCave01    Music = 5  // cave01
	MusicCombat1   Music = 6  // combat1
	MusicCombat2   Music = 7  // combat2
	MusicCombat3   Music = 8  // combat3
	MusicCove      Music = 9  // cove
	MusicCreate1   Music = 10 // create1
	MusicDeath     Music = 11 // death
	MusicDragflit  Music = 12 // dragflit
	MusicDungeon2  Music = 13 // dungeon2
	MusicDungeon9  Music = 14 // dungeon9
	MusicForest_a  Music = 15 // forest_a
	MusicIntown01  Music = 16 // intown01
	MusicJhelom    Music = 17 // jhelom
	MusicJungle_a  Music = 18 // jungle_a
	MusicLBCastle  Music = 19 // lbcastle
	MusicLinelle   Music = 20 // linelle
	MusicMagincia  Music = 21 // magincia
	MusicMinoc     Music = 22 // minoc
	MusicMoonglow  Music = 23 // moonglow
	MusicMountn_a  Music = 24 // mountn_a
	MusicNujelm    Music = 25 // nujelm
	MusicOcllo     Music = 26 // ocllo
	MusicOldult01  Music = 27 // oldult01
	MusicOldult02  Music = 28 // oldult02
	MusicOldult03  Music = 29 // oldult03
	MusicOldult04  Music = 30 // oldult04
	MusicOldult05  Music = 31 // oldult05
	MusicOldult06  Music = 32 // oldult06
	MusicPlains_a  Music = 33 // plains_a
	MusicSailing   Music = 34 // sailing
	MusicSamlethe  Music = 35 // samlethe
	MusicSerpents  Music = 36 // serpents
	MusicSkarabra  Music = 37 // skarabra
	MusicStones2   Music = 38 // stones2
	MusicSwamp_a   Music = 39 // swamp_a
	MusicTavern01  Music = 40 // tavern01
	MusicTavern02  Music = 41 // tavern02
	MusicTavern03  Music = 42 // tavern03
	MusicTavern04  Music = 43 // tavern04
	MusicTrinsic   Music = 44 // trinsic
	MusicVesper    Music = 45 // vesper
	MusicVictory   Music = 46 // victory
	MusicWind      Music = 47 // wind
	MusicYew       Music = 48 // yew
	MusicLastValid Music = MusicYew
)

type Notoriety

type Notoriety byte

A Noto is a 3-bit value describing the notoriety status of a mobile The zero-value is invalid

const (
	NotorietyInvalid      Notoriety = 0 // Invalid value
	NotorietyInnocent     Notoriety = 1 // Blue - not attackable
	NotorietyFriend       Notoriety = 2 // Green - guild or faction ally, attackable
	NotorietyAttackable   Notoriety = 3 // Gray - attackable but not criminal
	NotorietyCriminal     Notoriety = 4 // Gray - attackable, criminal
	NotorietyEnemy        Notoriety = 5 // Orange - guild or faction enemy
	NotorietyMurderer     Notoriety = 6 // Red - attackable, murderer
	NotorietyInvulnerable Notoriety = 7 // Yellow - invulnerable, vendors etc
)

Notoriety constants

type ProtocolExtensionRequest

type ProtocolExtensionRequest byte

Protocol extension request types

const (
	ProtocolExtensionRequestPartyLocations ProtocolExtensionRequest = 0x00 // Send all party member locations for tracking
	ProtocolExtensionRequestGuildLocations ProtocolExtensionRequest = 0x01 // Send all guild member locations for tracking
)

type RandomSource

type RandomSource interface {
	// RandomBool returns a random boolean value
	RandomBool() bool
	// Random returns a random int value between min and max inclusive
	Random(int, int) int
}

RandomSource is the interface sources of psuedo-random numbers that the Random* functions expect.

type Serial

type Serial uint32

Serial is a 31-bit value with the following characteristics: The zero value is also the "invalid value" value No Serial will have a value greater than 2^31-1

const (
	SerialZero            Serial = 0x00000000
	SerialMobileNil       Serial = 0x00000000
	SerialFirstMobile     Serial = 0x00000001
	SerialLastMobile      Serial = 0x3fffffff
	SerialItemNil         Serial = 0x40000000
	SerialFirstItem       Serial = 0x40000001
	SerialLastItem        Serial = 0x7fffffff
	SerialSelfMask        Serial = 0x7fffffff
	SerialMobileSelfNil   Serial = 0x80000000
	SerialFirstMobileSelf Serial = 0x80000001
	SerialLastMobileSelf  Serial = 0xcfffffff
	SerialTheVoid         Serial = 0xd0000000
	SerialTextGUMP        Serial = 0xd0000001
	SerialSystem          Serial = 0xffffffff
)

Pre-defined values of Serial

func RandomItemSerial

func RandomItemSerial(rng RandomSource) Serial

RandomItemSerial returns a randomized Serial fit for an item

func RandomMobileSerial

func RandomMobileSerial(rng RandomSource) Serial

RandomMobileSerial returns a randomized Serial fit for a mobile

func (Serial) IsItem

func (s Serial) IsItem() bool

IsItem returns true if the serial refers to a item

func (Serial) IsMobile

func (s Serial) IsMobile() bool

IsMobile returns true if the serial refers to a mobile

func (Serial) IsNil

func (s Serial) IsNil() bool

IsNull returns true if the serial refers to a null mobile or item

func (Serial) IsSelf

func (s Serial) IsSelf() bool

IsSelf returns true if the serial is a valid client self-reference

func (Serial) String

func (s Serial) String() string

String returns the string representation of the serial.

func (Serial) StripSelfFlag

func (s Serial) StripSelfFlag() Serial

StripSelfFlag strips the MobileSelf flag out of the serial

type SerialType

type SerialType byte

SerialType is a classification code for serial values

const (
	SerialTypeItem   SerialType = 0
	SerialTypeMobile SerialType = 1
)

All valid values for SerialType

type Skill

type Skill byte

Skill represents a skill by numeric ID

const (
	SkillAlchemy              Skill = 0
	SkillAnatomy              Skill = 1
	SkillAnimalLore           Skill = 2
	SkillItemID               Skill = 3
	SkillArmsLore             Skill = 4
	SkillParrying             Skill = 5
	SkillBegging              Skill = 6
	SkillBlacksmithing        Skill = 7
	SkillBowcraft             Skill = 8
	SkillPeacemaking          Skill = 9
	SkillCamping              Skill = 10
	SkillCarpentry            Skill = 11
	SkillCartography          Skill = 12
	SkillCooking              Skill = 13
	SkillDetectHidden         Skill = 14
	SkillEnticement           Skill = 15
	SkillEvaluateIntelligence Skill = 16
	SkillHealing              Skill = 17
	SkillFishing              Skill = 18
	SkillForensicEvaluation   Skill = 19
	SkillHerding              Skill = 20
	SkillHiding               Skill = 21
	SkillProvocation          Skill = 22
	SkillInscription          Skill = 23
	SkillLockpicking          Skill = 24
	SkillMagery               Skill = 25
	SkillMagicResistance      Skill = 26
	SkillTactics              Skill = 27
	SkillSnooping             Skill = 28
	SkillMusicianship         Skill = 29
	SkillPoisoning            Skill = 30
	SkillArchery              Skill = 31
	SkillSpiritSpeak          Skill = 32
	SkillStealing             Skill = 33
	SkillTailoring            Skill = 34
	SkillAnimalTaming         Skill = 35
	SkillTasteIdentification  Skill = 36
	SkillTinkering            Skill = 37
	SkillTracking             Skill = 38
	SkillVeterinary           Skill = 39
	SkillSwordsmanship        Skill = 40
	SkillMaceFighting         Skill = 41
	SkillFencing              Skill = 42
	SkillWrestling            Skill = 43
	SkillLumberjacking        Skill = 44
	SkillMining               Skill = 45
	SkillMeditation           Skill = 46
	SkillStealth              Skill = 47
	SkillRemoveTrap           Skill = 48
	SkillNecromancy           Skill = 49
	SkillFocus                Skill = 50
	SkillChivalry             Skill = 51
	SkillBushido              Skill = 52
	SkillNinjitsu             Skill = 53
	SkillSpellweaving         Skill = 54
	SkillMysticism            Skill = 55
	SkillImbuing              Skill = 56
	SkillThrowing             Skill = 57
	SkillFirst                Skill = SkillAlchemy
	SkillLast                 Skill = SkillThrowing
	SkillCount                Skill = SkillLast + 1
	SkillAll                  Skill = 0xFF // Asks for all skills in a status request
)

All valid values for SkillID

type SkillDefinition

type SkillDefinition struct {
	// ID of the skill
	ID Skill
	// Name of the skill
	Name string
	// Title given by the skill
	Title string
	// Strength gain rate
	StrengthGain float32
	// Dexterity gain
	DexterityGain float32
	// Intelligence gain
	IntelligenceGain float32
	// Primary stat to gain
	PrimaryStat Stat
	// Secondary stat to gain
	SecondaryStat Stat
}

SkillDefinitino holds all of the information about a skill

type SkillLock

type SkillLock byte

SkillLock is a numeric code for the states of skill lock

const (
	SkillLockUp     SkillLock = 0 // Skill is marked for gains
	SkillLockDown   SkillLock = 1 // Skill is marked for atrophy
	SkillLockLocked SkillLock = 2 // Skill is locked
)

type SkillUpdate

type SkillUpdate byte

SkillUpdate is a code for the types of skill updates

const (
	SkillUpdateLegacyAll    SkillUpdate = 0x00
	SkillUpdateAll          SkillUpdate = 0x02
	SkillUpdateSingle       SkillUpdate = 0xDF
	SkillUpdateLegacySingle SkillUpdate = 0xFF
)

SkillUpdate values

type Sound

type Sound uint16

Sound is a code referencing a sound effect on the client side

const (
	SoundInvalidDrop Sound = 0
	SoundDefaultLift Sound = 0x57
	SoundDefaultDrop Sound = 0x42
	SoundBagDrop     Sound = 0x48
)

type SpeechType

type SpeechType byte

SpeechType represents the type of speech being requested or sent.

const (
	SpeechTypeNormal       SpeechType = 0    // Overhead speech
	SpeechTypeBroadcast    SpeechType = 1    // System broadcast
	SpeechTypeEmote        SpeechType = 2    // Overhead emote
	SpeechTypeSystem       SpeechType = 6    // System message in corner
	SpeechTypeMessage      SpeechType = 7    // Message in corner with name
	SpeechTypeWhisper      SpeechType = 8    // Overhead whisper
	SpeechTypeYell         SpeechType = 9    // Overhead yell
	SpeechTypeSpell        SpeechType = 10   // Overhead spell words
	SpeechTypeGuild        SpeechType = 13   // Guild chat in corner
	SpeechTypeAlliance     SpeechType = 14   // Guild alliance chat in corner
	SpeechTypePrompt       SpeechType = 15   // Prompt for user input
	SpeechTypeClientParsed SpeechType = 0xc0 // Contains client-side parsed keywords
)

All SpeechType values

type Stat

type Stat byte

Stat is a numeric code to refer to a mobile stat

const (
	StatStrength     Stat = 0 // Strength
	StatDexterity    Stat = 1 // Dexterity
	StatIntelligence Stat = 2 // Intelligence
)

type Static

type Static struct {

	// Absolute location
	Location Location
	// contains filtered or unexported fields
}

Static represents a static object on the map

func NewStatic

func NewStatic(l Location, def *StaticDefinition) Static

NewStatic returns a new Static object with the given definition and location

func (Static) AlphaBlend

func (s Static) AlphaBlend() bool

func (Static) Animation

func (s Static) Animation() bool

func (Static) Armor

func (s Static) Armor() bool

func (Static) ArtUsed

func (s Static) ArtUsed() bool

func (Static) ArticleA

func (s Static) ArticleA() bool

func (Static) ArticleAn

func (s Static) ArticleAn() bool

func (Static) Background

func (s Static) Background() bool

func (Static) BaseGraphic

func (s Static) BaseGraphic() Graphic

BaseGraphic returns the graphic of the static

func (Static) Bridge

func (s Static) Bridge() bool

func (Static) Container

func (s Static) Container() bool

func (Static) Damaging

func (s Static) Damaging() bool

func (Static) Door

func (s Static) Door() bool

func (Static) Foliage

func (s Static) Foliage() bool

func (Static) Generic

func (s Static) Generic() bool

func (Static) Height

func (s Static) Height() int8

Height returns the height of the static with regards to internal flags

func (Static) Highest

func (s Static) Highest() int8

Highest returns the highest elevation of the object

func (Static) Impassable

func (s Static) Impassable() bool

func (Static) Internal

func (s Static) Internal() bool

func (Static) LightSource

func (s Static) LightSource() bool

func (Static) Map

func (s Static) Map() bool

func (Static) MultiMovable

func (s Static) MultiMovable() bool

func (Static) NoDiagonal

func (s Static) NoDiagonal() bool

func (Static) NoHouse

func (s Static) NoHouse() bool

func (Static) NoShadow

func (s Static) NoShadow() bool

func (Static) NoShoot

func (s Static) NoShoot() bool

func (Static) PartialHue

func (s Static) PartialHue() bool

func (Static) PixelBleed

func (s Static) PixelBleed() bool

func (Static) PlayAnimOnce

func (s Static) PlayAnimOnce() bool

func (Static) Roof

func (s Static) Roof() bool

func (Static) StairBack

func (s Static) StairBack() bool

func (Static) StairRight

func (s Static) StairRight() bool

func (Static) StandingHeight

func (s Static) StandingHeight() int8

StandingHeight returns the standing height based on the object's flags.

func (Static) Surface

func (s Static) Surface() bool

func (Static) Translucent

func (s Static) Translucent() bool

func (Static) Transparent

func (s Static) Transparent() bool

func (Static) UseNewArt

func (s Static) UseNewArt() bool

func (Static) Wall

func (s Static) Wall() bool

func (Static) Weapon

func (s Static) Weapon() bool

func (Static) Wearable

func (s Static) Wearable() bool

func (Static) Wet

func (s Static) Wet() bool

func (Static) Window

func (s Static) Window() bool

func (Static) Z

func (s Static) Z() int8

Z returns the permanent Z location of the tile

type StaticDefinition

type StaticDefinition struct {
	// Graphic of the item
	Graphic Graphic
	// Flags
	TileFlags TileFlags
	// Weight
	Weight int
	// Layer
	Layer Layer
	// Stack amount
	Count int
	// Animation of the static
	Animation AnimationType
	// Hue
	Hue Hue
	// Light index
	Light Light
	// Height
	Height int8
	// Name of the static, truncated to 20 characters
	Name string
}

StaticDefinition holds the static data of a static object

type StatusFlag

type StatusFlag byte

A StatusFlag describes the status of a mobile

const (
	StatusNormal StatusFlag = 0
)

StatusFlag constants

type StatusRequestType

type StatusRequestType byte

StatusRequestType represents the types of status requests

const (
	StatusRequestTypeGod    StatusRequestType = 0
	StatusRequestTypeBasic  StatusRequestType = 4
	StatusRequestTypeSkills StatusRequestType = 5
)

All StatusRequestType values

type TargetType

type TargetType uint8

TargetType describes which type of targeting to use

const (
	TargetTypeObject   TargetType = 0
	TargetTypeLocation TargetType = 1
)

All TargetType values

type Texture

type Texture uint16

Texture represents a texture ID

const (
	TextureNone Texture = 0x0000
)

All known values for Texture

type Tile

type Tile struct {
	// contains filtered or unexported fields
}

Tile represents one landscape tile on the map

func NewTile

func NewTile(z int8, def *TileDefinition) Tile

NewTile returns a Tile value with the given properties

func (Tile) AlphaBlend

func (t Tile) AlphaBlend() bool

func (Tile) Animation

func (t Tile) Animation() bool

func (Tile) Armor

func (t Tile) Armor() bool

func (Tile) ArtUsed

func (t Tile) ArtUsed() bool

func (Tile) ArticleA

func (t Tile) ArticleA() bool

func (Tile) ArticleAn

func (t Tile) ArticleAn() bool

func (Tile) Background

func (t Tile) Background() bool

func (Tile) BaseGraphic

func (t Tile) BaseGraphic() Graphic

BaseGraphic returns the graphic of the tile

func (Tile) Bridge

func (t Tile) Bridge() bool

func (Tile) Container

func (t Tile) Container() bool

func (Tile) Damaging

func (t Tile) Damaging() bool

func (Tile) Door

func (t Tile) Door() bool

func (Tile) Foliage

func (t Tile) Foliage() bool

func (Tile) Generic

func (t Tile) Generic() bool

func (Tile) Height

func (t Tile) Height() int8

Height returns the height of the tile

func (Tile) Highest

func (t Tile) Highest() int8

Highest returns the highest point of the tile

func (Tile) Ignore

func (t Tile) Ignore() bool

Ignore returns true if this tile should not used when calculating Z locations

func (Tile) Impassable

func (t Tile) Impassable() bool

func (Tile) Internal

func (t Tile) Internal() bool

func (Tile) LightSource

func (t Tile) LightSource() bool

func (Tile) Map

func (t Tile) Map() bool

func (Tile) MultiMovable

func (t Tile) MultiMovable() bool

func (Tile) NoDiagonal

func (t Tile) NoDiagonal() bool

func (Tile) NoHouse

func (t Tile) NoHouse() bool

func (Tile) NoShadow

func (t Tile) NoShadow() bool

func (Tile) NoShoot

func (t Tile) NoShoot() bool

func (Tile) PartialHue

func (t Tile) PartialHue() bool

func (Tile) PixelBleed

func (t Tile) PixelBleed() bool

func (Tile) PlayAnimOnce

func (t Tile) PlayAnimOnce() bool

func (Tile) RawZ

func (t Tile) RawZ() int8

RawZ returns the elevation of the tile from map0.mul

func (Tile) Roof

func (t Tile) Roof() bool

func (Tile) SetElevations

func (t Tile) SetElevations(lowest, avg, height int8) Tile

SetElevations sets the three pre-calculated elevation parameters

func (Tile) StairBack

func (t Tile) StairBack() bool

func (Tile) StairRight

func (t Tile) StairRight() bool

func (Tile) StandingHeight

func (t Tile) StandingHeight() int8

StandingHeight returns the standing height of the tile, which is always 0

func (Tile) Surface

func (t Tile) Surface() bool

func (Tile) Translucent

func (t Tile) Translucent() bool

func (Tile) Transparent

func (t Tile) Transparent() bool

func (Tile) UseNewArt

func (t Tile) UseNewArt() bool

func (Tile) Wall

func (t Tile) Wall() bool

func (Tile) Weapon

func (t Tile) Weapon() bool

func (Tile) Wearable

func (t Tile) Wearable() bool

func (Tile) Wet

func (t Tile) Wet() bool

func (Tile) Window

func (t Tile) Window() bool

func (Tile) Z

func (t Tile) Z() int8

Z returns the elevation of the lowest corder of the tile

type TileDefinition

type TileDefinition struct {
	// Tile graphic
	Graphic Graphic
	// Tile flags
	TileFlags TileFlags
	// Texture for the tile, if any
	Texture Texture
	// Name of the tile truncated to 20 characters
	Name string
}

TileDefinition holds the static data about a tile. Valid tile indexes are 0x0000-0x3FFF.

type TileFlags

type TileFlags uint64

TileFlags represents the bit field of flags for a tile definition.

const (
	TileFlagsNone         TileFlags = 0x000000000000
	TileFlagsBackground   TileFlags = 0x000000000001
	TileFlagsWeapon       TileFlags = 0x000000000002
	TileFlagsTransparent  TileFlags = 0x000000000004
	TileFlagsTranslucent  TileFlags = 0x000000000008
	TileFlagsWall         TileFlags = 0x000000000010
	TileFlagsDamaging     TileFlags = 0x000000000020
	TileFlagsImpassable   TileFlags = 0x000000000040
	TileFlagsWet          TileFlags = 0x000000000008
	TileFlagsUnknown1     TileFlags = 0x000000000100
	TileFlagsSurface      TileFlags = 0x000000000200
	TileFlagsBridge       TileFlags = 0x000000000400
	TileFlagsGeneric      TileFlags = 0x000000000800
	TileFlagsWindow       TileFlags = 0x000000001000
	TileFlagsNoShoot      TileFlags = 0x000000002000
	TileFlagsArticleA     TileFlags = 0x000000004000
	TileFlagsArticleAn    TileFlags = 0x000000008000
	TileFlagsInternal     TileFlags = 0x000000010000
	TileFlagsFoliage      TileFlags = 0x000000020000
	TileFlagsPartialHue   TileFlags = 0x000000040000
	TileFlagsNoHouse      TileFlags = 0x000000080000
	TileFlagsMap          TileFlags = 0x000000100000
	TileFlagsContainer    TileFlags = 0x000000200000
	TileFlagsWearable     TileFlags = 0x000000400000
	TileFlagsLightSource  TileFlags = 0x000000800000
	TileFlagsAnimation    TileFlags = 0x000001000000
	TileFlagsNoDiagonal   TileFlags = 0x000002000000
	TileFlagsUnknown2     TileFlags = 0x000004000000
	TileFlagsArmor        TileFlags = 0x000008000000
	TileFlagsRoof         TileFlags = 0x000010000000
	TileFlagsDoor         TileFlags = 0x000020000000
	TileFlagsStairBack    TileFlags = 0x000040000000
	TileFlagsStairRight   TileFlags = 0x000080000000
	TileFlagsAlphaBlend   TileFlags = 0x000100000000
	TileFlagsUseNewArt    TileFlags = 0x000200000000
	TileFlagsArtUsed      TileFlags = 0x000400000000
	TileFlagsNoShadow     TileFlags = 0x001000000000
	TileFlagsPixelBleed   TileFlags = 0x002000000000
	TileFlagsPlayAnimOnce TileFlags = 0x004000000000
	TileFlagsMultiMovable TileFlags = 0x010000000000
)

Bit definitions for TileFlags

func (TileFlags) AlphaBlend

func (f TileFlags) AlphaBlend() bool

func (TileFlags) Animation

func (f TileFlags) Animation() bool

func (TileFlags) Armor

func (f TileFlags) Armor() bool

func (TileFlags) ArtUsed

func (f TileFlags) ArtUsed() bool

func (TileFlags) ArticleA

func (f TileFlags) ArticleA() bool

func (TileFlags) ArticleAn

func (f TileFlags) ArticleAn() bool

func (TileFlags) Background

func (f TileFlags) Background() bool

Flag reading functions

func (TileFlags) Bridge

func (f TileFlags) Bridge() bool

func (TileFlags) Container

func (f TileFlags) Container() bool

func (TileFlags) Damaging

func (f TileFlags) Damaging() bool

func (TileFlags) Door

func (f TileFlags) Door() bool

func (TileFlags) Foliage

func (f TileFlags) Foliage() bool

func (TileFlags) Generic

func (f TileFlags) Generic() bool

func (TileFlags) Impassable

func (f TileFlags) Impassable() bool

func (TileFlags) Internal

func (f TileFlags) Internal() bool

func (TileFlags) LightSource

func (f TileFlags) LightSource() bool

func (TileFlags) Map

func (f TileFlags) Map() bool

func (TileFlags) MultiMovable

func (f TileFlags) MultiMovable() bool

func (TileFlags) NoDiagonal

func (f TileFlags) NoDiagonal() bool

func (TileFlags) NoHouse

func (f TileFlags) NoHouse() bool

func (TileFlags) NoShadow

func (f TileFlags) NoShadow() bool

func (TileFlags) NoShoot

func (f TileFlags) NoShoot() bool

func (TileFlags) PartialHue

func (f TileFlags) PartialHue() bool

func (TileFlags) PixelBleed

func (f TileFlags) PixelBleed() bool

func (TileFlags) PlayAnimOnce

func (f TileFlags) PlayAnimOnce() bool

func (TileFlags) Roof

func (f TileFlags) Roof() bool

func (TileFlags) StairBack

func (f TileFlags) StairBack() bool

func (TileFlags) StairRight

func (f TileFlags) StairRight() bool

func (TileFlags) Surface

func (f TileFlags) Surface() bool

func (TileFlags) Translucent

func (f TileFlags) Translucent() bool

func (TileFlags) Transparent

func (f TileFlags) Transparent() bool

func (TileFlags) UseNewArt

func (f TileFlags) UseNewArt() bool

func (TileFlags) Wall

func (f TileFlags) Wall() bool

func (TileFlags) Weapon

func (f TileFlags) Weapon() bool

func (TileFlags) Wearable

func (f TileFlags) Wearable() bool

func (TileFlags) Wet

func (f TileFlags) Wet() bool

func (TileFlags) Window

func (f TileFlags) Window() bool

type Time

type Time uint64

A uo.Time value represents the number of seconds since the beginning of the Sossarian universe. One second of Sossarian time equals about 1/12 second real-world time.

const DurationDay Time = DurationHour * 24

Ticks per real-world day

const DurationHour Time = DurationMinute * 60

Ticks per real-world hour

const DurationMinute Time = DurationSecond * 60

Ticks per real-world minute

const DurationSecond Time = 12

Ticks per real-world second

const TimeEpoch Time = 289 * 876 * 24 * 60 * 60 /*seconds in a minute*/

The start of the Ultima Online game services. A brand-new server starts at this time.

const TimeNever Time = Time(^uint64(0))

A value meaning "will never happen"

const TimeZero Time = 0

The zero value for Time

type Visibility

type Visibility uint8

Visibility is a code that indicates the visibility state of an object.

const (
	VisibilityVisible   Visibility = 0 // Normal visibility, everyone can see it
	VisibilityInvisible Visibility = 1 // Magical invisibility, the kind certain AI and spells can see through
	VisibilityHidden    Visibility = 2 // Hidden as in the hiding skill, certain AI and spells can see through this
	VisibilityStaff     Visibility = 3 // Only staff can see this object
	VisibilityNone      Visibility = 4 // This object is never shown to the client
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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