本文整理汇总了C++中PlayerbotAI::initPetSpell方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerbotAI::initPetSpell方法的具体用法?C++ PlayerbotAI::initPetSpell怎么用?C++ PlayerbotAI::initPetSpell使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerbotAI
的用法示例。
在下文中一共展示了PlayerbotAI::initPetSpell方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoNonCombatActions
void PlayerbotWarlockAI::DoNonCombatActions()
{
SpellSequence = SPELL_CURSES;
PlayerbotAI *ai = GetAI();
Player * m_bot = GetPlayerBot();
if (!ai || !m_bot)
return;
Pet *pet = m_bot->GetPet();
// Initialize pet spells
if (pet && pet->GetEntry() != m_lastDemon)
{
switch (pet->GetEntry())
{
case DEMON_IMP:
{
BLOOD_PACT = ai->initPetSpell(BLOOD_PACT_ICON);
FIREBOLT = ai->initPetSpell(FIREBOLT_ICON);
FIRE_SHIELD = ai->initPetSpell(FIRE_SHIELD_ICON);
break;
}
case DEMON_VOIDWALKER:
{
CONSUME_SHADOWS = ai->initPetSpell(CONSUME_SHADOWS_ICON);
SACRIFICE = ai->initPetSpell(SACRIFICE_ICON);
SUFFERING = ai->initPetSpell(SUFFERING_ICON);
TORMENT = ai->initPetSpell(TORMENT_ICON);
break;
}
case DEMON_SUCCUBUS:
{
LASH_OF_PAIN = ai->initPetSpell(LASH_OF_PAIN_ICON);
SEDUCTION = ai->initPetSpell(SEDUCTION_ICON);
SOOTHING_KISS = ai->initPetSpell(SOOTHING_KISS_ICON);
break;
}
case DEMON_FELHUNTER:
{
DEVOUR_MAGIC = ai->initPetSpell(DEVOUR_MAGIC_ICON);
FEL_INTELLIGENCE = ai->initPetSpell(FEL_INTELLIGENCE_ICON);
SHADOW_BITE = ai->initPetSpell(SHADOW_BITE_ICON);
SPELL_LOCK = ai->initPetSpell(SPELL_LOCK_ICON);
break;
}
case DEMON_FELGUARD:
{
ANGUISH = ai->initPetSpell(ANGUISH_ICON);
CLEAVE = ai->initPetSpell(CLEAVE_ICON);
INTERCEPT = ai->initPetSpell(INTERCEPT_ICON);
break;
}
}
m_lastDemon = pet->GetEntry();
if (!m_isTempImp)
m_demonOfChoice = pet->GetEntry();
}
// Destroy extra soul shards
uint8 shardCount = m_bot->GetItemCount(SOUL_SHARD, false, NULL);
uint8 freeSpace = ai->GetFreeBagSpace();
if (shardCount > MAX_SHARD_COUNT || (freeSpace == 0 && shardCount > 1))
m_bot->DestroyItemCount(SOUL_SHARD, shardCount > MAX_SHARD_COUNT ? shardCount - MAX_SHARD_COUNT : 1, true, false);
// buff myself DEMON_SKIN, DEMON_ARMOR, FEL_ARMOR
if (FEL_ARMOR)
{
if (ai->SelfBuff(FEL_ARMOR))
return;
}
else if (DEMON_ARMOR)
{
if (ai->SelfBuff(DEMON_ARMOR))
return;
}
else if (DEMON_SKIN)
if (ai->SelfBuff(DEMON_SKIN))
return;
// healthstone creation
if (CREATE_HEALTHSTONE && shardCount > 0)
{
Item* const healthStone = ai->FindConsumable(HEALTHSTONE_DISPLAYID);
if (!healthStone && ai->CastSpell(CREATE_HEALTHSTONE))
return;
}
// soulstone creation and use
if (CREATE_SOULSTONE)
{
Item* soulStone = ai->FindConsumable(SOULSTONE_DISPLAYID);
if (!soulStone)
{
if (shardCount > 0 && !m_bot->HasSpellCooldown(CREATE_SOULSTONE) && ai->CastSpell(CREATE_SOULSTONE))
return;
}
else
//.........这里部分代码省略.........