mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[11044] Make EffectDistract implementation less hacky
This commit is contained in:
parent
0f70e9a79c
commit
9bc37afa28
3 changed files with 8 additions and 18 deletions
|
|
@ -4588,22 +4588,13 @@ void Spell::EffectDistract(SpellEffectIndex /*eff_idx*/)
|
|||
|
||||
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->clearUnitState(UNIT_STAT_MOVING);
|
||||
unitTarget->SetOrientation(angle);
|
||||
unitTarget->StopMoving();
|
||||
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*/)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11043"
|
||||
#define REVISION_NR "11044"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue