eq2go/internal/common/types.go

227 lines
8.2 KiB
Go

package common
type EQ2DataType int
// Constants matching data_struct.hpp exactly
const (
TypeNone EQ2DataType = iota
TypeInt8
TypeInt16
TypeInt32
TypeInt64
TypeFloat
TypeDouble
TypeColor
TypeSInt8
TypeSInt16
TypeSInt32
TypeChar
TypeString8
TypeString16
TypeString32
TypeEquipment
TypeArray
TypeItem
TypeSInt64
)
type EQ2Color struct {
Red int8
Green int8
Blue int8
}
type EQ2EquipmentItem struct {
Type uint16
Color EQ2Color
Highlight EQ2Color
}
type EQ2String8 struct {
Size int8
Data string
}
type EQ2String16 struct {
Size int16
Data string
}
type EQ2String32 struct {
Size int32
Data string
}
const (
SlotPrimary = iota
SlotSecondary
SlotHead
SlotChest
SlotShoulders
SlotForearms
SlotHands
SlotLegs
SlotFeet
SlotLeftRing
SlotRightRing
SlotEars
SlotNeck
SlotLeftWrist
SlotRightWrist
SlotRanged
SlotAmmo
SlotWaist
SlotActivate1
SlotActivate2
SlotTextures
SlotHair
SlotBeard
SlotNakedChest
SlotNakedLegs
)
type EQ2Equipment struct {
EquipID [25]int16 // Equipment item IDs for each slot
Color [25]EQ2Color // Primary colors for each equipment slot
Highlight [25]EQ2Color // Highlight colors for each equipment slot
}
type CharFeatures struct {
HairType int16 // Hair style type
HairFaceType int16 // Facial hair type
WingType int16 // Wing type (for races with wings)
ChestType int16 // Chest appearance type
LegsType int16 // Leg appearance type
EyeType [3]int8 // Eye shape variations
EarType [3]int8 // Ear shape variations
EyeBrowType [3]int8 // Eyebrow shape variations
CheekType [3]int8 // Cheek shape variations
LipType [3]int8 // Lip shape variations
ChinType [3]int8 // Chin shape variations
NoseType [3]int8 // Nose shape variations
BodySize int8 // Body size modifier
BodyAge int8 // Body age appearance
SogaEyeType [3]int8 // SOGA eye shape variations
SogaEarType [3]int8 // SOGA ear shape variations
SogaEyeBrowType [3]int8 // SOGA eyebrow shape variations
SogaCheekType [3]int8 // SOGA cheek shape variations
SogaChestType int16 // SOGA chest appearance type
SogaLegsType int16 // SOGA leg appearance type
SogaLipType [3]int8 // SOGA lip shape variations
SogaChinType [3]int8 // SOGA chin shape variations
SogaNoseType [3]int8 // SOGA nose shape variations
SogaBodySize int8 // SOGA body size modifier
SogaBodyAge int8 // SOGA body age appearance
SogaHairType int16 // SOGA hair style type
SogaHairFaceType int16 // SOGA facial hair type
CombatVoice int16 // Combat voice type
EmoteVoice int16 // Emote voice type
MountModelType int16 // Mount model type
MountSaddleColor EQ2Color // Mount saddle color
MountColor EQ2Color // Mount body color
SkinColor EQ2Color // Skin color
EyeColor EQ2Color // Eye color
HairTypeColor EQ2Color // Primary hair color
HairTypeHighlightColor EQ2Color // Hair highlight color
HairFaceColor EQ2Color // Facial hair color
HairFaceHighlightColor EQ2Color // Facial hair highlight color
HairHighlightColor EQ2Color // Hair highlight color
WingColor1 EQ2Color // Wing primary color
WingColor2 EQ2Color // Wing secondary color
ShirtColor EQ2Color // Shirt color
PantsColor EQ2Color // Pants color
HairColor1 EQ2Color // Hair primary color
HairColor2 EQ2Color // Hair secondary color
SogaSkinColor EQ2Color // SOGA skin color
SogaEyeColor EQ2Color // SOGA eye color
SogaHairColor1 EQ2Color // SOGA hair primary color
SogaHairColor2 EQ2Color // SOGA hair secondary color
SogaHairTypeColor EQ2Color // SOGA primary hair color
SogaHairTypeHighlightColor EQ2Color // SOGA hair highlight color
SogaHairFaceColor EQ2Color // SOGA facial hair color
SogaHairFaceHighlightColor EQ2Color // SOGA facial hair highlight color
SogaHairHighlightColor EQ2Color // SOGA hair highlight color
ModelColor EQ2Color // Model color
SogaModelColor EQ2Color // SOGA model color
}
type PositionData struct {
GridID int32 // Current grid identifier
BadGridID int32 // Invalid grid identifier
Speed1 int8 // Primary speed value
Speed2 int8 // Secondary speed value
Dir1 int16 // Primary direction
Dir2 int16 // Secondary direction
Pitch1 int16 // Primary pitch angle
Pitch2 int16 // Secondary pitch angle
Roll int16 // Roll angle
X float32 // X coordinate
Y float32 // Y coordinate
Z float32 // Z coordinate
X2 float32 // Secondary X coordinate
Y2 float32 // Secondary Y coordinate
Z2 float32 // Secondary Z coordinate
X3 float32 // Tertiary X coordinate
Y3 float32 // Tertiary Y coordinate
Z3 float32 // Tertiary Z coordinate
SpawnOrigX float32 // Original spawn X coordinate
SpawnOrigY float32 // Original spawn Y coordinate
SpawnOrigZ float32 // Original spawn Z coordinate
SpawnOrigHeading float32 // Original spawn heading
SpawnOrigPitch float32 // Original spawn pitch
SpawnOrigRoll float32 // Original spawn roll
SpeedX float32 // X-axis speed
SpeedY float32 // Y-axis speed
SpeedZ float32 // Z-axis speed
SideSpeed float32 // Lateral movement speed
VertSpeed float32 // Vertical movement speed
ClientHeading1 float32 // Client-side heading (primary)
ClientHeading2 float32 // Client-side heading (secondary)
ClientPitch float32 // Client-side pitch
CollisionRadius int16 // Collision detection radius
State int16 // Current movement state
}
type AppearanceData struct {
Pos PositionData // Position and movement data
ModelType int16 // 3D model type identifier
SogaModelType int16 // SOGA model type identifier
ActivityStatus int16 // Current activity status
VisualState int16 // Visual state flags
ActionState int16 // Action state flags
MoodState int16 // Mood/emotion state
EmoteState int16 // Current emote state
Attackable int8 // Whether entity can be attacked
Icon int8 // Icon type to display
HideHood int8 // Whether to hide hood graphics
ShowLevel int8 // Whether to show level
LockedNoLoot int8 // Locked status with no loot
QuestFlag int8 // Quest-related flag
HeroicFlag int8 // Heroic opportunity flag
ShowCommandIcon int8 // Whether to show command icon
DisplayHandIcon int8 // Whether to show hand cursor icon
PlayerFlag int8 // Player character flag
Targetable int8 // Whether entity can be targeted
DisplayName int8 // Whether to display name
SubTitle [255]byte // Subtitle text (Guild name)
DisplayHP int32 // Health percentage (0 = 100%)
PowerLeft int32 // Power remaining (bar hidden if >=100)
AdventureClass int8 // Adventure class identifier
TradeskillClass int8 // Tradeskill class identifier
Level int8 // Character level
TradeskillLevel int8 // Tradeskill level
MinLevel int8 // Minimum level for encounters
MaxLevel int8 // Maximum level for encounters
Difficulty int8 // Encounter difficulty rating
Visible int16 // Visibility state (02 = normal, 15 = shadow)
Name [128]byte // Entity name
LastName [64]byte // Last name (for players)
PrefixTitle [128]byte // Title prefix
SuffixTitle [128]byte // Title suffix
Race int8 // Race identifier
Gender int8 // Gender identifier
Randomize int32 // Randomization seed
LuaRaceID int8 // Lua script race identifier
}