View Single Post
  #5  
Old 07-17-2014, 07:28 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

I didnt realize that the knockback method was working like that. Anyway the code I actually am using that is still reproducing these results is the following:

Code:
void Mob::PushClient(Mob *pusher)
 {

float distance = 0.02;
 
if(distance > 0.0)
 {
 float angle = pusher->GetHeading() / 128.0f * 3.14159;
 // Warp(x_pos + sin(angle) * distance, y_pos + cos(angle) * distance, z_pos);
 
x_pos += sin(angle) * distance;
 y_pos += cos(angle) * distance;
 
EQApplicationPacket* app = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
 PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)app->pBuffer;
 MakeSpawnUpdateNoDelta(spu);
 // move_tic_count = 0; Commented because this section was copied and I don't think it applies
 app->priority = 6;
 entity_list.QueueClients(this, app, true);
 CastToClient()->FastQueuePacket(&app);
 safe_delete(app);
 }
 }

This seems to work just fine at least when I use that calculation with players hitting mobs. I am still getting the results with clients however. I didnt write the formula I took it from elsewhere.
Reply With Quote