Core/Spells: Core/Spells: Improve teleport destination for a certain class of spells (Killing Spree, Shadowstep, ...)
Port From (https://github.com/TrinityCore/TrinityCore/commit/540678be069b24664ad95f1922288d026b7e0e41)
This commit is contained in:
@@ -953,12 +953,9 @@ namespace Game.Spells
|
|||||||
if (effect != null)
|
if (effect != null)
|
||||||
{
|
{
|
||||||
float angle = targetType.CalcDirectionAngle();
|
float angle = targetType.CalcDirectionAngle();
|
||||||
float objSize = target.GetCombatReach();
|
float dist = effect.CalcRadius(null);
|
||||||
float dist = effect.CalcRadius(m_caster);
|
if (targetType.GetTarget() == Targets.DestRandom)
|
||||||
if (dist < objSize)
|
dist *= (float)RandomHelper.NextDouble();
|
||||||
dist = objSize;
|
|
||||||
else if (targetType.GetTarget() == Targets.DestRandom)
|
|
||||||
dist = objSize + (dist - objSize) * (float)RandomHelper.NextDouble();
|
|
||||||
|
|
||||||
Position pos = dest.Position;
|
Position pos = dest.Position;
|
||||||
target.MovePositionToFirstCollision(ref pos, dist, angle);
|
target.MovePositionToFirstCollision(ref pos, dist, angle);
|
||||||
|
|||||||
Reference in New Issue
Block a user