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


C++ Despawn函数代码示例

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


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

示例1: AIUpdate

	void AIUpdate()
	{
		SetAllowMelee(false);
		SetCanMove(false);
		timmer++;
		if (summoningst == true && (timmer == 20 || timmer == 60 || timmer == 100))
		{
			SpawnCreature(CN_SHADOWSWORD_BERSERKER, 1871, 650, 71, 0, false);
			SpawnCreature(CN_SHADOWSWORD_FURY_MAGE, 1871, 650, 71, 0, false);
			SpawnCreature(CN_SHADOWSWORD_FURY_MAGE, 1748, 700, 71, 0, false);
			SpawnCreature(CN_SHADOWSWORD_BERSERKER, 1748, 700, 71, 0, false);
		}

		if (timmer == 120)
		{
			timmer = 0;
			summoningst = true;
			switch (spawnplace)
			{
			case 1:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1800, 652, 71, 0, false);
				++spawnplace;
				}break;
			case 2:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1798, 605, 71, 0, false);
				++spawnplace;
				}break;
			case 3:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1826, 650, 71, 0, false);
				++spawnplace;
				}break;
			case 4:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1783, 625, 71, 0, false);
				++spawnplace;
				}break;
			case 5:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1816, 595, 71, 0, false);
				++spawnplace;
				}break;
			case 6:
				{
				SpawnCreature(CN_VOID_SENTINEL, 1844, 641, 71, 0, false);
				spawnplace = 1;
				}break;
			}
		}

		if (GetHealthPercent() <= 35)
		{
			SpawnCreature(CN_ENTROPIUS, true);
			Despawn(100,0);
		}

		ParentClass::AIUpdate();
	}
开发者ID:AscEmu,项目名称:AscEmu_TBC,代码行数:60,代码来源:Raid_SunwellPlateau.cpp

示例2: AIUpdate

		void AIUpdate()
		{
			if(Ogre == NULL)
				return;
			if(GetRange(Ogre) <= 5)
			{
				Ogre->SetDisplayWeaponIds(28562, 0);
				Ogre->GetUnit()->SetEmoteState(92);
				Ogre->GetUnit()->SetFaction(35);
				Ogre->GetUnit()->SetStandState(STANDSTATE_SIT);
				NdGo = GetNearestGameObject(184315);
				if(NdGo == NULL)
					return;
				NdGo->Despawn(0, 0);
				Ogre->Despawn(60 * 1000, 3 * 60 * 1000);
				if(plr == NULL)
					return;
				QuestLogEntry* qle = plr->GetQuestLogForEntry(10512);

				if(qle != NULL && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
				{
					qle->SetMobCount(0, qle->GetMobCount(0) + 1);
					qle->SendUpdateAddKill(0);
					qle->UpdatePlayerFields();
				}
				Despawn(0, 0);
				return;
			}
			ParentClass::AIUpdate();
		}
开发者ID:Antares84,项目名称:arcemu,代码行数:30,代码来源:Quest_BladeEdge_Mountains.cpp

示例3: AIUpdate

	void AIUpdate()
	{
		if(plr == NULL || plr->isDead() || !plr->HasAura(FROST_TOMB_SPELL))
			Despawn( 0, 0 );

		ParentClass::AIUpdate();
	};
开发者ID:arcticdev,项目名称:arctic-test,代码行数:7,代码来源:Instance_UtgardeKeep.cpp

示例4: OnReachWP

	void OnReachWP(uint32 iWaypointId, bool bForwards)
	{
		if (iWaypointId == 1)
		{
			Despawn(0, 3*60*1000);
		}
	}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:7,代码来源:Shadowmoon.cpp

示例5: Reset

        void Reset()
        {
            CheckTeronTimer = 10000;
            ShadowBoltTimer = 2000;

            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);

            TeronGUID = 0;
            TeronGUID = pInstance->GetData64(DATA_TERONGOREFIEND);
            Creature* c_Teron = NULL;
            if(TeronGUID!= 0)
                c_Teron = Creature::GetCreature((*me),TeronGUID);

            if(c_Teron)
            {
                me->setFaction(c_Teron->getFaction());
                if(c_Teron->getVictim())
                {
                    me->Attack(c_Teron->getVictim(),false);
                    DoZoneInCombat();

                    float x,y,z;
                    me->GetPosition(x,y,z);
                    me->GetMotionMaster()->MovePoint(0,x,y,z+HIGH);
                }else
                {
                    Despawn();
                }
            }
        }
开发者ID:Anonymus111,项目名称:chaoscore,代码行数:30,代码来源:boss_teron_gorefiend.cpp

示例6: UNUSED

void
sstSequence::Update( float timeStep )
{
	UNUSED(timeStep);	// no using of timeStep in this case;  we want to use actual times from sysTimer.

	float musicTime = m_mode->GetMusicTime();

	m_currentTransform = GetTransformAtTime( musicTime );

	const float c_rocketTime = 3.0f;
	while ( m_nextBeat < m_beatCount && musicTime + c_rocketTime > m_beat[m_nextBeat] )
	{
		sstRocket *r = m_mode->GetAvailableRocket();

		if ( r )
		{
			m_rocket[m_nextBeat] = r;

			vsTransform2D transformAtImpact = GetTransformAtTime( m_beat[m_nextBeat] );
			r->Spawn( transformAtImpact.ApplyTo(m_segment[m_nextBeat].m_position), m_beat[m_nextBeat] - musicTime, this, m_nextBeat );
		}
		m_nextBeat++;
	}

	if ( musicTime > m_end )
		Despawn();
}
开发者ID:vectorstorm,项目名称:vectorstorm-testbeds,代码行数:27,代码来源:SST_Sequence.cpp

