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

C++ HasFollowState函数代码示例

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

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



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

示例1: MoveInLineOfSight

        void MoveInLineOfSight(Unit* who) override

        {
            FollowerAI::MoveInLineOfSight(who);

            if (!me->GetVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_LILADRIS)
            {
                if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE*5))
                {
                    if (Player* player = GetLeaderForFollower())
                    {
                        if (player->GetQuestStatus(QUEST_SLEEPER_AWAKENED) == QUEST_STATUS_INCOMPLETE)
                            player->GroupEventHappens(QUEST_SLEEPER_AWAKENED, me);

                        Talk(SAY_KER_END);
                    }

                    SetFollowComplete();
                }
            }
        }
开发者ID:HevdavDEV,项目名称:DeathCore_3.3.5a,代码行数:21,代码来源:zone_darkshore.cpp


示例2: AddFollowState

void FollowerAI::SetFollowComplete(bool bWithEndEvent)
{
    if (me->HasUnitState(UNIT_STAT_FOLLOW))
    {
        me->ClearUnitState(UNIT_STAT_FOLLOW);

        me->StopMoving();
        me->GetMotionMaster()->Clear();
        me->GetMotionMaster()->MoveIdle();
    }

    if (bWithEndEvent)
        AddFollowState(STATE_FOLLOW_POSTEVENT);
    else
    {
        if (HasFollowState(STATE_FOLLOW_POSTEVENT))
            RemoveFollowState(STATE_FOLLOW_POSTEVENT);
    }

    AddFollowState(STATE_FOLLOW_COMPLETE);
}
开发者ID:Zakamurite,项目名称:TrilliumEMU,代码行数:21,代码来源:ScriptedFollowerAI.cpp


示例3: UpdateFollowerAI

    void UpdateFollowerAI(const uint32 uiDiff)
    {
        if (!UpdateVictim())
        {
            if (HasFollowState(STATE_FOLLOW_POSTEVENT))
            {
                if (m_uiPostEventTimer <= uiDiff)
                {
                    m_uiPostEventTimer = 3000;

                    Unit *pArynia = Unit::GetUnit(*me, AryniaGUID);
                    if (!pArynia || !pArynia->isAlive())
                    {
                        SetFollowComplete();
                        return;
                    }

                    switch(m_uiPhasePostEvent)
                    {
                    case 0:
                        DoScriptText(SAY_AT_HOME, pArynia);
                        break;
                    case 1:
                        DoScriptText(EMOTE_AT_HOME, me, 0, true);
                        me->GetMotionMaster()->MovePoint(POINT_ID_TO_FOREST, m_afToForestLoc[0], m_afToForestLoc[1], m_afToForestLoc[2]);
                        break;
                    }

                    ++m_uiPhasePostEvent;
                }
                else
                    m_uiPostEventTimer -= uiDiff;
            }

            return;
        }

        DoMeleeAttackIfReady();
    }
开发者ID:Dolmero,项目名称:L4G_Core,代码行数:39,代码来源:teldrassil.cpp


示例4: StartFollow

void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Quest* quest)
{
    if (me->getVictim())
    {
        sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI attempt to StartFollow while in combat.");
        return;
    }

    if (HasFollowState(STATE_FOLLOW_INPROGRESS))
    {
        sLog->outError(LOG_FILTER_TSCR, "FollowerAI attempt to StartFollow while already following.");
        return;
    }

    //set variables
    m_uiLeaderGUID = player->GetGUID();

    if (factionForFollower)
        me->setFaction(factionForFollower);

    m_pQuestForFollow = quest;

    if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
    {
        me->GetMotionMaster()->Clear();
        me->GetMotionMaster()->MoveIdle();
        sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
    }

    me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
    me->SetUInt32Value(UNIT_NPC_FLAGS + 1, UNIT_NPC_FLAG2_NONE);

    AddFollowState(STATE_FOLLOW_INPROGRESS);

    me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);

    sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName(), m_uiLeaderGUID);
}
开发者ID:Cailiaock,项目名称:5.4.7-Wow-source,代码行数:38,代码来源:ScriptedFollowerAI.cpp


示例5: StartFollow

