本文整理汇总了C++中PlayerbotAI::CastSpell方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerbotAI::CastSpell方法的具体用法?C++ PlayerbotAI::CastSpell怎么用?C++ PlayerbotAI::CastSpell使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerbotAI
的用法示例。
在下文中一共展示了PlayerbotAI::CastSpell方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoFirstCombatManeuver
bool PlayerbotWarriorAI::DoFirstCombatManeuver(Unit *pTarget)
{
Player *m_bot = GetPlayerBot();
PlayerbotAI *ai = GetAI();
PlayerbotAI::CombatOrderType co = ai->GetCombatOrder();
float fTargetDist = m_bot->GetDistance( pTarget );
if( (co&PlayerbotAI::ORDERS_TANK) && DEFENSIVE_STANCE>0 && !m_bot->HasAura(DEFENSIVE_STANCE, EFFECT_INDEX_0) && ai->CastSpell(DEFENSIVE_STANCE) )
{
if( ai->GetManager()->m_confDebugWhisper )
ai->TellMaster( "First > Defensive Stance (%d)", DEFENSIVE_STANCE );
return true;
}
else if( (co&PlayerbotAI::ORDERS_TANK) && TAUNT>0 && m_bot->HasAura(DEFENSIVE_STANCE, EFFECT_INDEX_0) && ai->CastSpell(TAUNT,*pTarget) )
{
if( ai->GetManager()->m_confDebugWhisper )
ai->TellMaster( "First > Taunt (%d)", TAUNT );
return false;
}
else if( BATTLE_STANCE>0 && !m_bot->HasAura(BATTLE_STANCE, EFFECT_INDEX_0) && ai->CastSpell(BATTLE_STANCE) )
{
if( ai->GetManager()->m_confDebugWhisper )
ai->TellMaster( "First > Battle Stance (%d)", BATTLE_STANCE );
return true;
}
else if( BATTLE_STANCE>0 && CHARGE>0 && m_bot->HasAura(BATTLE_STANCE, EFFECT_INDEX_0) )
{
if( fTargetDist<8.0f )
return false;
else if( fTargetDist>25.0f )
return true;
else if( CHARGE>0 && ai->CastSpell(CHARGE,*pTarget) )
{
float x, y, z;
pTarget->GetContactPoint( m_bot, x, y, z, 3.666666f );
m_bot->Relocate( x, y, z );
if( ai->GetManager()->m_confDebugWhisper )
ai->TellMaster( "First > Charge (%d)", CHARGE );
return false;
}
}
return false;
}
示例2: HealTarget
bool PlayerbotPriestAI::HealTarget(Unit* target)
{
PlayerbotAI* ai = GetAI();
uint8 hp = target->GetHealth() * 100 / target->GetMaxHealth();
if (hp >= 80)
return false;
if (hp < 25 && FLASH_HEAL && ai->CastSpell(FLASH_HEAL, target))
return true;
else if (hp < 30 && GREATER_HEAL > 0 && ai->CastSpell(GREATER_HEAL, target))
return true;
else if (hp < 33 && BINDING_HEAL > 0 && ai->CastSpell(BINDING_HEAL, target))
return true;
else if (hp < 40 && PRAYER_OF_HEALING > 0 && ai->CastSpell(PRAYER_OF_HEALING, target))
return true;
else if (hp < 50 && CIRCLE_OF_HEALING > 0 && ai->CastSpell(CIRCLE_OF_HEALING, target))
return true;
else if (hp < 60 && HEAL > 0 && ai->CastSpell(HEAL, target))
return true;
else if (hp < 80 && RENEW > 0 && ai->CastSpell(RENEW, target))
return true;
else
return false;
} // end HealTarget
示例3: HealTarget
void PlayerbotDruidAI::HealTarget(Unit &target, uint8 hp)
{
PlayerbotAI* ai = GetAI();
Player *m_bot = GetPlayerBot();
if (hp < 70 && REJUVENATION > 0 && !target.HasAura(REJUVENATION, EFFECT_INDEX_0) && !target.HasAura(REGROWTH, EFFECT_INDEX_0) && ai->GetManaPercent() >=21)
ai->CastSpell(REJUVENATION, target);
if (hp < 60 && LIFEBLOOM > 0 && !target.HasAura(LIFEBLOOM, EFFECT_INDEX_0) && ai->GetManaPercent() >= 28)
ai->CastSpell(LIFEBLOOM, target);
if (hp < 55 && REGROWTH > 0 && !target.HasAura(REGROWTH, EFFECT_INDEX_0) && !target.HasAura(REJUVENATION, EFFECT_INDEX_0) && ai->GetManaPercent() >= 33)
ai->CastSpell(REGROWTH, target);
if (hp < 50 && SWIFTMEND > 0 && target.HasAura(REJUVENATION, EFFECT_INDEX_0) || target.HasAura(REGROWTH, EFFECT_INDEX_0) && ai->GetManaPercent() >= 16)
ai->CastSpell(SWIFTMEND, target);
if (hp < 45 && WILD_GROWTH > 0 && !target.HasAura(WILD_GROWTH, EFFECT_INDEX_0) && ai->GetManaPercent() >= 26)
ai->CastSpell(WILD_GROWTH, target);
if (hp < 30 && NOURISH > 0 && ai->GetManaPercent() >= 18)
ai->CastSpell(NOURISH, target);
if (hp < 25 && HEALING_TOUCH > 0 && ai->GetManaPercent() >= 38)
ai->CastSpell(HEALING_TOUCH, target);
} // end HealTarget
示例4: HealTarget
bool PlayerbotPaladinAI::HealTarget(Unit *target)
{
PlayerbotAI* ai = GetAI();
uint8 hp = target->GetHealth() * 100 / target->GetMaxHealth();
if (hp < 25 && ai->CastSpell(LAY_ON_HANDS, *target))
return true;
if (hp < 30 && ai->CastSpell(FLASH_OF_LIGHT, *target))
return true;
if (hp < 35 && ai->CastSpell(HOLY_SHOCK, *target))
return true;
if (hp < 40 && ai->CastSpell(HOLY_LIGHT, *target))
return true;
return false;
} // end HealTarget
示例5: _DoNextPVECombatManeuverHeal
void PlayerbotDruidAI::_DoNextPVECombatManeuverHeal(Unit* pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return;
uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth();
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
if (TREE_OF_LIFE > 0 && !m_bot->HasAura(TREE_OF_LIFE, EFFECT_INDEX_0))
ai->CastSpell(TREE_OF_LIFE, *m_bot);
if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(CAT_FORM_1);
//ai->TellMaster("FormClearCat");
return;
}
if (m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(BEAR_FORM_1);
//ai->TellMaster("FormClearBear");
return;
}
if (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(DIRE_BEAR_FORM_1);
//ai->TellMaster("FormClearDireBear");
return;
}
// spellcasting form, but disables healing spells so it's got to go
if (m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(MOONKIN_FORM_1);
//ai->TellMaster("FormClearMoonkin");
return;
}
if (ai->GetHealthPercent() <= 60)
{
HealTarget(m_bot);
return;
}
if (masterHP <= 50)
{
HealTarget(GetMaster());
return;
}
// TODO: err... what about the other teammates?
DruidSpellCombat = 0;
}
示例6: HealTarget
bool PlayerbotDruidAI::HealTarget(Unit *target)
{
PlayerbotAI* ai = GetAI();
uint8 hp = target->GetHealth() * 100 / target->GetMaxHealth();
if (hp >= 70)
return false;
// Reset form if needed
GoBuffForm(GetPlayerBot());
if (hp < 70 && REJUVENATION > 0 && !target->HasAura(REJUVENATION) && ai->CastSpell(REJUVENATION, *target))
return true;
if (hp < 60 && LIFEBLOOM > 0 && !target->HasAura(LIFEBLOOM) && ai->CastSpell(LIFEBLOOM, *target))
return true;
if (hp < 55 && REGROWTH > 0 && !target->HasAura(REGROWTH) && ai->CastSpell(REGROWTH, *target))
return true;
if (hp < 50 && SWIFTMEND > 0 && (target->HasAura(REJUVENATION) || target->HasAura(REGROWTH)) && ai->CastSpell(SWIFTMEND, *target))
return true;
if (hp < 45 && WILD_GROWTH > 0 && !target->HasAura(WILD_GROWTH) && ai->CastSpell(WILD_GROWTH, *target))
return true;
if (hp < 30 && NOURISH > 0 && ai->CastSpell(NOURISH, *target))
return true;
if (hp < 25 && HEALING_TOUCH > 0 && ai->CastSpell(HEALING_TOUCH, *target))
return true;
return false;
} // end HealTarget
示例7: DoNextCombatManeuver
void PlayerbotDruidAI::DoNextCombatManeuver(Unit *pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return;
switch (ai->GetScenarioType())
{
case PlayerbotAI::SCENARIO_DUEL:
ai->CastSpell(MOONFIRE);
return;
default:
break;
}
uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth();
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_HEAL) // && ai->GetMovementOrder() == PlayerbotAI::MOVEMENT_STAY)
SpellSequence = DruidHeal;
else if (IsFeral() && ai->GetCombatOrder() == PlayerbotAI::ORDERS_ASSIST) // && ai->GetMovementOrder() == PlayerbotAI::MOVEMENT_STAY)
SpellSequence = DruidCombat;
else if (IsFeral() && ai->GetCombatOrder() == PlayerbotAI::ORDERS_TANK)
SpellSequence = DruidTank;
else
SpellSequence = DruidSpell;
switch (SpellSequence)
{
case DruidTank: // Its now a tank druid!
//ai->TellMaster("DruidTank");
_DoNextPVECombatManeuverBear(pTarget);
break;
case DruidSpell:
//ai->TellMaster("DruidSpell");
_DoNextPVECombatManeuverSpellDPS(pTarget);
break;
case DruidHeal:
//ai->TellMaster("DruidHeal");
_DoNextPVECombatManeuverHeal(pTarget);
break;
case DruidCombat:
//ai->TellMaster("DruidCombat");
_DoNextPVECombatManeuverMeleeDPS(pTarget);
break;
}
} // end DoNextCombatManeuver
示例8: DoNextCombatManeuver
void PlayerbotDruidAI::DoNextCombatManeuver(Unit *pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return;
switch (ai->GetScenarioType())
{
case PlayerbotAI::SCENARIO_DUEL:
ai->CastSpell(MOONFIRE);
return;
}
uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth();
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_HEAL)
SpellSequence = DruidHeal;
else if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_ASSIST && CAT_FORM > 0)
SpellSequence = DruidCombat;
// No check for Dire Bear here: you must have Bear form to learn Dire Bear form.
else if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_TANK && BEAR_FORM > 0)
SpellSequence = DruidTank;
else
SpellSequence = DruidSpell;
switch (SpellSequence)
{
case DruidTank: // Its now a tank druid!
//ai->TellMaster("DruidTank");
_DoNextPVECombatManeuverBear(pTarget);
break;
case DruidSpell:
//ai->TellMaster("DruidSpell");
_DoNextPVECombatManeuverSpellDPS(pTarget);
break;
case DruidHeal:
//ai->TellMaster("DruidHeal");
_DoNextPVECombatManeuverHeal(pTarget);
break;
case DruidCombat:
//ai->TellMaster("DruidCombat");
_DoNextPVECombatManeuverMeleeDPS(pTarget);
break;
}
} // end DoNextCombatManeuver
示例9: HealTarget
bool PlayerbotPaladinAI::HealTarget(Unit &target, uint8 hp)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return false;
Player* pMaster = ai->GetMaster();
if (!pMaster)
return false;
if ((hp < 40)
&& (HOLY_LIGHT > 0)
&& (ai->GetManaPercent() >= 34)
&& (ai->CastSpell(HOLY_LIGHT, target)))
return true;
if ((hp < 35)
&& (HOLY_SHOCK > 0)
&& (ai->GetManaPercent() >= 21)
&& (ai->CastSpell(HOLY_SHOCK, target)))
return true;
if ((hp < 30)
&& (FLASH_OF_LIGHT > 0)
&& (ai->GetManaPercent() >= 8)
&& (ai->CastSpell(FLASH_OF_LIGHT, target)))
return true;
if ((hp < 25)
&& (LAY_ON_HANDS > 0)
&& (ai->GetHealthPercent() > 30)
&& (ai->GetManaPercent() >= 8)
&& (ai->CastSpell(LAY_ON_HANDS, target)))
return true;
return false;
}
示例10: HealTarget
bool PlayerbotPriestAI::HealTarget(Unit* target)
{
PlayerbotAI* ai = GetAI();
uint8 hp = target->GetHealth() * 100 / target->GetMaxHealth();
if (CURE_DISEASE > 0 && ai->GetCombatOrder() != PlayerbotAI::ORDERS_NODISPEL)
{
uint32 dispelMask = GetDispellMask(DISPEL_DISEASE);
Unit::SpellAuraHolderMap const& auras = target->GetSpellAuraHolderMap();
for(Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellAuraHolder *holder = itr->second;
if ((1<<holder->GetSpellProto()->Dispel) & dispelMask)
{
if(holder->GetSpellProto()->Dispel == DISPEL_DISEASE)
ai->CastSpell(CURE_DISEASE, *target);
return false;
}
}
}
if (hp >= 80)
return false;
if (hp < 25 && FLASH_HEAL && ai->CastSpell(FLASH_HEAL, *target))
return true;
else if (hp < 30 && GREATER_HEAL > 0 && ai->CastSpell(GREATER_HEAL, *target))
return true;
else if (hp < 33 && BINDING_HEAL > 0 && ai->CastSpell(BINDING_HEAL, *target))
return true;
else if (hp < 40 && PRAYER_OF_HEALING > 0 && ai->CastSpell(PRAYER_OF_HEALING, *target))
return true;
else if (hp < 50 && CIRCLE_OF_HEALING > 0 && ai->CastSpell(CIRCLE_OF_HEALING, *target))
return true;
else if (hp < 60 && HEAL > 0 && ai->CastSpell(HEAL, *target))
return true;
else if (hp < 80 && RENEW > 0 && !target->HasAura(RENEW) && ai->CastSpell(RENEW, *target))
return true;
else
return false;
} // end HealTarget
示例11: HealTarget
void PlayerbotPriestAI::HealTarget(Unit &target, uint8 hp)
{
PlayerbotAI* ai = GetAI();
// return ((hp < 80 && !target.HasAura(RENEW, EFFECT_INDEX_0) && ai->CastSpell(RENEW, target)) ||
// (hp < 60 && ai->CastSpell(HEAL, target)) ||
// (hp < 30 && ai->CastSpell(FLASH_HEAL, target)) );
if (hp < 25 && FLASH_HEAL > 0 && ai->GetManaPercent() >= 20)
{
ai->TellMaster("I'm casting flash heal.");
ai->CastSpell(FLASH_HEAL, target);
}
else if (hp < 30 && GREAT_HEAL > 0 && ai->GetManaPercent() >= 36)
{
ai->TellMaster("I'm casting one of the sorted heal spells.");
ai->CastSpell(GREAT_HEAL, target);
}
else if (hp < 33 && BINDING_HEAL > 0 && ai->GetManaPercent() >= 27)
{
ai->TellMaster("I'm casting binding heal.");
ai->CastSpell(BINDING_HEAL, target);
}
else if (hp < 40 && PRAYER_OF_HEALING > 0 && ai->GetManaPercent() >= 54)
{
ai->TellMaster("I'm casting prayer of healing.");
ai->CastSpell(PRAYER_OF_HEALING, target);
}
else if (hp < 50 && CIRCLE_OF_HEALING > 0 && ai->GetManaPercent() >= 24)
{
ai->TellMaster("I'm casting circle of healing.");
ai->CastSpell(CIRCLE_OF_HEALING, target);
}
else if (hp < 60 && HEAL > 0 && ai->GetManaPercent() >= 36)
{
ai->TellMaster("I'm casting one of the sorted heal spells.");
ai->CastSpell(HEAL, target);
}
else if (hp < 80 && RENEW > 0 && ai->GetManaPercent() >= 19)
{
//ai->TellMaster("I'm casting renew.");
ai->CastSpell(RENEW, target);
}
} // end HealTarget
示例12: DoFirstCombatManeuver
bool PlayerbotRogueAI::DoFirstCombatManeuver(Unit *pTarget)
{
PlayerbotAI* ai = GetAI();
Player * m_bot = GetPlayerBot();
if (STEALTH > 0 && !m_bot->HasAura(STEALTH, EFFECT_INDEX_0) && ai->CastSpell(STEALTH, *m_bot))
{
if (ai->GetManager()->m_confDebugWhisper)
ai->TellMaster("First > Stealth (%d)", STEALTH);
m_bot->addUnitState(UNIT_STAT_CHASE); // ensure that the bot does not use MoveChase(), as this doesn't seem to work with STEALTH
return true;
}
else if (m_bot->HasAura(STEALTH, EFFECT_INDEX_0))
{
m_bot->GetMotionMaster()->MoveFollow(pTarget, 4.5f, m_bot->GetOrientation());
return false;
}
return false;
}
示例13: DoNonCombatActions
void PlayerbotDruidAI::DoNonCombatActions()
{
Player* m_bot = GetPlayerBot();
Player* master = GetMaster();
if (!m_bot || !master)
return;
PlayerbotAI* ai = GetAI();
// 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() < 30)
{
ai->TellMaster("I could use a drink.");
ai->UseItem(pItem);
return;
}
else if (!pItem && INNERVATE > 0 && !m_bot->HasAura(INNERVATE) && ai->GetManaPercent() <= 20 && ai->CastSpell(INNERVATE, *m_bot))
return;
// 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);
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;
}
// buff and heal master's group
if (master->GetGroup())
{
// Buff master with group buff
if (!master->IsInDuel(master))
if (master->isAlive() && GIFT_OF_THE_WILD && ai->HasSpellReagents(GIFT_OF_THE_WILD) && ai->Buff(GIFT_OF_THE_WILD, 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;
if (tPlayer->IsInDuelWith(master))
continue;
// Resurrect member if needed
if (!tPlayer->isAlive())
{
if (ai->CastSpell(REVIVE, *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->IsInDuel(master))
return;
if (master->isAlive())
{
if (BuffPlayer(master))
return;
if (HealTarget(master))
return;
}
else
if (ai->CastSpell(REVIVE, *master))
//.........这里部分代码省略.........
示例14: _DoNextPVECombatManeuverMeleeDPS
void PlayerbotDruidAI::_DoNextPVECombatManeuverMeleeDPS(Unit* pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return;
// True, bear form is set up for tanking but even then it's better DPS for levels 10-19 than humanoid form
if (CAT_FORM == 0 && BEAR_FORM > 0)
// but only go there if you can get into bear form. else stay here.
if (ai->CastSpell(BEAR_FORM))
return _DoNextPVECombatManeuverBear(pTarget);
//uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth();
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
if (!m_bot->HasInArc(M_PI_F, pTarget))
{
m_bot->SetFacingTo(m_bot->GetAngle(pTarget));
if (pVictim)
pVictim->Attack(pTarget, true);
}
if (CAT_FORM > 0 && !m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
if (!ai->CastSpell(CAT_FORM))
{
if (ai->GetManaPercent() < 30) // TODO: tweak this value. Pretty sure bear form mana Req is way less than 30% of base mana, let alone total mana
return; // conserve mana
else
_DoNextPVECombatManeuverSpellDPS(pTarget);
}
// Commented out: Above should take care of it
//// Technically bear form is better than no form for melee druids levels 10-19.
//if (m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
//{
// m_bot->RemoveAurasDueToSpell(BEAR_FORM_1);
// //ai->TellMaster("FormClearBear");
// return;
//}
//if (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
//{
// m_bot->RemoveAurasDueToSpell(DIRE_BEAR_FORM_1);
// //ai->TellMaster("FormClearDireBear");
// return;
//}
//if (m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
//{
// m_bot->RemoveAurasDueToSpell(MOONKIN_FORM_1);
// //ai->TellMaster("FormClearMoonkin");
// return;
//}
//if (COWER > 0 && m_bot->GetComboPoints() == 1 && ai->GetEnergyAmount() >= 20) // && HasAnyAggroWhereSecondAggroIsNotHealer()
//{
// ai->CastSpell(COWER);
// //ai->TellMaster("Cower");
//}
if (MAIM > 0 && m_bot->GetComboPoints() >= 1 && pTarget->IsNonMeleeSpellCasted(true))
{
ai->CastSpell(MAIM, *pTarget);
//ai->TellMaster("SpellPreventing Maim");
return;
}
if (RAKE > 0 && m_bot->GetComboPoints() < 1 && ai->GetEnergyAmount() >= 40) // should be replaced by a check for the bleed effect it causes (along with Combo != 5)
{
ai->CastSpell(RAKE, *pTarget);
//ai->TellMaster("Rake");
return;
}
if (MANGLE > 0 && m_bot->GetComboPoints() == 1 && ai->GetEnergyAmount() >= 45)
{
ai->CastSpell(MANGLE, *pTarget);
//ai->TellMaster("Mangle");
return;
}
if (CLAW > 0 && m_bot->GetComboPoints() < 5 && ai->GetEnergyAmount() >= 45)
{
ai->CastSpell(CLAW, *pTarget);
//ai->TellMaster("Claw");
return;
}
if (m_bot->GetComboPoints() == 5)
{
if (RIP > 0 && pTarget->getClass() == CLASS_ROGUE && ai->GetEnergyAmount() >= 30)
ai->CastSpell(RIP, *pTarget);
else if (FEROCIOUS_BITE > 0 && ai->GetEnergyAmount() >= 35 &&
(pTarget->getClass() == CLASS_HUNTER || pTarget->getClass() == CLASS_WARRIOR ||
pTarget->getClass() == CLASS_PALADIN || pTarget->getClass() == CLASS_DEATH_KNIGHT))
ai->CastSpell(FEROCIOUS_BITE, *pTarget);
else if (ai->GetEnergyAmount() >= 35)
{
//ai->TellMaster("Else Maim, Ferocious Bite or Rip.");
// MAIM must be first check, best option against other classes
if (MAIM > 0)
ai->CastSpell(MAIM, *pTarget);
else if (FEROCIOUS_BITE > 0)
//.........这里部分代码省略.........
示例15: _DoNextPVECombatManeuverSpellDPS
void PlayerbotDruidAI::_DoNextPVECombatManeuverSpellDPS(Unit* pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return;
//uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth();
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
if (MOONKIN_FORM > 0 && !m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
ai->CastSpell (MOONKIN_FORM);
// NOTE: Tree of Life is beneficial to armor and Wrath - leave on if not in Moonkin (not talented or OutOfMana)
if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(CAT_FORM_1);
//ai->TellMaster("FormClearCat");
return;
}
if (m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(BEAR_FORM_1);
//ai->TellMaster("FormClearBear");
return;
}
if (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(DIRE_BEAR_FORM_1);
//ai->TellMaster("FormClearDireBear");
return;
}
if (FAERIE_FIRE > 0 && DruidSpellCombat < 1 && !pTarget->HasAura(FAERIE_FIRE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 8)
{
ai->CastSpell(FAERIE_FIRE, *pTarget);
return;
}
DruidSpellCombat++;
if (MOONFIRE > 0 && DruidSpellCombat < 2 && !pTarget->HasAura(MOONFIRE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 24)
{
ai->CastSpell(MOONFIRE, *pTarget);
return;
}
DruidSpellCombat++;
if (ROOTS > 0 && DruidSpellCombat < 3 && !pTarget->HasAura(ROOTS, EFFECT_INDEX_0) && ai->GetManaPercent() >= 8)
{
ai->CastSpell(ROOTS, *pTarget);
return;
}
DruidSpellCombat++;
if (HURRICANE > 0 && ai->GetAttackerCount() >= 5 && DruidSpellCombat < 4 && ai->GetManaPercent() >= 91)
{
ai->CastSpell(HURRICANE, *pTarget);
ai->SetIgnoreUpdateTime(10);
return;
}
DruidSpellCombat++;
if (WRATH > 0 && DruidSpellCombat < 5 && ai->GetManaPercent() >= 13)
{
ai->CastSpell(WRATH, *pTarget);
return;
}
DruidSpellCombat++;
if (INSECT_SWARM > 0 && DruidSpellCombat < 6 && !pTarget->HasAura(INSECT_SWARM, EFFECT_INDEX_0) && ai->GetManaPercent() >= 9)
{
ai->CastSpell(INSECT_SWARM, *pTarget);
return;
}
DruidSpellCombat++;
if (STARFIRE > 0 && DruidSpellCombat < 7 && ai->GetManaPercent() >= 18)
{
ai->CastSpell(STARFIRE, *pTarget);
return;
}
DruidSpellCombat++;
if (FORCE_OF_NATURE > 0 && DruidSpellCombat < 8 && ai->GetManaPercent() >= 12)
{
ai->CastSpell(FORCE_OF_NATURE);
return;
}
DruidSpellCombat++;
if (STARFALL > 0 && !m_bot->HasAura(STARFALL, EFFECT_INDEX_0) && ai->GetAttackerCount() >= 3 && DruidSpellCombat < 9 && ai->GetManaPercent() >= 39)
{
ai->CastSpell(STARFALL, *pTarget);
return;
}
DruidSpellCombat++;
if (BARKSKIN > 0 && pVictim == m_bot && ai->GetHealthPercent() < 75 && DruidSpellCombat < 10 && !m_bot->HasAura(BARKSKIN, EFFECT_INDEX_0))
{
//.........这里部分代码省略.........