diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 3e28d4532..03a3d891a 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4583,26 +4583,17 @@ void Spell::EffectDistract(SpellEffectIndex /*eff_idx*/) return; // target must be OK to do this - if( unitTarget->hasUnitState(UNIT_STAT_CAN_NOT_REACT) ) + if (unitTarget->hasUnitState(UNIT_STAT_CAN_NOT_REACT)) return; float angle = unitTarget->GetAngle(m_targets.m_destX, m_targets.m_destY); - if ( unitTarget->GetTypeId() == TYPEID_PLAYER ) - { - // For players just turn them - WorldPacket data; - ((Player*)unitTarget)->BuildTeleportAckMsg(&data, unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), angle); - ((Player*)unitTarget)->GetSession()->SendPacket( &data ); - ((Player*)unitTarget)->SetPosition(unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), angle, false); - } - else - { - // Set creature Distracted, Stop it, And turn it - unitTarget->SetOrientation(angle); - unitTarget->StopMoving(); + unitTarget->clearUnitState(UNIT_STAT_MOVING); + unitTarget->SetOrientation(angle); + unitTarget->SendMonsterMove(unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), SPLINETYPE_FACINGANGLE, SPLINEFLAG_WALKMODE, 0, NULL, angle); + + if (unitTarget->GetTypeId() == TYPEID_UNIT) unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS); - } } void Spell::EffectPickPocket(SpellEffectIndex /*eff_idx*/) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 4ec9d7ea7..c56fee839 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -364,7 +364,6 @@ bool Unit::haveOffhandWeapon() const void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, SplineType type, SplineFlags flags, uint32 Time, Player* player, ...) { - va_list vargs; va_start(vargs,player); @@ -395,7 +394,7 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, SplineTy case SPLINETYPE_FACINGTARGET: data << uint64(va_arg(vargs,uint64)); break; - case SPLINETYPE_FACINGANGLE: // not used currently + case SPLINETYPE_FACINGANGLE: data << float(va_arg(vargs,double)); // facing angle break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index da830d29f..01c70eaca 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11043" + #define REVISION_NR "11044" #endif // __REVISION_NR_H__