本文整理汇总了C++中PlayerbotAI::Follow方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerbotAI::Follow方法的具体用法?C++ PlayerbotAI::Follow怎么用?C++ PlayerbotAI::Follow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerbotAI
的用法示例。
在下文中一共展示了PlayerbotAI::Follow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoNextCombatManeuver
void PlayerbotPriestAI::DoNextCombatManeuver(Unit *pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return;
switch (ai->GetScenarioType())
{
case PlayerbotAI::SCENARIO_DUEL:
(ai->HasAura(SCREAM,*pTarget) && ai->GetHealthPercent() < 60 && ai->CastSpell(HEAL)) ||
ai->CastSpell(PAIN) ||
(ai->GetHealthPercent() < 80 && ai->CastSpell(RENEW)) ||
(ai->GetPlayerBot()->GetDistance(pTarget) <= 5 && ai->CastSpell(SCREAM)) ||
ai->CastSpell(MIND_BLAST) ||
(ai->GetHealthPercent() < 20 && ai->CastSpell(FLASH_HEAL)) ||
ai->CastSpell(SMITE);
return;
}
// ------- Non Duel combat ----------
ai->Follow(*GetMaster()); // dont want to melee mob
Player *m_bot = GetPlayerBot();
Group *m_group = m_bot->GetGroup();
// Heal myself
if (ai->GetHealthPercent() < 15 && FADE > 0 && !m_bot->HasAura(FADE, 0))
{
GetAI()->TellMaster("I'm casting fade");
ai->CastSpell(FADE);
}
else if (ai->GetHealthPercent() < 25 && PWS > 0 && !m_bot->HasAura(PWS, 0))
{
GetAI()->TellMaster("I'm casting pws on myself.");
ai->CastSpell(PWS);
}
else if (ai->GetHealthPercent() < 80)
HealTarget (*m_bot, ai->GetHealthPercent());
// Heal master
uint32 masterHP = GetMaster()->GetHealth()*100 / GetMaster()->GetMaxHealth();
if (GetMaster()->isAlive())
{
if (masterHP < 25 && PWS > 0 && !GetMaster()->HasAura(PWS, 0))
ai->CastSpell(PWS, *(GetMaster()));
else if (masterHP < 80)
HealTarget (*GetMaster(), masterHP);
}
// Heal group
if( m_group )
{
Group::MemberSlotList const& groupSlot = m_group->GetMemberSlots();
for (Group::member_citerator itr = groupSlot.begin(); itr != groupSlot.end(); itr++)
{
Player *m_groupMember = objmgr.GetPlayer( itr->guid );
if( !m_groupMember || !m_groupMember->isAlive() )
continue;
uint32 memberHP = m_groupMember->GetHealth()*100 / m_groupMember->GetMaxHealth();
if( memberHP < 25 )
HealTarget( *m_groupMember, memberHP );
}
}
// Damage Spells
ai->SetInFront( pTarget );
switch (SpellSequence)
{
case SPELL_HOLY:
if (SMITE > 0 && LastSpellHoly <= 1 && ai->GetManaPercent() >= 60)
{
ai->CastSpell(SMITE);
SpellSequence = SPELL_SHADOWMAGIC;
LastSpellHoly = LastSpellHoly +1;
break;
}
else if (CLEARCASTING > 0 && LastSpellHoly <2 && ai->GetManaPercent() >= 60)
{
GetAI()->TellMaster("I'm casting clearcasting");
ai->CastSpell(CLEARCASTING, *pTarget);
SpellSequence = SPELL_SHADOWMAGIC;
LastSpellHoly = LastSpellHoly +1;
break;
}
else if (HOLY_NOVA > 0 && LastSpellHoly <3 && ai->GetManaPercent() >= 60)
{
GetAI()->TellMaster("I'm casting holy nova");
ai->CastSpell(HOLY_NOVA);
SpellSequence = SPELL_SHADOWMAGIC;
LastSpellHoly = LastSpellHoly +1;
break;
}
else if (HOLY_FIRE > 0 && LastSpellHoly <4 && ai->GetManaPercent() >= 60)
{
GetAI()->TellMaster("I'm casting holy fire");
ai->CastSpell(HOLY_FIRE, *pTarget);
SpellSequence = SPELL_SHADOWMAGIC;
//.........这里部分代码省略.........