本文整理汇总了C++中PlayerbotAI::GetEnergyAmount方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerbotAI::GetEnergyAmount方法的具体用法?C++ PlayerbotAI::GetEnergyAmount怎么用?C++ PlayerbotAI::GetEnergyAmount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerbotAI
的用法示例。
在下文中一共展示了PlayerbotAI::GetEnergyAmount方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoNextCombatManeuver
void PlayerbotRogueAI::DoNextCombatManeuver(Unit *pTarget)
{
if (!pTarget)
return;
PlayerbotAI* ai = GetAI();
if (!ai)
return;
switch (ai->GetScenarioType())
{
case PlayerbotAI::SCENARIO_DUEL:
{
if (SINISTER_STRIKE > 0)
ai->CastSpell(SINISTER_STRIKE);
return;
}
default:
break;
}
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
float fTargetDist = m_bot->GetCombatDistance(pTarget);
// TODO: make this work better...
/*if (pVictim)
{
if( pVictim!=m_bot && !m_bot->hasUnitState(UNIT_STAT_FOLLOW) && !pTarget->isInBackInMap(m_bot,10) ) {
GetAI()->TellMaster( "getting behind target" );
m_bot->GetMotionMaster()->Clear( true );
m_bot->GetMotionMaster()->MoveFollow( pTarget, 1, 2*M_PI );
}
else if( pVictim==m_bot && m_bot->hasUnitState(UNIT_STAT_FOLLOW) )
{
GetAI()->TellMaster( "chasing attacking target" );
m_bot->GetMotionMaster()->Clear( true );
m_bot->GetMotionMaster()->MoveChase( pTarget );
}
}*/
//Rouge like behaviour. ^^
/* if (VANISH > 0 && GetMaster()->isDead()) { //Causes the server to crash :( removed for now.
m_bot->AttackStop();
m_bot->RemoveAllAttackers();
ai->CastSpell(VANISH);
// m_bot->RemoveAllSpellCooldown();
GetAI()->TellMaster("AttackStop, CombatStop, Vanish");
}*/
// decide what to do:
if (pVictim == m_bot && CLOAK_OF_SHADOWS > 0 && pVictim->HasAura(SPELL_AURA_PERIODIC_DAMAGE) && !m_bot->HasAura(CLOAK_OF_SHADOWS, EFFECT_INDEX_0) && ai->CastSpell(CLOAK_OF_SHADOWS))
{
if (ai->GetManager()->m_confDebugWhisper)
ai->TellMaster("CoS!");
return;
}
else if (m_bot->HasAura(STEALTH, EFFECT_INDEX_0))
SpellSequence = RogueStealth;
else if (pTarget->IsNonMeleeSpellCasted(true))
SpellSequence = RogueSpellPreventing;
else if (pVictim == m_bot && ai->GetHealthPercent() < 40)
SpellSequence = RogueThreat;
else
SpellSequence = RogueCombat;
// we fight in melee, target is not in range, skip the next part!
if (fTargetDist > ATTACK_DISTANCE)
return;
std::ostringstream out;
switch (SpellSequence)
{
case RogueStealth:
out << "Case Stealth";
if (PICK_POCKET > 0 && (pTarget->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) != 0 &&
!((Creature*)pTarget)->lootForPickPocketed && ai->CastSpell(PICK_POCKET, *pTarget))
out << " > Pick Pocket";
else if (PREMEDITATION > 0 && ai->CastSpell(PREMEDITATION, *pTarget))
out << " > Premeditation";
else if (AMBUSH > 0 && ai->GetEnergyAmount() >= 60 && ai->CastSpell(AMBUSH, *pTarget))
out << " > Ambush";
else if (CHEAP_SHOT > 0 && !pTarget->HasAura(CHEAP_SHOT, EFFECT_INDEX_0) && ai->GetEnergyAmount() >= 60 && ai->CastSpell(CHEAP_SHOT, *pTarget))
out << " > Cheap Shot";
else if (GARROTE > 0 && ai->GetEnergyAmount() >= 50 && ai->CastSpell(GARROTE, *pTarget))
out << " > Garrote";
else
m_bot->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
break;
case RogueThreat:
out << "Case Threat";
if (GOUGE > 0 && ai->GetEnergyAmount() >= 45 && !pTarget->HasAura(GOUGE, EFFECT_INDEX_0) && ai->CastSpell(GOUGE, *pTarget))
out << " > Gouge";
else if (EVASION > 0 && ai->GetHealthPercent() <= 35 && !m_bot->HasAura(EVASION, EFFECT_INDEX_0) && ai->CastSpell(EVASION))
out << " > Evasion";
else if (BLIND > 0 && ai->GetHealthPercent() <= 30 && !pTarget->HasAura(BLIND, EFFECT_INDEX_0) && ai->GetEnergyAmount() >= 30 && ai->CastSpell(BLIND, *pTarget))
out << " > Blind";
else if (FEINT > 0 && ai->GetHealthPercent() <= 25 && ai->GetEnergyAmount() >= 20 && ai->CastSpell(FEINT))
out << " > Feint";
else if (VANISH > 0 && ai->GetHealthPercent() <= 20 && !m_bot->HasAura(FEINT, EFFECT_INDEX_0) && ai->CastSpell(VANISH))
//.........这里部分代码省略.........
示例2: _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)
//.........这里部分代码省略.........
示例3: DoNextCombatManeuver
//.........这里部分代码省略.........
break;
}
break;
case DruidCombat:
//ai->TellMaster("DruidCombat");
if (!m_bot->HasInArc(M_PI_F, pTarget))
{
m_bot->SetFacingTo(m_bot->GetAngle(pTarget));
if (pVictim)
pVictim->Attack(pTarget, true);
}
if (m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(5487);
//ai->TellMaster("FormClearBear");
break;
}
if (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(9634);
//ai->TellMaster("FormClearDireBear");
break;
}
if (m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(24858);
//ai->TellMaster("FormClearMoonkin");
break;
}
if (CAT_FORM > 0 && !m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
ai->CastSpell (CAT_FORM);
/*
if (COWER > 0 && m_bot->GetComboPoints() == 1 && ai->GetEnergyAmount() >= 20)
{
ai->CastSpell(COWER);
//ai->TellMaster("Cower");
}*/
if (MAIM > 0 && m_bot->GetComboPoints() >= 1 && pTarget->IsNonMeleeSpellCasted(true))
{
ai->CastSpell(MAIM, *pTarget);
//ai->TellMaster("SpellPreventing Maim");
break;
}
if (RAKE > 0 && m_bot->GetComboPoints() <= 1 && ai->GetEnergyAmount() >= 40)
{
ai->CastSpell (RAKE, *pTarget);
//ai->TellMaster("Rake");
break;
}
else if (CLAW > 0 && m_bot->GetComboPoints() <= 2 && ai->GetEnergyAmount() >= 45)
{
ai->CastSpell (CLAW, *pTarget);
//ai->TellMaster("Claw");
break;
}
else if (MANGLE > 0 && m_bot->GetComboPoints() <= 3 && ai->GetEnergyAmount() >= 45)
{
ai->CastSpell (MANGLE, *pTarget);
//ai->TellMaster("Mangle");
break;
}
else if (CLAW > 0 && m_bot->GetComboPoints() <= 4 && ai->GetEnergyAmount() >= 45)
{
ai->CastSpell (CLAW, *pTarget);
示例4: DoNextCombatManeuver
//.........这里部分代码省略.........
// Common Dps and protection routine
if (ai->GetHealthPercent() <= 70 && CastSpell(BARKSKIN,m_bot)) { return; }
if (isUnderAttack() && CastSpell(NATURES_GRASP,m_bot)) { return; }
if (ai->GetForm() == FORM_CAT)
{
// If at threat limit, use Cower to reduce threat
if (pThreat > threatThreshold && m_tank->GetGUID() != m_bot->GetGUID() && !isUnderAttack())
{
if (m_tank->getVictim() && m_tank->getVictim()->GetGUID() != pTarget->GetGUID()) // I am attacking wrong target!!
{
m_bot->SetSelection(m_tank->getVictim()->GetGUID());
return;
}
else
{
if (CastSpell(COWER,pTarget)) { return; } //Lets see if we can manage
else { return; } //use no spells and wait threat to be reduced
}
}
if (CastSpell(FERAL_CHARGE_CAT,pTarget)) { return; }
if (m_bot->GetComboPoints() >= 1 && pTarget->IsNonMeleeSpellCasted(true) && CastSpell(MAIM, pTarget)) { return; }
if (CastSpell(BERSERK, m_bot)) { return; }
if (ai->GetHealthPercent() <= 75 && CastSpell(SURVIVAL_INSTINCTS, m_bot)) { return; }
if (isUnderAttack() && CastSpell(NATURES_GRASP, m_bot)) { return; }
if (CastSpell(FAERIE_FIRE_FERAL, pTarget)) { return; }
if (m_bot->GetComboPoints() < 5)
{
if (CastSpell(RAKE, pTarget)) { return; }
if (CastSpell(MANGLE_CAT, pTarget)) { return; }
if (!pTarget->HasInArc(M_PI,m_bot) && CastSpell(SHRED, pTarget)) { return; }
if (ai->GetEnergyAmount() > 65 && CastSpell(MANGLE_CAT, pTarget)) { return; } //Spam mangle if cannot cast shred
if (ai->GetEnergyAmount() > 65 && CastSpell(CLAW, pTarget) ) { return; } //Spam Claw if there is no mangle
// if (CanCast(COWER, pTarget) && CastSpell(COWER, pTarget)) { return; } //if still nothing, use COWER to reduce threat
}
else
{
if (CastSpell(SAVAGE_ROAR)) { return; }
if (CastSpell(RIP, pTarget)) { return; }
if (ai->GetEnergyAmount() >= 65 && CastSpell(FEROCIOUS_BITE, pTarget)) { return; } //maxhit for feracious bite
}
if (CastSpell(TIGERS_FURY, m_bot)) { return; } //if nothing is ready yet, use tigers fury
}
else if (ai->GetForm() == FORM_DIREBEAR || ai->GetForm() == FORM_BEAR)
{
// If at threat limit, stop
if (pThreat > threatThreshold && m_tank->GetGUID() != m_bot->GetGUID() && !isUnderAttack() )
{
//Change to tank's target
if (m_tank->getVictim() && m_tank->getVictim()->GetGUID() != pTarget->GetGUID()) { m_bot->SetSelection(m_tank->getVictim()->GetGUID()); }
return; //use no spells and wait threat to be reduced
}
if (CastSpell(FERAL_CHARGE_BEAR,pTarget)) { return; }
if (CastSpell(BASH, pTarget,true,true)) { return; } //Need check for immunity
if (CastSpell(BERSERK, m_bot)) { return; }
if (CastSpell(DEMORALIZING_ROAR, pTarget)) { return; }
if (ai->GetHealthPercent() > 90 && ai->GetRageAmount() < 50 && CastSpell(ENRAGE, m_bot)) { return; }
if (ai->GetHealthPercent() <= 75 && CastSpell(SURVIVAL_INSTINCTS, m_bot)) { return; }
if ( ( ai->GetHealthPercent() <= 30 || (ai->GetHealthPercent() < 85 && m_tank->GetGUID() != m_bot->GetGUID()) )
&& CastSpell(FRENZIED_REGENERATION)) { return; }
if (CastSpell(FAERIE_FIRE_FERAL, pTarget)) { return; }
if (CastSpell(MANGLE_BEAR, pTarget)) { return; }
if ((ai->GetRageAmount() > 70 || m_tank->GetGUID() == m_bot->GetGUID()) && CastSpell(SWIPE_BEAR, pTarget)) { return; }
if (ai->GetRageAmount() > 50 && CastSpell(MAUL, pTarget)) {} // Low Priority, Next Attack effect
示例5: DoNextCombatManeuver
//.........这里部分代码省略.........
!m_bot->isInCombat() && CastSpell(STEALTH))
{ return; }
TakePosition(pTarget);
// If there's a cast stop
if (m_bot->hasUnitState(UNIT_STAT_CASTING)) { return; }
// wait until we actually reach our target b4 we actually do anything
/*if (GetPlayerBot()->GetDistance(pTarget)>10.0 &&
!HasAuraName(GetPlayerBot(),STEALTH) &&
!GetPlayerBot()->isInCombat() && CastSpell(STEALTH))
{ return; }*/
//Buff
if (CastSpell(PREMEDITATION,m_bot)) { return; }
if (CastSpell(COLD_BLOOD,m_bot)) { } //no gcd
//PROTECT UP
if (m_tank->GetGUID() != m_bot->GetGUID() && pVictim && pVictim->GetGUID() == m_bot->GetGUID() )
{
if (CastSpell(TRICKS_OF_THE_TRADE,m_tank)) { return; }
if (CastSpell(FEINT,m_bot)) { return; }
if (CastSpell(VANISH,m_bot)) { return; }
}
if (isUnderAttack() && pDist <= MELEE_RANGE && ai->GetHealthPercent() <= 85 && CastSpell(EVASION, m_bot)) { } //no GCD
if (ai->GetHealthPercent() <= 55 && CastSpell(CLOAK_OF_SHADOWS, m_bot)) { return; }
if (isUnderAttack() && ai->GetHealthPercent() <= 65 && CastSpell(GOUGE, m_bot)) { return; }
if (isUnderAttack() && ai->GetHealthPercent() <= 45 && CastSpell(BLIND, m_bot)) { return; }
if (m_bot->getRace() == (uint8) RACE_DWARF && ai->GetHealthPercent() < 75 && CastSpell(R_STONEFORM,m_bot)) { } //no gcd
//Break spells
if (m_bot->getRace() == (uint8) RACE_BLOODELF && pDist < 8 && (pTarget->IsNonMeleeSpellCasted(true) || ai->GetManaPercent() < 40) && CastSpell(R_ARCANE_TORRENT, pTarget)) { } //no gcd
else if (pTarget->IsNonMeleeSpellCasted(true) && CastSpell(KICK, pTarget)) { return; }
else if (pTarget->IsNonMeleeSpellCasted(true) && CastSpell(GOUGE, pTarget)) { return; }
else if (pTarget->IsNonMeleeSpellCasted(true) && m_bot->GetComboPoints() >= 1 && CastSpell(KIDNEY_SHOT, pTarget)) { return; }
//Transfer threat
if (m_tank->GetGUID() != m_bot->GetGUID() && CastSpell(TRICKS_OF_THE_TRADE,m_tank)) { return; }
if (m_bot->getRace() == (uint8) RACE_TROLL && CastSpell(R_BERSERKING,m_bot)) {} //no GCD
if (m_bot->getRace() == (uint8) RACE_ORC && CastSpell(R_BLOOD_FURY,m_bot)) {} //no GCD
// sometimes we lose attack
if (!m_bot->isInCombat()) {
m_bot->Attack(pTarget, true);
}
if(TALENT_ASSASSINATION)
{
if (!m_bot->HasAura(HUNGER_FOR_BLOOD) && CastSpell(HUNGER_FOR_BLOOD,m_bot)) { return; }
if (m_bot->GetComboPoints() < 5)
{
if (CastSpell(MUTILATE, pTarget)) { return; }
}
else
{
if (!pTarget->HasAura(RUPTURE) && CastSpell(RUPTURE)) { return; }
}
}
if(TALENT_COMBAT)
{
if (CastSpell(BLADE_FLURRY,m_bot)) { return; }
if (ai->GetEnergyAmount() < 20 && CastSpell(ADRENALINE_RUSH,m_bot)) { return; }
if (!CastSpell(ADRENALINE_RUSH) && CastSpell(KILLING_SPREE,m_bot,1,0,1)) { return; }
if (m_bot->GetComboPoints() > 5)
{
if (!pTarget->HasAura(RUPTURE) && CastSpell(RUPTURE)) { return; }
}
}
if(TALENT_SUBTELTY)
{
if (CastSpell(PREMEDITATION,m_bot)) {}
if (CastSpell(SHADOW_DANCE,m_bot)) {}
if (!CastSpell(SHADOW_DANCE,m_bot) && CastSpell(PREPARATION,m_bot)) { return; }
if (m_bot->GetComboPoints() < 5)
{
if (m_bot->HasAura(SHADOW_DANCE) && !pTarget->HasInArc(M_PI,m_bot)) { if (CastSpell(AMBUSH, pTarget)) { return; } }
if (CastSpell(GHOSTLY_STRIKE, pTarget)) { return; }
}
else
{
if (!pTarget->HasAura(RUPTURE) && CastSpell(RUPTURE)) { return; }
if (!m_bot->HasAura(SLICE_AND_DICE) && CastSpell(SLICE_AND_DICE)) { return; }
if (CastSpell(SHADOWSTEP,pTarget)) { }
}
}
// defaults if not high enough do specialized attacks
if (m_bot->GetComboPoints() < 5) {
if (!pTarget->HasInArc(M_PI,m_bot)) { if (CastSpell(BACKSTAB, pTarget)) { return; } }
if (!MUTILATE &&CastSpell(SINISTER_STRIKE,pTarget)) { return; } // Dont cast if we have mutilate, save energy for it
} else {
if (!m_bot->HasAura(SLICE_AND_DICE) && CastSpell(SLICE_AND_DICE)) { return; }
if (CastSpell(ENVENOM,pTarget)) { return; }
if (CastSpell(EVISCERATE,pTarget)) { return; }
}
} //end DoNextCombatManeuver
示例6: DoNextCombatManeuver
//.........这里部分代码省略.........
{
DruidSpellCombat = 0;
break;
}
break;
case DruidCombat:
if (!m_bot->HasInArc(M_PI_F, pTarget))
{
m_bot->SetInFront(pTarget);
}
if (m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(5487);
break;
}
if (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(9634);
break;
}
if (m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
{
m_bot->RemoveAurasDueToSpell(24858);
break;
}
if (CAT_FORM > 0 && !m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
ai->CastSpell (CAT_FORM);
/*
if (COWER > 0 && m_bot->GetComboPoints() == 1 && ai->GetEnergyAmount() >= 20)
{
ai->CastSpell(COWER);
}*/
if (MAIM > 0 && m_bot->GetComboPoints() >= 1 && pTarget->IsNonMeleeSpellCasted(true))
{
ai->CastSpell(MAIM, pTarget);
break;
}
if (RAKE > 0 && m_bot->GetComboPoints() <= 1 && ai->GetEnergyAmount() >= 40)
{
ai->CastSpell (RAKE, pTarget);
break;
}
else if (CLAW > 0 && m_bot->GetComboPoints() <= 2 && ai->GetEnergyAmount() >= 45)
{
ai->CastSpell (CLAW, pTarget);
break;
}
else if (MANGLE > 0 && m_bot->GetComboPoints() <= 3 && ai->GetEnergyAmount() >= 45)
{
ai->CastSpell (MANGLE, pTarget);
break;
}
else if (CLAW > 0 && m_bot->GetComboPoints() <= 4 && ai->GetEnergyAmount() >= 45)
{
ai->CastSpell (CLAW, pTarget);
示例7: DoNextCombatManeuver
//.........这里部分代码省略.........
}
}
#pragma endregion
// wait until we actually reach our target b4 we actually do anything
/*if (m_bot->GetDistance(pTarget)>10.0 &&
!m_bot->HasAura(STEALTH) &&
!m_bot->isInCombat() && CastSpell(STEALTH))
{ return; }*/
TakePosition(pTarget);
// If there's a cast stop
if (m_bot->hasUnitState(UNIT_STAT_CASTING)) { return; }
// wait until we actually reach our target b4 we actually do anything
if (GetPlayerBot()->GetDistance(pTarget)>10.0 &&
!HasAuraName(GetPlayerBot(),STEALTH) &&
!GetPlayerBot()->isInCombat() && CastSpell(STEALTH))
{ return; }
//Buff
if (CastSpell(PREMEDITATION,m_bot)) { return; }
//PROTECT UP
if (m_tank->GetGUID() != m_bot->GetGUID() && pVictim && pVictim->GetGUID() == m_bot->GetGUID() )
{
if (CastSpell(FEINT,m_bot)) { return; }
if (CastSpell(TRICKS_OF_THE_TRADE,m_tank)) { return; }
if (CastSpell(VANISH,m_bot)) { return; }
}
if (isUnderAttack() && pDist <= MELEE_RANGE && ai->GetHealthPercent() <= 85 && CastSpell(EVASION, m_bot)) { } //no GCD
if (ai->GetHealthPercent() <= 55 && CastSpell(CLOAK_OF_SHADOWS, m_bot)) { return; }
if (isUnderAttack() && ai->GetHealthPercent() <= 65 && CastSpell(GOUGE, m_bot)) { return; }
if (isUnderAttack() && ai->GetHealthPercent() <= 45 && CastSpell(BLIND, m_bot)) { return; }
if (m_bot->getRace() == (uint8) RACE_DWARF && ai->GetHealthPercent() < 75 && CastSpell(R_STONEFORM,m_bot)) { } //no gcd
if (m_bot->getRace() == (uint8) RACE_DRAENEI && ai->GetHealthPercent() < 55 && CastSpell(R_GIFT_OF_NAARU,m_bot)) { return; } //no Gcd, but has cast
if (m_bot->getRace() == (uint8) RACE_TAUREN && pDist < 8 && CastSpell(R_WAR_STOMP, pTarget)) { return; } //no gcd but is cast
//Break spells
if (m_bot->getRace() == (uint8) RACE_BLOODELF && pDist < 8 && (pTarget->IsNonMeleeSpellCasted(true) || ai->GetManaPercent() < 40) && CastSpell(R_ARCANE_TORRENT, pTarget)) { } //no gcd
else if (pTarget->IsNonMeleeSpellCasted(true) && CastSpell(KICK, pTarget)) { return; }
else if (pTarget->IsNonMeleeSpellCasted(true) && CastSpell(GOUGE, pTarget)) { return; }
else if (pTarget->IsNonMeleeSpellCasted(true) && m_bot->GetComboPoints() >= 1 && CastSpell(KIDNEY_SHOT, pTarget)) { return; }
// If at threat limit, try to reduce threat
if (pThreat > threatThreshold && m_tank->GetGUID() != m_bot->GetGUID() && !isUnderAttack())
{
if (m_tank->getVictim() && m_tank->getVictim()->GetGUID() != pTarget->GetGUID()) // I am attacking wrong target!!
{
m_bot->SetSelection(m_tank->getVictim()->GetGUID());
return;
}
else
{
if (CastSpell(FEINT,m_bot)) { return; } //Lets see if we can manage
else if (CastSpell(TRICKS_OF_THE_TRADE,m_tank)) { return; }
else { return; } //use no spells and wait threat to be reduced
}
}
//Transfer threat
if (m_tank->GetGUID() != m_bot->GetGUID() && CastSpell(TRICKS_OF_THE_TRADE,m_tank)) { return; }
//Urgent DPS
if ((m_bot->HasAura(STEALTH) || m_bot->HasAura(VANISH))&& CastSpell(CHEAP_SHOT,pTarget)) { return; }
//DPS UP
if (m_bot->getRace() == (uint8) RACE_TROLL && CastSpell(R_BERSERKING,m_bot)) {} //no GCD
if (m_bot->getRace() == (uint8) RACE_ORC && CastSpell(R_BLOOD_FURY,m_bot)) {} //no GCD
if (CastSpell(COLD_BLOOD,m_bot)) { } //no gcd
if (CastSpell(HUNGER_FOR_BLOOD,m_bot)) { return; }
if (CastSpell(BLADE_FLURRY,m_bot)) { return; }
if (ai->GetEnergyAmount() < 20 && CastSpell(ADRENALINE_RUSH,m_bot)) { return; }
if (CastSpell(SHADOW_DANCE,m_bot)) { return; }
if (CastSpell(DISMANTLE,pTarget)) { return; }
if (CastSpell(PREPARATION,m_bot)) { return; }
if (m_bot->GetComboPoints() < 5)
{
if (CastSpell(RIPOSTE,pTarget)) { return; }
if (CastSpell(KILLING_SPREE,m_bot,1,0,1)) { return; } // KILLING SPREE works great on 1 mob
if (isUnderAttack(m_tank,3) && CastSpell(FAN_OF_KNIVES,pTarget)) { return; }
if (BACKSTAB && !pTarget->HasInArc(M_PI,m_bot)) { if (CastSpell(BACKSTAB, pTarget)) { return; } }
else if (CastSpell(MUTILATE, pTarget)) { return; }
if (CastSpell(SINISTER_STRIKE,pTarget)) { return; }
if (CastSpell(HEMORRHAGE,pTarget)) { return; }
if (CastSpell(GHOSTLY_STRIKE,pTarget)) { return; }
}
else
{
if (ai->GetHealthPercent(*pTarget) > 30 && !m_bot->HasAura(SLICE_AND_DICE) && CastSpell(SLICE_AND_DICE)) { return; }
if (ai->GetHealthPercent(*pTarget) < 20 && CastSpell(EVISCERATE)) { return; }
if (!pTarget->HasAura(RUPTURE) && CastSpell(RUPTURE)) { return; }
if (CastSpell(EVISCERATE)) { return; } // default if all else fails
}
} //end DoNextCombatManeuver
示例8: DoNextCombatManeuver
//.........这里部分代码省略.........
return true;
DruidSpellCombat = 0;
break;
case DruidCombat:
m_bot->SetInFront(pTarget);
if (pVictim)
pVictim->Attack(pTarget, true);
if (m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
m_bot->RemoveAurasDueToSpell(5487);
if (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
m_bot->RemoveAurasDueToSpell(9634);
if (m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
m_bot->RemoveAurasDueToSpell(24858);
if ((CAT_FORM > 0)
&& (!m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
&& (ai->CastSpell(CAT_FORM)))
return true;
if ((MAIM > 0)
&& (m_bot->GetComboPoints() >= 1)
&& (pTarget->IsNonMeleeSpellCasted(true))
&& (ai->CastSpell(MAIM, *pTarget)))
return true;
if ((RAKE > 0)
&& (m_bot->GetComboPoints() <= 1)
&& (ai->GetEnergyAmount() >= 40)
&& (ai->CastSpell(RAKE, *pTarget)))
return true;
if ((CLAW > 0)
&& (m_bot->GetComboPoints() <= 2)
&& (ai->GetEnergyAmount() >= 45)
&& (ai->CastSpell(CLAW, *pTarget)))
return true;
if ((MANGLE > 0)
&& (m_bot->GetComboPoints() <= 3)
&& (ai->GetEnergyAmount() >= 45)
&& (ai->CastSpell(MANGLE, *pTarget)))
return true;
if ((CLAW > 0)
&& (m_bot->GetComboPoints() <= 4)
&& (ai->GetEnergyAmount() >= 45)
&& (ai->CastSpell(CLAW, *pTarget)))
return true;
if (m_bot->GetComboPoints() == 5)
{
if ((RIP > 0)
&& (pTarget->getClass() == CLASS_ROGUE)
&& (ai->GetEnergyAmount() >= 30)
&& (ai->CastSpell(RIP, *pTarget)))
return true;
if ((MAIM > 0)
&& (pTarget->getClass() == CLASS_DRUID)
&& (ai->GetEnergyAmount() >= 35)