本文整理汇总了C++中PlayerbotAI::SelfBuff方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerbotAI::SelfBuff方法的具体用法?C++ PlayerbotAI::SelfBuff怎么用?C++ PlayerbotAI::SelfBuff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerbotAI
的用法示例。
在下文中一共展示了PlayerbotAI::SelfBuff方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoNonCombatActions
void PlayerbotMageAI::DoNonCombatActions()
{
Player * m_bot = GetPlayerBot();
Player * master = GetMaster();
if (!m_bot || !master)
return;
SpellSequence = SPELL_FROST;
PlayerbotAI* ai = GetAI();
// Buff armor
if (MOLTEN_ARMOR)
{
if (ai->SelfBuff(MOLTEN_ARMOR))
return;
}
else if (MAGE_ARMOR)
{
if (ai->SelfBuff(MAGE_ARMOR))
return;
}
else if (ICE_ARMOR)
{
if (ai->SelfBuff(ICE_ARMOR))
return;
}
else if (FROST_ARMOR)
if (ai->SelfBuff(FROST_ARMOR))
return;
// buff master's group
if (master->GetGroup())
{
// Buff master with group buff...
if (ARCANE_BRILLIANCE && ai->HasSpellReagents(ARCANE_BRILLIANCE))
if (ai->Buff(ARCANE_BRILLIANCE, master))
return;
// ...and check group for new members joined or resurrected, or just buff everyone if no group buff available
Group::MemberSlotList const& groupSlot = GetMaster()->GetGroup()->GetMemberSlots();
for (Group::member_citerator itr = groupSlot.begin(); itr != groupSlot.end(); itr++)
{
Player *tPlayer = sObjectMgr.GetPlayer(itr->guid);
if (!tPlayer || !tPlayer->isAlive() || tPlayer == m_bot)
continue;
// buff
if (BuffPlayer(tPlayer))
return;
}
}
// There is no group, buff master
else if (master->isAlive() && BuffPlayer(master))
return;
// Buff self finally
if (BuffPlayer(m_bot))
return;
// conjure food & water
if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
m_bot->SetStandState(UNIT_STAND_STATE_STAND);
Item* pItem = ai->FindDrink();
Item* fItem = ai->FindBandage();
if (pItem == NULL && CONJURE_WATER && ai->GetBaseManaPercent() >= 48)
{
ai->TellMaster("I'm conjuring some water.");
ai->CastSpell(CONJURE_WATER, *m_bot);
ai->SetIgnoreUpdateTime(3);
return;
}
else if (pItem != NULL && ai->GetManaPercent() < 30)
{
ai->TellMaster("I could use a drink.");
ai->UseItem(pItem);
return;
}
pItem = ai->FindFood();
if (pItem == NULL && CONJURE_FOOD && ai->GetBaseManaPercent() >= 48)
{
ai->TellMaster("I'm conjuring some food.");
ai->CastSpell(CONJURE_FOOD, *m_bot);
ai->SetIgnoreUpdateTime(3);
}
// hp check
if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
m_bot->SetStandState(UNIT_STAND_STATE_STAND);
pItem = ai->FindFood();
if (pItem != NULL && ai->GetHealthPercent() < 30)
{
ai->TellMaster("I could use some food.");
ai->UseItem(pItem);
//.........这里部分代码省略.........
示例2: 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
//.........这里部分代码省略.........
示例3: DoNonCombatActions
void PlayerbotPaladinAI::DoNonCombatActions()
{
PlayerbotAI* ai = GetAI();
Player * m_bot = GetPlayerBot();
if (!m_bot)
return;
// Buff myself
if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_TANK) ai->SelfBuff(RIGHTEOUS_FURY);
if (SEAL_OF_WISDOM > 0 && !m_bot->HasAura(SEAL_OF_WISDOM, EFFECT_INDEX_0) && ai->GetManaPercent() <= 30)
ai->CastSpell(SEAL_OF_WISDOM, *m_bot);
else if (m_bot->HasAura(SEAL_OF_WISDOM, EFFECT_INDEX_0) && ai->GetManaPercent() < 85)
{ }
else if (SEAL_OF_LIGHT > 0 && !m_bot->HasAura(SEAL_OF_LIGHT, EFFECT_INDEX_0) && ai->GetHealthPercent() < 40)
ai->CastSpell(SEAL_OF_LIGHT, *m_bot);
else if (SEAL_OF_RIGHTEOUSNESS > 0 && !m_bot->HasAura(SEAL_OF_RIGHTEOUSNESS, EFFECT_INDEX_0))
ai->CastSpell(SEAL_OF_RIGHTEOUSNESS, *m_bot);
BuffPlayer(m_bot);
// Buff master
if(!GetMaster()->IsInDuel(GetMaster()))
BuffPlayer(GetMaster());
// mana check
if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
m_bot->SetStandState(UNIT_STAND_STATE_STAND);
Item* pItem = ai->FindDrink();
Item* fItem = ai->FindBandage();
if (pItem != NULL && ai->GetManaPercent() < 40)
{
ai->TellMaster("I could use a drink.");
ai->UseItem(pItem);
return;
}
// hp check original
if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
m_bot->SetStandState(UNIT_STAND_STATE_STAND);
pItem = ai->FindFood();
if (pItem != NULL && ai->GetHealthPercent() < 40)
{
ai->TellMaster("I could use some food.");
ai->UseItem(pItem);
return;
}
else if (pItem == NULL && fItem != NULL && !m_bot->HasAura(RECENTLY_BANDAGED, EFFECT_INDEX_0) && ai->GetHealthPercent() < 70)
{
ai->TellMaster("I could use first aid.");
ai->UseItem(fItem);
return;
}
// heal and buff group
if (GetMaster()->GetGroup())
{
Group::MemberSlotList const& groupSlot = GetMaster()->GetGroup()->GetMemberSlots();
for (Group::member_citerator itr = groupSlot.begin(); itr != groupSlot.end(); itr++)
{
Player *tPlayer = sObjectMgr.GetPlayer(itr->guid);
if (!tPlayer)
continue;
if (tPlayer->IsInDuelWith(GetMaster()))
continue;
if (!tPlayer->isAlive())
{
if (ai->CastSpell(REDEMPTION, *tPlayer))
{
std::string msg = "Resurrecting ";
msg += tPlayer->GetName();
m_bot->Say(msg, LANG_UNIVERSAL);
return;
}
else
continue;
}
if (HealTarget(tPlayer))
return;
if (tPlayer != m_bot && tPlayer != GetMaster())
if (BuffPlayer(tPlayer))
return;
}
}
}
示例4: DoNonCombatActions
void PlayerbotPriestAI::DoNonCombatActions()
{
PlayerbotAI* ai = GetAI();
Player * m_bot = GetPlayerBot();
Player * master = GetMaster();
if (!m_bot || !master)
return;
SpellSequence = SPELL_HOLY;
// selfbuff goes first
if (ai->SelfBuff(INNER_FIRE))
return;
// mana check
if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
m_bot->SetStandState(UNIT_STAND_STATE_STAND);
Item* pItem = ai->FindDrink();
Item* fItem = ai->FindBandage();
if (pItem != nullptr && ai->GetManaPercent() < 30)
{
ai->TellMaster("I could use a drink.");
ai->UseItem(pItem);
return;
}
// hp check
if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
m_bot->SetStandState(UNIT_STAND_STATE_STAND);
pItem = ai->FindFood();
if (pItem != nullptr && ai->GetHealthPercent() < 30)
{
ai->TellMaster("I could use some food.");
ai->UseItem(pItem);
return;
}
else if (pItem == nullptr && fItem != nullptr && !m_bot->HasAura(RECENTLY_BANDAGED, EFFECT_INDEX_0) && ai->GetHealthPercent() < 70)
{
ai->TellMaster("I could use first aid.");
ai->UseItem(fItem);
return;
}
// buff and heal master's group
if (master->GetGroup())
{
// Buff master with group buffs
if (master->isAlive())
{
if (PRAYER_OF_FORTITUDE && ai->HasSpellReagents(PRAYER_OF_FORTITUDE) && ai->Buff(PRAYER_OF_FORTITUDE, master))
return;
if (PRAYER_OF_SPIRIT && ai->HasSpellReagents(PRAYER_OF_SPIRIT) && ai->Buff(PRAYER_OF_SPIRIT, master))
return;
if (PRAYER_OF_SHADOW_PROTECTION && ai->HasSpellReagents(PRAYER_OF_SHADOW_PROTECTION) && ai->Buff(PRAYER_OF_SHADOW_PROTECTION, master))
return;
}
Group::MemberSlotList const& groupSlot = GetMaster()->GetGroup()->GetMemberSlots();
for (Group::member_citerator itr = groupSlot.begin(); itr != groupSlot.end(); itr++)
{
Player *tPlayer = sObjectMgr.GetPlayer(itr->guid);
if (!tPlayer || tPlayer == m_bot)
continue;
// first rezz em
if (!tPlayer->isAlive())
{
if (ai->CastSpell(RESURRECTION, *tPlayer))
{
std::string msg = "Resurrecting ";
msg += tPlayer->GetName();
m_bot->Say(msg, LANG_UNIVERSAL);
return;
}
else
continue;
}
else
{
// buff and heal
if (BuffPlayer(tPlayer))
return;
if (HealTarget(tPlayer))
return;
}
}
}
else
{
if (master->isAlive())
{
if (BuffPlayer(master))
return;
//.........这里部分代码省略.........