Guest User

Untitled

a guest
Oct 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed)
  2. {
  3. if (i_owner->GetTypeId() != TYPEID_UNIT)
  4. return;
  5.  
  6. uint32 moveFlag = SPLINEFLAG_FLYING | SPLINEFLAG_ANIMATIONTIER;
  7. uint32 moveTime = uint32(i_owner->GetExactDist(&pos) / speed) * IN_MILLISECONDS;
  8.  
  9. // CHARGING state makes the unit use m_TempSpeed and JUMPING prevents sending movement packet in PointMovementGenerator
  10. i_owner->AddUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
  11. i_owner->m_TempSpeed = speed;
  12.  
  13. float x, y, z;
  14. pos.GetPosition(x, y, z);
  15. sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", i_owner->GetEntry(), id, x, y, z);
  16. Mutate(new PointMovementGenerator<Creature>(id, x, y, z), MOTION_SLOT_ACTIVE);
  17.  
  18. MonsterMoveData data;
  19. data.DestLocation.Relocate(pos);
  20. data.SplineFlag = moveFlag;
  21. data.Time = moveTime;
  22. data.AnimationState = ANIMATION_ON_GROUND;
  23.  
  24. i_owner->SendMonsterMove(data);
  25. }
Add Comment
Please, Sign In to add comment