示例#1
0
 void HandleTaxiRequestEarlyLanding(TaxiRequestEarlyLanding taxiRequestEarlyLanding)
 {
     if (GetPlayer().GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Flight)
     {
         if (GetPlayer().m_taxi.RequestEarlyLanding())
         {
             FlightPathMovementGenerator flight = (FlightPathMovementGenerator)GetPlayer().GetMotionMaster().top();
             flight.LoadPath(GetPlayer(), flight.GetPath()[(int)flight.GetCurrentNode()].NodeIndex);
             flight.Reset(GetPlayer());
         }
     }
 }
示例#2
0
        void HandleTaxiRequestEarlyLanding(TaxiRequestEarlyLanding taxiRequestEarlyLanding)
        {
            FlightPathMovementGenerator flight = GetPlayer().GetMotionMaster().GetCurrentMovementGenerator() as FlightPathMovementGenerator;

            if (flight != null)
            {
                if (GetPlayer().m_taxi.RequestEarlyLanding())
                {
                    flight.LoadPath(GetPlayer(), flight.GetPath()[(int)flight.GetCurrentNode()].NodeIndex);
                    flight.Reset(GetPlayer());
                }
            }
        }
        void HandleMoveSplineDoneOpcode(MoveSplineDone moveSplineDone)
        {
            MovementInfo movementInfo = moveSplineDone.Status;

            _player.ValidateMovementInfo(movementInfo);

            // in taxi flight packet received in 2 case:
            // 1) end taxi path in far (multi-node) flight
            // 2) switch from one map to other in case multim-map taxi path
            // we need process only (1)

            uint curDest = GetPlayer().m_taxi.GetTaxiDestination();

            if (curDest != 0)
            {
                TaxiNodesRecord curDestNode = CliDB.TaxiNodesStorage.LookupByKey(curDest);

                // far teleport case
                if (curDestNode != null && curDestNode.ContinentID != GetPlayer().GetMapId())
                {
                    if (GetPlayer().GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Flight)
                    {
                        // short preparations to continue flight
                        FlightPathMovementGenerator flight = (FlightPathMovementGenerator)GetPlayer().GetMotionMaster().Top();

                        flight.SetCurrentNodeAfterTeleport();
                        TaxiPathNodeRecord node = flight.GetPath()[(int)flight.GetCurrentNode()];
                        flight.SkipCurrentNode();

                        GetPlayer().TeleportTo(curDestNode.ContinentID, node.Loc.X, node.Loc.Y, node.Loc.Z, GetPlayer().GetOrientation());
                    }
                }

                return;
            }

            // at this point only 1 node is expected (final destination)
            if (GetPlayer().m_taxi.GetPath().Count != 1)
            {
                return;
            }

            GetPlayer().CleanupAfterTaxiFlight();
            GetPlayer().SetFallInformation(0, GetPlayer().GetPositionZ());
            if (GetPlayer().pvpInfo.IsHostile)
            {
                GetPlayer().CastSpell(GetPlayer(), 2479, true);
            }
        }