Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct SpawnPositionUpdate_Struct
- {
- /*0000*/ int16 spawn_id; // Comment: Id of spawn to update
- /*0002*/ sint8 anim_type; // Comment: Velocity of the spawn on the client maalanar 2008-02-05: updated to be signed (confirmed by Sp0tter)
- /*0003*/ int8 heading; // Comment: Heading
- /*0004*/ sint8 delta_heading; // Comment: Heading Change
- /*0005*/ sint16 y_pos; // Comment: New Y position of spawn
- /*0007*/ sint16 x_pos; // Comment: New X position of spawn
- /*0009*/ sint16 z_pos; // Comment: New Z position of spawn
- /*0011*/ int32 delta_y:10, // Y Velocity
- spacer1:1, // ***Placeholder
- delta_z:10, // Z Velocity
- spacer2:1, // ***Placeholder
- delta_x:10; // X Velocity
- };
- ENCODE(OP_ClientUpdate) {
- SETUP_VAR_ENCODE(PlayerPositionUpdateServer_Struct);
- EQApplicationPacket* app = new EQApplicationPacket(OP_MobUpdate, sizeof(structs::SpawnPositionUpdates_Struct) + sizeof(structs::SpawnPositionUpdate_Struct));
- structs::SpawnPositionUpdates_Struct *data = (structs::SpawnPositionUpdates_Struct *) app->pBuffer;
- data->num_updates = 1;
- data->spawn_update[0].spawn_id = emu->spawn_id;
- data->spawn_update[0].anim_type = (sint8)emu->animation/4;
- data->spawn_update[0].x_pos = (sint16)EQ19toFloat(emu->x_pos);
- data->spawn_update[0].y_pos = (sint16)EQ19toFloat(emu->y_pos);
- data->spawn_update[0].z_pos = (sint16)EQ19toFloat(emu->z_pos) * 10;
- data->spawn_update[0].heading = (int8)EQ19toFloat(emu->heading);
- if ( emu->delta_x == 0 && emu->delta_y == 0)
- {
- data->spawn_update[0].delta_x = 0;
- data->spawn_update[0].delta_y = 0;
- data->spawn_update[0].delta_z = 0;
- }
- else
- {
- data->spawn_update[0].delta_x = (int32)NewEQ13toFloat(emu->delta_x)/125;
- data->spawn_update[0].delta_y = (int32)NewEQ13toFloat(emu->delta_y)/125;
- data->spawn_update[0].delta_z = (int32)NewEQ13toFloat(emu->delta_z)/40;
- }
- data->spawn_update[0].delta_heading = (sint8)NewEQ13toFloat(emu->delta_heading);
- dest->FastQueuePacket(&app);
- delete[] __emu_buffer;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement