mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
Core/Spells: Allow spell effects to have multiple destinations. Spells like: 49814, 10869 and similar are now properly selecting destination targets.
This commit is contained in:
@@ -1756,7 +1756,7 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader
|
||||
if (Unit* device = seat->GetPassenger(2))
|
||||
if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||
{
|
||||
float dist = unit->GetExactDistSq(targets.GetDst());
|
||||
float dist = unit->GetExactDistSq(targets.GetDstPos());
|
||||
if (dist < minDist)
|
||||
{
|
||||
minDist = dist;
|
||||
@@ -1764,13 +1764,13 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader
|
||||
}
|
||||
}
|
||||
}
|
||||
if (target && target->IsWithinDist2d(targets.GetDst(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct
|
||||
if (target && target->IsWithinDist2d(targets.GetDstPos(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct
|
||||
passenger->EnterVehicle(target, 0);
|
||||
else
|
||||
{
|
||||
passenger->ExitVehicle();
|
||||
float x, y, z;
|
||||
targets.GetDst()->GetPosition(x, y, z);
|
||||
targets.GetDstPos()->GetPosition(x, y, z);
|
||||
passenger->GetMotionMaster()->MoveJump(x, y, z, targets.GetSpeedXY(), targets.GetSpeedZ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,13 +772,11 @@ class spell_dk_death_grip : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
Position pos;
|
||||
Position const* pos = GetTargetDest();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
GetSummonPosition(effIndex, pos, 0.0f, 0);
|
||||
|
||||
if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence
|
||||
target->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), damage, true);
|
||||
target->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), damage, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user