• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetPlayerForEscort函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetPlayerForEscort函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPlayerForEscort函数的具体用法?C++ GetPlayerForEscort怎么用?C++ GetPlayerForEscort使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetPlayerForEscort函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: JustDied

		void JustDied(Unit* /*pKiller*/) {
			Player* pPlayer = GetPlayerForEscort();
			if (pPlayer)
				pPlayer->FailQuest(QUEST_RETURN_TO_VAHLARRIEL);
			return;
		}
开发者ID:FrenchCORE,项目名称:Server,代码行数:6,代码来源:desolace.cpp


示例2: JustDied

 void JustDied(Unit* /*killer*/)
 {
     if (Player* player = GetPlayerForEscort())
         player->FailQuest(QUEST_TRAIL_OF_FIRE);
 }
开发者ID:Bulbucan,项目名称:TrinityCore,代码行数:5,代码来源:howling_fjord.cpp


示例3: JustDied

 void JustDied(Unit* /*killer*/)
 {
     if (Player* player = GetPlayerForEscort())
         player->FailQuest(QUEST_MARK_V_IS_ALIVE);
 }
开发者ID:BooYoods,项目名称:TrinityCore,代码行数:5,代码来源:zone_netherstorm.cpp


示例4: WaypointReached

 void WaypointReached(uint32 i)
 {
     Player* pPlayer = GetPlayerForEscort();
     if (!pPlayer)
         return;
     switch (i)
     {
         case 9:
             if (Creature *Mrfloppy = GetClosestCreatureWithEntry(me, NPC_MRFLOPPY, 100.0f))
                 MrfloppyGUID = Mrfloppy->GetGUID();
             break;
         case 10:
             if (Unit::GetCreature(*me, MrfloppyGUID))
             {
                 DoScriptText(SAY_WORGHAGGRO1, me);
                 me->SummonCreature(NPC_HUNGRY_WORG,me->GetPositionX()+5,me->GetPositionY()+2,me->GetPositionZ()+1,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
             }
             break;
         case 11:
             if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
                 Mrfloppy->GetMotionMaster()->MoveFollow(me, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
             break;
         case 17:
             if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
                 Mrfloppy->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
             DoScriptText(SAY_WORGRAGGRO3, me);
             if (Creature *RWORG = me->SummonCreature(NPC_RAVENOUS_WORG,me->GetPositionX()+10,me->GetPositionY()+8,me->GetPositionZ()+2,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000))
             {
                 RWORG->setFaction(35);
                 RWORGGUID = RWORG->GetGUID();
             }
             break;
         case 18:
             if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
             {
                 if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
                     RWORG->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
                 DoCast(Mrfloppy,SPELL_MRFLOPPY);
             }
             break;
         case 19:
             if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
             {
                 if (Mrfloppy->HasAura(SPELL_MRFLOPPY, 0))
                 {
                     if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
                         Mrfloppy->EnterVehicle(RWORG);
                 }
             }
             break;
         case 20:
             if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
                 RWORG->HandleEmoteCommand(34);
             break;
         case 21:
             if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
             {
                 if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
                 {
                     RWORG->Kill(Mrfloppy);
                     Mrfloppy->ExitVehicle();
                     RWORG->setFaction(14);
                     RWORG->GetMotionMaster()->MovePoint(0, RWORG->GetPositionX()+10,RWORG->GetPositionY()+80,RWORG->GetPositionZ());
                     DoScriptText(SAY_VICTORY2, me);
                 }
             }
             break;
         case 22:
             if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
             {
                 if (Mrfloppy->isDead())
                 {
                     if (Creature *RWORG = Unit::GetCreature(*me, RWORGGUID))
                         RWORG->DisappearAndDie();
                     me->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
                     Mrfloppy->setDeathState(ALIVE);
                     Mrfloppy->GetMotionMaster()->MoveFollow(me, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
                     DoScriptText(SAY_VICTORY3, me);
                 }
             }
             break;
         case 24:
             if (pPlayer)
             {
                 Completed = true;
                 pPlayer->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, me);
                 DoScriptText(SAY_QUEST_COMPLETE, me, pPlayer);
             }
             me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
             break;
         case 25:
             DoScriptText(SAY_VICTORY4, me);
             break;
         case 27:
             me->DisappearAndDie();
             if (Creature *Mrfloppy = Unit::GetCreature(*me, MrfloppyGUID))
                 Mrfloppy->DisappearAndDie();
             break;
     }
 }
开发者ID:ag3nt-amestris,项目名称:TrinityCore,代码行数:100,代码来源:grizzly_hills.cpp


示例5: WaypointReached

        void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
        {
            Player* player = GetPlayerForEscort();
            if (!player)
                return;

            switch (waypointId)
            {
                case WP_START:
                    SetEscortPaused(true);
                    me->SetFacingToObject(player);
                    Talk(SAY_LEGOSO_1);
                    _moveTimer = 2.5 * IN_MILLISECONDS;
                    _phase = PHASE_CONTINUE;
                    break;
                case WP_EXPLOSIVES_FIRST_POINT:
                    SetEscortPaused(true);
                    Talk(SAY_LEGOSO_2);
                    _moveTimer = 8 * IN_MILLISECONDS;
                    _phase = PHASE_WP_22;
                    break;
                case WP_EXPLOSIVES_FIRST_PLANT:
                    me->SetFacingTo(1.46f);
                    break;
                case WP_EXPLOSIVES_FIRST_DETONATE:
                    SetEscortPaused(true);
                    me->SetFacingTo(1.05f);
                    _moveTimer = 1 * IN_MILLISECONDS;
                    _phase = PHASE_PLANT_FIRST_TIMER_1;
                    break;
                case WP_DEBUG_1:
                    SetEscortPaused(true);
                    _moveTimer = 0.5 * IN_MILLISECONDS;
                    _phase = PHASE_WP_26;
                    break;
                case WP_SIRONAS_HILL:
                {
                    SetEscortPaused(true);

                    //Find Sironas and make it respawn if needed
                    Creature* sironas = nullptr;
                    Trinity::AllCreaturesOfEntryInRange check(me, NPC_SIRONAS, SIZE_OF_GRIDS);
                    Trinity::CreatureSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, sironas, check);
                    Cell::VisitAllObjects(me, searcher, SIZE_OF_GRIDS);

                    if (sironas)
                    {
                        if (!sironas->IsAlive())
                            sironas->Respawn(true);

                        sironas->AI()->DoAction(ACTION_SIRONAS_CHANNEL_START);
                        me->SetFacingToObject(sironas);
                    }
                    _moveTimer = 1 * IN_MILLISECONDS;
                    _phase = PHASE_FEEL_SIRONAS_1;
                    break;
                }
                case WP_EXPLOSIVES_SECOND_BATTLEROAR:
                    SetEscortPaused(true);
                    _moveTimer = 0.2 * IN_MILLISECONDS;
                    _phase = PHASE_MEET_SIRONAS_ROAR;
                    break;
                case WP_EXPLOSIVES_SECOND_PLANT:
                    SetEscortPaused(true);
                    _moveTimer = 0.5 * IN_MILLISECONDS;
                    _phase = PHASE_PLANT_SECOND_KNEEL;
                    break;
                case WP_EXPLOSIVES_SECOND_DETONATE:
                    SetEscortPaused(true);
                    me->SetFacingTo(5.7f);
                    _moveTimer = 2 * IN_MILLISECONDS;
                    _phase = PHASE_PLANT_SECOND_TIMER_1;
                    break;
                default:
                    break;
            }
        }
开发者ID:lasyan3,项目名称:TrinityCore,代码行数:77,代码来源:zone_bloodmyst_isle.cpp


示例6: JustDied

  void JustDied(Unit* /*killer*/)
 {
    Player* player = GetPlayerForEscort();
     if (player)
         player->FailQuest(QUEST_TOMB_LIGHTBRINGER);
 }
开发者ID:A-Shox,项目名称:TrinityCore,代码行数:6,代码来源:western_plaguelands.cpp


示例7: JustDied

 void JustDied(Unit* /*killer*/)
 {
     if (Player* player = GetPlayerForEscort())
         player->FailQuest(QUEST_CHASING_AME);
 }
开发者ID:A-Shox,项目名称:TrinityCore,代码行数:5,代码来源:ungoro_crater.cpp


示例8: UpdateEscortAI

    void UpdateEscortAI(const uint32 uiDiff)
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
        {
            if (!HasEscortState(STATE_ESCORT_ESCORTING))
                return;

            if (HasEscortState(STATE_ESCORT_PAUSED))
            {
                if (m_uiExplodeTimer < uiDiff)
                {
                    if (m_bFirstBarrel)
                    {
                        switch(m_uiExplodePhase)
                        {
                            case 0:
                                DoCastSpellIfCan(m_creature, SPELL_DETONATE_EXPLOSIVES_1);

                                if (Player* pPlayer = GetPlayerForEscort())
                                    DoScriptText(SAY_HELICE_EXPLODE_1, m_creature, pPlayer);

                                m_uiExplodeTimer = 2500;
                                ++m_uiExplodePhase;
                                break;
                            case 1:
                                if (Player* pPlayer = GetPlayerForEscort())
                                    DoScriptText(SAY_HELICE_MOVE_ON, m_creature, pPlayer);

                                m_uiExplodeTimer = 2500;
                                ++m_uiExplodePhase;
                                break;
                            case 2:
                                SetEscortPaused(false);
                                m_uiExplodePhase = 0;
                                m_uiExplodeTimer = 5000;
                                m_bFirstBarrel = false;
                                break;
                        }
                    }
                    else
                    {
                        switch(m_uiExplodePhase)
                        {
                            case 0:
                                DoCastSpellIfCan(m_creature, SPELL_DETONATE_EXPLOSIVES_2);

                                if (Player* pPlayer = GetPlayerForEscort())
                                    DoScriptText(SAY_HELICE_EXPLODE_2, m_creature, pPlayer);

                                m_uiExplodeTimer = 2500;
                                ++m_uiExplodePhase;
                                break;
                            case 1:
                                SetEscortPaused(false);
                                m_uiExplodePhase = 0;
                                m_uiExplodeTimer = 5000;
                                m_bFirstBarrel = true;
                                break;
                        }
                    }
                }
                else
                    m_uiExplodeTimer -= uiDiff;
            }

            return;
        }

        DoMeleeAttackIfReady();
    }
