Beispiel #1
0
 void StartEvent(Player* pPlayer)
 {
     if (!pPlayer)
         return;
     if (pPlayer->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE)
     {
         for (uint8 i = 0; i < 41; ++i)
         {
             AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]);
         }
         PlayerGUID = pPlayer->GetGUID();
         Start(true,false,PlayerGUID);
     }
     return;
 }
Beispiel #2
0
 void StartEvent(Player* player)
 {
     if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE)
     {
         for (uint8 i = 0; i < 41; ++i)
         {
             AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]);
         }
         PlayerGUID = player->GetGUID();
         Start(true, false, PlayerGUID);
         me->SetDisplayId(me->GetCreatureTemplate()->Modelid1);
         me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
     }
     return;
 }
    explicit DofNaralexAI(Creature* pCreature) : CreatureAIScript(pCreature)
    {
        Mutanus = nullptr;

        for (uint8 i = 1; i < 39; ++i)
        {
            AddWaypoint(CreateWaypoint(i, 0, Movement::WP_MOVE_TYPE_RUN, ToNaralex[i]));
        }

        SetWaypointMoveType(Movement::WP_MOVEMENT_SCRIPT_NONE);

        // Awakening Spell
        Awakening = addAISpell(6271, 0.0f, TARGET_SELF);
        Awakening->addEmote("Step back and be ready!, I'll try to Awake Naralex", CHAT_MSG_MONSTER_SAY, 0);

        SpawnTimer = 0;
    }
Beispiel #4
0
GpxRootElement::GpxRootElement(const wxString &creator, GpxMetadataElement *metadata, ListOfGpxWpts *waypoints, ListOfGpxRoutes *routes, ListOfGpxTracks *tracks, GpxExtensionsElement *extensions) : TiXmlElement("gpx")
{
      my_extensions = NULL;
      my_metadata = NULL;
      first_waypoint = NULL;
      last_waypoint = NULL;
      first_route = NULL;
      last_route = NULL;
      first_track = NULL;
      last_track = NULL;

      SetAttribute ( "version", "1.1" );
      SetAttribute ( "creator", creator.ToUTF8() );
      SetAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
      SetAttribute( "xmlns", "http://www.topografix.com/GPX/1/1" );
      SetAttribute( "xmlns:gpxx", "http://www.garmin.com/xmlschemas/GpxExtensions/v3" );
      SetAttribute( "xsi:schemaLocation", "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" );
      SetMetadata(metadata);
      if (waypoints) {
            wxListOfGpxWptsNode *waypoint = waypoints->GetFirst();
            while (waypoint)
            {
                  AddWaypoint(waypoint->GetData());
                  waypoint = waypoint->GetNext();
            }
      }
      if (routes) {
            wxListOfGpxRoutesNode *route = routes->GetFirst();
            while (route)
            {
                  AddRoute(route->GetData());
                  route = route->GetNext();
            }
      }
      if (tracks) {
            wxListOfGpxTracksNode *track = tracks->GetFirst();
            while (track)
            {
                  AddTrack(track->GetData());
                  track = track->GetNext();
            }
      }
      SetExtensions(extensions);
}
Beispiel #5
0
        The_Plains_Vision(Creature* pCreature) : MoonScriptCreatureAI(pCreature)
        {
            auto area = _unit->GetArea();
            switch (area->id)
            {
            case 222: // Mulgore
            {
                WPCount = 23;
                WayPoints = WaypointPlainVision;
                _unit->GetAIInterface()->SetAllowedToEnterCombat(false);
            }
            break;
            }

            for (int i = 1; i <= WPCount; ++i)
            {
                AddWaypoint(CreateWaypoint(i, 0, WayPoints[i].addition, WayPoints[i]));
            }
        }