void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const Quest* pQuest, float followDist)
{
    if (m_creature->getVictim())
    {
        sLog.outDebug("FollowerAI attempt to StartFollow while in combat.");
        return;
    }

    if (HasFollowState(STATE_FOLLOW_INPROGRESS))
    {
        sLog.outError("FollowerAI attempt to StartFollow while already following.");
        return;
    }

    //set variables
    m_uiLeaderGUID = pLeader->GetGUID();
    m_uiFollowDistance = followDist;

    if (uiFactionForFollower)
        m_creature->setFaction(uiFactionForFollower);

    m_pQuestForFollow = pQuest;

    if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
    {
        m_creature->GetMotionMaster()->Clear();
        m_creature->GetMotionMaster()->MoveIdle();
        sLog.outDebug("FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
    }

    m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);

    AddFollowState(STATE_FOLLOW_INPROGRESS);

    m_creature->GetMotionMaster()->MoveFollow(pLeader, followDist, PET_FOLLOW_ANGLE);

    sLog.outDebug("FollowerAI start follow %s (GUID %u)", pLeader->GetName(), m_uiLeaderGUID);
}
开发者ID:Maduse,项目名称:server,代码行数:38,代码来源:ScriptedFollowerAI.cpp


示例6: JustDied

void FollowerAI::JustDied(Unit*)
{
    if (!HasFollowState(STATE_FOLLOW_INPROGRESS) || !m_leaderGuid || !m_pQuestForFollow)
        return;

    //TODO: need a better check for quests with time limit.
    if (Player* pPlayer = GetLeaderForFollower())
    {
        if (Group* pGroup = pPlayer->GetGroup())
        {
            for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
            {
                if (Player* pMember = pRef->getSource())
                {
                    if (pMember->GetQuestStatus(m_pQuestForFollow->GetQuestId()) == QUEST_STATUS_INCOMPLETE)
                        pMember->FailQuest(m_pQuestForFollow->GetQuestId());
                }
            }
        }
        else if (pPlayer->GetQuestStatus(m_pQuestForFollow->GetQuestId()) == QUEST_STATUS_INCOMPLETE)
            pPlayer->FailQuest(m_pQuestForFollow->GetQuestId());
    }
}
开发者ID:yyhhrr,项目名称:mangospriv,代码行数:23,代码来源:follower_ai.cpp


示例7: debug_log

void FollowerAI::StartFollow(Player* leader, uint32 factionForFollower, const Quest* quest)
{
    if (m_creature->getVictim())
    {
        debug_log("SD2: FollowerAI attempt to StartFollow while in combat.");
        return;
    }

    if (HasFollowState(STATE_FOLLOW_INPROGRESS))
    {
        script_error_log("FollowerAI attempt to StartFollow while already following.");
        return;
    }

    // set variables
    m_leaderGuid = leader->GetObjectGuid();

    if (factionForFollower)
        m_creature->SetFactionTemporary(factionForFollower, TEMPFACTION_RESTORE_RESPAWN);

    m_questForFollow = quest;

    if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
    {
        m_creature->GetMotionMaster()->Clear();
        m_creature->GetMotionMaster()->MoveIdle();
        debug_log("SD2: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
    }

    m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);

    AddFollowState(STATE_FOLLOW_INPROGRESS);

    m_creature->GetMotionMaster()->MoveFollow(leader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);

    debug_log("SD2: FollowerAI start follow %s (Guid %s)", leader->GetName(), m_leaderGuid.GetString().c_str());
}
开发者ID:krullgor,项目名称:mangos-wotlk,代码行数:37,代码来源:follower_ai.cpp


示例8: TC_LOG_DEBUG

void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Quest* quest)
{
    if (me->GetVictim())
    {
        TC_LOG_DEBUG("scripts", "FollowerAI attempt to StartFollow while in combat.");
        return;
    }

    if (HasFollowState(STATE_FOLLOW_INPROGRESS))
    {
        TC_LOG_ERROR("scripts", "FollowerAI attempt to StartFollow while already following.");
        return;
    }

    //set variables
    m_uiLeaderGUID = player->GetGUID();

    if (factionForFollower)
        me->setFaction(factionForFollower);

    m_pQuestForFollow = quest;

    if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
    {
        me->GetMotionMaster()->Clear();
        me->GetMotionMaster()->MoveIdle();
        TC_LOG_DEBUG("scripts", "FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
    }

    me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);

    AddFollowState(STATE_FOLLOW_INPROGRESS);

    me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);

    TC_LOG_DEBUG("scripts", "FollowerAI start follow %s (%s)", player->GetName().c_str(), m_uiLeaderGUID.ToString().c_str());
}
开发者ID:FixCore,项目名称:335source,代码行数:37,代码来源:ScriptedFollowerAI.cpp


