dbc

package
v0.0.0-...-382259f Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package dbc implements a reflection-based decoder for multiple versions of the DBC/DB2 format

Index

Constants

View Source
const (
	// Format versions
	WDBC MagicType = 1
	WDB2 MagicType = 2
	WDB3 MagicType = 3
	WDB4 MagicType = 4
	WDB5 MagicType = 5
	WDB6 MagicType = 6
	WDC1 MagicType = 7
	WDC2 MagicType = 8

	HasOffsetMap    uint16 = 0x01
	HasSecondaryKey uint16 = 0x02
	HasNonOnlineIds uint16 = 0x04
	IsBitpacked     uint16 = 0x10
)
View Source
const (
	Empty = -1

	// InventoryTypes
	IT_Unequippable = 0
	IT_Head         = 1
	IT_Neck         = 2
	IT_Shoulder     = 3
	IT_Shirt        = 4
	IT_Chest        = 5
	IT_Waist        = 6
	IT_Legs         = 7
	IT_Feet         = 8
	IT_Wrists       = 9
	IT_Hands        = 10
	IT_Finger       = 11
	IT_Trinket      = 12
	IT_Weapon       = 13
	IT_Shield       = 14
	IT_Ranged       = 15
	IT_Back         = 16
	IT_TwoHand      = 17
	IT_Bag          = 18
	IT_Tabard       = 19
	IT_Robe         = 20
	IT_MainHand     = 21
	IT_OffHand      = 22
	IT_Holdable     = 23
	IT_Ammo         = 24
	IT_Thrown       = 25
	IT_Gun          = 26
	IT_Quiver       = 27
	IT_Relic        = 28
)

Variables

This section is empty.

Functions

func EncodeDB5

func EncodeDB5(e *etc.Buffer, locale uint32, v interface{}) error

Types

type DBC

type DBC struct {
	Magic           MagicType
	RecordCount     uint32
	FieldCount      uint32
	RecordSize      uint32
	StringBlockSize uint32

	// DB2 only
	TableHash            uint32
	Build                vsn.Build
	TimestampLastWritten uint32
	MinID, MaxID         uint32
	Locale               uint32
	CopyTableSize        uint32

	// DB5
	LayoutHash     uint32
	Flags          uint16
	IDIndex        uint16
	FieldStructure []FieldStruct
	// contains filtered or unexported fields
}

DBC contains DBC/DB2 file metadata.

func Decode

func Decode(game vsn.Build, i *etc.Buffer) (*DBC, error)

func Open

func Open(game vsn.Build, path string) (*DBC, error)

func Parse

func Parse(game vsn.Build, input []byte) (*DBC, error)

func (*DBC) ParseRecords

func (d *DBC) ParseRecords(out interface{}) error

type Ent_AreaTable

type Ent_AreaTable struct {
	ID                          uint32
	ContinentID                 uint32
	ParentArea                  uint32
	ExploreFlag                 uint32
	Flags                       uint32
	SoundProviderPref           uint32
	SoundProviderPrefUnderwater uint32
	AmbienceID                  uint32
	ZoneMusic                   uint32
	IntroMusic                  uint32
	ExplorationLevel            uint32
	Name                        string `dbc:"(loc)"`
	FactionGroup                uint32
	LiquidTypes                 []uint32 `dbc:"-5875(len:1),8606-(len:4)"`
	MinElevation                float32
	AmbientMultiplier           float32
	LightID                     uint32 `dbc:"8606(disabled)"`
}

type Ent_AreaTrigger

type Ent_AreaTrigger struct {
	ID     uint32 `xorm:"'id' pk"`
	MapID  uint32
	X      float32
	Y      float32
	Z      float32
	Radius float32
	BoxX   float32 `dbc:"5875-(only)"`
	BoxY   float32 `dbc:"5875-(only)"`
	BoxZ   float32 `dbc:"5875-(only)"`
	BoxO   float32 `dbc:"5875-(only)"`
}

type Ent_BarberShopStyle

type Ent_BarberShopStyle struct {
	ID           uint32
	Type         uint32
	Name         string `dbc:"(loc)"`
	Description  string `dbc:"(loc)"`
	CostModifier float32
	RaceID       uint32
	Gender       uint32
	HairID       uint32
}

type Ent_CharStartOutfit

type Ent_CharStartOutfit struct {
	ID             uint32       `xorm:"'id' pk"`
	Race           packet.Race  `xorm:"'race'"`
	Class          packet.Class `xorm:"'class'"`
	Gender         uint8        `xorm:"'gender'"`
	OutfitID       uint8        `xorm:"'outfit_id'"`
	ItemIDs        []int32      `xorm:"'item_ids'" dbc:"-8606(len:12),12340(len:24)"`
	DisplayInfoIDs []int32      `xorm:"'display_info_ids'" dbc:"-8606(len:12),12340(len:24)"`
	InventoryTypes []int32      `xorm:"'inventory_types'" dbc:"-8606(len:12),12340(len:24)"`
}