Beispiel #6
0
int FindOrAddWaypoint(WAYPOINT *read_waypoint, bool look_for_airfield) {
    read_waypoint->Name[NAME_SIZE-1] = 0; // prevent overrun if data is bogus

    int waypoint_index=-1;

    // Search for waypoint having same name AND same lat/lon/flags.
    // If we are searching for airfield, search for waypoint having same name and
    // lat/lon within 1km , and having flags set as airfieldsolid or grass.
    // We dont look at anything else for matching.

    if (look_for_airfield)
        waypoint_index = FindMatchingAirfield(read_waypoint);
    else
        waypoint_index = FindMatchingWaypoint(read_waypoint);

    if (waypoint_index == -1) { // waypoint not found, so add it!
        WAYPOINT new_waypoint = {};

        //
        // Note: we dont save task waypoints inside WP files!
        // SO WE DONT NEED TO USE COMMENTS and DETAILS. They are useless.
        //
        memcpy(&new_waypoint, read_waypoint, sizeof(WAYPOINT));
        // this is  needed for avoid freeing twice ...
        // ownership of allocated memory is transferred from "read_waypoint" to "new_waypoint"
        read_waypoint->Comment = NULL;

        #if TASK_DETAILS
        read_waypoint->Details = NULL;
        #else
        new_waypoint.Details = NULL;
        #endif

        new_waypoint.FileNum=-1; // HERE WE SET THE FLAG FOR "DO NOT SAVE TO WAYPOINT FILE"
        if(AddWaypoint(new_waypoint)) {
            waypoint_index = WayPointList.size() -1;
        }
    }
    return waypoint_index;
}
Beispiel #7
0
        void UpdateAI(uint32 diff)
        {
            if (instance && instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS)
                me->CastStop();

            npc_escortAI::UpdateAI(diff);

            if (!bHasGotMovingPoints)
            {
                bHasGotMovingPoints = true;
                switch (uiBoss)
                {
                    case 1:
                        for (int i=0;i<3;i++)
                            AddWaypoint(i, SaboteurFinalPos1[i][0], SaboteurFinalPos1[i][1], SaboteurFinalPos1[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos1[2][0], SaboteurFinalPos1[2][1], SaboteurFinalPos1[2][2], 4.762346f);
                        break;
                    case 2:
                        for (int i=0;i<3;i++)
                            AddWaypoint(i, SaboteurFinalPos2[i][0], SaboteurFinalPos2[i][1], SaboteurFinalPos2[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos2[2][0], SaboteurFinalPos2[2][1], SaboteurFinalPos2[2][2], 1.862674f);
                        break;
                    case 3:
                        for (int i=0;i<2;i++)
                            AddWaypoint(i, SaboteurFinalPos3[i][0], SaboteurFinalPos3[i][1], SaboteurFinalPos3[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos3[1][0], SaboteurFinalPos3[1][1], SaboteurFinalPos3[1][2], 5.500638f);
                        break;
                    case 4:
                        AddWaypoint(0, SaboteurFinalPos4[0], SaboteurFinalPos4[1], SaboteurFinalPos4[2], 0);
                        me->SetHomePosition(SaboteurFinalPos4[0], SaboteurFinalPos4[1], SaboteurFinalPos4[2], 3.991108f);
                        break;
                    case 5:
                        AddWaypoint(0, SaboteurFinalPos5[0], SaboteurFinalPos5[1], SaboteurFinalPos5[2], 0);
                        me->SetHomePosition(SaboteurFinalPos5[0], SaboteurFinalPos5[1], SaboteurFinalPos5[2], 1.100841f);
                        break;
                    case 6:
                        for (int i=0;i<5;i++)
                            AddWaypoint(i, SaboteurFinalPos6[i][0], SaboteurFinalPos6[i][1], SaboteurFinalPos6[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos6[4][0], SaboteurFinalPos6[4][1], SaboteurFinalPos6[4][2], 0.983031f);
                        break;
                }

                SetDespawnAtEnd(false);
                Start(true, true);
            }
        }
        void SetData(uint32 uiType, uint32 uiData)
        {
            switch(uiType)
            {
                case 1:
                    AddWaypoint(0, 746.45f, 647.03f, 411.57f);
                    AddWaypoint(1, 771.434f, 642.606f, 411.9f);
                    AddWaypoint(2, 779.807f, 617.535f, 411.716f);
                    AddWaypoint(3, 771.098f, 594.635f, 411.625f);
                    AddWaypoint(4, 746.887f, 583.425f, 411.668f);
                    AddWaypoint(5, 715.176f, 583.782f, 412.394f);
                    AddWaypoint(6, 720.719f, 591.141f, 411.737f);
                    uiWaypointPath = 1;
                    break;
                case 2:
                    AddWaypoint(0, 746.45f, 647.03f, 411.57f);
                    AddWaypoint(1, 771.434f, 642.606f, 411.9f);
                    AddWaypoint(2, 779.807f, 617.535f, 411.716f);
                    AddWaypoint(3, 771.098f, 594.635f, 411.625f);
                    AddWaypoint(4, 746.887f, 583.425f, 411.668f);
                    AddWaypoint(5, 746.16f, 571.678f, 412.389f);
                    AddWaypoint(6, 746.887f, 583.425f, 411.668f);
                    uiWaypointPath = 2;
                    break;
                case 3:
                    AddWaypoint(0, 746.45f, 647.03f, 411.57f);
                    AddWaypoint(1, 771.434f, 642.606f, 411.9f);
                    AddWaypoint(2, 779.807f, 617.535f, 411.716f);
                    AddWaypoint(3, 771.098f, 594.635f, 411.625f);
                    AddWaypoint(4, 777.759f, 584.577f, 412.393f);
                    AddWaypoint(5, 772.48f, 592.99f, 411.68f);
                    uiWaypointPath = 3;
                    break;
            }

            if (uiType <= 3)
                Start(false, true, 0, NULL);
        }
Beispiel #9
0
    void StartEscort (Player* player, uint8 Parts)
    {
        Part = Parts;

        switch (Parts)
        {
            case 1:
                AddWaypoint(0, 2230.91, 118.765, 82.2947, 2000),
                AddWaypoint(1, 2230.33, 114.980, 82.2946, 0);
                AddWaypoint(2, 2233.36, 111.057, 82.2996, 0);
                AddWaypoint(3, 2231.17, 108.486, 82.6624, 0);
                AddWaypoint(4, 2220.22, 114.605, 89.4264, 0);
                AddWaypoint(5, 2215.23, 115.990, 89.4549, 0);
                AddWaypoint(6, 2207.97, 105.351, 89.4549, 0);
                AddWaypoint(7, 2202.53, 106.922, 89.4549, 0);
                AddWaypoint(8, 2192.26, 112.618, 89.4549, 2000);
                AddWaypoint(9, 2182.96, 117.850, 89.4548, 2000);
                AddWaypoint(10, 2182.11, 120.328, 89.4548, 5000);
                AddWaypoint(11, 2182.11, 120.329, 89.4548, 5000);
                AddWaypoint(12, 2182.11, 120.330, 89.4548, 3000);
                AddWaypoint(13, 2189.44, 113.922, 89.4549, 0); 
                AddWaypoint(14, 2195.63, 110.584, 89.4549, 0);
                AddWaypoint(15, 2201.09, 115.115, 89.4549, 0);
                AddWaypoint(16, 2204.34, 121.036, 89.4355, 0);
                AddWaypoint(17, 2208.66, 129.127, 87.9560, 0);
                AddWaypoint(18, 2193.09, 137.940, 88.2164, 0);
                AddWaypoint(19, 2173.39, 149.064, 87.9227, 0);
                AddWaypoint(20, 2164.25, 137.965, 85.0595, 0);
                AddWaypoint(21, 2149.31, 125.645, 77.0858, 0);
                AddWaypoint(22, 2142.78, 127.173, 75.5954, 0);
                AddWaypoint(23, 2139.28, 133.952, 73.6386, 0);
                AddWaypoint(24, 2139.54, 155.235, 67.1269, 0);
                AddWaypoint(25, 2145.38, 167.551, 64.8974, 0);
                AddWaypoint(26, 2134.28, 175.304, 67.9446, 0);
                AddWaypoint(27, 2118.08, 187.387, 68.8141, 0);
                AddWaypoint(28, 2105.88, 195.461, 65.1854, 0);
                AddWaypoint(29, 2096.77, 196.939, 65.2117, 0);
                AddWaypoint(30, 2083.90, 209.395, 64.8736, 0);
                AddWaypoint(31, 2063.40, 229.509, 64.4883, 25000);
                AddWaypoint(32, 2063.40, 229.510, 64.4883, 0);
                AddWaypoint(33, 2063.40, 229.512, 64.4883, 0);
                ((npc_escortAI*)(me->AI()))->SetClearWaypoints(true);
                ((npc_escortAI*)(me->AI()))->SetDespawnAtEnd(false);
                ((npc_escortAI*)(me->AI()))->SetDespawnAtFar(false);
                Start(true, true, player->GetGUID());
                break;
            case 2:
                AddWaypoint(0, 2046.70, 251.941, 62.7851, 4000);
                AddWaypoint(1, 2046.70, 251.942, 62.7851, 3000);
                AddWaypoint(2, 2011.77, 278.478, 65.3388, 0);
                AddWaypoint(3, 2005.08, 289.676, 66.1179, 0);
                AddWaypoint(4, 2033.11, 337.450, 66.0948, 0);
                AddWaypoint(5, 2070.30, 416.208, 66.0893, 0);
                AddWaypoint(6, 2086.76, 469.768, 65.9182, 0);
                AddWaypoint(7, 2101.70, 497.955, 61.7881, 0);
                AddWaypoint(8, 2133.39, 530.933, 55.3700, 0);
                AddWaypoint(9, 2157.91, 559.635, 48.5157, 0);
                AddWaypoint(10, 2167.34, 586.191, 42.4394, 0);
                AddWaypoint(11, 2174.17, 637.643, 33.9002, 0);
                AddWaypoint(12, 2179.31, 656.053, 34.723, 0);
                AddWaypoint(13, 2183.65, 670.941, 34.0318, 0);
                AddWaypoint(14, 2201.50, 668.616, 36.1236, 0);
                AddWaypoint(15, 2221.56, 652.747, 36.6153, 0);
                AddWaypoint(16, 2238.97, 640.125, 37.2214, 0);
                AddWaypoint(17, 2251.17, 620.574, 40.1473, 0);
                AddWaypoint(18, 2261.98, 595.303, 41.4117, 0);
                AddWaypoint(19, 2278.67, 560.172, 38.9090, 0);
                AddWaypoint(20, 2336.72, 528.327, 40.9369, 0);
                AddWaypoint(21, 2381.04, 519.612, 37.7312, 0);
                AddWaypoint(22, 2412.20, 515.425, 39.2068, 0);
                AddWaypoint(23, 2452.39, 516.174, 42.9387, 0);
                AddWaypoint(24, 2467.38, 539.389, 47.4992, 0);
                AddWaypoint(25, 2470.70, 554.333, 46.6668, 0);
                AddWaypoint(26, 2478.07, 575.321, 55.4549, 0);
                AddWaypoint(27, 2480.00, 585.408, 56.6921, 0);
                AddWaypoint(28, 2482.67, 608.817, 55.6643, 0);
                AddWaypoint(29, 2485.62, 626.061, 58.0132, 2000);
                AddWaypoint(30, 2486.91, 626.356, 58.0761, 2000);
                AddWaypoint(31, 2486.91, 626.357, 58.0761, 0);
                ((npc_escortAI*)(me->AI()))->SetClearWaypoints(true);
                ((npc_escortAI*)(me->AI()))->SetDespawnAtEnd(false);
                ((npc_escortAI*)(me->AI()))->SetDespawnAtFar(false);
                Start(true, false, player->GetGUID());
                break;
            case 3:
                AddWaypoint(0, 2488.58, 660.940, 57.3913, 0);
                AddWaypoint(1, 2502.56, 686.059, 55.6252, 0);
                AddWaypoint(2, 2502.08, 694.360, 55.5083, 0);
                AddWaypoint(3, 2491.46, 694.321, 55.7163, 0);
                AddWaypoint(4, 2491.10, 703.300, 55.7630, 0);
                AddWaypoint(5, 2485.64, 702.992, 55.7917, 0);
                AddWaypoint(6, 2479.63, 696.521, 55.7901, 0);
                AddWaypoint(7, 2476.24, 696.204, 55.8093, 0);
                AddWaypoint(8, 2475.39, 695.983, 55.8146, 0);
                AddWaypoint(9, 2477.75, 694.473, 55.7945, 0);
                AddWaypoint(10, 2481.27, 697.747, 55.7910, 0);
                AddWaypoint(11, 2486.31, 703.131, 55.7861, 0);
                AddWaypoint(12, 2490.76, 703.511, 55.7662, 0);
                AddWaypoint(13, 2491.30, 694.792, 55.7195, 0);
                AddWaypoint(14, 2502.08, 694.360, 55.5083, 0);
                AddWaypoint(15, 2507.99, 679.298, 56.3760, 0);
                AddWaypoint(16, 2524.79, 669.919, 54.9258, 0);
                AddWaypoint(17, 2543.19, 665.289, 56.2957, 0);
                AddWaypoint(18, 2566.49, 664.354, 54.5034, 0);
                AddWaypoint(19, 2592.00, 664.611, 56.4394, 0);
                AddWaypoint(20, 2616.14, 665.499, 55.1610, 0);
                AddWaypoint(21, 2623.56, 666.965, 54.3983, 0);
                AddWaypoint(22, 2629.99, 661.059, 54.2738, 0);
                AddWaypoint(23, 2629.00, 656.982, 56.0651, 0);
                AddWaypoint(24, 2620.84, 633.007, 56.0300, 3000);
                AddWaypoint(25, 2621.62, 635.352, 56.0300, 0);
                AddWaypoint(26, 2622.99, 639.178, 56.0300, 0);
                AddWaypoint(27, 2628.73, 656.693, 56.0610, 0);
                AddWaypoint(28, 2630.34, 661.135, 54.2738, 0);
                AddWaypoint(29, 2635.38, 672.243, 54.4508, 0);
                AddWaypoint(30, 2644.13, 668.158, 55.3797, 0);
                AddWaypoint(31, 2646.82, 666.740, 56.9898, 0);
                AddWaypoint(32, 2658.22, 665.432, 57.1725, 0);
                AddWaypoint(33, 2661.88, 674.849, 57.1725, 0);
                AddWaypoint(34, 2656.23, 677.208, 57.1725, 0);
                AddWaypoint(35, 2652.28, 670.270, 61.9353, 0);
                AddWaypoint(36, 2650.79, 664.290, 61.9302, 0);
                AddWaypoint(37, 2660.48, 659.409, 61.9370, 5000);
                AddWaypoint(38, 2660.48, 659.410, 61.9370, 0);
                ((npc_escortAI*)(me->AI()))->SetClearWaypoints(true);
                ((npc_escortAI*)(me->AI()))->SetDespawnAtEnd(false);
                ((npc_escortAI*)(me->AI()))->SetDespawnAtFar(false);
                Start(true, true, player->GetGUID());
                break;
            case 4:
                AddWaypoint(0, 2660.48, 659.411, 61.9370, 5000);
                AddWaypoint(1, 2660.48, 659.412, 61.9370, 2000);
                AddWaypoint(2, 2652.32, 664.994, 61.9305, 0);
                AddWaypoint(3, 2652.37, 670.561, 61.9368, 0);
                AddWaypoint(4, 2656.05, 676.761, 57.1727, 0);
                AddWaypoint(5, 2658.49, 677.166, 57.1727, 0);
                AddWaypoint(6, 2659.28, 667.117, 57.1727, 0);
                AddWaypoint(7, 2649.71, 665.387, 57.1727, 0);
                AddWaypoint(8, 2634.79, 672.964, 54.4577, 0);
                AddWaypoint(9, 2635.06, 673.892, 54.4713, 6000);
                AddWaypoint(10, 2635.06, 673.893, 54.4713, 6000);
                AddWaypoint(11, 2635.06, 673.890, 54.4713, 0);
                AddWaypoint(12, 2634.30, 661.698, 54.4147, 0);
                AddWaypoint(13, 2652.21, 644.396, 56.1906, 0);
                ((npc_escortAI*)(me->AI()))->SetClearWaypoints(true);
                ((npc_escortAI*)(me->AI()))->SetDespawnAtEnd(true);
                ((npc_escortAI*)(me->AI()))->SetDespawnAtFar(false);
                Start(true, true, player->GetGUID());
                break;
        }
        return;
    }
Beispiel #10
0
    void InitWaypoint()
    {
        AddWaypoint(1, 2389.03,     -5902.74,     109.014, 5000);
        AddWaypoint(2, 2341.812012, -5900.484863, 102.619743);
        AddWaypoint(3, 2306.561279, -5901.738281, 91.792419);
        AddWaypoint(4, 2300.098389, -5912.618652, 86.014885);
        AddWaypoint(5, 2294.142090, -5927.274414, 75.316849);
        AddWaypoint(6, 2286.984375, -5944.955566, 63.714966);
        AddWaypoint(7, 2280.001709, -5961.186035, 54.228283);
        AddWaypoint(8, 2259.389648, -5974.197754, 42.359348);
        AddWaypoint(9, 2242.882812, -5984.642578, 32.827850);
        AddWaypoint(10, 2217.265625, -6028.959473, 7.675705);
        AddWaypoint(11, 2202.595947, -6061.325684, 5.882018);
        AddWaypoint(12, 2188.974609, -6080.866699, 3.370027);

        if (urand(0,1))
        {
            AddWaypoint(13, 2176.483887, -6110.407227, 1.855181);
            AddWaypoint(14, 2172.516602, -6146.752441, 1.074235);
            AddWaypoint(15, 2138.918457, -6158.920898, 1.342926);
            AddWaypoint(16, 2129.866699, -6174.107910, 4.380779);
            AddWaypoint(17, 2117.709473, -6193.830078, 13.3542, 10000);
        }
        else
        {
            AddWaypoint(13, 2184.190186, -6166.447266, 0.968877);
            AddWaypoint(14, 2234.265625, -6163.741211, 0.916021);
            AddWaypoint(15, 2268.071777, -6158.750977, 1.822252);
            AddWaypoint(16, 2270.028320, -6176.505859, 6.340538);
            AddWaypoint(17, 2271.739014, -6195.401855, 13.3542, 10000);
        }
    }
Beispiel #11
0
void WP_command( int argc )
{
        char    cmd_command[1024];
        if( argc < 3)
                return;
        
        trap_CmdArgv( 2, cmd_command, sizeof( cmd_command ) );

        if(!strcmp(cmd_command, "add"))
        {
                waypoint_t wp;

                if( argc < 7 )
                        return;

                memset(&wp, 0 ,sizeof(wp));
                trap_CmdArgv( 3, cmd_command, sizeof( cmd_command ) );
                wp.index = atoi( cmd_command );
                trap_CmdArgv( 4, cmd_command, sizeof( cmd_command ) );
                wp.origin[0] = atof( cmd_command );
                trap_CmdArgv( 5, cmd_command, sizeof( cmd_command ) );
                wp.origin[1] = atof( cmd_command );
                trap_CmdArgv( 6, cmd_command, sizeof( cmd_command ) );
                wp.origin[2] = atof( cmd_command );
                wp.teams = 15 ;// (1<<0)+(1<<1)+(1<<2)+(1<<3);
                if( argc > 7 )
                {
                        trap_CmdArgv( 7, cmd_command, sizeof( cmd_command ) );
                        wp.flags = atoi( cmd_command );
                        
                }
                if( argc > 8 )
                {
                        trap_CmdArgv( 8, cmd_command, sizeof( cmd_command ) );
                        wp.teams = atoi( cmd_command );
                }

                if( argc > 9 )
                {
                        trap_CmdArgv( 9, cmd_command, sizeof( cmd_command ) );
                        wp.radius = atof( cmd_command );
                        
                }
                AddWaypoint(&wp);
                return;
        }

        if(!strcmp(cmd_command, "link"))
        {
                wp_link_t link;
                int i1,i2;
                if( argc < 5 )
                        return;

                memset(&link, 0 ,sizeof(link));
                trap_CmdArgv( 3, cmd_command, sizeof( cmd_command ) );
                i1 = atoi( cmd_command );
                trap_CmdArgv( 4, cmd_command, sizeof( cmd_command ) );
                i2 = atoi( cmd_command );
                link.teams = 15;
                if( argc > 5 )
                {
                        trap_CmdArgv( 5, cmd_command, sizeof( cmd_command ) );
                        link.flags = atoi( cmd_command );
                }
                if( argc > 6 )
                {
                        trap_CmdArgv( 6, cmd_command, sizeof( cmd_command ) );
                        link.teams = atoi( cmd_command );
                }

                if( argc > 7 )
                {
                        trap_CmdArgv( 7, cmd_command, sizeof( cmd_command ) );
                        link.req_velocity = atof( cmd_command );
                        
                }
                AddLink( i1, i2, &link);
                return;
        }

        if(!strcmp(cmd_command, "dlink"))
        {
                wp_link_t link;
                int i1,i2;
                if( argc < 5 )
                        return;

                memset(&link, 0 ,sizeof(link));
                trap_CmdArgv( 3, cmd_command, sizeof( cmd_command ) );
                i1 = atoi( cmd_command );
                trap_CmdArgv( 4, cmd_command, sizeof( cmd_command ) );
                i2 = atoi( cmd_command );
                link.teams = 15;
                if( argc > 5 )
                {
                        trap_CmdArgv( 5, cmd_command, sizeof( cmd_command ) );
                        link.flags = atoi( cmd_command );
                }
                if( argc > 6 )
                {
                        trap_CmdArgv( 6, cmd_command, sizeof( cmd_command ) );
                        link.teams = atoi( cmd_command );
                }

                if( argc > 7 )
                {
                        trap_CmdArgv( 7, cmd_command, sizeof( cmd_command ) );
                        link.req_velocity = atof( cmd_command );
                        
                }
                AddLink( i1, i2, &link);
                AddLink( i2, i1, &link);
                return;
        }

        if(!strcmp(cmd_command, "target"))
        {
                if( argc < 6 )
                        return;

                trap_CmdArgv( 3, cmd_command, sizeof( cmd_command ) );
                end_pos[0] = atof( cmd_command );
                trap_CmdArgv( 4, cmd_command, sizeof( cmd_command ) );
                end_pos[1] = atof( cmd_command );
                trap_CmdArgv( 5, cmd_command, sizeof( cmd_command ) );
                end_pos[2] = atof( cmd_command );
                return;
        }
        if(!strcmp(cmd_command, "draw"))
        {
                DrawWPS();
                return;
        }
        if(!strcmp(cmd_command, "clear"))
        {
                ClearWaypoints();
                return;
        }
}
Beispiel #12
0
 void
 Visit(const Waypoint& way_point)
 {
   AddWaypoint(way_point, false);
 }
    void UpdateAI(const uint32 diff)
    {
        if (IsEvent)
        {
            //Must update npc_escortAI
            npc_escortAI::UpdateAI(diff);
            if(!go)
            {
                go = true;
                if(pInstance)
                {
                    AddWaypoint(0, 5492.91,    -2404.61,    1462.63);
                    AddWaypoint(1, 5531.76,    -2460.87,    1469.55);
                    AddWaypoint(2, 5554.58,    -2514.66,    1476.12);
                    AddWaypoint(3, 5554.16,    -2567.23,    1479.90);
                    AddWaypoint(4, 5540.67,    -2625.99,    1480.89);
                    AddWaypoint(5, 5508.16,    -2659.2,    1480.15);
                    AddWaypoint(6, 5489.62,    -2704.05,    1482.18);
                    AddWaypoint(7, 5457.04,    -2726.26,    1485.10);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }
        }

        //Return since we have no target
        if (!UpdateVictim() )
            return;

        if(CheckTimer < diff)
        {
            DoZoneInCombat();
            m_creature->SetSpeed(MOVE_RUN, 3.0);
            CheckTimer = 3000;
        }
        else
            CheckTimer -= diff;

        if(CleaveTimer < diff)
        {
            DoCast(m_creature->getVictim(), SPELL_CLEAVE);
            CleaveTimer = urand(6000, 21000);
        }
        else
            CleaveTimer -= diff;

        if(WarStompTimer < diff)
        {
            DoCast(m_creature, SPELL_WARSTOMP);
            WarStompTimer = urand(15000, 25000);
        }
        else
            WarStompTimer -= diff;

        if(CrippleTimer < diff)
        {
            if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1, 20, true))
                DoCast(target, SPELL_CRIPPLE);

            CrippleTimer = urand(10000, 12000);
        }
        else
            CrippleTimer -= diff;

        if(MarkTimer < diff)
        {
            m_creature->CastSpell(m_creature, SPELL_MARK, false);

            MarkTimerBase -= 5000;

            if(MarkTimerBase <= 5500)
                MarkTimerBase = 10500;

            MarkTimer = MarkTimerBase;
            switch(rand()%3)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_MARK1);
                    DoYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_MARK2);
                    DoYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }
        else
            MarkTimer -= diff;

        DoMeleeAttackIfReady();
    }
Beispiel #14
0
        void UpdateAI(const uint32 diff)
        {
            if (IsEvent)
            {
                //Must update npc_escortAI
                npc_escortAI::UpdateAI(diff);
                if (!pGo)
                {
                    pGo = true;
                    if (pInstance)
                    {
                        AddWaypoint(0, 4896.08f,    -1576.35f,    1333.65f);
                        AddWaypoint(1, 4898.68f,    -1615.02f,    1329.48f);
                        AddWaypoint(2, 4907.12f,    -1667.08f,    1321.00f);
                        AddWaypoint(3, 4963.18f,    -1699.35f,    1340.51f);
                        AddWaypoint(4, 4989.16f,    -1716.67f,    1335.74f);
                        AddWaypoint(5, 5026.27f,    -1736.89f,    1323.02f);
                        AddWaypoint(6, 5037.77f,    -1770.56f,    1324.36f);
                        AddWaypoint(7, 5067.23f,    -1789.95f,    1321.17f);
                        Start(false, true);
                        SetDespawnAtEnd(false);
                    }
                }
            }

            //Return since we have no target
            if (!UpdateVictim())
                return;

            if (SwarmTimer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    DoCast(target, SPELL_CARRION_SWARM);

                SwarmTimer = urand(45000, 60000);
                switch (urand(0, 1))
                {
                case 0:
                    DoPlaySoundToSet(me, SOUND_SWARM1);
                    me->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0);
                    break;
                case 1:
                    DoPlaySoundToSet(me, SOUND_SWARM2);
                    me->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0);
                    break;
                }
            } else SwarmTimer -= diff;

            if (SleepTimer <= diff)
            {
                for (uint8 i = 0; i < 3; ++i)
                {
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                        target->CastSpell(target, SPELL_SLEEP, true);
                }
                SleepTimer = 60000;
                switch (urand(0, 1))
                {
                case 0:
                    DoPlaySoundToSet(me, SOUND_SLEEP1);
                    me->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0);
                    break;
                case 1:
                    DoPlaySoundToSet(me, SOUND_SLEEP2);
                    me->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0);
                    break;
                }
            } else SleepTimer -= diff;
            if (AuraTimer <= diff)
            {
                DoCast(me, SPELL_VAMPIRIC_AURA, true);
                AuraTimer = urand(10000, 20000);
            } else AuraTimer -= diff;
            if (InfernoTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_INFERNO);
                InfernoTimer = 45000;
                switch (urand(0, 1))
                {
                case 0:
                    DoPlaySoundToSet(me, SOUND_INFERNO1);
                    me->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0);
                    break;
                case 1:
                    DoPlaySoundToSet(me, SOUND_INFERNO2);
                    me->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0);
                    break;
                }
            } else InfernoTimer -= diff;

            DoMeleeAttackIfReady();
        }