示例9: EnterEvadeMode

void FollowerAI::EnterEvadeMode()
{
    me->RemoveAllAuras();
    me->DeleteThreatList();
    me->CombatStop(true);
    me->SetLootRecipient(NULL);

    if (HasFollowState(STATE_FOLLOW_INPROGRESS))
    {
        if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
        {
            float fPosX, fPosY, fPosZ;
            me->GetPosition(fPosX, fPosY, fPosZ);
            me->GetMotionMaster()->MovePoint(POINT_COMBAT_START, fPosX, fPosY, fPosZ);
        }
    }
    else
    {
        if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
            me->GetMotionMaster()->MoveTargetedHome();
    }

    Reset();
}
开发者ID:Cailiaock,项目名称:5.4.7-Wow-source,代码行数:24,代码来源:ScriptedFollowerAI.cpp


示例10: UpdateFollowerAI

	void UpdateFollowerAI(const uint32 uiDiff)
	{
		if (!UpdateVictim())
		{
			if (HasFollowState(STATE_FOLLOW_POSTEVENT))
			{
				if (m_uiEndEventTimer <= uiDiff)
				{
					Unit* pKernobee = Unit::GetUnit(*me, KernobeeGUID);
					if (!pKernobee || !pKernobee->IsAlive())
					{
						SetFollowComplete();
						return;
					}

					switch (m_uiEndEventProgress)
					{
					case 1:
						DoScriptText(SAY_KERNOBEE_END, me);
						m_uiEndEventTimer = 3000;
						break;					
					case 2:
						SetFollowComplete();
						break;
					}

					++m_uiEndEventProgress;
				}
				else
					m_uiEndEventTimer -= uiDiff;
			}	
			return;
		}

		DoMeleeAttackIfReady();
	}
开发者ID:Phentora,项目名称:OregonCore,代码行数:36,代码来源:gnomeregan.cpp


示例11: debug_log

void FollowerAI::UpdateAI(const uint32 uiDiff)
{
    if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !m_creature->getVictim())
    {
        if (m_uiUpdateFollowTimer < uiDiff)
        {
            if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT))
            {
                debug_log("SD2: FollowerAI is set completed, despawns.");
                m_creature->ForcedDespawn();
                return;
            }

            bool bIsMaxRangeExceeded = true;

            if (Player* pPlayer = GetLeaderForFollower())
            {
                if (HasFollowState(STATE_FOLLOW_RETURNING))
                {
                    debug_log("SD2: FollowerAI is returning to leader.");

                    RemoveFollowState(STATE_FOLLOW_RETURNING);
                    m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
                    return;
                }

                if (Group* pGroup = pPlayer->GetGroup())
                {
                    for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
                    {
                        Player* pMember = pRef->getSource();

                        if (pMember && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE))
                        {
                            bIsMaxRangeExceeded = false;
                            break;
                        }
                    }
                }
                else
                {
                    if (m_creature->IsWithinDistInMap(pPlayer, MAX_PLAYER_DISTANCE))
                        bIsMaxRangeExceeded = false;
                }
            }

            if (bIsMaxRangeExceeded)
            {
                debug_log("SD2: FollowerAI failed because player/group was to far away or not found");
                m_creature->ForcedDespawn();
                return;
            }

            m_uiUpdateFollowTimer = 1000;
        }
        else
            m_uiUpdateFollowTimer -= uiDiff;
    }

    UpdateFollowerAI(uiDiff);
}
开发者ID:sd0,项目名称:scriptdevzero,代码行数:61,代码来源:follower_ai.cpp