type Ent_ChatProfanity

type Ent_ChatProfanity struct {
	ID         uint32
	Text       string
	LanguageID uint32
}

type Ent_ChrClasses

type Ent_ChrClasses struct {
	ID                  uint32 `xorm:"'id' pk"`
	Flag                uint32
	DamageBonusStat     uint32 `dbc:"-5875(only)"`
	PowerType           uint32
	PetNameToken        uint32 `dbc:"8606-(only)"`
	PetNameTokenString  string `dbc:"-5875(only)"`
	Name                string `dbc:"(loc)"`
	NameFemale          string `dbc:"8606-(only,loc)"`
	NameMale            string `dbc:"8606-(only,loc)"`
	Filename            string
	SpellClassSet       uint32
	Flags               uint32
	CinematicSequenceID uint32 `dbc:"12340-(only)"`
	Expansion           uint32 `dbc:"12340-(only)"`
}

type Ent_ChrRaces

type Ent_ChrRaces struct {
	ID                      uint32 `xorm:"'id' pk"`
	Flags                   uint32
	FactionID               uint32 `xorm:"'faction_id'"`
	ExplorationSound        uint32 `dbc:"5875-(only)"`
	MaleDisplayID           uint32 `xorm:"'male_display_id'"`
	FemaleDisplayID         uint32 `xorm:"'female_display_id'"`
	ClientPrefix            string
	Speed                   float32 `dbc:"12340-(disabled)"`
	BaseLanguage            uint32
	CreatureType            uint32
	LoginEffectSpellID      uint32 `dbc:"-5875(only)"`
	UnalteredVisualRaceID   uint32 `dbc:"-5875(only)"`
	ResSicknessSpellID      uint32
	SplashSoundID           uint32
	StartingTaxiNodes       uint32 `dbc:"-5875(only)"`
	ClientFileString        string
	CinematicSequenceID     uint32
	Alliance                uint32   `dbc:"12340-(only)"`
	Name                    string   `dbc:"(loc)"`
	NameFemale              string   `dbc:"8606-(only,loc)"`
	NameMale                string   `dbc:"8606-(only,loc)"`
	FacialHairCustomization []string `dbc:"5875-(only,len:2)"`
	HairCustomization       string   `dbc:"5875-(only)"`
	Expansion               uint32   `dbc:"8606-(only)"`
}

type Ent_CreatureFamily

type Ent_CreatureFamily struct {
	ID             uint32
	MinScale       float32
	MinScaleLevel  uint32
	MaxScale       float32
	MaxScaleLevel  uint32
	SkillLine      []uint32 `dbc:"3368(only,len:2)"`
	PetFoodMask    uint32   `dbc:"5875-(only)"`
	PetTalentType  uint32   `dbc:"5875-(only)"`
	CategoryEnumID uint32   `dbc:"5875-(only)"`
	Name           string   `dbc:"5875-(only,loc)"`
	IconFile       string   `dbc:"5875-(only)"`
}

type Ent_DeclinedWord

type Ent_DeclinedWord struct {
	ID   uint32
	Word string
}

type Ent_Emotes

type Ent_Emotes struct {
	ID                 uint32 `xorm:"'id' pk"`
	EmoteSlashCommand  string
	AnimID             uint32 `dbc:"5875-(only)"`
	EmoteFlags         uint32
	EmoteSpecProc      uint32
	EmoteSpecProcParam uint32
	EventSoundID       uint32 `dbc:"5875-(only)"`
}

type Ent_EmotesText

type Ent_EmotesText struct {
	ID        uint32 `xorm:"'id' pk"`
	Name      string
	EmoteID   uint32   `xorm:"'emote_id'"`
	EmoteText []uint32 `dbc:"(len:16)"`
}

type Ent_EmotesTextData

type Ent_EmotesTextData struct {
	ID   uint32
	Text string `dbc:"(loc)"`
}

type Ent_LanguageWord

type Ent_LanguageWord struct {
	ID         uint32
	LanguageID uint32
	Text       string
}

type Ent_Map_5875

type Ent_Map_5875 struct {
	ID              uint32
	Directory       string
	InstanceType    uint32
	MapType         uint32
	Name            string `dbc:"(loc)"`
	MinLevel        uint32
	MaxLevel        uint32
	MaxPlayers      uint32
	EntranceMap     int32
	EntranceX       float32
	EntranceY       float32
	ParentMapID     uint32
	Description0    string `dbc:"(loc)"`
	Description1    string `dbc:"(loc)"`
	LoadingScreenID int32
	RaidOffset      uint32
	ContinentName   uint32
	Scale           float32
}

type Ent_Map_8606

