Example #1
0
        void WaypointReached(uint32 i) {
            Player* pPlayer = GetPlayerForEscort();

            if (!pPlayer)
                return;

            switch (i) {
            case 16:
                DoScriptText(SAY_AMBUSH, me);
                me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f,
                                   -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,
                                   30000);
                me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f,
                                   -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,
                                   30000);
                me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f,
                                   -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,
                                   30000);
                break;
            case 18:
                me->SetInFront(pPlayer);
                DoScriptText(SAY_END, me, pPlayer);
                if (pPlayer)
                    pPlayer->GroupEventHappens(QUEST_PROTECT_KAYA, me);
                break;
            }
        }
Example #2
0
        void WaypointReached(uint32 waypointId)
        {
            Player* player = GetPlayerForEscort();
            if (!player)
                return;

            switch (waypointId)
            {
            case 3: //first spawn
                me->SummonCreature(SPAWN_FIRST, 2449.67f, 2183.11f, 96.85f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
                me->SummonCreature(SPAWN_FIRST, 2449.53f, 2184.43f, 96.36f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
                me->SummonCreature(SPAWN_FIRST, 2449.85f, 2186.34f, 97.57f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
                break;
            case 7:
                me->SummonCreature(SPAWN_SECOND, 2309.64f, 2186.24f, 92.25f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
                me->SummonCreature(SPAWN_SECOND, 2309.25f, 2183.46f, 91.75f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
                break;
            case 12:
                player->GroupEventHappens(Q_ALMABTRIEB, me);
                if (me->FindNearestCreature(N_THADELL, 30))
                    DoScriptText(SAY_THADELL_1, me);
                break;
            case 13:
                if (me->FindNearestCreature(N_THADELL, 30))
                    DoScriptText(SAY_THADELL_2, me, player);
                break;
            }
        }
Example #3
0
void SmartAI::EndPath(bool fail)
{
    GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, NULL, mLastWP->id, GetScript()->GetPathId());

    RemoveEscortState(SMART_ESCORT_ESCORTING | SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING);
    mWayPoints = NULL;
    mCurrentWPID = 0;
    mWPPauseTimer = 0;
    mLastWP = NULL;

    if (mCanRepeatPath)
        StartPath(mRun, GetScript()->GetPathId(), true);
    else
        GetScript()->SetPathId(0);

    ObjectList* targets = GetScript()->GetTargetList(SMART_ESCORT_TARGETS);
    if (targets && mEscortQuestID)
    {
        if (targets->size() == 1 && GetScript()->IsPlayer((*targets->begin())))
        {
            Player* player = (*targets->begin())->ToPlayer();
            if (!fail && player->IsAtGroupRewardDistance(me) && !player->GetCorpse())
                player->GroupEventHappens(mEscortQuestID, me);

            if (fail && player->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
                player->FailQuest(mEscortQuestID);

            if (Group* group = player->GetGroup())
            {
                for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
                {
                    Player* groupGuy = groupRef->GetSource();

                    if (!fail && groupGuy->IsAtGroupRewardDistance(me) && !groupGuy->GetCorpse())
                        groupGuy->AreaExploredOrEventHappens(mEscortQuestID);
                    if (fail && groupGuy->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
                        groupGuy->FailQuest(mEscortQuestID);
                }
            }
        } else
        {
            for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); ++iter)
            {
                if (GetScript()->IsPlayer((*iter)))
                {
                    Player* player = (*iter)->ToPlayer();
                    if (!fail && player->IsAtGroupRewardDistance(me) && !player->GetCorpse())
                        player->AreaExploredOrEventHappens(mEscortQuestID);
                    if (fail && player->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
                        player->FailQuest(mEscortQuestID);
                }
            }
        }
    }
    if (mDespawnState == 1)
        StartDespawn();
}
        void WaypointReached(uint32 waypointId) override
        {
            Player* player = GetPlayerForEscort();
            if (!player)
                return;

            switch (waypointId)
            {
            case 0:
                if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10))
                    Cage->SetGoState(GO_STATE_ACTIVE);
                break;
            case 2:
                Talk(SAY_PROGRESS_1, player);
                break;
            case 5:
                Talk(SAY_PROGRESS_2, player);
                break;
            case 6:
                Talk(SAY_PROGRESS_3, player);
                break;
            case 29:
                Talk(SAY_PROGRESS_4, player);
                if (player->GetTeam() == ALLIANCE)
                    player->GroupEventHappens(QUEST_EFTW_A, me);
                else if (player->GetTeam() == HORDE)
                    player->GroupEventHappens(QUEST_EFTW_H, me);
                me->SetInFront(player);
                break;
            case 30:
                me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
                break;
            case 31:
                DoCast(me, SPELL_CAT);
                me->SetWalk(false);
                break;
            }
        }
Example #5
0
        void WaypointReached(uint32 waypointId) override
        {
            Player* player = GetPlayerForEscort();
            if (!player)
                return;

            switch (waypointId)
            {
            case 26:
                Talk(SAY_END_WP_REACHED, player);
                break;
            case 27:
                player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me);
                break;
            }
        }
        void WaypointReached(uint32 waypointId) override
        {
            Player* player = GetPlayerForEscort();
            if (!player)
                return;

            switch (waypointId)
            {
            case 3:
                me->SummonCreature(NPC_CABAL_SKRIMISHER, -2795.99f, 5420.33f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
                me->SummonCreature(NPC_CABAL_SKRIMISHER, -2793.55f, 5412.79f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
                break;
            case 11:
                if (player->GetTypeId() == TYPEID_PLAYER)
                    player->GroupEventHappens(QUEST_ESCAPING_THE_TOMB, me);
                break;
            }
        }
        void MoveInLineOfSight(Unit* who) override

        {
            FollowerAI::MoveInLineOfSight(who);

            if (!me->GetVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && who->GetEntry() == NPC_TORTA)
            {
                if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE))
                {
                    Player* player = GetLeaderForFollower();
                    if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE)
                        player->GroupEventHappens(QUEST_TOOGA, me);

                    TortaGUID = who->GetGUID();
                    SetFollowComplete(true);
                }
            }
        }
        void WaypointReached(uint32 i)
        {
            Player* pPlayer = GetPlayerForEscort();

            if (!pPlayer)
                return;

            switch(i)
            {
            case 1:
                SetRun();
                break;
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 15:
            case 16:
            case 17:
            case 18:
                me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
                me->RemoveUnitMovementFlag(MOVEMENTFLAG_JUMPING);
                me->SetSpeed(MOVE_SWIM, 0.85f, true);
                me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
                break;
            case 19:
                me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
                break;
            case 28:
                if (Player* pPlayer = GetPlayerForEscort())
                    pPlayer->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me);
                //  me->RestoreFaction();
                DoScriptText(SAY_END_IRO,me);
                SetRun(false);
                break;
            }
        }
 void WaypointReached(uint32 i)
 {
     Player* pPlayer = GetPlayerForEscort();
     switch (i)
     {
     case 0:
         DoScriptText(SAY_WP_2, me);
         break;
     case 1:
         DoScriptText(SAY_WP_3, me);
         me->CastSpell(5918.33f, 5372.91f, -98.770f, SPELL_EXPLODE_CRYSTAL, true);
         me->SummonGameObject(184743, 5918.33f, 5372.91f, -98.770f, 0, 0, 0, 0, 0, TEMPSUMMON_MANUAL_DESPAWN);     //approx 3 to 4 seconds
         me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
         break;
     case 2:
         DoScriptText(SAY_WP_4, me);
         break;
     case 7:
         DoScriptText(SAY_WP_5, me);
         break;
     case 8:
         me->CastSpell(5887.37f, 5379.39f, -91.289f, SPELL_EXPLODE_CRYSTAL, true);
         me->SummonGameObject(184743, 5887.37f, 5379.39f, -91.289f, 0, 0, 0, 0, 0, TEMPSUMMON_MANUAL_DESPAWN);      //approx 3 to 4 seconds
         me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
         break;
     case 9:
         DoScriptText(SAY_WP_6, me);
         break;
     case 13:
         if (pPlayer)
         {
             pPlayer->GroupEventHappens(QUEST_DISASTER, me);
             DoScriptText(SAY_WP_7, me);
         }
         break;
     }
 }