开发者ID:Shutok,项目名称:StrawberryCore-501Beta,代码行数:70,代码来源:sholazar_basin.cpp


示例9: JustDied

 void JustDied(Unit* /*killer*/)
 {
     if (Player* player = GetPlayerForEscort())
         CAST_PLR(player)->FailQuest(QUEST_WILLIX_THE_IMPORTER);
 }
开发者ID:AlmasServer,项目名称:TrinityCore,代码行数:5,代码来源:razorfen_kraul.cpp


示例10: JustSummoned

 void JustSummoned(Creature* pSummoned) override
 {
     // Note: may not work on guardian pets
     if (Player* pPlayer = GetPlayerForEscort())
         pSummoned->AI()->AttackStart(pPlayer);
 }
开发者ID:520lly,项目名称:mangos-classic,代码行数:6,代码来源:wetlands.cpp


示例11: WaypointReached

        void WaypointReached(uint32 i) {
            Player *pPlayer = GetPlayerForEscort();
            if (!pPlayer)
                return;

            switch (i) {
            case 0:
                DoScriptText(WHISPER_CUSTODIAN_1, me, pPlayer);
                break;
            case 1:
                DoScriptText(WHISPER_CUSTODIAN_2, me, pPlayer);
                break;
            case 2:
                DoScriptText(WHISPER_CUSTODIAN_3, me, pPlayer);
                break;
            case 3:
                DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer);
                break;
            case 5:
                DoScriptText(WHISPER_CUSTODIAN_5, me, pPlayer);
                break;
            case 6:
                DoScriptText(WHISPER_CUSTODIAN_6, me, pPlayer);
                break;
            case 7:
                DoScriptText(WHISPER_CUSTODIAN_7, me, pPlayer);
                break;
            case 8:
                DoScriptText(WHISPER_CUSTODIAN_8, me, pPlayer);
                break;
            case 9:
                DoScriptText(WHISPER_CUSTODIAN_9, me, pPlayer);
                break;
            case 10:
                DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer);
                break;
            case 13:
                DoScriptText(WHISPER_CUSTODIAN_10, me, pPlayer);
                break;
            case 14:
                DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer);
                break;
            case 16:
                DoScriptText(WHISPER_CUSTODIAN_11, me, pPlayer);
                break;
            case 17:
                DoScriptText(WHISPER_CUSTODIAN_12, me, pPlayer);
                break;
            case 18:
                DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer);
                break;
            case 22:
                DoScriptText(WHISPER_CUSTODIAN_13, me, pPlayer);
                break;
            case 23:
                DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer);
                break;
            case 24:
                DoScriptText(WHISPER_CUSTODIAN_14, me, pPlayer);
                DoCast(pPlayer, 34883);
                // below here is temporary workaround, to be removed when spell works properly
                pPlayer->AreaExploredOrEventHappens(10277);
                break;
            }
        }
