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


C++ MoonScriptCreatureAI::SetDespawnWhenInactive方法代码示例

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


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

示例1: AIUpdate

    void AIUpdate()
    {
        if (GetHealthPercent() <= 75 && GetPhase() == 1)
        {
            _unit->SendScriptTextChatMessage(7723);     // Lapdogs, all of you!
            SetPhase(2);
        }
        else if (GetHealthPercent() <= 50 && GetPhase() == 2)
        {
            _unit->SendScriptTextChatMessage(7725);     // Fools! Our cause is righteous!

            for (int x = 0; x < 2; x++)
            {
                MoonScriptCreatureAI* Guard = SpawnCreature(636);
                if (Guard != NULL)
                {
                    Guard->SetDespawnWhenInactive(true);
                    Guard->GetUnit()->m_noRespawn = true;
                }
            }

            SetPhase(3);

        }
        else if (GetHealthPercent() <= 25 && GetPhase() == 3)
        {
            _unit->SendScriptTextChatMessage(7727);     // The Brotherhood shall prevail!
            SetPhase(4);
        }
        ParentClass::AIUpdate();
    }
开发者ID:Nupper,项目名称:AscEmu,代码行数:31,代码来源:Instance_Deadmines.cpp

示例2: AIUpdate

	/*
		At <= 50% He will spawn 2 Defias Blackguards
		ToDo: Make them despawn WHEN he dies, also make them unlootable
	*/
	void AIUpdate()
	{
		if(GetHealthPercent() <= 75 && GetPhase() == 1)
		{
			Emote("Lap dogs, all of you.", Text_Yell, 5782);
			SetPhase(2);
		}
		else if(GetHealthPercent() <= 50 && GetPhase() == 2)
		{
			Emote("Fools! Our cause is righteous.", Text_Yell, 5783);
			// Defias Blackguard x 2
			MoonScriptCreatureAI* Guard = NULL;
			for(int x=0; x<2; x++)
			{
				Guard = SpawnCreature(636);
				if(Guard == NULL)
					continue;
				Guard->SetDespawnWhenInactive(true);
				Guard->GetUnit()->m_noRespawn = true;
				Guard = NULL;
			}
			SetPhase(3);
		}
		else if(GetHealthPercent() <= 25 && GetPhase() == 3)
		{
			Emote("The brotherhood shall remain.", Text_Yell, 5784);
			SetPhase(4);
		}
		ParentClass::AIUpdate();
	}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例3: AIUpdate

    void AIUpdate()
	{	
        ParentClass::AIUpdate();

		if( IsTimerFinished( mSummonTime ) )
		{
			MoonScriptCreatureAI *Eagle = NULL;
			// Spawn 3 Soaring Eagles
			for(int x=0; x<3; x++)
			{
				Eagle = SpawnCreature(CN_SOARING_EAGLE, ( _unit->GetPositionX() + RandomFloat( 12 ) - 10 ), ( _unit->GetPositionY()+ RandomFloat( 12 ) - 15 ),
				_unit->GetPositionZ(), _unit->GetOrientation(), true);
				if(Eagle)
				{
					Eagle->AggroNearestUnit();
					Eagle->SetDespawnWhenInactive(true);
				}
			}
			Eagle = NULL;
			Emote("Feed, me bruddahs!", Text_Yell, 12019);
			// Restart the timer
			ResetTimer( mSummonTime, 120000);
		}
	}
开发者ID:Desch,项目名称:Edge-of-Chaos,代码行数:24,代码来源:Raid_ZulAman.cpp


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