/// <summary> /// Perform the melee attack swing animation /// </summary> public void DoSwingMotion(WorldObject target, MotionCommand motionCommand, out float animLength, out List <float> attackFrames) { if (ForcePos) { SendUpdatePosition(); } //Console.WriteLine($"{maneuver.Style} - {maneuver.Motion} - {maneuver.AttackHeight}"); var baseSpeed = GetAnimSpeed(); var animSpeedMod = IsDualWieldAttack ? 1.2f : 1.0f; // dual wield swing animation 20% faster var animSpeed = baseSpeed * animSpeedMod; animLength = MotionTable.GetAnimationLength(MotionTableId, CurrentMotionState.Stance, motionCommand, animSpeed); attackFrames = MotionTable.GetAttackFrames(MotionTableId, CurrentMotionState.Stance, motionCommand); var motion = new Motion(this, motionCommand, animSpeed); motion.MotionState.TurnSpeed = 2.25f; if (!AiImmobile) { motion.MotionFlags |= MotionFlags.StickToObject; } motion.TargetGuid = target.Guid; CurrentMotionState = motion; EnqueueBroadcastMotion(motion); }
/// <summary> /// Perform the melee attack swing animation /// </summary> public void DoSwingMotion(WorldObject target, CombatManeuver maneuver, out float animLength, out List <float> attackFrames) { if (ForcePos) { SendUpdatePosition(); } var animSpeed = GetAnimSpeed(); animLength = MotionTable.GetAnimationLength(MotionTableId, CurrentMotionState.Stance, maneuver.Motion, animSpeed); attackFrames = MotionTable.GetAttackFrames(MotionTableId, CurrentMotionState.Stance, maneuver.Motion); var motion = new Motion(this, maneuver.Motion, animSpeed); motion.MotionState.TurnSpeed = 2.25f; if (!AiImmobile) { motion.MotionFlags |= MotionFlags.StickToObject; } motion.TargetGuid = target.Guid; CurrentMotionState = motion; EnqueueBroadcastMotion(motion); }