开发者ID:814077430,项目名称:ArkCORE,代码行数:65,代码来源:tanaris.cpp


示例12: JustDidDialogueStep

        void JustDidDialogueStep(int32 entry)
        {
            switch (entry)
            {
                case NPC_RANSHALLA:
                    // Start the altar channeling
                    DoChannelTorchSpell(true);
                    break;
                case SAY_RANSHALLA_ALTAR_6:
                    SetEscortPaused(false);
                    break;
                case SAY_PRIESTESS_ALTAR_8:
                    // make the gem respawn
                    if (GameObject* gem = GetClosestGameObjectWithEntry(me, GO_ELUNE_GEM, 10.0f))
                    {
                        if (gem->isSpawned())
                            break;

                        gem->SetRespawnTime(90);
                        gem->Refresh();
                    }
                    break;
                case SAY_PRIESTESS_ALTAR_9:
                    // move near the escort npc
                    if (Creature* priestess = me->GetMap()->GetCreature(_firstPriestessGUID))
                        priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[6].m_positionX, wingThicketLocations[6].m_positionY, wingThicketLocations[6].m_positionZ);
                    break;
                case SAY_PRIESTESS_ALTAR_13:
                    // summon the Guardian of Elune
                    if (Creature* guard = me->SummonCreature(NPC_GUARDIAN_ELUNE, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ, wingThicketLocations[2].m_orientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
                    {
                        guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[5].m_positionX, wingThicketLocations[5].m_positionY, wingThicketLocations[5].m_positionZ);
                        _guardEluneGUID = guard->GetGUID();
                    }
                    // summon the Voice of Elune
                    if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
                    {
                        if (Creature* voice = me->SummonCreature(NPC_VOICE_ELUNE, altar->GetPositionX(), altar->GetPositionY(), altar->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000))
                            _voiceEluneGUID = voice->GetGUID();
                    }
                    break;
                case SAY_VOICE_ALTAR_15:
                    // move near the escort npc and continue dialogue
                    if (Creature* priestess = me->GetMap()->GetCreature(_secondPriestessGUID))
                    {
                        priestess->AI()->Talk(SAY_PRIESTESS_ALTAR_14);
                        priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[7].m_positionX, wingThicketLocations[7].m_positionY, wingThicketLocations[7].m_positionZ);
                    }
                    break;
                case SAY_PRIESTESS_ALTAR_19:
                    // make the voice of elune leave
                    if (Creature* guard = me->GetMap()->GetCreature(_guardEluneGUID))
                    {
                        guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ);
                        guard->DespawnOrUnsummon(4000);
                    }
                    break;
                case SAY_PRIESTESS_ALTAR_20:
                    // make the first priestess leave
                    if (Creature* priestess = me->GetMap()->GetCreature(_firstPriestessGUID))
                    {
                        priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[0].m_positionX, wingThicketLocations[0].m_positionY, wingThicketLocations[0].m_positionZ);
                        priestess->DespawnOrUnsummon(4000);
                    }
                    break;
                case SAY_PRIESTESS_ALTAR_21:
                    // make the second priestess leave
                    if (Creature* priestess = me->GetMap()->GetCreature(_secondPriestessGUID))
                    {
                        priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[1].m_positionX, wingThicketLocations[1].m_positionY, wingThicketLocations[1].m_positionZ);
                        priestess->DespawnOrUnsummon(4000);
                    }
                    break;
                case DATA_EVENT_END:
                    // Turn towards the player
                    if (Player* player = GetPlayerForEscort())
                    {
                        me->SetFacingToObject(player);
                        Talk(SAY_RANSHALLA_END_1, player->GetGUID());
                    }
                    break;
                case SAY_RANSHALLA_END_2:
                    // Turn towards the altar and kneel - quest complete
                    if (GameObject* altar = me->GetMap()->GetGameObject(_altarGUID))
                    {
                        me->SetFacingToObject(altar);
                        altar->ResetDoorOrButton();
                    }
                    me->SetStandState(UNIT_STAND_STATE_KNEEL);
                    if (Player* player = GetPlayerForEscort())
                    {
                        player->GroupEventHappens(QUEST_GUARDIANS_ALTAR, me);
                        Talk(SAY_RANSHALLA_END_2, player->GetGUID());
                    }
                    me->DespawnOrUnsummon(4000);
                    break;
            }
        }
