当前位置: 首页>>代码示例>>C++>>正文


C++ Creature::DeleteThreatList方法代码示例

本文整理汇总了C++中Creature::DeleteThreatList方法的典型用法代码示例。如果您正苦于以下问题:C++ Creature::DeleteThreatList方法的具体用法?C++ Creature::DeleteThreatList怎么用?C++ Creature::DeleteThreatList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Creature的用法示例。


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

示例1: BeginOutro

    void BeginOutro()
    {
        debug_log("SD2: KALEC: Beginning Outro");

        if (!pInstance)
        {
            error_log(ERROR_INST_DATA);
            return;
        }

        Unit* Sathrovarr = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SATHROVARR));
        if (Sathrovarr)
        {
            Sathrovarr->DealDamage(Sathrovarr, Sathrovarr->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);

            Sathrovarr->Relocate(KALECGOS_ARENA_X, KALECGOS_ARENA_Y, KALECGOS_ARENA_Z);
            Sathrovarr->SendMonsterMove(KALECGOS_ARENA_X, KALECGOS_ARENA_Y, KALECGOS_ARENA_Z, 0, 0, 0);
        }

        Creature* Kalec = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_HUMAN)));
        if (Kalec)
        {
            Kalec->DeleteThreatList();
            Kalec->SetVisibility(VISIBILITY_OFF);
        }

        m_creature->GetMotionMaster()->MoveIdle();
        m_creature->setFaction(35);
    }
开发者ID:,项目名称:,代码行数:29,代码来源:

示例2: EffectDummy

    bool EffectDummy(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Object* pTarget, ObjectGuid /*originalCasterGuid*/) override
    {
        if (pCaster->GetTypeId() != TYPEID_PLAYER)
            return true;

        Creature* pCreatureTarget = pTarget->ToCreature();
        if (pCaster->HasAura(SPELL_DRAKE_HATCHLING_SUBDUED) || pCreatureTarget->HasAura(SPELL_SUBDUED))
            return true;

        Player* pPlayer = (Player*)pCaster;
        if (!pPlayer)
            return true;

        // check the quest
        if (pPlayer->GetQuestStatus(QUEST_DRAKE_HUNT) != QUEST_STATUS_INCOMPLETE && pPlayer->GetQuestStatus(QUEST_DRAKE_HUNT_DAILY) != QUEST_STATUS_INCOMPLETE)
            return true;

        // evade and set friendly and start following @TODO move to creature script
        pCreatureTarget->SetFactionTemporary(FACTION_FRIENDLY, TEMPFACTION_RESTORE_REACH_HOME | TEMPFACTION_RESTORE_RESPAWN);
        pCreatureTarget->DeleteThreatList();
        pCreatureTarget->CombatStop(true);
        pCreatureTarget->AI()->SendAIEvent(AI_EVENT_START_EVENT, pCaster, pCreatureTarget);

        // cast visual spells
        pCreatureTarget->CastSpell(pCreatureTarget, SPELL_DRAKE_VOMIT_PERIODIC, true);
        pCreatureTarget->CastSpell(pCreatureTarget, SPELL_SUBDUED, true);
        pCreatureTarget->CastSpell(pCaster, SPELL_DRAKE_HATCHLING_SUBDUED, true);
        return true;
    }
开发者ID:Chuck5ta,项目名称:ScriptDev3,代码行数:29,代码来源:borean_tundra.cpp

