private void HandleEffectRapidTransport(UnitEntity target, SpellTargetInfo.SpellTargetEffectInfo info) { TaxiNodeEntry taxiNode = GameTableManager.Instance.TaxiNode.GetEntry(parameters.TaxiNode); if (taxiNode == null) { return; } WorldLocation2Entry worldLocation = GameTableManager.Instance.WorldLocation2.GetEntry(taxiNode.WorldLocation2Id); if (worldLocation == null) { return; } if (!(target is Player player)) { return; } var rotation = new Quaternion(worldLocation.Facing0, worldLocation.Facing0, worldLocation.Facing2, worldLocation.Facing3); player.Rotation = rotation.ToEulerDegrees(); player.TeleportTo((ushort)worldLocation.WorldId, worldLocation.Position0, worldLocation.Position1, worldLocation.Position2); }
public static void HandleClientTarget(WorldSession session, ClientRapidTransport rapidTransport) { //TODO: check for cooldown //TODO: handle payment TaxiNodeEntry taxiNode = GameTableManager.Instance.TaxiNode.GetEntry(rapidTransport.TaxiNode); if (taxiNode == null) { throw new InvalidPacketValueException(); } if (session.Player.Level < taxiNode.AutoUnlockLevel) { throw new InvalidPacketValueException(); } WorldLocation2Entry worldLocation = GameTableManager.Instance.WorldLocation2.GetEntry(taxiNode.WorldLocation2Id); if (worldLocation == null) { throw new InvalidPacketValueException(); } GameFormulaEntry entry = GameTableManager.Instance.GameFormula.GetEntry(1307); session.Player.CastSpell(entry.Dataint0, new SpellParameters { TaxiNode = rapidTransport.TaxiNode }); }