Beispiel #15
0
bool
EWDevice::DeclareInner(const struct Declaration &declaration,
                       OperationEnvironment &env)
{
  char sTmp[72];

  ewDecelTpIndex = 0;

  if (!TryConnect(env))
    return false;

  // send SetPilotInfo
  WriteWithChecksum(port, "#SPI");
  env.Sleep(50);

  char sPilot[13], sGliderType[9], sGliderID[9];
  convert_string(sPilot, sizeof(sPilot), declaration.pilot_name);
  convert_string(sGliderType, sizeof(sGliderType), declaration.aircraft_type);
  convert_string(sGliderID, sizeof(sGliderID), declaration.aircraft_registration);

  // build string (field 4-5 are GPS info, no idea what to write)
  sprintf(sTmp, "%-12s%-8s%-8s%-12s%-12s%-6s\r", sPilot, sGliderType, sGliderID,
          "" /* GPS Model */, "" /* GPS Serial No. */, "" /* Flight Date */
          /* format unknown, left blank (GPS has a RTC) */);
  port.Write(sTmp);

  if (!port.ExpectString("OK\r", env))
    return false;

  /*
  sprintf(sTmp, "#SUI%02d", 0);           // send pilot name
  WriteWithChecksum(port, sTmp);
  env.Sleep(50);
  port.Write(PilotsName);
  port.Write('\r');

  if (!port.ExpectString("OK\r"))
    return false;

  sprintf(sTmp, "#SUI%02d", 1);           // send type of aircraft
  WriteWithChecksum(port, sTmp);
  env.Sleep(50);
  port.Write(Class);
  port.Write('\r');

  if (!port.ExpectString("OK\r"))
    nDeclErrorCode = 1;

  sprintf(sTmp, "#SUI%02d", 2);           // send aircraft ID
  WriteWithChecksum(port, sTmp);
  env.Sleep(50);
  port.Write(ID);
  port.Write('\r');

  if (!port.ExpectString("OK\r"))
    return false;
  */

  // clear all 6 TP's
  for (int i = 0; i < 6; i++) {
    sprintf(sTmp, "#CTP%02d", i);
    WriteWithChecksum(port, sTmp);
    if (!port.ExpectString("OK\r", env))
      return false;
  }

  for (unsigned j = 0; j < declaration.Size(); ++j)
    if (!AddWaypoint(declaration.GetWaypoint(j), env))
      return false;

  return true;
}
Beispiel #16
0
        void UpdateAI(const uint32 diff)
        {
            if (IsEvent)
            {
                //Must update npc_escortAI
                npc_escortAI::UpdateAI(diff);
                if (!go)
                {
                    go = true;
                    if (instance)
                    {
                        AddWaypoint(0, 5492.91f,    -2404.61f,    1462.63f);
                        AddWaypoint(1, 5531.76f,    -2460.87f,    1469.55f);
                        AddWaypoint(2, 5554.58f,    -2514.66f,    1476.12f);
                        AddWaypoint(3, 5554.16f,    -2567.23f,    1479.90f);
                        AddWaypoint(4, 5540.67f,    -2625.99f,    1480.89f);
                        AddWaypoint(5, 5508.16f,    -2659.2f,    1480.15f);
                        AddWaypoint(6, 5489.62f,    -2704.05f,    1482.18f);
                        AddWaypoint(7, 5457.04f,    -2726.26f,    1485.10f);
                        Start(false, true);
                        SetDespawnAtEnd(false);
                    }
                }
            }

            //Return since we have no target
            if (!UpdateVictim())
                return;

            if (CleaveTimer <= diff)
            {
                DoCast(me, SPELL_CLEAVE);
                CleaveTimer = 6000+rand()%15000;
            } else CleaveTimer -= diff;

            if (WarStompTimer <= diff)
            {
                DoCast(me, SPELL_WARSTOMP);
                WarStompTimer = 60000;
            } else WarStompTimer -= diff;

            if (MarkTimer <= diff)
            {
                DoCastAOE(SPELL_MARK);

                MarkTimerBase -= 5000;
                if (MarkTimerBase < 5500)
                    MarkTimerBase = 5500;
                MarkTimer = MarkTimerBase;
                switch (urand(0, 2))
                {
                    case 0:
                        DoPlaySoundToSet(me, SOUND_MARK1);
                        me->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, 0);
                        break;
                    case 1:
                        DoPlaySoundToSet(me, SOUND_MARK2);
                        me->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, 0);
                        break;
                }
            } else MarkTimer -= diff;

            DoMeleeAttackIfReady();
        }
