コード例 #1
0
        public void MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint id = EventId.Jump, bool hasOrientation = false,
                             JumpArrivalCastArgs arrivalCast = null, SpellEffectExtraData spellEffectExtraData = null)
        {
            Log.outDebug(LogFilter.Server, "Unit ({0}) jump to point (X: {1} Y: {2} Z: {3})", _owner.GetGUID().ToString(), x, y, z);

            float moveTimeHalf = (float)(speedZ / gravity);
            float max_height   = -MoveSpline.computeFallElevation(moveTimeHalf, false, -speedZ);

            MoveSplineInit init = new MoveSplineInit(_owner);

            init.MoveTo(x, y, z, false);
            init.SetParabolic(max_height, 0);
            init.SetVelocity(speedXY);
            if (hasOrientation)
            {
                init.SetFacing(o);
            }
            if (spellEffectExtraData != null)
            {
                init.SetSpellEffectExtraData(spellEffectExtraData);
            }
            init.Launch();

            uint       arrivalSpellId         = 0;
            ObjectGuid arrivalSpellTargetGuid = ObjectGuid.Empty;

            if (arrivalCast != null)
            {
                arrivalSpellId         = arrivalCast.SpellId;
                arrivalSpellTargetGuid = arrivalCast.Target;
            }

            StartMovement(new EffectMovementGenerator(id, arrivalSpellId, arrivalSpellTargetGuid), MovementSlot.Controlled);
        }
コード例 #2
0
 public void MoveJump(Position pos, float speedXY, float speedZ, uint id = EventId.Jump, bool hasOrientation = false, JumpArrivalCastArgs arrivalCast = null, SpellEffectExtraData spellEffectExtraData = null)
 {
     MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), speedXY, speedZ, id, hasOrientation, arrivalCast, spellEffectExtraData);
 }