Documentation ¶
Index ¶
- Constants
- Variables
- func BoundUpdateRange(r int16) int16
- func BoundViewRange(r int16) int16
- func HuffmanDecodePacket(in io.ByteReader, out io.ByteWriter) error
- func HuffmanEncodePacket(in io.Reader, out io.Writer) error
- type AnimationAction
- type AnimationType
- type Body
- type Bounds
- type Cliloc
- type CommonObject
- type CursorType
- type Direction
- func (d Direction) Bound() Direction
- func (d Direction) IsDiagonal() bool
- func (d Direction) IsRunning() bool
- func (d Direction) Left() Direction
- func (d Direction) Right() Direction
- func (d Direction) RotateClockwise(n int) Direction
- func (d Direction) RotateCounterclockwise(n int) Direction
- func (d Direction) SetRunningFlag() Direction
- func (d Direction) StripRunningFlag() Direction
- type FeatureFlag
- type Font
- type GFXBlendMode
- type GFXType
- type GUMP
- type Graphic
- type Hue
- type Layer
- type Light
- type LightLevel
- type Location
- func (l Location) Bound() Location
- func (l Location) BoundsByRadius(r int) Bounds
- func (l Location) DirectionTo(a Location) Direction
- func (l Location) Forward(d Direction) Location
- func (l Location) WrapAndBound(ref Location) Location
- func (l Location) WrapToDungeonServer() Location
- func (l Location) WrapToOverworld() Location
- func (l Location) XYDistance(d Location) int16
- type LoginDeniedReason
- type LootType
- type MacroType
- type MobileFlags
- type MoveItemRejectReason
- type MoveSpeed
- type Music
- type Notoriety
- type ProtocolExtensionRequest
- type RandomSource
- type Serial
- type SerialType
- type Skill
- type SkillDefinition
- type SkillLock
- type SkillUpdate
- type Sound
- type SpeechType
- type Stat
- type Static
- func (s Static) AlphaBlend() bool
- func (s Static) Animation() bool
- func (s Static) Armor() bool
- func (s Static) ArtUsed() bool
- func (s Static) ArticleA() bool
- func (s Static) ArticleAn() bool
- func (s Static) Background() bool
- func (s Static) BaseGraphic() Graphic
- func (s Static) Bridge() bool
- func (s Static) Container() bool
- func (s Static) Damaging() bool
- func (s Static) Door() bool
- func (s Static) Foliage() bool
- func (s Static) Generic() bool
- func (s Static) Height() int8
- func (s Static) Highest() int8
- func (s Static) Impassable() bool
- func (s Static) Internal() bool
- func (s Static) LightSource() bool
- func (s Static) Map() bool
- func (s Static) MultiMovable() bool
- func (s Static) NoDiagonal() bool
- func (s Static) NoHouse() bool
- func (s Static) NoShadow() bool
- func (s Static) NoShoot() bool
- func (s Static) PartialHue() bool
- func (s Static) PixelBleed() bool
- func (s Static) PlayAnimOnce() bool
- func (s Static) Roof() bool
- func (s Static) StairBack() bool
- func (s Static) StairRight() bool
- func (s Static) StandingHeight() int8
- func (s Static) Surface() bool
- func (s Static) Translucent() bool
- func (s Static) Transparent() bool
- func (s Static) UseNewArt() bool
- func (s Static) Wall() bool
- func (s Static) Weapon() bool
- func (s Static) Wearable() bool
- func (s Static) Wet() bool
- func (s Static) Window() bool
- func (s Static) Z() int8
- type StaticDefinition
- type StatusFlag
- type StatusRequestType
- type TargetType
- type Texture
- type Tile
- func (t Tile) AlphaBlend() bool
- func (t Tile) Animation() bool
- func (t Tile) Armor() bool
- func (t Tile) ArtUsed() bool
- func (t Tile) ArticleA() bool
- func (t Tile) ArticleAn() bool
- func (t Tile) Background() bool
- func (t Tile) BaseGraphic() Graphic
- func (t Tile) Bridge() bool
- func (t Tile) Container() bool
- func (t Tile) Damaging() bool
- func (t Tile) Door() bool
- func (t Tile) Foliage() bool
- func (t Tile) Generic() bool
- func (t Tile) Height() int8
- func (t Tile) Highest() int8
- func (t Tile) Ignore() bool
- func (t Tile) Impassable() bool
- func (t Tile) Internal() bool
- func (t Tile) LightSource() bool
- func (t Tile) Map() bool
- func (t Tile) MultiMovable() bool
- func (t Tile) NoDiagonal() bool
- func (t Tile) NoHouse() bool
- func (t Tile) NoShadow() bool
- func (t Tile) NoShoot() bool
- func (t Tile) PartialHue() bool
- func (t Tile) PixelBleed() bool
- func (t Tile) PlayAnimOnce() bool
- func (t Tile) RawZ() int8
- func (t Tile) Roof() bool
- func (t Tile) SetElevations(lowest, avg, height int8) Tile
- func (t Tile) StairBack() bool
- func (t Tile) StairRight() bool
- func (t Tile) StandingHeight() int8
- func (t Tile) Surface() bool
- func (t Tile) Translucent() bool
- func (t Tile) Transparent() bool
- func (t Tile) UseNewArt() bool
- func (t Tile) Wall() bool
- func (t Tile) Weapon() bool
- func (t Tile) Wearable() bool
- func (t Tile) Wet() bool
- func (t Tile) Window() bool
- func (t Tile) Z() int8
- type TileDefinition
- type TileFlags
- func (f TileFlags) AlphaBlend() bool
- func (f TileFlags) Animation() bool
- func (f TileFlags) Armor() bool
- func (f TileFlags) ArtUsed() bool
- func (f TileFlags) ArticleA() bool
- func (f TileFlags) ArticleAn() bool
- func (f TileFlags) Background() bool
- func (f TileFlags) Bridge() bool
- func (f TileFlags) Container() bool
- func (f TileFlags) Damaging() bool
- func (f TileFlags) Door() bool
- func (f TileFlags) Foliage() bool
- func (f TileFlags) Generic() bool
- func (f TileFlags) Impassable() bool
- func (f TileFlags) Internal() bool
- func (f TileFlags) LightSource() bool
- func (f TileFlags) Map() bool
- func (f TileFlags) MultiMovable() bool
- func (f TileFlags) NoDiagonal() bool
- func (f TileFlags) NoHouse() bool
- func (f TileFlags) NoShadow() bool
- func (f TileFlags) NoShoot() bool
- func (f TileFlags) PartialHue() bool
- func (f TileFlags) PixelBleed() bool
- func (f TileFlags) PlayAnimOnce() bool
- func (f TileFlags) Roof() bool
- func (f TileFlags) StairBack() bool
- func (f TileFlags) StairRight() bool
- func (f TileFlags) Surface() bool
- func (f TileFlags) Translucent() bool
- func (f TileFlags) Transparent() bool
- func (f TileFlags) UseNewArt() bool
- func (f TileFlags) Wall() bool
- func (f TileFlags) Weapon() bool
- func (f TileFlags) Wearable() bool
- func (f TileFlags) Wet() bool
- func (f TileFlags) Window() bool
- type Time
- type Visibility
Constants ¶
const ( MinWalkRequestDelayMS int64 = 250 FastWalkDelayMS int64 = 175 )
Wall clock constants
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 ¶
var BoundsFullMap = Bounds{ Z: MapMinZ, W: int16(MapWidth), H: int16(MapHeight), D: int16(MapMaxZ) - int16(MapMinZ), }
var BoundsZero = Bounds{} // Bounds zero value
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
var ErrIncompletePacket = errors.New("incomplete packet")
ErrIncompletePacket is used to flag incomplete decompression of a packet.
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}, }
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 ¶
BoundUpdateRange bounds an update range between MinViewRange and MaxUpdateRange
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.
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.
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 BoundsOf ¶
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) RandomLocation ¶
func (b Bounds) RandomLocation(rng RandomSource) Location
RandomLocation returns a random location within these bounds.
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 ¶
Bound returns the direction code bounded to valid values while preserving the running flag.
func (Direction) IsDiagonal ¶
IsDiagonal returns true if the direction refers to a non-cardinal direction.
func (Direction) RotateClockwise ¶
RotateClockwise rotates the direction clockwise by n steps while preserving the running flag.
func (Direction) RotateCounterclockwise ¶
RotateCounterclockwise rotates the direction counterclockwise by n steps while preserving the running flag.
func (Direction) SetRunningFlag ¶
SetRunningFlag sets the running flag of a Direction
func (Direction) StripRunningFlag ¶
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 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 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 ¶
HasHueFlag returns true if the hue flag is present
func (Graphic) IsNoDraw ¶
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 ¶
RemoveHueFlag removes the hue flag and returns the new Body value
func (Graphic) SetHueFlag ¶
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 (Hue) ClearPartial ¶
ClearPartial returns the hue value with the partial hue flag removed
func (Hue) SetPartial ¶
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 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 ¶
Bound bounds the spacial portion of the location to the absolute dimensions of the map.
func (Location) BoundsByRadius ¶
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 ¶
DirectionTo returns the direction code that most closely matches the direction of the argument location.
func (Location) Forward ¶
Forward moves the location in the given direction, affecting only the X and Y coordinates.
func (Location) WrapAndBound ¶
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 ¶
WrapToDungeonServer returns the location wrapped to the dungeon server section of the map.
func (Location) WrapToOverworld ¶
WrapToOverworld returns the location wrapped to the overworld portion of the map.
func (Location) XYDistance ¶
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.
type MacroType ¶
type MacroType uint8
MacroType is a code indicating what type of macro is requested in a client packet 0x12.
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 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) StripSelfFlag ¶
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 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 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 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 (Static) Background ¶
func (Static) BaseGraphic ¶
BaseGraphic returns the graphic of the static
func (Static) Impassable ¶
func (Static) LightSource ¶
func (Static) MultiMovable ¶
func (Static) NoDiagonal ¶
func (Static) PartialHue ¶
func (Static) PixelBleed ¶
func (Static) PlayAnimOnce ¶
func (Static) StairRight ¶
func (Static) StandingHeight ¶
StandingHeight returns the standing height based on the object's flags.
func (Static) Translucent ¶
func (Static) Transparent ¶
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 (Tile) Background ¶
func (Tile) BaseGraphic ¶
BaseGraphic returns the graphic of the tile
func (Tile) Impassable ¶
func (Tile) LightSource ¶
func (Tile) MultiMovable ¶
func (Tile) NoDiagonal ¶
func (Tile) PartialHue ¶
func (Tile) PixelBleed ¶
func (Tile) PlayAnimOnce ¶
func (Tile) SetElevations ¶
SetElevations sets the three pre-calculated elevation parameters
func (Tile) StairRight ¶
func (Tile) StandingHeight ¶
StandingHeight returns the standing height of the tile, which is always 0
func (Tile) Translucent ¶
func (Tile) Transparent ¶
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 (TileFlags) Impassable ¶
func (TileFlags) LightSource ¶
func (TileFlags) MultiMovable ¶
func (TileFlags) NoDiagonal ¶
func (TileFlags) PartialHue ¶
func (TileFlags) PixelBleed ¶
func (TileFlags) PlayAnimOnce ¶
func (TileFlags) StairRight ¶
func (TileFlags) Translucent ¶
func (TileFlags) Transparent ¶
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 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 )