type Ent_Map_8606 struct {
	ID                   uint32
	Directory            string
	InstanceType         uint32
	MapType              uint32
	Name                 string   `dbc:"(loc)"`
	Field05              []uint32 `dbc:"(len:6)"`
	AreaTableID          uint32
	Description0         string `dbc:"(loc)"`
	Description1         string `dbc:"(loc)"`
	LoadingScreenID      uint32
	Field10              uint32
	Field11              uint32
	MinimapIconScale     float32
	RequirementText_Lang string `dbc:"(loc)"`
	HeroicText_Lang      string `dbc:"(loc)"`
	EmptyText2_Lang      string `dbc:"(loc)"`
	CorpseMapID          uint32
	CorpseX              float32
	CorpseY              float32
	ResetTimeRaid        uint32
	ResetTimeHeroic      uint32
	Field21              uint32
	TimeOfDayOverride    uint32
	ExpansionID          uint32
}

type Ent_Spell

type Ent_Spell struct {
	ID                            uint32
	SchoolMask                    uint32
	Category                      uint32
	UICastType                    int32
	Dispel                        uint32
	DispelType                    uint32
	Mechanic                      uint32
	Attributes                    []uint32 `dbc:"(len:5)"`
	ShapeshiftMask                uint32
	ShapeshiftExclude             uint32
	Targets                       uint32
	TargetCreatureType            uint32
	RequiresSpellFocus            uint32
	CasterAuraState               uint32
	TargetAuraState               uint32
	CastingTimeIndex              uint32
	RecoveryTime                  uint32
	CategoryRecoveryTime          uint32
	InterruptFlags                uint32
	AuraInterruptFlags            uint32
	ChannelInterruptFlags         uint32
	ProcFlags                     uint32
	ProcChance                    uint32
	ProcCharges                   uint32
	MaximumLevel                  uint32
	BaseLevel                     uint32
	SpellLevel                    uint32
	DurationIndex                 uint32
	PowerType                     uint32
	ManaCost                      uint32
	ManaCostPerLevel              uint32
	ManaPerSecond                 uint32
	ManaPerSecondPerLevel         uint32
	RangeIndex                    uint32
	Speed                         float32
	ModalNextSpell                uint32
	StackAmount                   uint32
	Totem1                        uint32
	Totem2                        uint32
	Reagents                      []int32 `dbc:"(len:8)"`
	ReagentCounts                 []int32 `dbc:"(len:8)"`
	EquippedItemSubClassMask      int32
	EquippedItemInventoryTypeMask int32
	Effects                       []uint32  `dbc:"(len:3)"`
	EffectDieSides                []int32   `dbc:"(len:3)"`
	EffectBaseDice                []int32   `dbc:"(len:3)"`
	EffectDicePerLevel            []int32   `dbc:"(len:3)"`
	EffectRealPointsPerLevel      []int32   `dbc:"(len:3)"`
	EffectBasePoints              []int32   `dbc:"(len:3)"`
	EffectMechanics               []uint32  `dbc:"(len:3)"`
	EffectImplicitTargetsA        []uint32  `dbc:"(len:3)"`
	EffectImplicitTargetsB        []uint32  `dbc:"(len:3)"`
	EffectRadiusIndices           []uint32  `dbc:"(len:3)"`
	EffectApplyAuraNames          []uint32  `dbc:"(len:3)"`
	EffectAmplitudes              []uint32  `dbc:"(len:3)"`
	EffectMultipleValues          []float32 `dbc:"(len:3)"`
	EffectChainTargets            []uint32  `dbc:"(len:3)"`
	EffectItemTypes               []uint32  `dbc:"(len:3)"`
	EffectMiscValues              []int32   `dbc:"(len:3)"`
	EffectTriggerSpells           []uint32  `dbc:"(len:3)"`
	EffectPointsPerComboPoint     []float32 `dbc:"(len:3)"`
	SpellVisuals                  []uint32  `dbc:"(len:2)"`
	SpellIconID                   uint32
	ActiveIconID                  uint32
	SpellPriority                 uint32
	SpellName                     string `dbc:"(loc)"`
	SpellRank                     string `dbc:"(loc)"`
	SpellDescription              string `dbc:"(loc)"`
	SpellToolTip                  string `dbc:"(loc)"`
	ManaCostPercentage            uint32
	StartRecoveryCategory         uint32
	StartRecoveryTime             uint32
	MaximumTargetLevel            uint32
	SpellClassSet                 uint32
	SpellClassMask                []uint32 `dbc:"(len:2)"`
	MaximumAffectedTargets        uint32
	DamageClass                   uint32
	PreventionType                uint32
	StanceBarOrder                uint32
	EffectDamageMultipliers       []float32 `dbc:"(len:3)"`
	MinimumFactionId              uint32
	MinimumReputation             uint32
	RequiredAuraVision            uint32
}

type FieldStruct

type FieldStruct struct {
	Size     int16
	Position uint16
}

type FieldType

type FieldType int
const (
	Uint8 FieldType = iota
	Uint16
	Uint32
	Uint64
	Int32
	Float
	String
	Array
	Slice
)

func (FieldType) String

func (i FieldType) String() string

type MagicType

type MagicType int

type Record

type Record struct {
	ID        uint32
	Reference uint32
}

Jump to

Keyboard shortcuts

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