Beispiel #17
0
        void UpdateAI(const uint32 diff)
        {
            if (IsEvent)
            {
                //Must update npc_escortAI
                npc_escortAI::UpdateAI(diff);
                if (!go)
                {
                    go = true;
                    if (instance)
                    {
                        AddWaypoint(0, 5492.91f,    -2404.61f,    1462.63f);
                        AddWaypoint(1, 5531.76f,    -2460.87f,    1469.55f);
                        AddWaypoint(2, 5554.58f,    -2514.66f,    1476.12f);
                        AddWaypoint(3, 5554.16f,    -2567.23f,    1479.90f);
                        AddWaypoint(4, 5540.67f,    -2625.99f,    1480.89f);
                        AddWaypoint(5, 5508.16f,    -2659.2f,    1480.15f);
                        AddWaypoint(6, 5489.62f,    -2704.05f,    1482.18f);
                        AddWaypoint(7, 5457.04f,    -2726.26f,    1485.10f);
                        Start(false, true);
                        SetDespawnAtEnd(false);
                    }
                }
            }

            //Return since we have no target
            if (!UpdateVictim())
                return;

            if (RainTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true), SPELL_RAIN_OF_FIRE);
                RainTimer = 20000+rand()%15000;
            } else RainTimer -= diff;

            if (DoomTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true), SPELL_DOOM);//never on tank
                DoomTimer = 45000+rand()%5000;
            } else DoomTimer -= diff;

            if (HowlTimer <= diff)
            {
                DoCast(me, SPELL_HOWL_OF_AZGALOR);
                HowlTimer = 30000;
            } else HowlTimer -= diff;

            if (CleaveTimer <= diff)
            {
                DoCast(me->getVictim(), SPELL_CLEAVE);
                CleaveTimer = 10000+rand()%5000;
            } else CleaveTimer -= diff;

            if (EnrageTimer < diff && !enraged)
            {
                me->InterruptNonMeleeSpells(false);
                DoCast(me, SPELL_BERSERK, true);
                enraged = true;
                EnrageTimer = 600000;
            } else EnrageTimer -= diff;

            DoMeleeAttackIfReady();
        }