示例12: UpdateFollowerAI

        void UpdateFollowerAI(uint32 Diff) override
        {
            if (!UpdateVictim())
            {
                if (HasFollowState(STATE_FOLLOW_POSTEVENT))
                {
                    if (EndEventTimer <= Diff)
                    {
                        Creature* spraggle = ObjectAccessor::GetCreature(*me, SpraggleGUID);
                        if (!spraggle || !spraggle->IsAlive())
                        {
                            SetFollowComplete();
                            return;
                        }

                        switch (EndEventProgress)
                        {
                            case 1:
                                Talk(SAY_RIN_END_1);
                                EndEventTimer = 3000;
                                break;
                            case 2:
                                spraggle->AI()->Talk(SAY_SPR_END_2);
                                EndEventTimer = 5000;
                                break;
                            case 3:
                                Talk(SAY_RIN_END_3);
                                EndEventTimer = 1000;
                                break;
                            case 4:
                                Talk(EMOTE_RIN_END_4);
                                SetFaint();
                                EndEventTimer = 9000;
                                break;
                            case 5:
                                Talk(EMOTE_RIN_END_5);
                                ClearFaint();
                                EndEventTimer = 1000;
                                break;
                            case 6:
                                Talk(SAY_RIN_END_6);
                                EndEventTimer = 3000;
                                break;
                            case 7:
                                spraggle->AI()->Talk(SAY_SPR_END_7);
                                EndEventTimer = 10000;
                                break;
                            case 8:
                                Talk(EMOTE_RIN_END_8);
                                EndEventTimer = 5000;
                                break;
                            case 9:
                                SetFollowComplete();
                                break;
                        }

                        ++EndEventProgress;
                    }
                    else
                        EndEventTimer -= Diff;
                }
                else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED))
                {
                    if (FaintTimer <= Diff)
                    {
                        SetFaint();
                        FaintTimer = urand(60000, 120000);
                    }
                    else
                        FaintTimer -= Diff;
                }

                return;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:AwkwardDev,项目名称:RE,代码行数:77,代码来源:zone_ungoro_crater.cpp


示例13: MoveInLineOfSight

 void MoveInLineOfSight(Unit* pWho) override
 {
     // should not have npcflag by default, so set when expected
     if (!m_creature->getVictim() && !m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP) && HasFollowState(STATE_FOLLOW_INPROGRESS) && pWho->GetEntry() == NPC_WINNA)
     {
         if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
             m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
     }
 }
开发者ID:520lly,项目名称:mangos-classic,代码行数:9,代码来源:felwood.cpp


示例14: SpellHit

 void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell)
 {
     if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_AWAKEN)
         ClearSleeping();
 }
开发者ID:Bulbucan,项目名称:TrinityCore,代码行数:5,代码来源:darkshore.cpp


示例15: UpdateFollowerAI

    void UpdateFollowerAI(const uint32 uiDiff)
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
        {
            //we are doing the post-event, or...
            if (HasFollowState(STATE_FOLLOW_POSTEVENT))
            {
                if (m_uiPostEventTimer < uiDiff)
                {
                    m_uiPostEventTimer = 5000;

                    if (!pTorta || !pTorta->isAlive())
                    {
                        //something happened, so just complete
                        SetFollowComplete();
                        return;
                    }

                    switch(m_uiPhasePostEvent)
                    {
                    case 1:
                        DoScriptText(SAY_TOOG_POST_1, m_creature);
                        break;
                    case 2:
                        DoScriptText(SAY_TORT_POST_2, pTorta);
                        break;
                    case 3:
                        DoScriptText(SAY_TOOG_POST_3, m_creature);
                        break;
                    case 4:
                        DoScriptText(SAY_TORT_POST_4, pTorta);
                        break;
                    case 5:
                        DoScriptText(SAY_TOOG_POST_5, m_creature);
                        break;
                    case 6:
                        DoScriptText(SAY_TORT_POST_6, pTorta);
                        m_creature->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]);
                        break;
                    }

                    ++m_uiPhasePostEvent;
                }
                else
                    m_uiPostEventTimer -= uiDiff;
            }
            //...we are doing regular speech check
            else if (HasFollowState(STATE_FOLLOW_INPROGRESS))
            {
                if (m_uiCheckSpeechTimer < uiDiff)
                {
                    m_uiCheckSpeechTimer = 5000;

                    switch(urand(0, 50))
                    {
                    case 10:
                        DoScriptText(SAY_TOOG_THIRST, m_creature);
                        break;
                    case 25:
                        DoScriptText(SAY_TOOG_WORRIED, m_creature);
                        break;
                    }
                }
                else
                    m_uiCheckSpeechTimer -= uiDiff;
            }

            return;
        }

        DoMeleeAttackIfReady();
    }