示例7: Despawn

void Summon::OnRemoveInRangeObject(Object* object)
{
    if ((owner != NULL) && (object->GetGUID() == owner->GetGUID()))
        Despawn(1, 0);

    Creature::OnRemoveInRangeObject(object);
}
开发者ID:lev1976g,项目名称:easywow,代码行数:7,代码来源:Summon.cpp

示例8: AIUpdate

   void AIUpdate()
   {
		if( Ogre == NULL )
			return;
      if( GetRange( Ogre ) <= 5 )
      {
         Ogre->SetDisplayWeaponIds( 28562, 0);
         Ogre->GetUnit()->SetUInt32Value( UNIT_NPC_EMOTESTATE, 92 );
         Ogre->GetUnit()->SetUInt32Value( UNIT_FIELD_FACTIONTEMPLATE, 35 );		 
         Ogre->GetUnit()->SetStandState( STANDSTATE_SIT );
         Ogre->GetUnit()->_setFaction();
		 GameObject *GO = GetNearestGameObject(184315);
		 if( GO )
			GO->Despawn(0);
         Ogre->Despawn(60*1000, 3*60*1000);
         QuestLogEntry * qle = NULL;
		 if( plr )
			qle = plr->GetQuestLogForEntry( 10512 );

         if( qle!=NULL && qle->GetMobCount( 0 ) < qle->GetQuest()->required_mobcount[0] )
         {
            qle->SetMobCount( 0, qle->GetMobCount( 0 )+1);
            qle->SendUpdateAddKill( 0 );
            qle->UpdatePlayerFields();
         }
		 Despawn(0, 0);
      }	  
      ParentClass::AIUpdate();
   }
开发者ID:AtVirus,项目名称:Descent-Scripts,代码行数:29,代码来源:BladeEdge_Mountains.cpp

示例9: OnDied

	void OnDied( Unit* pKiller )
	{
		ParentClass::OnDied( pKiller );
		if( !mForceDied )
			ApplyAura( FELFIRE_FISSION );

		Despawn( 10000, 0 );
	};
开发者ID:Tulba,项目名称:wowtbc,代码行数:8,代码来源:kil'jaeden.cpp

示例10: RandomEmote

void MoonScriptCreatureAI::OnDied(Unit *pKiller)
{
	RandomEmote(mOnDiedEmotes);
	CancelAllSpells();
	CancelAllTimers();
	RemoveAllAuras();
	if( mDespawnWhenInactive ) Despawn(DEFAULT_DESPAWN_TIMER);
}
开发者ID:Refuge89,项目名称:Hearthstone,代码行数:8,代码来源:Base.cpp

示例11: OnDied

        void OnDied(Unit* pKilled)
        {
            if (plr != NULL && plr->HasAura(FROST_TOMB_SPELL))
                plr->RemoveAura(FROST_TOMB_SPELL);

            ParentClass::OnDied(pKilled);

            Despawn(1);
        };
开发者ID:Declipe,项目名称:AscEmu,代码行数:9,代码来源:Instance_UtgardeKeep.cpp

示例12: CoreHoundAI

    CoreHoundAI(Creature* pCreature) : MoonScriptCreatureAI(pCreature)
    {
		if(IsMagmadarDead[_unit->GetInstanceID()] == true)
		{
			Despawn(0, 0);
			return;
		}
		AddSpell(COREHOUND_SERRATEDBITE, Target_RandomPlayer, 10, 0, 0, 0, 10);
    }
开发者ID:wow4all,项目名称:wowtbc,代码行数:9,代码来源:Raid_MoltenCore.cpp

示例13: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if(CheckTeronTimer < diff)
        {
            Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
            if(Teron && Teron->isInCombat())
            {
                DoZoneInCombat();

                Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
                if((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
                    Despawn();

                float newX, newY, newZ;
                m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(), 3.0, newX, newY, newZ);

                newZ = (newZ < 200.0) ? (newZ + 1.0) : newZ;
                m_creature->GetMotionMaster()->MovePoint(1, newX, newY, newZ);
                m_creature->SetSpeed(MOVE_RUN, 0.1);
            }
            else
                Despawn();

            CheckTeronTimer = 5000;
        }
        else
            CheckTeronTimer -= diff;

        if(ShadowBoltTimer < diff)
        {
            Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
            if(!Teron)
                return;

            if(Unit *target = ((ScriptedAI*)Teron->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0, 200, true))
                DoCast(target, SPELL_SHADOWBOLT);

            ShadowBoltTimer = 1500+rand()%1000;
        }
        else
            ShadowBoltTimer -= diff;

        return;
    }
开发者ID:Blumfield,项目名称:ptc2,代码行数:44,代码来源:boss_teron_gorefiend.cpp

示例14: CancelAllSpells

void MoonScriptCreatureAI::OnCombatStop(Unit *pTarget)
{
	CancelAllSpells();
	CancelAllTimers();
	RemoveAllAuras();
	SetCanMove(true);
	SetBehavior(Behavior_Default);
	if( mDespawnWhenInactive )
		Despawn(DEFAULT_DESPAWN_TIMER);
}
开发者ID:Refuge89,项目名称:Hearthstone,代码行数:10,代码来源:Base.cpp

示例15: CancelAllSpells

void ArcScriptCreatureAI::OnCombatStop(Unit* pTarget)
{
	CancelAllSpells();
	CancelAllTimers();
	RemoveAllAuras();
	SetBehavior(Behavior_Default);
	_unit->GetAIInterface()->SetAIState(STATE_IDLE);
	RemoveAIUpdateEvent();
	if( mDespawnWhenInactive ) Despawn(DEFAULT_DESPAWN_TIMER);
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:10,代码来源:Base.cpp


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