示例3: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (!Phase)
                return;

            if (me->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist
            {
                EnterEvadeMode();
                return;
            }

            Creature* Essence = NULL;
            if (EssenceGUID)
            {
                Essence = Unit::GetCreature(*me, EssenceGUID);
                if (!Essence)
                {
                    EnterEvadeMode();
                    return;
                }
            }

            if (Timer <= diff)
            {
                switch (Counter)
                {
                case 0:
                    me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);  // I R ANNNGRRRY!
                    DoStartNoMovement(me);
                    Timer = 3000;
                    break;
                case 1:
                    Timer = 2800;
                    me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE);  // Release the cube
                    DoCast(me, SPELL_SUBMERGE);
                    DoStartNoMovement(me);
                    break;
                case 2:
                    Timer = 5000;
                    if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0))
                    {
                        me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED);  // Ribs: open
                        Summon->AI()->AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO, 0));
                        EssenceGUID = Summon->GetGUID();
                        DoStartNoMovement(me);
                    } else EnterEvadeMode();
                    break;
                case 3:
                    Timer = 1000;
                    if (Phase == 3)
                    {
                        if (!Essence->isAlive())
                            DoCast(me, 7, true);
                        else return;
                    }
                    else
                    {
                        if (Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
                        {
                            MergeThreatList(Essence);
                            Essence->RemoveAllAuras();
                            Essence->DeleteThreatList();
                            Essence->GetMotionMaster()->MoveFollow(me, 0.0f, 0.0f);
                        } else return;
                    }
                    break;
                case 4:
                    Timer = 1500;
                    if (Essence->IsWithinDistInMap(me, 10))
                    {
                        Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE, 374); //rotate and disappear
                        Timer = 2000;
                        me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
                    }
                    else
                    {
                        MergeThreatList(Essence);
                        Essence->RemoveAllAuras();
                        Essence->DeleteThreatList();
                        Essence->GetMotionMaster()->MoveFollow(me, 0, 0);
                        return;
                    }
                    break;
                case 5:
                    if (Phase == 1)
                    {
                        DoScriptText(SUFF_SAY_AFTER, Essence);
                    }
                    else
                    {
                        DoScriptText(DESI_SAY_AFTER, Essence);
                    }
                    Essence->DespawnOrUnsummon();
                    me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
                    EssenceGUID = 0;
                    SoulCount = 0;
                    SoulDeathCount = 0;
                    Timer = 3000;
                    break;
                case 6:
//.........这里部分代码省略.........
开发者ID:Hellzfires,项目名称:TrinityCore,代码行数:101,代码来源:boss_reliquary_of_souls.cpp

示例4: DoIntro


//.........这里部分代码省略.........
            ++IntroPhase;
            break;
        case 9:
            me->GetMotionMaster()->MoveIdle();
            me->AttackStop();
            pMadrigosa->setHover(false);
            pMadrigosa->SetLevitate(false);
            pMadrigosa->SetWalk(true);
            pMadrigosa->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
            pMadrigosa->SendHeartBeat();
            IntroPhaseTimer = 1000;
            ++IntroPhase;
            break;
        case 10:
            pMadrigosa->GetMotionMaster()->MoveIdle();
            IntroPhaseTimer = 2500;
            ++IntroPhase;
            break;
        case 11:
            pMadrigosa->GetMap()->CreatureRelocation((Creature*)pMadrigosa, MADRI_FLY_X, MADRI_FLY_Y, MADRI_FLY_Z, me->GetOrientation());
            pMadrigosa->GetMotionMaster()->MoveIdle();
            IntroPhaseTimer = 2000;
            ++IntroPhase;
            break;
        case 12:
            me->GetMotionMaster()->MoveIdle();
            pMadrigosa->CastSpell(me, SPELL_INTRO_ENCAPSULATE, false);
            DoScriptText(YELL_MADR_TRAP, pMadrigosa);
            IntroPhaseTimer = 1000;
            ++IntroPhase;
            break;
        case 13:
            me->GetPosition(x, y, z);
            me->GetMotionMaster()->MovePoint(1, x-6, y-15, z+10);
            me->SetInFront(pMadrigosa);
            IntroPhaseTimer = 8000;
            ++IntroPhase;
            break;
        case 14:
            me->RemoveAurasDueToSpell(44883);
            pMadrigosa->InterruptNonMeleeSpells(false);
            pMadrigosa->GetMotionMaster()->MoveIdle();
            DoScriptText(YELL_INTRO_CHARGE, me);
            me->SetInFront(pMadrigosa);
            me->GetPosition(x, y, z);
            me->GetMotionMaster()->MoveFall();
            IntroPhaseTimer = 3500;
            ++IntroPhase;
            break;
        case 15:
            for(uint8 i = 0; i < 8; ++i)
                me->SetSpeed(UnitMoveType(i), 10.0);
            me->GetMotionMaster()->MoveCharge(MADRI_FLY_X-5, MADRI_FLY_Y-15, MADRI_FLY_Z);
            AddSpellToCast((Unit*)NULL, SPELL_INTRO_CHARGE);
            IntroPhaseTimer = 1000;
            ++IntroPhase;
            break;
        case 16:
            DoScriptText(YELL_MADR_DEATH, pMadrigosa);
            pMadrigosa->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
            pMadrigosa->SetFlag(UNIT_DYNAMIC_FLAGS, (UNIT_DYNFLAG_DEAD | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED));
            pMadrigosa->CombatStop();
            pMadrigosa->DeleteThreatList();
            pMadrigosa->setFaction(35);
            me->CombatStop();
            me->RemoveFlag(UNIT_FIELD_FLAGS, (UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_PVP_ATTACKABLE));
            IntroPhaseTimer = 4000;
            ++IntroPhase;
            break;
        case 17:
            if(pInstance)
                me->SetFacingToObject(GameObject::GetGameObject(*me, pInstance->GetData64(DATA_BRUTALLUS_TRIGGER)));
            for(uint8 i = 0; i < 8; ++i)
                me->SetSpeed(UnitMoveType(i), 2.0);
            IntroPhaseTimer = 6000;
            ++IntroPhase;
            break;
        case 18:
            DoScriptText(YELL_INTRO_KILL_MADRIGOSA, me);
            IntroPhaseTimer = 8000;
            ++IntroPhase;
            break;
        case 19:
            DoScriptText(YELL_INTRO_TAUNT, me);
            AddSpellToCast(me, SPELL_INTRO_BREAK_ICE);
            if(pInstance)
                pInstance->SetData(DATA_BRUTALLUS_INTRO_EVENT, DONE);
            else
                return;
            if(Unit *pTrigger = me->GetUnit(pInstance->GetData64(DATA_BRUTALLUS_TRIGGER)))
                pTrigger->CastSpell((Unit*)NULL, SPELL_INTRO_BREAK_ICE_KNOCKBACK, false);
            IntroPhaseTimer = 2000;
            ++IntroPhase;
            break;
        case 20:
            EnterEvadeMode();
            ++IntroPhase;
            break;
        }
    }