开发者ID:eviljared,项目名称:diamondcore,代码行数:72,代码来源:tanaris.cpp


示例16: UpdateFollowerAI

        void UpdateFollowerAI(const uint32 diff)
        {
            if(!UpdateVictim())
            {
                //we are doing the post-event, or...
                if(HasFollowState(STATE_FOLLOW_POSTEVENT))
                {
                    if(m_uiPostEventTimer <= diff)
                    {
                        m_uiPostEventTimer = 5000;

                        Unit* pTorta = Unit::GetUnit(*me, TortaGUID);
                        if(!pTorta || !pTorta->isAlive())
                        {
                            //something happened, so just complete
                            SetFollowComplete();
                            return;
                        }

                        switch(m_uiPhasePostEvent)
                        {
                            case 1:
                                DoScriptText(SAY_TOOG_POST_1, me);
                                break;
                            case 2:
                                DoScriptText(SAY_TORT_POST_2, pTorta);
                                break;
                            case 3:
                                DoScriptText(SAY_TOOG_POST_3, me);
                                break;
                            case 4:
                                DoScriptText(SAY_TORT_POST_4, pTorta);
                                break;
                            case 5:
                                DoScriptText(SAY_TOOG_POST_5, me);
                                break;
                            case 6:
                                DoScriptText(SAY_TORT_POST_6, pTorta);
                                me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]);
                                break;
                        }

                        ++m_uiPhasePostEvent;
                    }
                    else
                        m_uiPostEventTimer -= diff;
                }
                //...we are doing regular speech check
                else if(HasFollowState(STATE_FOLLOW_INPROGRESS))
                {
                    if(m_uiCheckSpeechTimer <= diff)
                    {
                        m_uiCheckSpeechTimer = 5000;

                        if(urand(0, 9) > 8)
                            DoScriptText(RAND(SAY_TOOG_THIRST, SAY_TOOG_WORRIED), me);
                    }
                    else
                        m_uiCheckSpeechTimer -= diff;
                }

                return;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Naios,项目名称:MythCore,代码行数:66,代码来源:tanaris.cpp


示例17: UpdateFollowerAI

        void UpdateFollowerAI(uint32 Diff)
        {
            if (!UpdateVictim())
            {
                //we are doing the post-event, or...
                if (HasFollowState(STATE_FOLLOW_POSTEVENT))
                {
                    if (PostEventTimer <= Diff)
                    {
                        PostEventTimer = 5000;

                        Creature* torta = Creature::GetCreature(*me, TortaGUID);
                        if (!torta || !torta->isAlive())
                        {
                            //something happened, so just complete
                            SetFollowComplete();
                            return;
                        }

                        switch (PhasePostEvent)
                        {
                            case 1:
                                Talk(SAY_TOOG_POST_1);
                                break;
                            case 2:
                                torta->AI()->Talk(SAY_TORT_POST_2);
                                break;
                            case 3:
                                Talk(SAY_TOOG_POST_3);
                                break;
                            case 4:
                                torta->AI()->Talk(SAY_TORT_POST_4);
                                break;
                            case 5:
                                Talk(SAY_TOOG_POST_5);
                                break;
                            case 6:
                                torta->AI()->Talk(SAY_TORT_POST_6);
                                me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc);
                                break;
                        }

                        ++PhasePostEvent;
                    }
                    else
                        PostEventTimer -= Diff;
                }
                //...we are doing regular speech check
                else if (HasFollowState(STATE_FOLLOW_INPROGRESS))
                {
                    if (CheckSpeechTimer <= Diff)
                    {
                        CheckSpeechTimer = 5000;

                        if (urand(0, 9) > 8)
                            Talk(SAY_TOOG_WORRIED);
                    }
                    else
                        CheckSpeechTimer -= Diff;
                }

                return;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:CrazyMeal,项目名称:Serval_Core,代码行数:66,代码来源:zone_tanaris.cpp


示例18: TC_LOG_DEBUG

void FollowerAI::UpdateAI(uint32 uiDiff)
{
    if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !me->GetVictim())
    {
        if (m_uiUpdateFollowTimer <= uiDiff)
        {
            if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT))
            {
                TC_LOG_DEBUG("scripts", "FollowerAI is set completed, despawns.");
                me->DespawnOrUnsummon();
                return;
            }

            bool bIsMaxRangeExceeded = true;

            if (Player* player = GetLeaderForFollower())
            {
                if (HasFollowState(STATE_FOLLOW_RETURNING))
                {
                    TC_LOG_DEBUG("scripts", "FollowerAI is returning to leader.");

                    RemoveFollowState(STATE_FOLLOW_RETURNING);
                    me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
                    return;
                }

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

                        if (member && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE))
                        {
                            bIsMaxRangeExceeded = false;
                            break;
                        }
                    }
                }
                else
                {
                    if (me->IsWithinDistInMap(player, MAX_PLAYER_DISTANCE))
                        bIsMaxRangeExceeded = false;
                }
            }

            if (bIsMaxRangeExceeded)
            {
                TC_LOG_DEBUG("scripts", "FollowerAI failed because player/group was to far away or not found");
                me->DespawnOrUnsummon();
                return;
            }

            m_uiUpdateFollowTimer = 1000;
        }
        else
            m_uiUpdateFollowTimer -= uiDiff;
    }

    UpdateFollowerAI(uiDiff);
}
开发者ID:AriDEV,项目名称:SkyFire.548,代码行数:61,代码来源:ScriptedFollowerAI.cpp


