mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
Redo timing on movement and missiles to better match our new tic rate
This commit is contained in:
parent
18d28ae8d3
commit
a632d60140
@ -922,11 +922,11 @@ bool Mob::TryProjectileAttack(Mob *other, const EQEmu::ItemData *item, EQEmu::sk
|
||||
if (slot < 0)
|
||||
return false;
|
||||
|
||||
float speed_mod = speed * 0.45f;
|
||||
float speed_mod = speed;
|
||||
|
||||
float distance = other->CalculateDistance(GetX(), GetY(), GetZ());
|
||||
float hit =
|
||||
60.0f + (distance / speed_mod); // Calcuation: 60 = Animation Lag, 1.8 = Speed modifier for speed of (4)
|
||||
1200.0f + (10 * distance / speed_mod); // Calcuation: 60 = Animation Lag, 1.8 = Speed modifier for speed of (4)
|
||||
|
||||
ProjectileAtk[slot].increment = 1;
|
||||
ProjectileAtk[slot].hit_increment = static_cast<uint16>(hit); // This projected hit time if target does NOT MOVE
|
||||
@ -979,7 +979,7 @@ void Mob::ProjectileAttack()
|
||||
ProjectileAtk[i].tlast_y = target->GetY();
|
||||
float distance = target->CalculateDistance(
|
||||
ProjectileAtk[i].origin_x, ProjectileAtk[i].origin_y, ProjectileAtk[i].origin_z);
|
||||
float hit = 60.0f + (distance / ProjectileAtk[i].speed_mod); // Calcuation: 60 =
|
||||
float hit = 1200.0f + (10 * distance / ProjectileAtk[i].speed_mod); // Calcuation: 60 =
|
||||
// Animation Lag, 1.8 =
|
||||
// Speed modifier for speed
|
||||
// of (4)
|
||||
|
||||
@ -6612,9 +6612,9 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed){
|
||||
|
||||
if (CheckLosFN(spell_target)) {
|
||||
|
||||
float speed_mod = speed * 0.45f; //Constant for adjusting speeds to match calculated impact time.
|
||||
float speed_mod = speed; //Constant for adjusting speeds to match calculated impact time.
|
||||
float distance = spell_target->CalculateDistance(GetX(), GetY(), GetZ());
|
||||
float hit = 60.0f + (distance / speed_mod);
|
||||
float hit = 1200.0f + (10 * distance / speed_mod);
|
||||
|
||||
ProjectileAtk[slot].increment = 1;
|
||||
ProjectileAtk[slot].hit_increment = static_cast<uint16>(hit); //This projected hit time if target does NOT MOVE
|
||||
|
||||
@ -586,7 +586,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, int speed, boo
|
||||
tar_vector = (float)speed / mag;
|
||||
|
||||
// mob move fix
|
||||
int numsteps = (int)(mag * 16.0f / (float)speed + 0.5f);
|
||||
int numsteps = (int)(mag * 13.5f / (float)speed + 0.5f);
|
||||
|
||||
|
||||
// mob move fix
|
||||
@ -626,12 +626,17 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, int speed, boo
|
||||
}
|
||||
|
||||
else {
|
||||
tar_vector /= 16.0f;
|
||||
tar_vector /= 13.5f;
|
||||
float dur = Timer::GetCurrentTime() - pLastChange;
|
||||
if (dur < 1.0f) {
|
||||
dur = 1.0f;
|
||||
if (dur < 0.0f) {
|
||||
dur = 0.0f;
|
||||
}
|
||||
tar_vector = (tar_vector * AImovement_duration) / 100.0f;
|
||||
|
||||
if (dur > 100.f) {
|
||||
dur = 100.f;
|
||||
}
|
||||
|
||||
tar_vector *= (dur / 100.0f);
|
||||
|
||||
float new_x = m_Position.x + m_TargetV.x*tar_vector;
|
||||
float new_y = m_Position.y + m_TargetV.y*tar_vector;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user