AoE rewrite and bug fixes

Rewrote aoe checks for cone and line aoes and added minimum distance values
Added height checks for commands
Fixed combo effects repeating for every target hit by AoE attacks
Fixed teleport sometimes not raising (I think)
Fixed gear checks in some command scripts
This commit is contained in:
yogurt 2018-07-02 00:45:06 -05:00
parent 8c5375f609
commit cf30eef39e
34 changed files with 483 additions and 330 deletions

View file

@ -409,5 +409,37 @@ namespace FFXIVClassic.Common
return dx * dx + dy * dy + dz * dz;
}
//Distance of just the x and z valeus, ignoring y
public static float XZDistanceSquared(Vector3 lhs, Vector3 rhs)
{
return XZDistanceSquared(lhs.X, lhs.Z, rhs.X, rhs.Z);
}
public static float XZDistance(Vector3 lhs, Vector3 rhs)
{
return XZDistance(lhs.X, lhs.Z, rhs.X, rhs.Z);
}
public static float XZDistance(float x, float z, float x2, float z2)
{
if (x == x2 && z == z2)
return 0.0f;
return (float)Math.Sqrt(XZDistanceSquared(x, z, x2, z2));
}
public static float XZDistanceSquared(float x, float z, float x2, float z2)
{
if (x == x2 && z == z2)
return 0.0f;
// todo: mz maths is shit
var dx = x - x2;
var dz = z - z2;
return dx * dx + dz * dz;
}
}
}