// Copyright (C) 2007 EQ2EMulator Development Team - GNU GPL v3 #pragma once #include // Equipment slot indices for character gear #define SPAWN_PACKET_SIZE 895 #define EQUIPMENT_L_WEAPON_INDEX 0 // Character's left hand weapon #define EQUIPMENT_R_WEAPON_INDEX 1 // Character's right hand weapon #define EQUIPMENT_HELMET 2 // Character's helmet slot #pragma pack(1) // Key generation structure for authentication struct KeyGen_Struct { int32_t size; // Size of the key data }; // End structure for key generation process struct KeyGen_End_Struct { int32_t exponent_len; // Length of the exponent int8_t exponent; // Exponent value for key calculation }; // Login request structure for account authentication struct LoginByNumRequest_Struct { int32_t account_id; // Account identifier int32_t access_code; // Access code for authentication int16_t version; // Client version int32_t unknown2[5]; // Reserved fields }; // Login server response structure struct LS_LoginResponse { int8_t reply_code; // 0 = granted, 1 = denied int16_t unknown01; // Reserved field int8_t unknown02; // Reserved field int32_t unknown03; // -1 = denied, 0 = granted int32_t unknown04; // Reserved field int32_t unknown05; // Reserved field int32_t unknown06; // Reserved field int8_t unknown07; // Reserved field int8_t unknown08; // Reserved field int8_t unknown09; // Reserved field int8_t unknown10; // Reserved field int32_t unknown11; // Reserved field int32_t accountid; // Account identifier int16_t unknown12; // Reserved field }; #pragma pack() // Equipment slot enumeration for character gear placement enum EQ2_EquipmentSlot { slot_primary = 0, // Primary weapon slot slot_secondary = 1, // Secondary weapon slot slot_head = 2, // Head/helmet slot slot_chest = 3, // Chest armor slot slot_shoulders = 4, // Shoulder armor slot slot_forearms = 5, // Forearm armor slot slot_hands = 6, // Hand/glove armor slot slot_legs = 7, // Leg armor slot slot_feet = 8, // Foot armor slot slot_left_ring = 9, // Left ring slot slot_right_ring = 10, // Right ring slot slot_ears = 11, // Earring slot slot_neck = 12, // Necklace slot slot_left_wrist = 13, // Left wrist slot slot_right_wrist = 14, // Right wrist slot slot_ranged = 15, // Ranged weapon slot slot_ammo = 16, // Ammunition slot slot_waist = 17, // Belt/waist slot slot_activate1 = 18, // First activatable item slot slot_activate2 = 19, // Second activatable item slot slot_textures = 20, // Texture overlay slot slot_hair = 21, // Hair style slot slot_beard = 22, // Beard style slot slot_naked_chest = 23, // Naked chest appearance slot slot_naked_legs = 24 // Naked legs appearance slot }; // Individual equipment item with visual properties struct EQ2_EquipmentItem { int16_t type; // Item type identifier EQ2_Color color; // Primary color of the item EQ2_Color highlight; // Highlight color of the item }; // Complete equipment set for a character struct EQ2_Equipment { int16_t equip_id[25]; // Equipment item IDs for each slot EQ2_Color color[25]; // Primary colors for each equipment slot EQ2_Color highlight[25]; // Highlight colors for each equipment slot }; #pragma pack(1) // Character appearance features and customization options struct CharFeatures { int16_t hair_type; // Hair style type int16_t hair_face_type; // Facial hair type int16_t wing_type; // Wing type (for races with wings) int16_t chest_type; // Chest appearance type int16_t legs_type; // Leg appearance type int8_t eye_type[3]; // Eye shape variations int8_t ear_type[3]; // Ear shape variations int8_t eye_brow_type[3]; // Eyebrow shape variations int8_t cheek_type[3]; // Cheek shape variations int8_t lip_type[3]; // Lip shape variations int8_t chin_type[3]; // Chin shape variations int8_t nose_type[3]; // Nose shape variations int8_t body_size; // Body size modifier int8_t body_age; // Body age appearance int8_t soga_eye_type[3]; // SOGA eye shape variations int8_t soga_ear_type[3]; // SOGA ear shape variations int8_t soga_eye_brow_type[3]; // SOGA eyebrow shape variations int8_t soga_cheek_type[3]; // SOGA cheek shape variations int16_t soga_chest_type; // SOGA chest appearance type int16_t soga_legs_type; // SOGA leg appearance type int8_t soga_lip_type[3]; // SOGA lip shape variations int8_t soga_chin_type[3]; // SOGA chin shape variations int8_t soga_nose_type[3]; // SOGA nose shape variations int8_t soga_body_size; // SOGA body size modifier int8_t soga_body_age; // SOGA body age appearance int16_t soga_hair_type; // SOGA hair style type int16_t soga_hair_face_type; // SOGA facial hair type int16_t combat_voice; // Combat voice type int16_t emote_voice; // Emote voice type int16_t mount_model_type; // Mount model type // Color customization for various character features EQ2_Color mount_saddle_color; // Mount saddle color EQ2_Color mount_color; // Mount body color EQ2_Color skin_color; // Skin color EQ2_Color eye_color; // Eye color EQ2_Color hair_type_color; // Primary hair color EQ2_Color hair_type_highlight_color; // Hair highlight color EQ2_Color hair_face_color; // Facial hair color EQ2_Color hair_face_highlight_color; // Facial hair highlight color EQ2_Color hair_highlight_color; // Hair highlight color EQ2_Color wing_color1; // Wing primary color EQ2_Color wing_color2; // Wing secondary color EQ2_Color shirt_color; // Shirt color EQ2_Color pants_color; // Pants color EQ2_Color hair_color1; // Hair primary color EQ2_Color hair_color2; // Hair secondary color EQ2_Color soga_skin_color; // SOGA skin color EQ2_Color soga_eye_color; // SOGA eye color EQ2_Color soga_hair_color1; // SOGA hair primary color EQ2_Color soga_hair_color2; // SOGA hair secondary color EQ2_Color soga_hair_type_color; // SOGA primary hair color EQ2_Color soga_hair_type_highlight_color; // SOGA hair highlight color EQ2_Color soga_hair_face_color; // SOGA facial hair color EQ2_Color soga_hair_face_highlight_color; // SOGA facial hair highlight color EQ2_Color soga_hair_highlight_color; // SOGA hair highlight color EQ2_Color model_color; // Model color EQ2_Color soga_model_color; // SOGA model color }; // Position and movement data for entities struct PositionData { int32_t grid_id; // Current grid identifier int32_t bad_grid_id; // Invalid grid identifier int8_t Speed1; // Primary speed value int8_t Speed2; // Secondary speed value int16_t Dir1; // Primary direction int16_t Dir2; // Secondary direction int16_t Pitch1; // Primary pitch angle int16_t Pitch2; // Secondary pitch angle int16_t Roll; // Roll angle float X; // X coordinate float Y; // Y coordinate float Z; // Z coordinate float X2; // Secondary X coordinate float Y2; // Secondary Y coordinate float Z2; // Secondary Z coordinate float X3; // Tertiary X coordinate float Y3; // Tertiary Y coordinate float Z3; // Tertiary Z coordinate float SpawnOrigX; // Original spawn X coordinate float SpawnOrigY; // Original spawn Y coordinate float SpawnOrigZ; // Original spawn Z coordinate float SpawnOrigHeading; // Original spawn heading float SpawnOrigPitch; // Original spawn pitch float SpawnOrigRoll; // Original spawn roll float SpeedX; // X-axis speed float SpeedY; // Y-axis speed float SpeedZ; // Z-axis speed float SideSpeed; // Lateral movement speed float VertSpeed; // Vertical movement speed float ClientHeading1; // Client-side heading (primary) float ClientHeading2; // Client-side heading (secondary) float ClientPitch; // Client-side pitch int16_t collision_radius; // Collision detection radius int16_t state; // Current movement state }; // Visual appearance and display properties for entities struct AppearanceData { PositionData pos; // Position and movement data int16_t model_type; // 3D model type identifier int16_t soga_model_type; // SOGA model type identifier int16_t activity_status; // Current activity status int16_t visual_state; // Visual state flags int16_t action_state; // Action state flags int16_t mood_state; // Mood/emotion state int16_t emote_state; // Current emote state int8_t attackable; // Whether entity can be attacked int8_t icon; // Icon type to display int8_t hide_hood; // Whether to hide hood graphics int8_t show_level; // Whether to show level int8_t locked_no_loot; // Locked status with no loot int8_t quest_flag; // Quest-related flag int8_t heroic_flag; // Heroic opportunity flag int8_t show_command_icon; // Whether to show command icon int8_t display_hand_icon; // Whether to show hand cursor icon int8_t player_flag; // Player character flag int8_t targetable; // Whether entity can be targeted int8_t display_name; // Whether to display name char sub_title[255]; // Subtitle text (Guild name) int32_t display_hp; // Health percentage (0 = 100%) int32_t power_left; // Power remaining (bar hidden if >=100) int8_t adventure_class; // Adventure class identifier int8_t tradeskill_class; // Tradeskill class identifier int8_t level; // Character level int8_t tradeskill_level; // Tradeskill level int8_t min_level; // Minimum level for encounters int8_t max_level; // Maximum level for encounters int8_t difficulty; // Encounter difficulty rating int16_t visible; // Visibility state (02 = normal, 15 = shadow) char name[128]; // Entity name char last_name[64]; // Last name (for players) char prefix_title[128]; // Title prefix char suffix_title[128]; // Title suffix int8_t race; // Race identifier int8_t gender; // Gender identifier int32_t randomize; // Randomization seed int8_t lua_race_id; // Lua script race identifier }; // Player movement update packet structure struct Player_Update { /*0000*/ int32_t activity; // Activity state /*0004*/ float unknown2; // Unknown value (typically 1) /*0008*/ float direction1; // Primary direction /*0012*/ float unknown3[8]; // Unknown array of values /*0044*/ float speed; // Movement speed /*0048*/ float side_speed; // Lateral movement speed /*0052*/ float vert_speed; // Vertical movement speed /*0056*/ float orig_x; // Original X position /*0060*/ float orig_y; // Original Y position /*0064*/ float orig_z; // Original Z position /*0068*/ float orig_x2; // Secondary original X position /*0072*/ float orig_y2; // Secondary original Y position /*0076*/ float orig_z2; // Secondary original Z position /*0080*/ float unknown5[3]; // Unknown array of values /*0092*/ int32_t unknown6; // Unknown value /*0096*/ float unknown7[3]; // Unknown array of values /*0108*/ int32_t unknown8; // Unknown value /*0112*/ int32_t grid_location; // Grid location identifier /*0116*/ float x; // Current X position /*0120*/ float y; // Current Y position /*0124*/ float z; // Current Z position /*0128*/ float direction2; // Secondary direction /*0132*/ float pitch; // Pitch angle /*0136*/ float unknown10; // Unknown value /*0140*/ float speed_x; // X-axis velocity /*0144*/ float speed_y; // Y-axis velocity /*0148*/ float speed_z; // Z-axis velocity }; // Enhanced player movement update for version 283 struct Player_Update283 { /*0000*/ int32_t activity; // Activity state /*0004*/ int32_t movement_mode; // Movement mode (typically 1) /*0008*/ float direction1; // Primary direction /*0012*/ float desiredpitch; // Desired pitch angle /*0016*/ float desired_heading_speed; // Desired heading change speed /*0020*/ float desired_pitch_speed; // Desired pitch change speed /*0024*/ float collision_radius; // Collision detection radius /*0028*/ float collision_scale; // Collision scale factor /*0032*/ float temp_scale; // Temporary scale factor /*0036*/ float speed_modifier; // Speed modification factor /*0040*/ float swim_speed_modifier; // Swimming speed modifier /*0044*/ float speed; // Movement speed /*0048*/ float side_speed; // Lateral movement speed /*0052*/ float vert_speed; // Vertical movement speed /*0056*/ float orig_x; // Original X position /*0060*/ float orig_y; // Original Y position /*0064*/ float orig_z; // Original Z position /*0068*/ float orig_x2; // Secondary original X position /*0072*/ float orig_y2; // Secondary original Y position /*0076*/ float orig_z2; // Secondary original Z position /*0080*/ int32_t face_actor_id; // ID of actor to face /*0084*/ int32_t face_actor_range; // Range for facing actor /*0088*/ int32_t grid_location; // Grid location identifier /*0092*/ float x; // Current X position /*0096*/ float y; // Current Y position /*0100*/ float z; // Current Z position /*0104*/ float direction2; // Secondary direction /*0108*/ float pitch; // Pitch angle /*0112*/ float roll; // Roll angle /*0116*/ float speed_x; // X-axis velocity /*0120*/ float speed_y; // Y-axis velocity /*0124*/ float speed_z; // Z-axis velocity }; // Total size: 0128 // Player movement update for version 1096 struct Player_Update1096 { /*0000*/ int32_t activity; // Activity state /*0004*/ float unknown2; // Unknown value (typically 1) /*0008*/ float direction1; // Primary direction /*0012*/ float unknown3[8]; // Unknown array of values /*0044*/ float unk_speed; // Unknown speed value /*0048*/ float speed; // Movement speed /*0052*/ float side_speed; // Lateral movement speed /*0056*/ float vert_speed; // Vertical movement speed /*0060*/ float orig_x; // Original X position /*0064*/ float orig_y; // Original Y position /*0068*/ float orig_z; // Original Z position /*0072*/ float orig_x2; // Secondary original X position /*0076*/ float orig_y2; // Secondary original Y position /*0080*/ float orig_z2; // Secondary original Z position /*0092*/ float unknown5[3]; // Unknown array of values /*0096*/ int32_t unknown6; // Unknown value /*0108*/ float unknown7[3]; // Unknown array of values /*0112*/ int32_t unknown8; // Unknown value /*0116*/ int32_t grid_location; // Grid location identifier /*0120*/ float x; // Current X position /*0124*/ float y; // Current Y position /*0128*/ float z; // Current Z position /*0132*/ float direction2; // Secondary direction /*0136*/ float pitch; // Pitch angle /*0140*/ float unknown10; // Unknown value /*0144*/ float speed_x; // X-axis velocity /*0148*/ float speed_y; // Y-axis velocity /*0152*/ float speed_z; // Z-axis velocity }; // Player movement update for version 1144 struct Player_Update1144 { /*0000*/ int32_t activity; // Activity state /*0004*/ float unknown2; // Unknown value (typically 1) /*0008*/ float direction1; // Primary direction /*0012*/ float unknown3[12]; // Extended unknown array of values /*0044*/ float unk_speed; // Unknown speed value /*0048*/ float speed; // Movement speed /*0052*/ float side_speed; // Lateral movement speed /*0056*/ float vert_speed; // Vertical movement speed /*0060*/ float orig_x; // Original X position /*0064*/ float orig_y; // Original Y position /*0068*/ float orig_z; // Original Z position /*0072*/ float orig_x2; // Secondary original X position /*0076*/ float orig_y2; // Secondary original Y position /*0080*/ float orig_z2; // Secondary original Z position /*0092*/ float unknown5[3]; // Unknown array of values /*0096*/ int32_t unknown6; // Unknown value /*0108*/ float unknown7[3]; // Unknown array of values /*0112*/ int32_t unknown8; // Unknown value /*0116*/ int32_t grid_location; // Grid location identifier /*0120*/ float x; // Current X position /*0124*/ float y; // Current Y position /*0128*/ float z; // Current Z position /*0132*/ float direction2; // Secondary direction /*0136*/ float pitch; // Pitch angle /*0140*/ float unknown10; // Unknown value /*0144*/ float speed_x; // X-axis velocity /*0148*/ float speed_y; // Y-axis velocity /*0152*/ float speed_z; // Z-axis velocity }; #pragma pack()