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

C++ GetHealthPercent函数代码示例

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

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



在下文中一共展示了GetHealthPercent函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: phaseTester

	void phaseTester()
	{

		_unit->Root();
		GetAllowMelee();
		SetBehavior(Behavior_Spell);

		if ((HandOfTheDeceiver1 && HandOfTheDeceiver2 && HandOfTheDeceiver3) && (HandOfTheDeceiver1->isDead() && HandOfTheDeceiver2->isDead() && HandOfTheDeceiver3->isDead()) && (GetPhase() != 1) && (GetPhase() != 2) && (starter == 0))
		{
			_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_EMERGE);
			_unit->PlaySoundToSet(SOUND_KJ_EMERGE);
			RemoveAura(42866);
			_unit->m_invisible = false;
			starter = 1;
		}

		switch(GetPhase())
		{
		case 1:
			{
				if(GetHealthPercent()<=85 && phase == 2)
				{
					_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_PHASE3);
					_unit->PlaySoundToSet(SOUND_KJ_PHASE3);
					AddPhaseSpell(1, AddSpell(SPELL_SINISTER_REFLECTION, Target_RandomPlayer, 10, 1.5f, 4, 0, 35));
					AddPhaseSpell(1, AddSpell(SPELL_SHADOW_SPIKE, Target_RandomDestination, 10, 2.0f, 6, 0, 35));
					AddPhaseSpell(1, AddSpell(SPELL_FLAME_DART, Target_RandomPlayer, 10, 1.3f, 4, 0, 35));
					ShieldOrb2 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_SHIELD_ORB, 1712.00f, 604.00f, 48.00f, 0.00f, true, true, 0, 0);
					phase++;
				}

				if(GetHealthPercent()<=55 && phase == 3)
				{
					_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_PHASE4);
					_unit->PlaySoundToSet(SOUND_KJ_PHASE4);
					ShieldOrb3 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_SHIELD_ORB, 1684.00f, 651.00f, 48.00f, 0.00f, true, true, 0, 0);
					dtimmer = 0;
					phase++;
				}

				if(GetHealthPercent()<=25 && phase == 4 && (dtimmer > 54 || dtimmer == 0))
				{
					_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, SAY_KJ_PHASE5);
					_unit->PlaySoundToSet(SOUND_KJ_PHASE5);
					ShieldOrb4 = _unit->GetMapMgr()->GetInterface()->SpawnCreature(CN_SHIELD_ORB, 1720.00f, 642.00f, 48.00f, 0.00f, true, true, 0, 0);
					CastSpellOnTarget(_unit, Target_Self, dbcSpell.LookupEntry(SPELL_SACRIFICE_OF_ANVEENA), true);
					dtimmer = 0;
					phase++;
				}
			}break;
		}
	}
开发者ID:AscEmu,项目名称:AscEmu_TBC,代码行数:52,代码来源:Raid_SunwellPlateau.cpp


示例3: AIUpdate

 void AIUpdate()
 {
     if (GetHealthPercent() <= 66 && IllusionCount == 0)
     {
         IllusionCount = 1;
         CastSpell(Illusion66);
     }
     else if (GetHealthPercent() <= 33 && IllusionCount == 1)
     {
         IllusionCount = 2;
         CastSpell(Illusion33);
     }
     ParentClass::AIUpdate();
 }
开发者ID:lev1976g,项目名称:AscEmu,代码行数:14,代码来源:Instance_Arcatraz.cpp


示例4: AIUpdate

	void AIUpdate()
	{
		if ( IsTimerFinished( mStompTimer ) )
		{
			if( m_bStomp == false )
			{
				m_bStomp = true;
				Announce( "Volkhan prepares to shatter his Brittle Golems!" );
				CastSpellNowNoScheduling( mStomp );
				ResetTimer( mStompTimer, 3000 );
			}
			else
			{
				DoStomp();
				ResetTimer( mStompTimer, TIMER_STOMP + ( RandomUInt( 6 ) * 1000 ) );
			}
		};

		if ( GetHealthPercent() <= ( 100 - ( 20 * mPhase ) ) )
		{
			ForceWaypointMove( 1 );
			Announce( "Volkhan runs to his anvil!" );
			++mPhase;
		}

		ParentClass::AIUpdate();
	};
开发者ID:Desch,项目名称:Edge-of-Chaos,代码行数:27,代码来源:Instance_HallsOfLightning.cpp


示例5: OnTargetDied

