Example #1
1
    void OnQuestStart( Player * mTarget, QuestLogEntry * qLogEntry)
    {
        if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
            return;
        float SSX = mTarget->GetPositionX();
        float SSY = mTarget->GetPositionY();
        float SSZ = mTarget->GetPositionZ();


        Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 5644);
        if(creat == NULL)
            return;
        creat->m_escorter = mTarget;
        creat->GetAIInterface()->setMoveType(11);
        creat->GetAIInterface()->StopMovement(3000);
        creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Ts...... I must be removed from this lair");
        creat->SetUInt32Value(UNIT_NPC_FLAGS, 0);

        EAS::CreateCustomWaypointMap(creat);
        EAS::WaypointCreate(creat,-336.599213f, 1764.957275f, 139.517746f, 4.461932f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-338.992798f, 1750.499023f, 139.414673f, 5.318010f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-327.872040f, 1734.572388f, 139.331665f, 3.382010f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-350.114044f, 1728.984741f, 139.337723f, 2.514144f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-372.413940f, 1745.675293f, 139.382660f, 3.872884f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-386.453796f, 1736.851685f, 137.771500f, 3.790415f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-400.639496f, 1728.250488f, 131.174881f, 3.511599f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-431.880005f, 1713.812378f, 127.584572f, 3.704021f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-453.655090f, 1700.086670f, 120.951744f, 4.261652f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-465.082306f, 1677.391113f, 111.065910f, 4.866406f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-462.129944f, 1665.744507f, 108.106010f, 4.257726f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-477.037445f, 1630.453857f, 99.003723f, 4.787863f, 1, 256, 3791);
        EAS::WaypointCreate(creat,-474.509247f, 1590.814453f, 94.546768f, 5.197841f, 1, 256, 3791);
    }
    void OnQuestStart( Player* mTarget, QuestLogEntry * qLogEntry)
    {
        if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
            return;
        float SSX = mTarget->GetPositionX();
        float SSY = mTarget->GetPositionY();
        float SSZ = mTarget->GetPositionZ();

        Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 467);

        if(creat == NULL)
            return;
        creat->m_escorter = mTarget;
        creat->GetAIInterface()->setMoveType(11);
        creat->GetAIInterface()->SetAllowedToEnterCombat(false);
        creat->GetAIInterface()->StopMovement(3000);
        creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Okay let's do this, you gotta protect me and stuff, I can't fight on my own!");
        creat->SetUInt32Value(UNIT_NPC_FLAGS, 0);

        sEAS.CreateCustomWaypointMap(creat);
        sEAS.WaypointCreate(creat,-10521.876953f, 1064.410278f, 54.820744f, 3.220135f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10548.616211f, 1072.964111f, 49.694920f, 3.345799f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10596.891602f, 1057.281982f, 38.864330f, 3.451828f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10663.427734f, 1030.475952f, 32.725643f, 3.098398f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10715.894531f, 1030.825317f, 33.473114f, 3.165157f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10754.050781f, 1016.978821f, 32.843971f, 3.443188f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10917.114258f, 997.355408f, 35.466064f, 3.314383f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10937.306641f, 1020.598755f, 36.644848f, 1.488332f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10933.578125f, 1058.460571f, 36.027996f, 1.472624f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10958.590820f, 1105.329224f, 36.635437f, 2.076595f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10895.253906f, 1248.348877f, 33.385048f, 1.176529f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10890.806641f, 1297.475708f, 34.488716f, 1.698819f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10917.052734f, 1419.003296f, 42.823147f, 1.804847f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10948.415039f, 1422.049927f, 43.411053f, 3.332447f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-10989.025391f, 1410.501953f, 42.863670f, 2.673498f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-11016.258789f, 1434.814697f, 42.987415f, 2.005909f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-11024.154297f, 1488.091064f, 43.177536f, 1.566087f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-11048.541992f, 1513.367798f, 43.154915f, 2.369550f, 0, 256, 0);
        sEAS.WaypointCreate(creat,-11065.412109f, 1526.429321f, 43.328102f, 3.068554f, 0, 256, 0);
        sEAS.EnableWaypoints( creat );
    }