示例19: SpellHit

 void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell)
 {
     if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_REVIVE_RINGO)
         ClearFaint();
 }
开发者ID:Sharkss,项目名称:DiamondCore3,代码行数:5,代码来源:ungoro_crater.cpp


示例20: UpdateFollowerAI

        void UpdateFollowerAI(const uint32 uiDiff)
        {
            if (!UpdateVictim())
            {
                if (HasFollowState(STATE_FOLLOW_POSTEVENT))
                {
                    if (m_uiEndEventTimer <= uiDiff)
                    {
                        Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID);
                        if (!pSpraggle || !pSpraggle->isAlive())
                        {
                            SetFollowComplete();
                            return;
                        }

                        switch (m_uiEndEventProgress)
                        {
                            case 1:
                                DoScriptText(SAY_RIN_END_1, me);
                                m_uiEndEventTimer = 3000;
                                break;
                            case 2:
                                DoScriptText(SAY_SPR_END_2, pSpraggle);
                                m_uiEndEventTimer = 5000;
                                break;
                            case 3:
                                DoScriptText(SAY_RIN_END_3, me);
                                m_uiEndEventTimer = 1000;
                                break;
                            case 4:
                                DoScriptText(EMOTE_RIN_END_4, me);
                                SetFaint();
                                m_uiEndEventTimer = 9000;
                                break;
                            case 5:
                                DoScriptText(EMOTE_RIN_END_5, me);
                                ClearFaint();
                                m_uiEndEventTimer = 1000;
                                break;
                            case 6:
                                DoScriptText(SAY_RIN_END_6, me);
                                m_uiEndEventTimer = 3000;
                                break;
                            case 7:
                                DoScriptText(SAY_SPR_END_7, pSpraggle);
                                m_uiEndEventTimer = 10000;
                                break;
                            case 8:
                                DoScriptText(EMOTE_RIN_END_8, me);
                                m_uiEndEventTimer = 5000;
                                break;
                            case 9:
                                SetFollowComplete();
                                break;
                        }

                        ++m_uiEndEventProgress;
                    }
                    else
                        m_uiEndEventTimer -= uiDiff;
                }
                else if (HasFollowState(STATE_FOLLOW_INPROGRESS))
                {
                    if (!HasFollowState(STATE_FOLLOW_PAUSED))
                    {
                        if (m_uiFaintTimer <= uiDiff)
                        {
                            SetFaint();
                            m_uiFaintTimer = urand(60000, 120000);
                        }
                        else
                            m_uiFaintTimer -= uiDiff;
                    }
                }

                return;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Sharkss,项目名称:DiamondCore3,代码行数:80,代码来源:ungoro_crater.cpp



注:本文中的HasFollowState函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ HasGeneratedLoot函数代码示例发布时间:2022-05-30
下一篇:
C++ HasFocus函数代码示例发布时间: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