void ArcScriptCreatureAI::OnTargetDied(Unit* pTarget)
{
	if( GetHealthPercent() > 0 )	//Prevent double yelling (OnDied and OnTargetDied)
	{
		RandomEmote(mOnTargetDiedEmotes);
	}
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:7,代码来源:Base.cpp


示例6: AIUpdate

		void AIUpdate()
		{
			if(GetHealthPercent() <= 75 && m_uiSay == 0)
			{
				Emote("Naughty secrets!", Text_Yell, 5849);
				m_uiSay = 1;
			};

			if(GetHealthPercent() <= 25 && m_uiSay == 1)
			{
				Emote("I'll rip the secrets from your flesh!", Text_Yell, 5850);
				m_uiSay = 2;
			};

			ParentClass::AIUpdate();
		};
开发者ID:Antares84,项目名称:arcemu,代码行数:16,代码来源:Instance_ScarletMonastery.cpp


示例7: 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


示例8: AIUpdate

	void AIUpdate()
	{
		if(GetHealthPercent()<=25)
		{
			ApplyAura(SHADOW_INFUSION);
		}
	ParentClass::AIUpdate();
	}
开发者ID:Bootz,项目名称:arcticdev,代码行数:8,代码来源:Raid_SunwellPlateau.cpp


示例9: AIUpdate

		void AIUpdate()
		{
			if(mEnraged == false && GetHealthPercent() <= 25)
			{
				ApplyAura(ENRAGE);
				mEnraged = true;
			};
		};
开发者ID:Refuge89,项目名称:Edge-of-Chaos,代码行数:8,代码来源:Instance_Nexus.cpp


示例10: AIUpdate

		void AIUpdate()
		{
			if(GetHealthPercent() <= 30 && !morph)
			{
				morph = true;
				_unit->CastSpell(_unit, 11089, true);	//Theka Transform
			}
			MoonScriptCreatureAI::AIUpdate();
		}
开发者ID:Refuge89,项目名称:arcscripts2,代码行数:9,代码来源:Instance_ZulFarrak.cpp


示例11: AIUpdate

    void AIUpdate()
    {
		if((GetHealthPercent() <= 76 && summon == 0) 
		|| (GetHealthPercent() <= 51 && summon == 2) 
		|| (GetHealthPercent() <= 25 && summon == 4))
			summon += 1;
		
		if(summon == 1 || summon == 3 || summon == 5) 
			Summon();

		if( mRift == true && ( pChaoticRift == NULL || !pChaoticRift->isAlive() ))
		{
			RemoveAura(47748);
			mRift = false;
		};

		ParentClass::AIUpdate();
    };
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:18,代码来源:Instance_Nexus.cpp


示例12: AIUpdate

 void AIUpdate()
 {
     if(GetHealthPercent() <= 20 && DivineProt->mEnabled == true)
     {
         CastSpellNowNoScheduling(DivineProt);
         DivineProt->mEnabled = false;
     }
     ParentClass::AIUpdate();
 }
开发者ID:lev1976g,项目名称:easywow,代码行数:9,代码来源:Instance_ShadowfangKeep.cpp


示例13: AIUpdate

	void AIUpdate()
	{
		if( mEnraged == false && GetHealthPercent() <= 20 )
		{
			ApplyAura(SHADOW_INFUSION);
			mEnraged = true;
		};

		ParentClass::AIUpdate();
	};
开发者ID:Tulba,项目名称:wowtbc,代码行数:10,代码来源:kil'jaeden.cpp


示例14: AIUpdate

        void AIUpdate()
        {
            if (GetHealthPercent() <= 42 && Heal)
            {
                CastSpell(mHealDf);
                Heal = false;
            }

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


示例15: AIUpdate

	void AIUpdate()
	{
		// If Health is less than 50% and Golemagg is still alive then they regain full health
		if(GetHealthPercent() <= 50 && Golemagg && Golemagg->isAlive())
		{
			Regenerate();
			Emote("Core Rager refuses to die while it's master is in trouble.", Text_Emote);
		}
		ParentClass::AIUpdate();
	}
开发者ID:wow4all,项目名称:wowtbc,代码行数:10,代码来源:Raid_MoltenCore.cpp


示例16: AIUpdate

		void AIUpdate()
		{
			// Every 25% Halazzi calls on the lynx
			if(!mLynx && GetHealthPercent() <= (100 - SplitCount * 25))
				Split();

			// Lynx OR Halazzi is at 20% HP Merge them together again
			if(mLynx && (mLynx->GetHealthPct() <= 20 || GetHealthPercent() <= 20))
				Merge();

			// At <25% Phase 3 begins
			if(GetHealthPercent() < 25 && GetPhase() == 1)
			{
				ResetTimer(mTotemTimer, 30000);
				SetPhase(3);
			}

			if(GetPhase() == 2 || GetPhase() == 3)
			{
				if(IsTimerFinished(mTotemTimer))
				{
					MoonScriptCreatureAI* Totem = NULL;
					Totem = SpawnCreature(CN_TOTEM, (_unit->GetPositionX() + RandomFloat(3) - 3), (_unit->GetPositionY() + RandomFloat(3) - 3), _unit->GetPositionZ(), 0, true);
					if(Totem)
					{
						Totem->Despawn(60000); // Despawn in 60 seconds
						Totem->AggroNearestPlayer();
						Totem = NULL;
					}
					switch(GetPhase())
					{
						case 2:
							ResetTimer(mTotemTimer, 60000);
							break;
						case 3:
							ResetTimer(mTotemTimer, 30000);
							break; // Spawn them faster then phase 2
					}
				}
			}
		}
开发者ID:Refuge89,项目名称:Edge-of-Chaos,代码行数:41,代码来源:Raid_ZulAman.cpp


示例17: AIUpdate

	void AIUpdate()
	{
		if (mAliveAdds > 1)
			return;

		if (GetPhase() == 1 && GetHealthPercent() <= 50)
		{
			SetPhase(2, mEnrage);
		}

		ParentClass::AIUpdate();
	}
开发者ID:Bootz,项目名称:arcticdev,代码行数:12,代码来源:Raid_GruulsLair.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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