Example #10
0
        void WaypointReached(uint32 i) override
        {
            Player* pPlayer = GetPlayerForEscort();

            if (!pPlayer)
            {
                return;
            }

            switch (i)
            {
            case 0:
                DoScriptText(SAY_START_2, m_creature, pPlayer);
                break;
            case 13:
#if defined (WOTLK) || defined (CATA)
                DoScriptText(SAY_END, m_creature, pPlayer);
#endif
#if defined (CLASSIC) || defined (TBC)
                switch (urand(0, 1))
                {
                case 0:
                    DoScriptText(SAY_END, m_creature, pPlayer);
                    break;
                case 1:
                    DoScriptText(SAY_PROGRESS, m_creature);
                    break;
                }
#endif
                pPlayer->GroupEventHappens(QUEST_ERLAND, m_creature);
#if defined (CLASSIC) || defined (TBC)
                m_creature->SetWalk(false);
#endif
                break;
#if defined (WOTLK) || defined (CATA)
            case 14:
                if (Creature* pRane = GetClosestCreatureWithEntry(m_creature, NPC_RANE, 45.0f))
                    DoScriptText(SAY_RANE, pRane, m_creature);
                break;
            case 15:
                DoScriptText(SAY_RANE_REPLY, m_creature);
                break;
#endif
            case 16:
#if defined (WOTLK) || defined (CATA)
                DoScriptText(SAY_CHECK_NEXT, m_creature);
#endif
#if defined (CLASSIC) || defined (TBC)
                m_creature->SetWalk(true);
                SetEscortPaused(true);
#endif
                break;
#if defined (WOTLK) || defined (CATA)
            case 24:
                DoScriptText(SAY_QUINN, m_creature);
                break;
#endif
            case 25:
#if defined (CLASSIC) || defined (TBC)
                SetEscortPaused(true);
#endif
#if defined (WOTLK) || defined (CATA)
                if (Creature* pQuinn = GetClosestCreatureWithEntry(m_creature, NPC_QUINN, 45.0f))
                    DoScriptText(SAY_QUINN_REPLY, pQuinn, m_creature);
#endif
                break;
#if defined (WOTLK) || defined (CATA)
            case 26:
                DoScriptText(SAY_BYE, m_creature);
                break;
#endif
            }
        }