开发者ID:mynew4,项目名称:looking4group-core,代码行数:101,代码来源:boss_brutallus.cpp

示例5: GordokTributeEvent

/*
Tribute Event
*/
void instance_dire_maul::GordokTributeEvent(uint32 diff)
{
	if(1<2)return;
	Creature* pChoRush = instance->GetCreature(m_uiChoRushGUID);
	Creature* pMizzle = instance->GetCreature(m_uiMizzleGUID);
	Creature* pTrigger = instance->GetCreature(m_uiTributeTriggerGUID);

	Map* pMap;
	pMap = pChoRush->GetMap();

	Map::PlayerList const &PlayerList = pMap->GetPlayers();

	if ((GetData(TYPE_KING_GORDOK) == DONE) && pMap->GetCreature(m_uiChoRushGUID)->isAlive() && !pChoRushHome)
	{
		pChoRush->SetFlag(UNIT_NPC_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PASSIVE);
		pChoRush->setFaction(35);
		pChoRush->DeleteThreatList();
		pChoRush->CombatStop();
		pChoRush->SetCanAttackPlayer(false);
		pChoRush->AI()->EnterEvadeMode();

		pChoRushHome = true;
		GossipStepGordok = 1;
		Text_Timer_Event = 1000;
	}
	else if ((TYPE_KING_GORDOK == DONE) && pMap->GetCreature(m_uiChoRushGUID)->isDead())
	{
		for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
		{
			Player* pPlayer = itr->getSource();
			if (pPlayer->IsWithinDistInMap(pTrigger, 30.0f))
					pTrigger->CastSpell(pPlayer, SPELL_KING_OF_GORDOK, false);
		}
	}

	if(pChoRushHome)
	{
		if (Text_Timer_Event<diff)
		{
			switch (GossipStepGordok)
			{
				case 1:
				DoScriptText(ChoRush_SAY_1, pChoRush);
				pChoRush->HandleEmote(EMOTE_STATE_TALK);
				pChoRush->SummonCreature(NPC_MIZZLE_THE_CRAFTY, 817.666f, 478.371f, 37.3182f, 3.07057f, TEMPSUMMON_TIMED_DESPAWN, 9000000);
				Text_Timer_Event = 5000;
				break;

				case 2:
				pChoRush->HandleEmote(EMOTE_STATE_SIT);
				DoScriptText(Mizzle_SAY_1, pMizzle);
				pMizzle->HandleEmote(EMOTE_STATE_TALK);
				Text_Timer_Event = 5000;
				break;

				case 3:
				DoScriptText(Mizzle_SAY_2, pMizzle);
				pMizzle->HandleEmote(EMOTE_STATE_TALK);
				Text_Timer_Event = 8000;
				break;

				case 4:
				for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
				{
					Player* pPlayer = itr->getSource();
					if (pPlayer->IsWithinDistInMap(pMizzle, 50.0f))
							pMizzle->CastSpell(pPlayer, SPELL_KING_OF_GORDOK, false);
				}
				if (pMap->GetCreature(m_uiMoldarGUID)->isAlive() && pMap->GetCreature(m_uiMizzleGUID)->isAlive() && pMap->GetCreature(m_uiFengusGUID)->isAlive())
				{
					pMizzle->SummonObject(pMap, GO_GORDOK_TRIBUTE, 809.899719f, 482.306366f, 37.318359f, 0.212846f);
					pMizzle->HandleEmote(EMOTE_ONESHOT_APPLAUD);
				}
				pChoRushHome = false;
				break;
			}
		}
		else Text_Timer_Event -= diff;
	}
}
开发者ID:yyhhrr,项目名称:mangospriv,代码行数:83,代码来源:instance_dire_maul.cpp