开发者ID:Angmon,项目名称:TrinityCore,代码行数:98,代码来源:zone_winterspring.cpp


示例13: WaypointReached

 void WaypointReached(uint32 i)
 {
     Player* pPlayer = GetPlayerForEscort();
     if (!pPlayer)
         return;
     Creature* Godfrey = me->FindNearestCreature(NPC_GODFREY, 50, true);
     if (!Godfrey)
         return;
     switch (i)
     {
         case 1:
             DoScriptText(SAY_WP_1, me, Godfrey);
             me->SetUInt64Value(UNIT_FIELD_TARGET, Godfrey->GetGUID());
             me->HandleEmoteCommand(5);
             me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
             me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
             break;
         case 2:
             Godfrey->HandleEmoteCommand(434);
             DoScriptText(SAY_WP_2, me, Godfrey);
             me->HandleEmoteCommand(15);
             break;
         case 3:
             DoScriptText(SAY_WP_3, me, Godfrey);
             me->HandleEmoteCommand(1);
             break;
         case 4:
             DoScriptText(SAY_WP_4, Godfrey);
             break;
         case 5:
             DoScriptText(SAY_WP_5, Godfrey);
             break;
         case 6:
             DoScriptText(SAY_WP_6, Godfrey);
             break;
         case 7:
             DoScriptText(SAY_WP_7, me, Godfrey);
             me->HandleEmoteCommand(1);
             break;
         case 8:
             DoScriptText(SAY_WP_8, me, Godfrey);
             me->HandleEmoteCommand(16);
             break;
         case 9:
             DoScriptText(SAY_WP_9, me, Godfrey);
             me->HandleEmoteCommand(5);
             break;
         case 10:
             DoScriptText(SAY_WP_10, me, Godfrey);
             DoCast(Godfrey, SPELL_HOLY_FIRE);
             break;
         case 11:
             Godfrey->HandleEmoteCommand(434);
             DoScriptText(SAY_WP_11, Godfrey);
             break;
         case 12:
             DoScriptText(SAY_WP_12, me, Godfrey);
             DoCast(Godfrey, SPELL_HOLY_FIRE);
             break;
         case 13:
             DoScriptText(SAY_WP_13, me, Godfrey);
             DoCast(Godfrey, SPELL_HOLY_FIRE);
             break;
         case 14:
             Godfrey->HandleEmoteCommand(434);
             DoScriptText(SAY_WP_14, Godfrey);
             break;
         case 15:
             DoScriptText(SAY_WP_15, me, Godfrey);
             DoCast(Godfrey, SPELL_HOLY_FIRE);
             break;
         case 16:
             DoScriptText(SAY_WP_16, me, Godfrey);
             break;
         case 17:
             DoScriptText(SAY_WP_17, me, Godfrey);
             break;
         case 18:
             DoScriptText(SAY_WP_18, Godfrey);
             break;
         case 19:
             DoScriptText(SAY_WP_19, me, Godfrey);
             break;
         case 20:
             DoScriptText(SAY_WP_20, Godfrey);
             break;
         case 21:
             DoScriptText(SAY_WP_21, Godfrey);
             break;
         case 22:
             DoScriptText(SAY_WP_22, me, Godfrey);
             break;
         case 23:
             DoScriptText(SAY_WP_23, Godfrey);
             break;
         case 24:
             DoScriptText(SAY_WP_24, Godfrey);
             break;
         case 25:
             DoScriptText(SAY_WP_25, me, Godfrey);
//.........这里部分代码省略.........
开发者ID:Drethek,项目名称:Darkpeninsula-Cata-Old,代码行数:101,代码来源:dragonblight.cpp


示例14: UpdateEscortAI

    void UpdateEscortAI(const uint32 uiDiff) override
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
        {
            if (HasEscortState(STATE_ESCORT_PAUSED))
            {
                if (m_uiEventTimer < uiDiff)
                {
                    m_uiEventTimer = 7000;

                    switch (m_uiEventCount)
                    {
                        case 0:
                            DoScriptText(SAY_LE_ALMOST, m_creature);
                            break;
                        case 1:
                            DoScriptText(SAY_LE_DRUM, m_creature);
                            break;
                        case 2:
                            if (Creature* pResearcher = GetAvailableResearcher(0))
                                DoScriptText(SAY_LE_DRUM_REPLY, pResearcher);
                            break;
                        case 3:
                            DoScriptText(SAY_LE_DISCOVERY, m_creature);
                            break;
                        case 4:
                            if (Creature* pResearcher = GetAvailableResearcher(0))
                                DoScriptText(SAY_LE_DISCOVERY_REPLY, pResearcher);
                            break;
                        case 5:
                            DoScriptText(SAY_LE_NO_LEAVE, m_creature);
                            break;
                        case 6:
                            if (Creature* pResearcher = GetAvailableResearcher(1))
                                DoScriptText(SAY_LE_NO_LEAVE_REPLY1, pResearcher);
                            break;
                        case 7:
                            if (Creature* pResearcher = GetAvailableResearcher(2))
                                DoScriptText(SAY_LE_NO_LEAVE_REPLY2, pResearcher);
                            break;
                        case 8:
                            if (Creature* pResearcher = GetAvailableResearcher(3))
                                DoScriptText(SAY_LE_NO_LEAVE_REPLY3, pResearcher);
                            break;
                        case 9:
                            if (Creature* pResearcher = GetAvailableResearcher(4))
                                DoScriptText(SAY_LE_NO_LEAVE_REPLY4, pResearcher);
                            break;
                        case 10:
                            DoScriptText(SAY_LE_SHUT, m_creature);
                            break;
                        case 11:
                            if (Creature* pResearcher = GetAvailableResearcher(0))
                                DoScriptText(SAY_LE_REPLY_HEAR, pResearcher);
                            break;
                        case 12:
                            DoScriptText(SAY_LE_IN_YOUR_FACE, m_creature);
                            m_creature->SummonCreature(NPC_BONE_SIFTER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OOC_DESPAWN, 30000);
                            break;
                        case 13:
                            DoScriptText(EMOTE_LE_PICK_UP, m_creature);

                            if (Player* pPlayer = GetPlayerForEscort())
                            {
                                DoScriptText(SAY_LE_THANKS, m_creature, pPlayer);
                                pPlayer->GroupEventHappens(QUEST_DIGGING_BONES, m_creature);
                            }

                            SetEscortPaused(false);
                            break;
                    }

                    ++m_uiEventCount;
                }
                else
                    m_uiEventTimer -= uiDiff;
            }

            return;
        }

        DoMeleeAttackIfReady();
    }
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:83,代码来源:terokkar_forest.cpp


示例15: UpdateAI

        void UpdateAI(uint32 diff) override
        {
            _events.Update(diff);

            if (UpdateVictim())
            {
                while (uint32 eventId = _events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_FROST_SHOCK:
                            DoCastVictim(SPELL_FROST_SHOCK);
                            _events.DelayEvents(1 * IN_MILLISECONDS);
                            _events.ScheduleEvent(EVENT_FROST_SHOCK, 10s, 15s);
                            break;
                        case EVENT_SEARING_TOTEM:
                            DoCast(me, SPELL_SEARING_TOTEM);
                            _events.DelayEvents(1 * IN_MILLISECONDS);
                            _events.ScheduleEvent(EVENT_SEARING_TOTEM, urand(110, 130) * IN_MILLISECONDS);
                            break;
                        case EVENT_STRENGTH_OF_EARTH_TOTEM:
                            DoCast(me, SPELL_STRENGTH_OF_EARTH_TOTEM);
                            _events.DelayEvents(1 * IN_MILLISECONDS);
                            _events.ScheduleEvent(EVENT_STRENGTH_OF_EARTH_TOTEM, urand(110, 130) * IN_MILLISECONDS);
                            break;
                        case EVENT_HEALING_SURGE:
                        {
                            Unit* target = nullptr;
                            if (me->GetHealthPct() < 85)
                                target = me;
                            else if (Player* player = GetPlayerForEscort())
                                if (player->GetHealthPct() < 85)
                                    target = player;
                            if (target)
                            {
                                DoCast(target, SPELL_HEALING_SURGE);
                                _events.ScheduleEvent(EVENT_HEALING_SURGE, 10s);
                            }
                            else
                                _events.ScheduleEvent(EVENT_HEALING_SURGE, 2s);
                            break;
                        }
                        default:
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }

            if (HasEscortState(STATE_ESCORT_NONE))
                return;

            EscortAI::UpdateAI(diff);

            if (_phase)
            {
                if (_moveTimer <= diff)
                {
                    switch (_phase)
                    {
                        case PHASE_WP_26: //debug skip path to point 26, buggy path calculation
                            me->GetMotionMaster()->MovePoint(WP_DEBUG_2, -2021.77f, -10648.8f, 129.903f, false);
                            _moveTimer = 2 * IN_MILLISECONDS;
                            _phase = PHASE_CONTINUE;
                            break;
                        case PHASE_CONTINUE: // continue escort
                            SetEscortPaused(false);
                            _moveTimer = 0 * IN_MILLISECONDS;
                            _phase = PHASE_NONE;
                            break;
                        case PHASE_WP_22: //debug skip path to point 22, buggy path calculation
                            me->GetMotionMaster()->MovePoint(WP_EXPLOSIVES_FIRST_PLANT, -1958.026f, -10660.465f, 111.547f, false);
                            Talk(SAY_LEGOSO_3);
                            _moveTimer = 2 * IN_MILLISECONDS;
                            _phase = PHASE_PLANT_FIRST_KNEEL;
                            break;
                        case PHASE_PLANT_FIRST_KNEEL: // plant first explosives stage 1 kneel
                            me->SetStandState(UNIT_STAND_STATE_KNEEL);
                            _moveTimer = 10 * IN_MILLISECONDS;
                            _phase = PHASE_PLANT_FIRST_STAND;
                            break;
                        case PHASE_PLANT_FIRST_STAND: // plant first explosives stage 1 stand
                            me->SetStandState(UNIT_STAND_STATE_STAND);
                            _moveTimer = 0.5* IN_MILLISECONDS;
                            _phase = PHASE_PLANT_FIRST_WORK;
                            break;
                        case PHASE_PLANT_FIRST_WORK: // plant first explosives stage 2 work
                            Talk(SAY_LEGOSO_4);
                            _moveTimer = 17.5 * IN_MILLISECONDS;
                            _phase = PHASE_PLANT_FIRST_FINISH;
                            break;
                        case PHASE_PLANT_FIRST_FINISH: // plant first explosives finish
                            _explosivesGuids.clear();
                            for (uint8 i = 0; i != MAX_EXPLOSIVES; ++i)
                            {
                                if (GameObject* explosive = me->SummonGameObject(GO_DRAENEI_EXPLOSIVES_1, ExplosivesPos[0][i], QuaternionData(), 0))
                                    _explosivesGuids.push_back(explosive->GetGUID());
                            }
                            me->HandleEmoteCommand(EMOTE_ONESHOT_NONE); // reset anim state
//.........这里部分代码省略.........
开发者ID:lasyan3,项目名称:TrinityCore,代码行数:101,代码来源:zone_bloodmyst_isle.cpp


示例16: UpdateEscortAI


//.........这里部分代码省略.........
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                temp->AI()->Talk(SAY_EVENT_END_09_KADD);
                        JumpToNextStep(18500);
                        break;
                    case 37:
                        Talk(SAY_EVENT_END_10);
                        JumpToNextStep(5500);
                        break;
                    case 38:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                temp->AI()->Talk(SAY_EVENT_END_11_KADD);
                            JumpToNextStep(20500);
                        break;
                    case 39:
                        Talk(SAY_EVENT_END_12);
                        JumpToNextStep(2500);
                        break;
                    case 40:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
                                temp->AI()->Talk(SAY_EVENT_END_13_KADD);
                        JumpToNextStep(19500);
                        break;
                    case 41:
                        Talk(SAY_EVENT_END_14);
                        JumpToNextStep(10500);
                        break;
                    case 42:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                temp->AI()->Talk(SAY_EVENT_END_15_MARN);
                            JumpToNextStep(6500);
                        break;
                    case 43:
                        Talk(SAY_EVENT_END_16);
                        JumpToNextStep(6500);
                        break;
                    case 44:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                temp->AI()->Talk(SAY_EVENT_END_17_MARN);
                            JumpToNextStep(25500);
                        break;
                    case 45:
                        Talk(SAY_EVENT_END_18);
                        JumpToNextStep(23500);
                        break;
                    case 46:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
                                temp->AI()->Talk(SAY_EVENT_END_19_MARN);
                            JumpToNextStep(3500);
                        break;
                    case 47:
                        Talk(SAY_EVENT_END_20);
                        JumpToNextStep(8500);
                        break;
                    case 48:
                        if (instance)
                            if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
                                temp->AI()->Talk(SAY_EVENT_END_21_ABED);
                            JumpToNextStep(5500);
                        break;
                    case 49:
                    {
                        if (instance)
                        {
                            instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), false);
                            instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), false);
                        }
                        Player* player = GetPlayerForEscort();
                        if (player)
                            player->GroupEventHappens(QUEST_HALLS_OF_STONE, me);
                        me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                        JumpToNextStep(180000);
                        break;
                    }
                    case 50:
                        SetEscortPaused(false);
                        break;
                }
            } else uiPhaseTimer -= uiDiff;

            if (!bIsLowHP && HealthBelowPct(30))
            {
                Talk(SAY_LOW_HEALTH);
                bIsLowHP = true;
            }
            else if (bIsLowHP && !HealthBelowPct(30))
                bIsLowHP = false;

            if (!UpdateVictim())
                return;

            DoMeleeAttackIfReady();
        }
