public static void AddTransportOffMesh(
        Vector3 waitForTransport,
        Vector3 stepIn,
        Vector3 objectDeparture,
        Vector3 objectArrival,
        Vector3 stepOut,
        int objectId,
        ContinentId continentId,
        string name     = "",
        float precision = 0.5f)
    {
        OffMeshConnection offMeshConnection = new OffMeshConnection(new List <Vector3>
        {
            waitForTransport,
            new Vector3(stepIn.X, stepIn.Y, stepIn.Z, "None")
            {
                Action = "c#: Logging.WriteNavigator(\"Waiting for transport\"); " +
                         "while (Conditions.InGameAndConnectedAndProductStartedNotInPause) " +
                         "{ " +
                         $"var elevator = ObjectManager.GetWoWGameObjectByEntry({objectId}).OrderBy(o => o.GetDistance).FirstOrDefault(); " +
                         $"if (elevator != null && elevator.IsValid && elevator.Position.DistanceTo(new Vector3({objectDeparture.X.ToString().Replace(",", ".")}, {objectDeparture.Y.ToString().Replace(",", ".")}, {objectDeparture.Z.ToString().Replace(",", ".")})) < {precision.ToString().Replace(",", ".")}) " +
                         "break; " +
                         "Thread.Sleep(100); " +
                         "}"
            },
            new Vector3(stepOut.X, stepOut.Y, stepOut.Z, "None")
            {
                Action = "c#: Logging.WriteNavigator(\"Wait to leave Elevator\"); " +
                         "while (Conditions.InGameAndConnectedAndProductStartedNotInPause) " +
                         "{ " +
                         $"var elevator = ObjectManager.GetWoWGameObjectByEntry({objectId}).OrderBy(o => o.GetDistance).FirstOrDefault(); " +
                         $"if (elevator != null && elevator.IsValid && elevator.Position.DistanceTo(new Vector3({objectArrival.X.ToString().Replace(",", ".")}, {objectArrival.Y.ToString().Replace(",", ".")}, {objectArrival.Z.ToString().Replace(",", ".")})) < {precision.ToString().Replace(",", ".")}) " +
                         "break; " +
                         "Thread.Sleep(100); " +
                         "}"
            },
        }, (int)continentId, OffMeshConnectionType.Unidirectional, true);

        offMeshConnection.Name = name;
        OffMeshConnections.Add(offMeshConnection, true);
    }
Ejemplo n.º 2
0
    // Add all offmesh connections
    public static void AddAllOffmeshConnections()
    {
        Logger.LogDebug("Adding offmesh connections");
        if (OffMeshConnections.MeshConnection == null || OffMeshConnections.MeshConnection.Count <= 0)
        {
            OffMeshConnections.Load();
        }

        var me = new List <OffMeshConnection>
        {
            new OffMeshConnection(new List <Vector3>
            {
                new Vector3(tirisfalPlatformZepOrgrimmar),
                new Vector3(insideZeppelinTirisfalToOrgrimmar)
            }, (int)ContinentId.Azeroth, OffMeshConnectionType.Bidirectional, true),
            new OffMeshConnection(new List <Vector3>
            {
                new Vector3(kalimdorlPlatformZepTirisfal),
                new Vector3(insideZeppelinKalimdorToTirisfal)
            }, (int)ContinentId.Kalimdor, OffMeshConnectionType.Bidirectional, true),
            new OffMeshConnection(new List <Vector3>
            {
                new Vector3(tirisfalPlatformZepNorthrend),
                new Vector3(insideZeppelinTirisfalToNorthrend)
            }, (int)ContinentId.Azeroth, OffMeshConnectionType.Bidirectional, true),
            new OffMeshConnection(new List <Vector3>
            {
                new Vector3(northrendPlatformZepTirisfal),
                new Vector3(insideZeppelinNorthrendToTirisfal)
            }, (int)ContinentId.Northrend, OffMeshConnectionType.Bidirectional, true),
            new OffMeshConnection(new List <Vector3>
            {
                new Vector3(kalimdorlPlatformZepNorthrend),
                new Vector3(insideZeppelinKalimdorToNorthrend)
            }, (int)ContinentId.Kalimdor, OffMeshConnectionType.Bidirectional, true),
            new OffMeshConnection(new List <Vector3>
            {
                new Vector3(northrendPlatformZepKalimdor),
                new Vector3(insideZeppelinNorthrendToKalimdor)
            }, (int)ContinentId.Northrend, OffMeshConnectionType.Bidirectional, true),

            // Kalimdor Tower to Zep Northrend
            new OffMeshConnection(new List <Vector3>
            {
                new Vector3(1176.045, -4176.415, 21.40396),
                new Vector3(1168.245, -4165.519, 22.72018),
                new Vector3(1162.044, -4162.295, 23.09159),
                new Vector3(1158.513, -4156.68, 25.38495),
                new Vector3(1163.283, -4152.811, 28.29832),
                new Vector3(1165.906, -4158.321, 30.88497),
                new Vector3(1160.758, -4159.898, 33.17702),
                new Vector3(1159.89, -4153.644, 36.38201),
                new Vector3(1165.508, -4154.742, 39.0405),
                new Vector3(1163.239, -4160.285, 41.67056),
                new Vector3(1157.424, -4157.666, 43.97564),
                new Vector3(1160.468, -4152.043, 46.343),
                new Vector3(1165.743, -4155.318, 48.80746),
                new Vector3(1162.361, -4160.978, 51.57532),
                new Vector3(1159.651, -4166.412, 51.64627),
                new Vector3(1166.205, -4167.621, 51.64627),
                new Vector3(1171.159, -4162.846, 51.64627),
                new Vector3(1173.271, -4156.186, 51.64627),
                kalimdorlPlatformZepNorthrend
            }, (int)ContinentId.Kalimdor, OffMeshConnectionType.Bidirectional, true),

            // Kalimdor Tower to Zep EK
            new OffMeshConnection(new List <Vector3>
            {
                new Vector3(1336.811, -4627.349, 23.71372),
                new Vector3(1338.415, -4635.818, 24.5164),
                new Vector3(1342.444, -4641.667, 24.60308),
                new Vector3(1347.086, -4646.91, 25.73846),
                new Vector3(1346.112, -4653.215, 28.24372),
                new Vector3(1340.509, -4651.799, 30.71605),
                new Vector3(1344.352, -4645.396, 34.15182),
                new Vector3(1347.778, -4650.873, 36.73572),
                new Vector3(1339.766, -4649.848, 41.08609),
                new Vector3(1343.882, -4645.242, 43.53802),
                new Vector3(1348.05, -4651.791, 46.52235),
                new Vector3(1342.296, -4654.397, 48.70516),
                new Vector3(1339.82, -4648.606, 51.09646),
                new Vector3(1349.617, -4644.258, 53.52875),
                new Vector3(1346.508, -4638.681, 53.52875),
                new Vector3(1339.75, -4639.255, 53.52875),
                new Vector3(1334.665, -4644.297, 53.52875),
                new Vector3(1326.729, -4649.013, 53.99952)
            }, (int)ContinentId.Kalimdor, OffMeshConnectionType.Bidirectional, true)
        };

        OffMeshConnections.MeshConnection.AddRange(me);
    }