Beispiel #18
0
        void SetData(uint32 uiType, uint32 /*uiData*/)
        {
            switch (me->GetEntry())
            {
                case NPC_ARGENT_LIGHWIELDER:
                    switch (uiType)
                    {
                        case 0:
                            AddWaypoint(0, 737.14f, 655.42f, 412.88f);
                            AddWaypoint(1, 712.14f, 628.42f, 411.88f);
                            break;
                        case 1:
                            AddWaypoint(0, 742.44f, 650.29f, 411.79f);
                            break;
                        case 2:
                            AddWaypoint(0, 756.14f, 655.42f, 411.88f);
                            AddWaypoint(1, 781.626f, 629.383f, 411.892f);
                            break;
                    }
                    break;
                case NPC_ARGENT_MONK:
                    switch (uiType)
                    {
                        case 0:
                            AddWaypoint(0, 737.14f, 655.42f, 412.88f);
                            AddWaypoint(1, 713.12f, 632.97f, 411.90f);
                            break;
                        case 1:
                            AddWaypoint(0, 746.73f, 650.24f, 411.56f);
                            break;
                        case 2:
                            AddWaypoint(0, 756.14f, 655.42f, 411.88f);
                            AddWaypoint(1, 781.351f, 633.146f, 411.907f);
                            break;
                    }
                    break;
                case NPC_PRIESTESS:
                    switch (uiType)
                    {
                        case 0:
                            AddWaypoint(0, 737.14f, 655.42f, 412.88f);
                            AddWaypoint(1, 715.06f, 637.07f, 411.91f);
                            break;
                        case 1:
                            AddWaypoint(0, 750.72f, 650.20f, 411.77f);
                            break;
                        case 2:
                            AddWaypoint(0, 756.14f, 655.42f, 411.88f);
                            AddWaypoint(1, 780.439f, 636.681f, 411.918f);
                            break;
                    }
                    break;
            }

            Start(false, true, 0);
            uiWaypoint = uiType;
        }