开发者ID:Asandru,项目名称:Script-Land,代码行数:101,代码来源:halls_of_stone.cpp


示例17: WaypointReached

        void WaypointReached(uint32 waypointId)
        {
            Player* player = GetPlayerForEscort();
            if (!player)
                return;

            switch (waypointId)
            {
                case 0:
                    Talk(SAY1, player->GetGUID());
                    break;
                case 4:
                    Talk(WHISP1, player->GetGUID());
                    break;
                case 6:
                    Talk(WHISP2, player->GetGUID());
                    break;
                case 7:
                    Talk(WHISP3, player->GetGUID());
                    break;
                case 8:
                    Talk(WHISP4, player->GetGUID());
                    break;
                case 17:
                    Talk(WHISP5, player->GetGUID());
                    break;
                case 18:
                    Talk(WHISP6, player->GetGUID());
                    break;
                case 19:
                    Talk(WHISP7, player->GetGUID());
                    break;
                case 33:
                    Talk(WHISP8, player->GetGUID());
                    break;
                case 34:
                    Talk(WHISP9, player->GetGUID());
                    break;
                case 35:
                    Talk(WHISP10, player->GetGUID());
                    break;
                case 36:
                    Talk(WHISP11, player->GetGUID());
                    break;
                case 43:
                    Talk(WHISP12, player->GetGUID());
                    break;
                case 44:
                    Talk(WHISP13, player->GetGUID());
                    break;
                case 49:
                    Talk(WHISP14, player->GetGUID());
                    break;
                case 50:
                    Talk(WHISP15, player->GetGUID());
                    break;
                case 51:
                    Talk(WHISP16, player->GetGUID());
                    break;
                case 52:
                    Talk(WHISP17, player->GetGUID());
                    break;
                case 53:
                    Talk(WHISP18, player->GetGUID());
                    break;
                case 54:
                    Talk(WHISP19, player->GetGUID());
                    break;
                case 55:
                    Talk(WHISP20, player->GetGUID());
                    break;
                case 56:
                    Talk(WHISP21, player->GetGUID());
                    player->GroupEventHappens(10211, me);
                    break;
            }
        }
开发者ID:Fose,项目名称:TrinityCore,代码行数:77,代码来源:zone_shattrath_city.cpp


示例18: JustDied

 void JustDied(Unit* pKiller)
 {
     if (Player* pPlayer = GetPlayerForEscort())
         pPlayer->FailQuest(QUEST_MISSING_IN_ACTION);
 }
开发者ID:Bootz,项目名称:diamondcore,代码行数:5,代码来源:redridge_mountains.cpp


示例19: WaypointReached

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetPlayerGUID函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPlayerFlags函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap