C++ (Cpp) DoScriptText Examples

C++ (Cpp) DoScriptText - 30 examples found. These are the top rated real world C++ (Cpp) examples of DoScriptText extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
        void KilledUnit(Unit* /*victim*/)
        {
            Unit* pLeftHead  = Unit::GetUnit(*me, LeftHeadGUID);
            Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID);

            if (!pLeftHead || !pRightHead)
                return;

            ikilling = rand()%2;

            Unit *source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead);

            switch(ikilling)
            {
            case 0:
                DoScriptText(Killing[ikilling].id, source);
                Delay_Timer = 3500;
                KillingYell = true;
                break;
            case 1:
                DoScriptText(Killing[ikilling].id, source);
                KillingYell = false;
                break;
            }
        }
Example #2
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 #3
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 #4
0
    void MoveInLineOfSight(Unit* pWho)
    {
        if (pWho->GetTypeId() == TYPEID_PLAYER && ((Player* )pWho)->GetReputationRank(941) >= REP_FRIENDLY && me->IsWithinDistInMap(((Player* )pWho), 20))
        {
            if (uiPlayerGUID == pWho->GetGUID())
            {
                return;
            }
            else uiPlayerGUID = 0;

            switch (urand(0,3))
            {
            case 0:
                DoScriptText(SAY_MAG_PRISONER1, me);
                break;
            case 1:
                DoScriptText(SAY_MAG_PRISONER2, me);
                break;
            case 2:
                DoScriptText(SAY_MAG_PRISONER3, me);
                break;
            case 3:
                DoScriptText(SAY_MAG_PRISONER4, me);
                break;
            }
            uiPlayerGUID = pWho->GetGUID();
        }
    }
Example #5
0
 void WaypointReached(uint32 uiPointId)
 {
     switch (uiPointId)
     {
     case 4:
         SetEscortPaused(true);
         DoScriptText(SAY_LESCOVAR_2, me);
         if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true))
             DoScriptText(SAY_GUARD_2, pGuard);
         DoGuardList();
         uiTimer = 3000;
         uiPhase = 1;
         break;
     case 5:
         SetEscortPaused(true);
         if (Creature* pMarzon = me->SummonCreature(NPC_MARZON_BLADE, -8411.360352f, 480.069733f, 123.760895f, 4.941504f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000))
         {
             pMarzon->GetMotionMaster()->MovePoint(0, -8406.08f, 469.349f, 123.76f);
             MarzonGUID = pMarzon->GetGUID();
         }
         uiTimer = 2000;
         uiPhase = 5;
         break;
     }
 }
Example #6
0
 void WaypointReached(uint32 uiPointId)
 {
     switch (uiPointId)
     {
     case 3:
         DoGuardList();
         SetEscortPaused(true);
         DoScriptText(SAY_SPYBOT_1, me);
         uiTimer = 5000;
         uiPhase = 5;
         break;
     case 9:
         if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f))
             pLescovar->SetFacingToObject(me);
         SetEscortPaused(true);
         DoScriptText(SAY_SPYBOT_3, me);
         uiTimer = 3000;
         uiPhase = 8;
         break;
     case 16:
         me->UpdateEntry(NPC_TYRION_SPYBOT);
         me->SetWalk(false);
         DoCast(SPELL_FADED);
         break;
     }
 }