void violet_hold_invaderAI::UpdateEscortAI(const uint32 diff)
{
    if (!WaypointSet)
    {
        uint8 i=0;
        switch (PortalNumber)
        {
        case 1:
            for (i=0;i<7;i++)
            {
                AddWaypoint(i, portal1WP[i][0], portal1WP[i][1], portal1WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 2:
            for (i=0;i<5;i++)
            {
                AddWaypoint(i, portal2WP[i][0], portal2WP[i][1], portal2WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;   
            break;
        case 3:
            for (i=0;i<5;i++)
            {
                AddWaypoint(i, portal3WP[i][0], portal3WP[i][1], portal3WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 4:
            for (i=0;i<3;i++)
            {
                AddWaypoint(i, portal4WP[i][0], portal4WP[i][1], portal4WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 5:
            for (i=0;i<3;i++)
            {
                AddWaypoint(i, portal5WP[i][0], portal5WP[i][1], portal5WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 6:
            for (i=0;i<3;i++)
            {
                AddWaypoint(i, portal6WP[i][0], portal6WP[i][1], portal6WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 7:
            for (i=0;i<8;i++)
            {
                AddWaypoint(i, portal7WP[i][0], portal7WP[i][1], portal7WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 8:
            for (i=0;i<8;i++)
            {
                AddWaypoint(i, portal8WP[i][0], portal8WP[i][1], portal8WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        }
        float modx,mody;
        modx=urand(28,39);
        modx=modx/2;
        mody=sqrt(380-pow(modx,2));
        if (m_instance)
        {
            Creature* tDoor=m_creature->GetMap()->GetCreature(m_instance->GetData64(DOOR_GUID));
            if (rand()%2)                    
                AddWaypoint(i, tDoor->GetPositionX()+modx,tDoor->GetPositionY()+mody,44.019f);
            else
                AddWaypoint(i, tDoor->GetPositionX()+modx,tDoor->GetPositionY()-mody,44.019f);
            AddWaypoint(i+1, finishWP[0][0],finishWP[0][1],finishWP[0][2]);
            AddWaypoint(i+2, finishWP[1][0],finishWP[1][1],finishWP[1][2]);
        }
    }

    if (AttackingDoor)
    {
        if (AttackingDoorTimer<diff)
        {
            if (m_instance)
            {
                m_instance->SetData(DATA_TICKCOUNTER,m_instance->GetData(DATA_TICKCOUNTER)+1);
                AttackingDoorTimer=500;
            }
        }
        else AttackingDoorTimer-=diff;
    }
}
Beispiel #20
0
    void UpdateAI(const uint32 diff)
    {
        if (IsEvent)
        {
            //Must update npc_escortAI
            npc_escortAI::UpdateAI(diff);
            if(!go)
            {
                go = true;
                if(pInstance)
                {
                    AddWaypoint(0, 4896.08,    -1576.35,    1333.65);
                    AddWaypoint(1, 4898.68,    -1615.02,    1329.48);
                    AddWaypoint(2, 4907.12,    -1667.08,    1321.00);
                    AddWaypoint(3, 4963.18,    -1699.35,    1340.51);
                    AddWaypoint(4, 4989.16,    -1716.67,    1335.74);
                    AddWaypoint(5, 5026.27,    -1736.89,    1323.02);
                    AddWaypoint(6, 5037.77,    -1770.56,    1324.36);
                    AddWaypoint(7, 5067.23,    -1789.95,    1321.17);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }
        }

        //back to victim target facing
        if (!UpdateVictim())
            return;

        if(CheckTimer < diff)
        {
            DoZoneInCombat();
            if(!m_creature->IsNonMeleeSpellCasted(true))
            {
                if(m_creature->GetSelection() != m_creature->getVictimGUID())
                    m_creature->SetSelection(m_creature->getVictimGUID());
            }
            m_creature->SetSpeed(MOVE_RUN, 3.0);
            CheckTimer = 2000;
        }
        else
            CheckTimer -= diff;

        if(SwarmTimer < diff)
        {
            if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,65,true))
            {
                AddSpellToCast(target, SPELL_CARRION_SWARM, false, true);
                SwarmTimer = 12000+rand()%6000;

                switch(rand()%2)
                {
                    case 0:
                        DoPlaySoundToSet(m_creature, SOUND_SWARM1);
                        DoYell(SAY_SWARM1, LANG_UNIVERSAL, NULL);
                    break;
                    case 1:
                        DoPlaySoundToSet(m_creature, SOUND_SWARM2);
                        DoYell(SAY_SWARM2, LANG_UNIVERSAL, NULL);
                    break;
                }
            }
        }
        else
            SwarmTimer -= diff;

        if(SleepTimer < diff)
        {
            DoCast(m_creature, SPELL_SLEEP, true);

            SleepTimer = 60000;

            switch(rand()%2)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_SLEEP1);
                    DoYell(SAY_SLEEP1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_SLEEP2);
                    DoYell(SAY_SLEEP2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }
        else
            SleepTimer -= diff;

        if(InfernoTimer < diff)
        {
            if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0,200,true))
            {
                m_creature->CastStop();
                AddSpellToCast(target, SPELL_INFERNO, false, true);

                switch(rand()%2)
                {
                    case 0:
                        DoPlaySoundToSet(m_creature, SOUND_INFERNO1);
                        DoYell(SAY_INFERNO1, LANG_UNIVERSAL, NULL);
                    break;
                    case 1:
                        DoPlaySoundToSet(m_creature, SOUND_INFERNO2);
                        DoYell(SAY_INFERNO2, LANG_UNIVERSAL, NULL);
                    break;
                }
                InfernoTimer = 60000;
            }
        }
        else
            InfernoTimer -= diff;

        CastNextSpellIfAnyAndReady();
        DoMeleeAttackIfReady();
    }
Beispiel #21
0
 void Visit(const WaypointPtr &way_point) override {
   AddWaypoint(way_point, false);
 }
Beispiel #22
0
    void UpdateAI(const uint32 diff)
    {
        if (IsEvent)
        {
            //Must update npc_escortAI
            npc_escortAI::UpdateAI(diff);
            if(!go)
            {
                go = true;
                if(pInstance)
                {
                    AddWaypoint(0, 4896.08,    -1576.35,    1333.65);
                    AddWaypoint(1, 4898.68,    -1615.02,    1329.48);
                    AddWaypoint(2, 4907.12,    -1667.08,    1321.00);
                    AddWaypoint(3, 4963.18,    -1699.35,    1340.51);
                    AddWaypoint(4, 4989.16,    -1716.67,    1335.74);
                    AddWaypoint(5, 5026.27,    -1736.89,    1323.02);
                    AddWaypoint(6, 5037.77,    -1770.56,    1324.36);
                    AddWaypoint(7, 5067.23,    -1789.95,    1321.17);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }
        }

        //Return since we have no target
        if (!UpdateVictim() )
            return;

        if(SwarmTimer < diff)
        {
            Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,100,true);
            if(target)
                DoCast(target,SPELL_CARRION_SWARM);

            SwarmTimer = 45000+rand()%15000;
            switch(rand()%2)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_SWARM1);
                    DoYell(SAY_SWARM1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_SWARM2);
                    DoYell(SAY_SWARM2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }else SwarmTimer -= diff;

        if(SleepTimer < diff)
        {
            for(uint8 i=0;i<3;++i)
            {
                Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,100,true);
                if(target)
                    target->CastSpell(target,SPELL_SLEEP,true);
            }
            SleepTimer = 60000;
            switch(rand()%2)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_SLEEP1);
                    DoYell(SAY_SLEEP1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_SLEEP2);
                    DoYell(SAY_SLEEP2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }else SleepTimer -= diff;
        if(AuraTimer < diff)
        {
            DoCast(m_creature, SPELL_VAMPIRIC_AURA,true);
            AuraTimer = 10000+rand()%10000;
        }else AuraTimer -= diff;
        if(InfernoTimer < diff)
        {
            DoCast(SelectUnit(SELECT_TARGET_RANDOM,0,100,true), SPELL_INFERNO);
            InfernoTimer = 45000;
            switch(rand()%2)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_INFERNO1);
                    DoYell(SAY_INFERNO1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_INFERNO2);
                    DoYell(SAY_INFERNO2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }else InfernoTimer -= diff;

        DoMeleeAttackIfReady();
    }
Beispiel #23
0
        void InitWaypoint()
        {
            AddWaypoint(1, 2389.03f,     -5902.74f,     109.014f, 5000);
            AddWaypoint(2, 2341.812012f, -5900.484863f, 102.619743f);
            AddWaypoint(3, 2306.561279f, -5901.738281f, 91.792419f);
            AddWaypoint(4, 2300.098389f, -5912.618652f, 86.014885f);
            AddWaypoint(5, 2294.142090f, -5927.274414f, 75.316849f);
            AddWaypoint(6, 2286.984375f, -5944.955566f, 63.714966f);
            AddWaypoint(7, 2280.001709f, -5961.186035f, 54.228283f);
            AddWaypoint(8, 2259.389648f, -5974.197754f, 42.359348f);
            AddWaypoint(9, 2242.882812f, -5984.642578f, 32.827850f);
            AddWaypoint(10, 2217.265625f, -6028.959473f, 7.675705f);
            AddWaypoint(11, 2202.595947f, -6061.325684f, 5.882018f);
            AddWaypoint(12, 2188.974609f, -6080.866699f, 3.370027f);

            if (urand(0,1))
            {
                AddWaypoint(13, 2176.483887f, -6110.407227f, 1.855181f);
                AddWaypoint(14, 2172.516602f, -6146.752441f, 1.074235f);
                AddWaypoint(15, 2138.918457f, -6158.920898f, 1.342926f);
                AddWaypoint(16, 2129.866699f, -6174.107910f, 4.380779f);
                AddWaypoint(17, 2117.709473f, -6193.830078f, 13.3542f, 10000);
            }
            else
            {
                AddWaypoint(13, 2184.190186f, -6166.447266f, 0.968877f);
                AddWaypoint(14, 2234.265625f, -6163.741211f, 0.916021f);
                AddWaypoint(15, 2268.071777f, -6158.750977f, 1.822252f);
                AddWaypoint(16, 2270.028320f, -6176.505859f, 6.340538f);
                AddWaypoint(17, 2271.739014f, -6195.401855f, 13.3542f, 10000);
            }
        }
        void UpdateAI(uint32 diff)
        {
            npc_escortAI::UpdateAI(diff);

            if(!bAddedWPs)
            {
                bAddedWPs = true;
                switch(uiBoss)
                {
                    case 1:
                        for(int i=0;i<3;i++)
                            AddWaypoint(i, SaboteurFinalPos1[i][0], SaboteurFinalPos1[i][1], SaboteurFinalPos1[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos1[2][0], SaboteurFinalPos1[2][1], SaboteurFinalPos1[2][2], 4.762346f);
                        break;
                    case 2:
                        for(int i=0;i<3;i++)
                            AddWaypoint(i, SaboteurFinalPos2[i][0], SaboteurFinalPos2[i][1], SaboteurFinalPos2[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos2[2][0], SaboteurFinalPos2[2][1], SaboteurFinalPos2[2][2], 1.862674f);
                        break;
                    case 3:
                        for(int i=0;i<2;i++)
                            AddWaypoint(i, SaboteurFinalPos3[i][0], SaboteurFinalPos3[i][1], SaboteurFinalPos3[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos3[1][0], SaboteurFinalPos3[1][1], SaboteurFinalPos3[1][2], 5.500638f);
                        break;
                    case 4:
                        AddWaypoint(0, SaboteurFinalPos4[0], SaboteurFinalPos4[1], SaboteurFinalPos4[2], 0);
                        me->SetHomePosition(SaboteurFinalPos4[0], SaboteurFinalPos4[1], SaboteurFinalPos4[2], 3.991108f);
                        break;
                    case 5:
                        AddWaypoint(0, SaboteurFinalPos5[0], SaboteurFinalPos5[1], SaboteurFinalPos5[2], 0);
                        me->SetHomePosition(SaboteurFinalPos5[0], SaboteurFinalPos5[1], SaboteurFinalPos5[2], 1.100841f);
                        break;
                    case 6:
                        for(int i=0;i<5;i++)
                            AddWaypoint(i, SaboteurFinalPos6[i][0], SaboteurFinalPos6[i][1], SaboteurFinalPos6[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos6[4][0], SaboteurFinalPos6[4][1], SaboteurFinalPos6[4][2], 0.983031f);
                        break;
                }
                SetDespawnAtEnd(false);
                Start(true, true);
            }

            if (bOpening)
            {
                if (timer <= diff)
                {
                    if (count < 2)
                    {
                        me->CastSpell(me, SABOTEUR_SHIELD_DISRUPTION, false);
                        timer = 1000;
                    }
                    else if (count == 2)
                    {
                        me->CastSpell(me, SABOTEUR_SHIELD_DISRUPTION, false);
                        if (pInstance)
                            pInstance->SetData(DATA_RELEASE_BOSS, 0);
                        timer = 500;
                    }
                    else
                    {
                        bOpening = false;
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                        me->SetDisplayId(11686);
                        me->CastSpell(me, SPELL_TELEPORT_VISUAL, true);
                        me->DespawnOrUnsummon(1000);
                    }
                    ++count;
                }
                else timer -= diff;
            }
        }
        void SetData(uint32 uiType, uint32 uiData)
        {
            switch(me->GetEntry())
            {
                case NPC_ARGENT_LIGHWIELDER:
                    switch(uiType)
                    {
                        case 0:
                            AddWaypoint(0, 737.14f,655.42f,412.88f);
                            AddWaypoint(1, 712.14f,628.42f,411.88f);
                            break;
                        case 1:
                            AddWaypoint(0, 742.44f, 650.29f, 411.79f);
                            break;
                        case 2:
                            AddWaypoint(0, 756.14f, 655.42f, 411.88f);
                            AddWaypoint(1, 775.912f, 639.033f, 411.907f);
                            break;
                    }
                    break;
                case NPC_ARGENT_MONK:
                    switch(uiType)
                    {
                        case 0:
                            AddWaypoint(0, 737.14f, 655.42f, 412.88f);
                            AddWaypoint(1, 713.12f, 632.97f, 411.90f);
                            break;
                        case 1:
                            AddWaypoint(0, 746.73f, 650.24f, 411.56f);
                            break;
                        case 2:
                            AddWaypoint(0, 756.14f, 655.42f, 411.88f);
                            AddWaypoint(1, 784.817f, 629.883f, 411.908f);
                            break;
                    }
                    break;
                case NPC_PRIESTESS:
                    switch(uiType)
                    {
                        case 0:
                            AddWaypoint(0, 737.14f, 655.42f, 412.88f);
                            AddWaypoint(1, 715.06f, 637.07f, 411.91f);
                            break;
                        case 1:
                            AddWaypoint(0, 750.72f, 650.20f, 411.77f);
                            break;
                        case 2:
                            AddWaypoint(0, 756.14f, 655.42f, 411.88f);
                            AddWaypoint(1, 779.942f, 634.061f, 411.905f);
                            break;
                    }
                    break;
            }

            Start(false,true,0);
            uiWaypoint = uiType;
        }
Beispiel #26
0
 void StartEvent(Player* player, const Quest* pQuest)
 {
     switch (CalculateWaypointID())
     {
     case 1:
         AddWaypoint(0, -4108.25, 3032.18, 344.799, 3000);
         AddWaypoint(1, -4114.41, 3036.73, 344.039);
         AddWaypoint(2, -4126.41, 3026.07, 344.156);
         AddWaypoint(3, -4145.17, 3029.69, 337.423);
         AddWaypoint(4, -4173.69, 3035.72, 343.346);
         AddWaypoint(5, -4173.70, 3047.37, 343.888);
         AddWaypoint(6, -4183.47, 3060.62, 344.157, 3000);
         AddWaypoint(7, -4179.13, 3090.20, 323.971, 30000);
         Start(false, false, player->GetGUID(), pQuest);
         break;
     case 2:
         AddWaypoint(0, -3718.81, 3787.24, 302.890, 3000);
         AddWaypoint(1, -3714.44, 3780.35, 302.075);
         AddWaypoint(2, -3698.33, 3788.04, 302.171);
         AddWaypoint(3, -3679.36, 3780.25, 295.077);
         AddWaypoint(4, -3654.82, 3770.43, 301.291);
         AddWaypoint(5, -3656.07, 3757.31, 301.985);
         AddWaypoint(6, -3648.83, 3743.07, 302.173, 3000);
         AddWaypoint(7, -3659.16, 3714.94, 281.576, 30000);
         Start(false, false, player->GetGUID(), pQuest);
         break;
     case 3:
         AddWaypoint(0, -3671.51, 3385.36, 312.956, 3000);
         AddWaypoint(1, -3677.74, 3379.05, 312.136);
         AddWaypoint(2, -3667.52, 3366.45, 312.233);
         AddWaypoint(3, -3672.87, 3343.52, 304.994);
         AddWaypoint(4, -3679.35, 3319.01, 311.419);
         AddWaypoint(5, -3692.93, 3318.69, 312.081);
         AddWaypoint(6, -3704.08, 3309.56, 312.233, 3000);
         AddWaypoint(7, -3733.99, 3315.77, 292.093, 30000);
         Start(false, false, player->GetGUID(), pQuest);
         break;
     }
     return;
 }
Beispiel #27
0
    void UpdateAI(const uint32 diff)
    {
        if (IsEvent)
        {
            //Must update npc_escortAI
            npc_escortAI::UpdateAI(diff);
            if (!pGo)
            {
                pGo = true;
                if (pInstance)
                {
                    AddWaypoint(0, 5492.91,    -2404.61,    1462.63);
                    AddWaypoint(1, 5531.76,    -2460.87,    1469.55);
                    AddWaypoint(2, 5554.58,    -2514.66,    1476.12);
                    AddWaypoint(3, 5554.16,    -2567.23,    1479.90);
                    AddWaypoint(4, 5540.67,    -2625.99,    1480.89);
                    AddWaypoint(5, 5508.16,    -2659.2,    1480.15);
                    AddWaypoint(6, 5489.62,    -2704.05,    1482.18);
                    AddWaypoint(7, 5457.04,    -2726.26,    1485.10);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }
        }

        //Return since we have no target
        if (!UpdateVictim())
            return;

        if (CleaveTimer < diff)
        {
            DoCast(m_creature, SPELL_CLEAVE);
            CleaveTimer = 6000+rand()%15000;
        }else CleaveTimer -= diff;

        if (WarStompTimer < diff)
        {
            DoCast(m_creature, SPELL_WARSTOMP);
            WarStompTimer = 60000;
        }else WarStompTimer -= diff;

        if (m_creature->HasAura(SPELL_MARK))
            m_creature->RemoveAurasDueToSpell(SPELL_MARK);
        if (MarkTimer < diff)
        {
            //cast dummy, useful for bos addons
            m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());

            std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
            for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
            {
                Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
                if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA)
                {
                    target->CastSpell(target, SPELL_MARK,true);//only cast on mana users
                }
            }
            MarkTimerBase -= 5000;
            if (MarkTimerBase < 5500)
                MarkTimerBase = 5500;
            MarkTimer = MarkTimerBase;
            switch(rand()%3)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_MARK1);
                    m_creature->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_MARK2);
                    m_creature->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }else MarkTimer -= diff;

        DoMeleeAttackIfReady();
    }
    void LoadWaypoints()
    {
        AddWaypoint(0, 2354.0f, -5906.375977f, 104.940987f);
        AddWaypoint(1, 2306.066895f, -5906.791992f, 89.610298f);
        AddWaypoint(2, 2278.72876f, -5959.347656f, 54.58366f);
        AddWaypoint(3, 2235.88501f, -5992.0f, 28.422256f);
        AddWaypoint(4, 2237.030518f, -5992.619141f, 28.341301f);
        AddWaypoint(5, 2223.199951f, -6018.459473f, 10.012696f);
        AddWaypoint(6, 2190.214844f, -6080.208496f, 3.315653f);
        AddWaypoint(7, 2168.917236f, -6160.133301f, 1.424436f);

        if (urand(0,1))
        {
            AddWaypoint(8, 2135.743164f, -6165.421875f, 0.716511f);
            AddWaypoint(9, 2128.039551f, -6177.420898f, 6.740788f);
            AddWaypoint(10, 2122.394531f, -6186.128418f, 14.043964f);
            AddWaypoint(11, 2116.232422f, -6195.810547f, 14.336172f);
        }
        else
        {
            AddWaypoint(8, 2267.669434f, -6165.244629f, 1.631780f);
            AddWaypoint(9, 2269.951660f, -6175.877441f, 5.924870f);
            AddWaypoint(10, 2271.001953f, -6187.146484f, 14.016878f);
            AddWaypoint(11, 2273.009766f, -6200.994629f, 14.222438f);
        }
    }
    void UpdateAI(const uint32 diff)
    {
        if (IsEvent)
        {
            //Must update npc_escortAI
            npc_escortAI::UpdateAI(diff);
            if (!pGo)
            {
                pGo = true;
                if (pInstance)
                {
                    AddWaypoint(0, 4896.08f,    -1576.35f,    1333.65f);
                    AddWaypoint(1, 4898.68f,    -1615.02f,    1329.48f);
                    AddWaypoint(2, 4907.12f,    -1667.08f,    1321.00f);
                    AddWaypoint(3, 4963.18f,    -1699.35f,    1340.51f);
                    AddWaypoint(4, 4989.16f,    -1716.67f,    1335.74f);
                    AddWaypoint(5, 5026.27f,    -1736.89f,    1323.02f);
                    AddWaypoint(6, 5037.77f,    -1770.56f,    1324.36f);
                    AddWaypoint(7, 5067.23f,    -1789.95f,    1321.17f);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }
        }

        //Return since we have no target
        if (!UpdateVictim())
            return;

        if (FrostArmorTimer <= diff)
        {
            DoCast(me, SPELL_FROST_ARMOR);
            FrostArmorTimer = 40000+rand()%20000;
        } else FrostArmorTimer -= diff;
        if (DecayTimer <= diff)
        {
            DoCast(me->getVictim(), SPELL_DEATH_AND_DECAY);
            DecayTimer = 60000+rand()%20000;
            switch (urand(0,1))
            {
                case 0:
                    DoPlaySoundToSet(me, SOUND_DECAY1);
                    me->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(me, SOUND_DECAY2);
                    me->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL);
                    break;
            }
        } else DecayTimer -= diff;
        if (NovaTimer <= diff)
        {
            DoCast(me->getVictim(), SPELL_FROST_NOVA);
            NovaTimer = 30000+rand()%15000;
            switch (urand(0,1))
            {
                case 0:
                    DoPlaySoundToSet(me, SOUND_NOVA1);
                    me->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(me, SOUND_NOVA2);
                    me->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL);
                    break;
            }
        } else NovaTimer -= diff;
        if (IceboltTimer <= diff)
        {
            DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT);
            IceboltTimer = 11000+rand()%20000;
        } else IceboltTimer -= diff;

        DoMeleeAttackIfReady();
    }
    void SetData(uint32 uiType, uint32 uiData)
    {
        switch(me->GetEntry())
        {
            case NPC_ARGENT_LIGHWIELDER:
                switch(uiType)
                {
                    case 0:
					    AddWaypoint(0,737.14,655.42,412.88);
                        AddWaypoint(1,712.14,628.42,411.88);
                        break;
                    case 1:
                        AddWaypoint(0,742.44,650.29,411.79);
                        break;
                    case 2:
					    AddWaypoint(0,756.14,655.42,411.88);
                        AddWaypoint(1,781.626, 629.383, 411.892);
                        break;
                }
                break;
            case NPC_ARGENT_MONK:
                switch(uiType)
                {
                    case 0:
					    AddWaypoint(0,737.14,655.42,412.88);
                        AddWaypoint(1,713.12,632.97,411.90);
                        break;
                    case 1:
                        AddWaypoint(0,746.73,650.24,411.56);
                        break;
                    case 2:
					    AddWaypoint(0,756.14,655.42,411.88);
                        AddWaypoint(1,781.351, 633.146, 411.907);
                        break;
                }
                break;
            case NPC_PRIESTESS:
                switch(uiType)
                {
                    case 0:
					    AddWaypoint(0,737.14,655.42,412.88);
                        AddWaypoint(1,715.06,637.07,411.91);
                        break;
                    case 1:
                        AddWaypoint(0,750.72,650.20,411.77);
                        break;
                    case 2:
					    AddWaypoint(0,756.14,655.42,411.88);
                        AddWaypoint(1,780.439, 636.681, 411.918);
                        break;
                }
                break;
        }

        Start(false,true,0);
        uiWaypoint = uiType;
    }