本文整理汇总了C++中GetHealthPercent函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHealthPercent函数的具体用法?C++ GetHealthPercent怎么用?C++ GetHealthPercent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetHealthPercent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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;
}
}
示例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();
}
示例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();
};
示例5: OnTargetDied
void ArcScriptCreatureAI::OnTargetDied(Unit* pTarget)
{
if( GetHealthPercent() > 0 ) //Prevent double yelling (OnDied and OnTargetDied)
{
RandomEmote(mOnTargetDiedEmotes);
}
}
示例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();
};
示例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();
}
示例8: AIUpdate
void AIUpdate()
{
if(GetHealthPercent()<=25)
{
ApplyAura(SHADOW_INFUSION);
}
ParentClass::AIUpdate();
}
示例9: AIUpdate
void AIUpdate()
{
if(mEnraged == false && GetHealthPercent() <= 25)
{
ApplyAura(ENRAGE);
mEnraged = true;
};
};
示例10: AIUpdate
void AIUpdate()
{
if(GetHealthPercent() <= 30 && !morph)
{
morph = true;
_unit->CastSpell(_unit, 11089, true); //Theka Transform
}
MoonScriptCreatureAI::AIUpdate();
}
示例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();
};
示例12: AIUpdate
void AIUpdate()
{
if(GetHealthPercent() <= 20 && DivineProt->mEnabled == true)
{
CastSpellNowNoScheduling(DivineProt);
DivineProt->mEnabled = false;
}
ParentClass::AIUpdate();
}
示例13: AIUpdate
void AIUpdate()
{
if( mEnraged == false && GetHealthPercent() <= 20 )
{
ApplyAura(SHADOW_INFUSION);
mEnraged = true;
};
ParentClass::AIUpdate();
};
示例14: AIUpdate
void AIUpdate()
{
if (GetHealthPercent() <= 42 && Heal)
{
CastSpell(mHealDf);
Heal = false;
}
ParentClass::AIUpdate();
}
示例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();
}