Documentation ¶
Index ¶
- Constants
- func DecompressData(data []byte) ([]byte, error)
- type Cache
- func (c *Cache) Enum(id uint16) (*Enum, error)
- func (c *Cache) Enums() (map[uint16]*Enum, error)
- func (c *Cache) ExportEnums(outputDir string, mode JSONExportMode) error
- func (c *Cache) ExportItems(outputDir string, mode JSONExportMode) error
- func (c *Cache) ExportNPCs(outputDir string, mode JSONExportMode) error
- func (c *Cache) ExportObjects(outputDir string, mode JSONExportMode) error
- func (c *Cache) ExportSprites(outputDir string) error
- func (c *Cache) ExportStructs(outputDir string, mode JSONExportMode) error
- func (c *Cache) ExportTextures(outputDir string, mode JSONExportMode) error
- func (c *Cache) Files(archiveID uint8, groupID uint32) (map[uint32][]byte, error)
- func (c *Cache) Index(archiveID uint8) (*Index, error)
- func (c *Cache) Item(id uint16) (*Item, error)
- func (c *Cache) Items() (map[uint16]*Item, error)
- func (c *Cache) NPC(id uint16) (*NPC, error)
- func (c *Cache) NPCs() (map[uint16]*NPC, error)
- func (c *Cache) Object(id uint16) (*Object, error)
- func (c *Cache) Objects() (map[uint16]*Object, error)
- func (c *Cache) Sprite(id uint16) (*Sprite, error)
- func (c *Cache) Sprites() (map[uint16]*Sprite, error)
- func (c *Cache) Struct(id uint16) (*Struct, error)
- func (c *Cache) Structs() (map[uint16]*Struct, error)
- func (c *Cache) Texture(id uint16) (*Texture, error)
- func (c *Cache) Textures() (map[uint16]*Texture, error)
- type CharacterModelData
- type Enum
- type File
- type Frame
- type Group
- type ImageExportable
- type ImageExporter
- type Index
- type InventoryModelData
- type Item
- type JSONExportMode
- type JSONExporter
- type NPC
- type NPCAnimationData
- type NPCModelData
- type Object
- type ObjectModelData
- type Protocol
- type Reader
- func (r *Reader) Len() int
- func (r *Reader) Read(p []byte) (n int, err error)
- func (r *Reader) ReadBigSmart2() (int32, error)
- func (r *Reader) ReadByte() (byte, error)
- func (r *Reader) ReadBytes(n int) ([]byte, error)
- func (r *Reader) ReadInt16() (int16, error)
- func (r *Reader) ReadInt32() (int32, error)
- func (r *Reader) ReadInt8() (int8, error)
- func (r *Reader) ReadSmartUint() (uint32, error)
- func (r *Reader) ReadString() (string, error)
- func (r *Reader) ReadUint16() (uint16, error)
- func (r *Reader) ReadUint16SmartMinus1() (uint16, error)
- func (r *Reader) ReadUint24() (uint32, error)
- func (r *Reader) ReadUint32() (uint32, error)
- func (r *Reader) ReadUint8() (uint8, error)
- func (r *Reader) Reset(b []byte)
- func (r *Reader) Seek(offset int64, whence int) (int64, error)
- func (r *Reader) Size() int64
- type Sprite
- type Store
- type Struct
- type Texture
Constants ¶
View Source
const ( CompressionNone = 0 CompressionBZIP2 = 1 CompressionGZIP = 2 )
View Source
const ( DigestBits = 512 DigestBytes = DigestBits >> 3 )
View Source
const ( FlagNames = 0x01 FlagDigests = 0x02 FlagLengths = 0x04 FlagUncompressedChecksums = 0x08 )
View Source
const ( FlagColumnMajor = 0x1 FlagAlpha = 0x2 )
View Source
const (
MaxArchive = 255
)
Variables ¶
This section is empty.
Functions ¶
func DecompressData ¶
Types ¶
type Cache ¶
type Cache struct {
Store Store
}
func (*Cache) ExportEnums ¶
func (c *Cache) ExportEnums(outputDir string, mode JSONExportMode) error
func (*Cache) ExportItems ¶
func (c *Cache) ExportItems(outputDir string, mode JSONExportMode) error
func (*Cache) ExportNPCs ¶
func (c *Cache) ExportNPCs(outputDir string, mode JSONExportMode) error
func (*Cache) ExportObjects ¶
func (c *Cache) ExportObjects(outputDir string, mode JSONExportMode) error
func (*Cache) ExportSprites ¶
func (*Cache) ExportStructs ¶
func (c *Cache) ExportStructs(outputDir string, mode JSONExportMode) error
func (*Cache) ExportTextures ¶
func (c *Cache) ExportTextures(outputDir string, mode JSONExportMode) error
type CharacterModelData ¶
type CharacterModelData struct { ModelPrimary uint16 `json:"model_primary"` ModelSecondary uint16 `json:"model_secondary"` ModelTertiary uint16 `json:"model_tertiary"` Offset uint8 `json:"offset"` ChatHeadModelPrimary uint16 `json:"chat_head_model_primary"` ChatHeadModelSecondary uint16 `json:"chat_head_model_secondary"` }
type Frame ¶
type Frame struct { ID uint16 `json:"id"` OffsetX uint16 `json:"offset_x"` OffsetY uint16 `json:"offset_y"` MaxWidth uint16 `json:"max_width"` MaxHeight uint16 `json:"max_height"` Pixels []byte `json:"pixels"` Alpha []byte `json:"alpha"` }
type Group ¶
type ImageExportable ¶
type ImageExporter ¶
type ImageExporter[K comparable, V ImageExportable] struct { // contains filtered or unexported fields }
func NewImageExporter ¶
func NewImageExporter[K comparable, V ImageExportable](definitions map[K]V, outputDir string) *ImageExporter[K, V]
func (*ImageExporter[K, V]) ExportToImage ¶
func (e *ImageExporter[K, V]) ExportToImage(prefix string) error
type Index ¶
type InventoryModelData ¶
type InventoryModelData struct { ID uint16 `json:"id"` Zoom uint16 `json:"zoom"` RotationX uint16 `json:"rotation_x"` RotationY uint16 `json:"rotation_y"` RotationZ uint16 `json:"rotation_z"` OffsetX uint16 `json:"offset_x"` OffsetY uint16 `json:"offset_y"` ScaleX uint16 `json:"scale_x"` ScaleY uint16 `json:"scale_y"` ScaleZ uint16 `json:"scale_z"` RecolorFrom []uint16 `json:"recolor_from"` RecolorTo []uint16 `json:"recolor_to"` RetextureFrom []uint16 `json:"retexture_from"` RetextureTo []uint16 `json:"retexture_to"` Ambient int8 `json:"ambient"` Contrast int8 `json:"contrast"` }
type Item ¶
type Item struct { ID uint16 `json:"id"` Category uint16 `json:"category"` Name string `json:"name"` Examine string `json:"examine"` MembersOnly bool `json:"members_only"` Stackable bool `json:"stackable"` Exchangeable bool `json:"exchangeable"` Value int32 `json:"value"` Weight int16 `json:"weight"` ActionsGround [5]string `json:"actions_ground"` ActionsInventory [5]string `json:"actions_inventory"` NotedItemID uint16 `json:"noted_item_id"` NotedTemplate uint16 `json:"noted_template"` StackItemIDs [10]uint16 `json:"stack_item_ids"` StackQuantities [10]uint16 `json:"stack_quantities"` Team int8 `json:"team"` BoughtLinkID uint16 `json:"bought_link_id"` BoughtTemplate uint16 `json:"bought_template"` PlaceholderItemID uint16 `json:"placeholder_item_id"` PlaceholderTemplate uint16 `json:"placeholder_template"` ShiftClickDropIndex uint8 `json:"shift_click_drop_index"` Params map[uint32]any `json:"params"` InventoryModelData InventoryModelData `json:"inventory_model_data"` CharacterModelDataMale CharacterModelData `json:"character_model_data_male"` CharacterModelDataFemale CharacterModelData `json:"character_model_data_female"` WearPositionPrimary uint8 `json:"wear_position_primary"` WearPositionSecondary uint8 `json:"wear_position_secondary"` WearPositionTertiary uint8 `json:"wear_position_tertiary"` }
type JSONExportMode ¶
type JSONExportMode string
const ( JsonExportModeSingle JSONExportMode = "single" JsonExportModeIndividual JSONExportMode = "individual" )
type JSONExporter ¶
type JSONExporter[K comparable, V any] struct { // contains filtered or unexported fields }
func NewJSONExporter ¶
func NewJSONExporter[K comparable, V any](definitions map[K]V, outputDir string) *JSONExporter[K, V]
func (*JSONExporter[K, V]) ExportAll ¶
func (e *JSONExporter[K, V]) ExportAll(filename string) error
func (*JSONExporter[K, V]) ExportIndividual ¶
func (e *JSONExporter[K, V]) ExportIndividual(prefix string) error
func (*JSONExporter[K, V]) ExportToJSON ¶
func (e *JSONExporter[K, V]) ExportToJSON(mode JSONExportMode, filename string) error
type NPC ¶
type NPC struct { ID uint16 `json:"id"` Category uint16 `json:"category"` Name string `json:"name"` Examine string `json:"examine"` Size uint8 `json:"size"` Height uint16 `json:"height"` Hitpoints uint16 `json:"hitpoints"` Attack uint16 `json:"attack"` Strength uint16 `json:"strength"` Defense uint16 `json:"defense"` Ranged uint16 `json:"ranged"` Magic uint16 `json:"magic"` CombatLevel uint16 `json:"combat_level"` Actions [5]string `json:"actions"` Interactable bool `json:"interactable"` Follower bool `json:"follower"` LowPriority bool `json:"low_priority"` Visible bool `json:"visible"` VisibleOnMinimap bool `json:"visible_on_minimap"` Configs []uint16 `json:"configs"` VarbitID uint16 `json:"varbit_id"` VarpIndex uint16 `json:"varp_index"` OobChild uint16 `json:"oob_child"` Params map[uint32]any `json:"params"` ModelData NPCModelData `json:"model_data"` AnimationData NPCAnimationData `json:"animation_data"` }
type NPCAnimationData ¶
type NPCAnimationData struct { Idle uint16 `json:"idle"` IdleRotateLeft uint16 `json:"idle_rotate_left"` IdleRotateRight uint16 `json:"idle_rotate_right"` Walking uint16 `json:"walking"` WalkingRotateLeft uint16 `json:"walking_rotate_left"` WalkingRotateRight uint16 `json:"walking_rotate_right"` WalkingRotate180 uint16 `json:"walking_rotate_180"` Running uint16 `json:"running"` RunningRotateLeft uint16 `json:"running_rotate_left"` RunningRotateRight uint16 `json:"running_rotate_right"` RunningRotate180 uint16 `json:"running_rotate_180"` Crawling uint16 `json:"crawling"` CrawlingRotateLeft uint16 `json:"crawling_rotate_left"` CrawlingRotateRight uint16 `json:"crawling_rotate_right"` CrawlingRotate180 uint16 `json:"crawling_rotate_180"` }
type NPCModelData ¶
type NPCModelData struct { Models []uint16 `json:"models"` ChatHeadModels []uint16 `json:"chat_head_models"` RecolorFrom []uint16 `json:"recolor_from"` RecolorTo []uint16 `json:"recolor_to"` RetextureFrom []uint16 `json:"retexture_from"` RetextureTo []uint16 `json:"retexture_to"` ScaleHeight uint16 `json:"scale_height"` ScaleWidth uint16 `json:"scale_width"` RenderPriority bool `json:"render_priority"` Ambient uint8 `json:"ambient"` Contrast uint8 `json:"contrast"` HeadIcon uint16 `json:"head_icon"` HeadIconArchive []int16 `json:"head_icon_archive"` HeadIconSpriteIndex []int16 `json:"head_icon_sprite_index"` RotateSpeed uint16 `json:"rotate_speed"` RotateFlag bool `json:"rotate_flag"` }
type Object ¶
type Object struct { ID uint16 `json:"id"` Category uint16 `json:"category"` Name string `json:"name"` ConfigID uint16 `json:"config_id"` MapAreaID uint16 `json:"map_area_id"` MapSceneID uint16 `json:"map_scene_id"` AnimationID uint16 `json:"animation_id"` Solid bool `json:"solid"` Shadow bool `json:"shadow"` ObstructGround bool `json:"obstruct_ground"` SupportsItems uint8 `json:"supports_items"` Actions [5]string `json:"actions"` InteractType uint8 `json:"interact_type"` Rotated bool `json:"rotated"` AmbientSoundID uint16 `json:"ambient_sound_id"` AmbientSoundIDs []uint16 `json:"ambient_sound_ids"` AmbientSoundDistance uint8 `json:"ambient_sound_distance"` AmbientSoundRetain uint8 `json:"ambient_sound_retain"` AmbientSoundChangeTicksMin uint16 `json:"ambient_sound_change_ticks_min"` AmbientSoundChangeTicksMax uint16 `json:"ambient_sound_change_ticks_max"` BlocksProjectile bool `json:"blocks_projectile"` WallOrDoor uint8 `json:"wall_or_door"` ContouredGround uint8 `json:"contoured_ground"` ConfigChangeDest []uint16 `json:"config_change_dest"` Params map[uint32]any `json:"params"` ModelData ObjectModelData `json:"model_data"` }
type ObjectModelData ¶
type ObjectModelData struct { Models []uint16 `json:"models"` Types []uint8 `json:"types"` RecolorFrom []uint16 `json:"recolor_from"` RecolorTo []uint16 `json:"recolor_to"` RetextureFrom []uint16 `json:"retexture_from"` RetextureTo []uint16 `json:"retexture_to"` SizeX uint8 `json:"size_x"` SizeY uint8 `json:"size_y"` OffsetX uint16 `json:"offset_x"` OffsetY uint16 `json:"offset_y"` OffsetZ uint16 `json:"offset_z"` ModelSizeX uint16 `json:"model_size_x"` ModelSizeY uint16 `json:"model_size_y"` ModelSizeZ uint16 `json:"model_size_z"` VarpID uint16 `json:"varp_id"` Ambient uint8 `json:"ambient"` Contrast uint8 `json:"contrast"` DecordDisplacement uint8 `json:"decord_displacement"` MergeNormals bool `json:"merge_normals"` BlockingMask uint8 `json:"blocking_mask"` }
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) ReadBigSmart2 ¶
func (*Reader) ReadSmartUint ¶
func (*Reader) ReadString ¶
func (*Reader) ReadUint16 ¶
func (*Reader) ReadUint16SmartMinus1 ¶
func (*Reader) ReadUint24 ¶
func (*Reader) ReadUint32 ¶
type Sprite ¶
type Texture ¶
type Texture struct { ID uint16 SpriteIDs []uint16 Opaque bool // Not 100% sure this is Opaque Colors []int32 // Not 100% sure this is Colors AverageRGB uint16 // Not 100% sure this is AverageRGB BlendModes []uint8 // Not 100% sure this is BlendModes AnimationSpeed uint8 AnimationDirection uint8 AnimationFrames []uint8 // Not 100% sure this is AnimationFrames }
func NewTexture ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.