mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 09:07:19 +00:00
Merge branch 'liyunfan1223:master' into oil_fix
This commit is contained in:
@@ -2566,7 +2566,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, float x, float y, float z, uint8
|
||||
|
||||
if (!itemTarget)
|
||||
{
|
||||
if (sqrt(bot->GetDistance(x, y, z)) > sPlayerbotAIConfig->sightDistance)
|
||||
if (bot->GetDistance(x, y, z) > sPlayerbotAIConfig->sightDistance)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3096,21 +3096,9 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target)
|
||||
|
||||
targets.SetDst(dest);
|
||||
targets.SetSpeed(30.0f);
|
||||
float distanceToDest = sqrt(vehicleBase->GetPosition().GetExactDist(dest));
|
||||
float elev = 0.01f;
|
||||
if (distanceToDest < 25.0f)
|
||||
elev = 0.04f;
|
||||
else if (distanceToDest < 55.0f)
|
||||
elev = 0.22f;
|
||||
else if (distanceToDest < 85.0f)
|
||||
elev = 0.42f;
|
||||
else if (distanceToDest < 95.0f)
|
||||
elev = 0.70f;
|
||||
else if (distanceToDest < 110.0f)
|
||||
elev = 0.88f;
|
||||
else
|
||||
elev = 1.0f;
|
||||
|
||||
float dist = vehicleBase->GetPosition().GetExactDist(dest);
|
||||
// very much an approximation of the real projectile arc
|
||||
float elev = dist >= 110.0f ? 1.0f : pow(((dist + 10.0f) / 120.0f), 2.0f);
|
||||
targets.SetElevation(elev);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user