本文整理汇总了C++中instance_ahnkahet::SelectRandomGuardianEggGuid方法的典型用法代码示例。如果您正苦于以下问题:C++ instance_ahnkahet::SelectRandomGuardianEggGuid方法的具体用法?C++ instance_ahnkahet::SelectRandomGuardianEggGuid怎么用?C++ instance_ahnkahet::SelectRandomGuardianEggGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类instance_ahnkahet
的用法示例。
在下文中一共展示了instance_ahnkahet::SelectRandomGuardianEggGuid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (!m_bGuardianSummoned && m_creature->GetHealthPercent() < 50.0f)
{
// guardian is summoned at 50% of boss HP
if (m_pInstance)
{
if (Creature* pGuardianEgg = m_creature->GetMap()->GetCreature(m_pInstance->SelectRandomGuardianEggGuid()))
pGuardianEgg->CastSpell(pGuardianEgg, SPELL_SUMMON_SWARM_GUARDIAN, false);
m_bGuardianSummoned = true;
}
}
if (m_uiSummonTimer < uiDiff)
{
if (roll_chance_i(50))
DoScriptText(urand(0, 1) ? SAY_SUMMON_EGG_1 : SAY_SUMMON_EGG_2, m_creature);
if (m_pInstance)
{
// There are 2 Swarmers summoned at a timer
if (Creature* pSwarmerEgg = m_creature->GetMap()->GetCreature(m_pInstance->SelectRandomSwarmerEggGuid()))
{
for (uint8 i = 0; i < 2; ++i)
pSwarmerEgg->CastSpell(pSwarmerEgg, SPELL_SUMMON_SWARMERS, false);
}
}
m_uiSummonTimer = urand(5000, 10000);
}
else
m_uiSummonTimer -= uiDiff;
if (m_uiBroodPlagueTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_BROOD_PLAGUE : SPELL_BROOD_PLAGUE_H);
m_uiBroodPlagueTimer = 20000;
}
else
m_uiBroodPlagueTimer -= uiDiff;
if (!m_bIsRegularMode)
{
if (m_uiBroodRageTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_BROOD_RAGE) == CAST_OK)
m_uiBroodRageTimer = 20000;
}
else
m_uiBroodRageTimer -= uiDiff;
}
if (!m_bBerserk && m_creature->GetPositionZ() < 24.0)
{
if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK)
m_bBerserk = true;
}
DoMeleeAttackIfReady();
}