本文整理汇总了C++中instance_gundrak::SelectRandomSladranTargetGuid方法的典型用法代码示例。如果您正苦于以下问题:C++ instance_gundrak::SelectRandomSladranTargetGuid方法的具体用法?C++ instance_gundrak::SelectRandomSladranTargetGuid怎么用?C++ instance_gundrak::SelectRandomSladranTargetGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类instance_gundrak
的用法示例。
在下文中一共展示了instance_gundrak::SelectRandomSladranTargetGuid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (m_uiPoisonNovaTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_POISON_NOVA : SPELL_POISON_NOVA_H) == CAST_OK)
{
DoScriptText(EMOTE_NOVA, m_creature);
m_uiPoisonNovaTimer = 22000;
}
}
else
m_uiPoisonNovaTimer -= uiDiff;
if (m_uiSummonTimer < uiDiff)
{
if (!m_pInstance)
return;
if (Creature* pSummonTarget = m_creature->GetMap()->GetCreature(m_pInstance->SelectRandomSladranTargetGuid()))
{
if (urand(0, 3))
{
// we don't want to get spammed
if (!urand(0, 4))
DoScriptText(SAY_SUMMON_CONSTRICTOR, m_creature);
pSummonTarget->CastSpell(pSummonTarget, SPELL_SUMMON_CONSTRICTOR, false, NULL, NULL, m_creature->GetObjectGuid());
}
else
{
// we don't want to get spammed
if (!urand(0, 4))
DoScriptText(SAY_SUMMON_SNAKE, m_creature);
pSummonTarget->CastSpell(pSummonTarget, SPELL_SUMMON_VIPER, false, NULL, NULL, m_creature->GetObjectGuid());
}
}
m_uiSummonTimer = m_bIsRegularMode ? 5000 : 3000;
}
else
m_uiSummonTimer -= uiDiff;
if (m_uiPowerfulBiteTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_POWERFUL_BITE : SPELL_POWERFUL_BITE_H) == CAST_OK)
m_uiPowerfulBiteTimer = 10000;
}
else
m_uiPowerfulBiteTimer -= uiDiff;
if (m_uiVenomBoltTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_VENOM_BOLT : SPELL_VENOM_BOLT_H) == CAST_OK)
m_uiVenomBoltTimer = 15000;
}
}
else
m_uiVenomBoltTimer -= uiDiff;
DoMeleeAttackIfReady();
}