示例6: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if (!Phase)
            return;

        // Reset if event is begun and we don't have a threatlist
        if (Phase && m_creature->getThreatManager().getThreatList().empty())
            EnterEvadeMode();

        if (Phase == 1)
        {
            if (AnimationTimer < diff)
            {
                // Release the cube
                m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,374);
                AnimationTimer = 8300;
            }else AnimationTimer -= diff;

            if (SummonEssenceTimer < diff)
            {
                // Ribs: open
                m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,373);
                Creature* EssenceSuffering = NULL;
                EssenceSuffering = m_creature->SummonCreature(23418, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 1.57f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);

                if (EssenceSuffering)
                {
                    DoScriptText(SUFF_SAY_FREED, EssenceSuffering);

                    if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0))
                    {
                        EssenceSuffering->AddThreat(target);
                        EssenceSuffering->AI()->AttackStart(target);
                    }

                    SufferingGUID = EssenceSuffering->GetGUID();
                }

                EndingPhase = false;
                Phase = 2;
            }else SummonEssenceTimer -= diff;
        }

        if (Phase == 2)
        {
            if (SufferingGUID)
            {
                Creature* EssenceSuffering = NULL;
                EssenceSuffering = ((Creature*)Unit::GetUnit((*m_creature), SufferingGUID));

                if (!EssenceSuffering || (!EssenceSuffering->isAlive()))
                    EnterEvadeMode();

                if (!EndingPhase)
                {
                    if (EssenceSuffering)
                    {
                        if (EssenceSuffering->GetHealthPercent() < 10.0f)
                        {
                            DoScriptText(SUFF_SAY_RECAP, EssenceSuffering);
                            MergeThreatList(EssenceSuffering);
                            EssenceSuffering->RemoveAllAuras();
                            EssenceSuffering->DeleteThreatList();
                            EssenceSuffering->GetMotionMaster()->MoveFollow(m_creature,0.0f,0.0f);
                            EssenceSuffering->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                            DespawnEssenceTimer = 4000;
                            AnimationTimer = 2200;
                            EndingPhase = true;
                        }
                    }
                }

                if ((EndingPhase) && (EssenceSuffering) && (EssenceSuffering->isAlive()))
                {
                    if (AnimationTimer < diff)
                    {
                        // Return
                        EssenceSuffering->SetUInt32Value(UNIT_NPC_EMOTESTATE,374);
                        AnimationTimer = 10000;
                    }else AnimationTimer -= diff;

                    if (DespawnEssenceTimer < diff)
                    {
                        DoScriptText(SUFF_SAY_AFTER, EssenceSuffering);

                        EssenceSuffering->DeleteThreatList();
                        EssenceSuffering->SetDisplayId(11686);
                        EssenceSuffering->setFaction(35);
                        m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
                        SummonEssenceTimer = 20000;         //60000;
                        AnimationTimer = 18200;             //58100;
                        SoulDeathCount = 0;
                        SoulCount = 0;
                        SummonSoulTimer = 1000;
                        EndingPhase = false;
                        Phase = 3;
                        SufferingGUID = 0;
                    }else DespawnEssenceTimer -= diff;
                }
            }
//.........这里部分代码省略.........
开发者ID:wowfrank,项目名称:diamondcore,代码行数:101,代码来源:boss_reliquary_of_souls.cpp


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