本文整理汇总了C++中PlayerbotAI::GetRageAmount方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerbotAI::GetRageAmount方法的具体用法?C++ PlayerbotAI::GetRageAmount怎么用?C++ PlayerbotAI::GetRageAmount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerbotAI
的用法示例。
在下文中一共展示了PlayerbotAI::GetRageAmount方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoNonCombatActions
void PlayerbotWarriorAI::DoNonCombatActions()
{
PlayerbotAI *ai = GetAI();
Player * m_bot = GetPlayerBot();
if (!m_bot)
return;
// TODO (by Runsttren): check if shout aura bot has is casted by this bot,
// otherwise cast other useful shout
// If the bot is protect talented, she/he needs stamina not attack power.
// With stance change can the shout change to.
// Inserted line to battle shout m_bot->HasAura( COMMANDING_SHOUT, EFFECT_INDEX_0)
// Natsukawa
if (((COMMANDING_SHOUT > 0 && !m_bot->HasAura(COMMANDING_SHOUT, EFFECT_INDEX_0)) ||
(BATTLE_SHOUT > 0 && !m_bot->HasAura(BATTLE_SHOUT, EFFECT_INDEX_0))) &&
ai->GetRageAmount() < 10 && BLOODRAGE > 0 && !m_bot->HasAura(BLOODRAGE, EFFECT_INDEX_0))
// we do have a useful shout, no rage coming but can cast bloodrage... do it
ai->CastSpell(BLOODRAGE, *m_bot);
else if (COMMANDING_SHOUT > 0 && !m_bot->HasAura(COMMANDING_SHOUT, EFFECT_INDEX_0))
// use commanding shout now
ai->CastSpell(COMMANDING_SHOUT, *m_bot);
else if (BATTLE_SHOUT > 0 && !m_bot->HasAura(BATTLE_SHOUT, EFFECT_INDEX_0) && !m_bot->HasAura(COMMANDING_SHOUT, EFFECT_INDEX_0))
// use battle shout
ai->CastSpell(BATTLE_SHOUT, *m_bot);
// buff master with VIGILANCE
if (VIGILANCE > 0)
(!GetMaster()->HasAura(VIGILANCE, EFFECT_INDEX_0) && ai->CastSpell(VIGILANCE, *GetMaster()));
// hp check
if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
m_bot->SetStandState(UNIT_STAND_STATE_STAND);
Item* pItem = ai->FindFood();
Item* fItem = ai->FindBandage();
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;
}
else if (pItem == NULL && fItem == NULL && m_bot->getRace() == RACE_DRAENEI && !m_bot->HasAura(GIFT_OF_THE_NAARU, EFFECT_INDEX_0) && ai->GetHealthPercent() < 70)
{
ai->TellMaster("I'm casting gift of the naaru.");
ai->CastSpell(GIFT_OF_THE_NAARU, *m_bot);
return;
}
} // end DoNonCombatActions
示例2: _DoNextPVECombatManeuverBear
void PlayerbotDruidAI::_DoNextPVECombatManeuverBear(Unit* pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return;
//uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth();
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
// Face your enemy!
if (!m_bot->HasInArc(M_PI_F, pTarget))
{
m_bot->SetFacingTo(m_bot->GetAngle(pTarget));
if (pVictim)
pVictim->Attack(pTarget, true);
}
// Try and go into [dire] bear form first
if (DIRE_BEAR_FORM > 0 && !m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
ai->CastSpell(DIRE_BEAR_FORM);
else if (BEAR_FORM > 0 && DIRE_BEAR_FORM == 0 && !m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) && !m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
ai->CastSpell(BEAR_FORM);
else if (DEMORALIZING_ROAR > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) || m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0)) && !pTarget->HasAura(DEMORALIZING_ROAR, EFFECT_INDEX_0) && ai->GetRageAmount() >= 10)
ai->CastSpell(DEMORALIZING_ROAR, *pTarget);
// entire tank spell sequence is predicated on being in [dire] bear form. If not in it, exit (*before* going out of other forms)
if (!m_bot->HasAura(DIRE_BEAR_FORM) && !m_bot->HasAura(BEAR_FORM))
return _DoNextPVECombatManeuverMeleeDPS(pTarget); // bear = melee so...
// Impossible due to check above
// If still in cat/moonkin/tree form, go out of it
//if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
// m_bot->RemoveAurasDueToSpell(CAT_FORM_1);
//if (m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
// m_bot->RemoveAurasDueToSpell(MOONKIN_FORM_1);
//if (m_bot->HasAura(TREE_OF_LIFE, EFFECT_INDEX_0))
// m_bot->RemoveAurasDueToSpell(TREE_OF_LIFE_1);
if (FAERIE_FIRE_FERAL > 0 && DruidSpellCombat < 1 && !pTarget->HasAura(FAERIE_FIRE_FERAL, EFFECT_INDEX_0))
{
ai->CastSpell(FAERIE_FIRE, *pTarget);
return;
}
DruidSpellCombat++;
if (ENRAGE > 0 && DruidSpellCombat < 2 && !m_bot->HasAura(ENRAGE, EFFECT_INDEX_0))
{
ai->CastSpell(ENRAGE, *m_bot);
return;
}
DruidSpellCombat++;
if (SWIPE > 0 && DruidSpellCombat < 3 && ai->GetRageAmount() >= 20)
{
ai->CastSpell(SWIPE, *pTarget);
DruidSpellCombat += 2;
return;
}
DruidSpellCombat++;
if (MAUL > 0 && DruidSpellCombat < 4 && ai->GetRageAmount() >= 15)
{
ai->CastSpell(MAUL, *pTarget);
DruidSpellCombat += 2;
return;
}
DruidSpellCombat++;
if (BASH > 0 && !pTarget->HasAura(BASH, EFFECT_INDEX_0) && DruidSpellCombat < 5 && ai->GetRageAmount() >= 10)
{
ai->CastSpell(BASH, *pTarget);
DruidSpellCombat += 2;
return;
}
DruidSpellCombat++;
if (CHALLENGING_ROAR > 0 && pVictim != m_bot && DruidSpellCombat < 6 && !pTarget->HasAura(CHALLENGING_ROAR, EFFECT_INDEX_0) && !pTarget->HasAura(GROWL, EFFECT_INDEX_0) && ai->GetRageAmount() >= 15)
{
ai->CastSpell(CHALLENGING_ROAR, *pTarget);
DruidSpellCombat += 2;
return;
}
DruidSpellCombat++;
if (GROWL > 0 && pVictim != m_bot && DruidSpellCombat < 7 && !pTarget->HasAura(CHALLENGING_ROAR, EFFECT_INDEX_0) && !pTarget->HasAura(GROWL, EFFECT_INDEX_0))
{
ai->CastSpell(GROWL, *pTarget);
DruidSpellCombat += 2;
return;
}
DruidSpellCombat = 0;
}
示例3: DoNextCombatManeuver
//.........这里部分代码省略.........
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
if (ai->GetRageAmount() > 60 && CastSpell(LACERATE, pTarget)) { return; } //Currently applies only 1
}
else
{
//Defensive stuff
if (m_tank->GetGUID() != m_bot->GetGUID() && pVictim && pVictim->GetGUID() == m_bot->GetGUID() )
{
if (ROOTS && !pTarget->HasAura(CYCLONE) && !pTarget->HasAura(HIBERNATE) && CastSpell(ROOTS, pTarget)) { return; }
if (CYCLONE && pDist > 5 && !pTarget->HasAura(ROOTS) && !pTarget->HasAura(HIBERNATE) && CastSpell(CYCLONE, pTarget)) { return; }
if (HIBERNATE && pTarget->GetCreatureType() == (uint32) CREATURE_TYPE_BEAST && !pTarget->HasAura(ROOTS) && !pTarget->HasAura(CYCLONE) && CastSpell(HIBERNATE, pTarget)) { return; }
//if (m_bot->getRace() == (uint8) RACE_NIGHTELF && isUnderAttack() && CastSpell(R_SHADOWMELD, m_bot)) { return; }
if (m_bot->getRace() == (uint8) RACE_TAUREN && pDist < 8 && CastSpell(R_WAR_STOMP, pTarget)) { return; }
}
if (CastSpell(FAERIE_FIRE, pTarget)) { return; }
// 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
}
// Continue attacking if theres excess mana (for healers)
if (m_role == BOT_ROLE_SUPPORT && ai->GetManaPercent() < offensiveSpellThreshold) { return; }
if (m_role != BOT_ROLE_SUPPORT && CastSpell(NATURES_SWIFTNESS, m_bot)) { } //only balance no gcd
if (m_bot->HasAura(NATURES_SWIFTNESS) && CastSpell(STARFIRE, pTarget)) { return; }
if (CastSpell(INSECT_SWARM, pTarget)) { return; }
if (CastSpell(TYPHOON, pTarget)) { return; }
if (isUnderAttack(m_tank,4) && CastSpell(HURRICANE, pTarget)) { ai->SetIgnoreUpdateTime(8); return; }
if (isUnderAttack(m_tank,5) && CastSpell(FORCE_OF_NATURE, m_bot)) { return; }
if (isUnderAttack(m_tank,4) && CastSpell(STARFALL, pTarget)) { return; }
if (CastSpell(MOONFIRE, pTarget)) { return; }
if (CastSpell(WRATH, pTarget)) { return; }
if (CastSpell(STARFIRE, pTarget)) { return; }
}
// If there is nothing else to do buff UP
if (m_role == BOT_ROLE_DPS_MELEE) //Those already healed and buffed or should never buff in combat
{
if (DoSupportRaid(GetMaster(),false,false,false)) { return; }
if (m_bot->GetGroup() && GetMaster()->GetGroup() != m_bot->GetGroup() && DoSupportRaid(m_bot,false,false,false)) { return; }
}
// drink potion if support / healer (Other builds simply overuse mana and waste mana pots)
if(ai->GetManaPercent() < 5 && (m_role == BOT_ROLE_SUPPORT || m_role == BOT_ROLE_HEALER) )
{
Item *pItem = ai->FindPotion();
if(pItem != NULL)
{
if (pItem->GetSpell() && m_bot->HasSpellCooldown(pItem->GetSpell()) ) { return; } //pot is in cooldown
ai->UseItem(*pItem);
}
}
#pragma endregion
} //end DoNextCombatManeuver
示例4: DoNextCombatManeuver
void PlayerbotWarriorAI::DoNextCombatManeuver(Unit *pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return;
switch (ai->GetScenarioType())
{
case PlayerbotAI::SCENARIO_DUEL:
if (HEROIC_STRIKE > 0)
ai->CastSpell(HEROIC_STRIKE);
return;
}
// ------- Non Duel combat ----------
// Damage Attacks
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
float fTargetDist = m_bot->GetCombatDistance(pTarget);
PlayerbotAI::CombatOrderType co = ai->GetCombatOrder();
// decide what stance to use
if ((co & PlayerbotAI::ORDERS_TANK) && !m_bot->HasAura(DEFENSIVE_STANCE, EFFECT_INDEX_0) && ai->CastSpell(DEFENSIVE_STANCE))
if (ai->GetManager()->m_confDebugWhisper)
ai->TellMaster("Stance > Defensive");
else if (!(co & PlayerbotAI::ORDERS_TANK) && !m_bot->HasAura(BATTLE_STANCE, EFFECT_INDEX_0) && ai->CastSpell(BATTLE_STANCE))
if (ai->GetManager()->m_confDebugWhisper)
ai->TellMaster("Stance > Battle");
// get spell sequence
if (pTarget->IsNonMeleeSpellCasted(true))
SpellSequence = WarriorSpellPreventing;
else if (m_bot->HasAura(BATTLE_STANCE, EFFECT_INDEX_0))
SpellSequence = WarriorBattle;
else if (m_bot->HasAura(DEFENSIVE_STANCE, EFFECT_INDEX_0))
SpellSequence = WarriorDefensive;
else if (m_bot->HasAura(BERSERKER_STANCE, EFFECT_INDEX_0))
SpellSequence = WarriorBerserker;
// do shouts, berserker rage, etc...
if (BERSERKER_RAGE > 0 && !m_bot->HasAura(BERSERKER_RAGE, EFFECT_INDEX_0) && ai->CastSpell(BERSERKER_RAGE))
if (ai->GetManager()->m_confDebugWhisper)
ai->TellMaster("Pre > Berseker Rage");
else if (DEMORALIZING_SHOUT > 0 && ai->GetRageAmount() >= 10 && !pTarget->HasAura(DEMORALIZING_SHOUT, EFFECT_INDEX_0) && ai->CastSpell(DEMORALIZING_SHOUT))
if (ai->GetManager()->m_confDebugWhisper)
ai->TellMaster("Pre > Demoralizing Shout");
else if (BATTLE_SHOUT > 0 && ai->GetRageAmount() >= 10 && !m_bot->HasAura(BATTLE_SHOUT, EFFECT_INDEX_0) && ai->CastSpell(BATTLE_SHOUT))
if (ai->GetManager()->m_confDebugWhisper)
ai->TellMaster("Pre > Battle Shout");
std::ostringstream out;
switch (SpellSequence)
{
case WarriorSpellPreventing:
out << "Case Prevent";
if (SHIELD_BASH > 0 && ai->GetRageAmount() >= 10 && ai->CastSpell(SHIELD_BASH, *pTarget))
out << " > Shield Bash";
else if (PUMMEL > 0 && ai->GetRageAmount() >= 10 && ai->CastSpell(PUMMEL, *pTarget))
out << " > Pummel";
else if (SPELL_REFLECTION > 0 && ai->GetRageAmount() >= 15 && !m_bot->HasAura(SPELL_REFLECTION, EFFECT_INDEX_0) && ai->CastSpell(SPELL_REFLECTION, *m_bot))
out << " > Spell Reflection";
else
out << " > NONE";
break;
case WarriorBattle:
out << "Case Battle";
if (EXECUTE > 0 && ai->GetRageAmount() >= 15 && pTarget->GetHealth() < pTarget->GetMaxHealth() * 0.2 && ai->CastSpell(EXECUTE, *pTarget))
out << " > Execute!";
else if (LAST_STAND > 0 && !m_bot->HasAura(LAST_STAND, EFFECT_INDEX_0) && m_bot->GetHealth() < m_bot->GetMaxHealth() * 0.5 && ai->CastSpell(LAST_STAND, *m_bot))
out << " > Last Stand!";
else if (BLOODRAGE > 0 && ai->GetRageAmount() < 50 && !m_bot->HasAura(BLOODRAGE, EFFECT_INDEX_0) && ai->CastSpell(BLOODRAGE, *m_bot))
out << " > Bloodrage";
else if (DEATH_WISH > 0 && ai->GetRageAmount() >= 10 && !m_bot->HasAura(DEATH_WISH, EFFECT_INDEX_0) && ai->CastSpell(DEATH_WISH, *m_bot))
out << " > Death Wish";
else if (RETALIATION > 0 && pVictim == m_bot && ai->GetAttackerCount() >= 2 && !m_bot->HasAura(RETALIATION, EFFECT_INDEX_0) && ai->CastSpell(RETALIATION, *m_bot))
out << " > Retaliation";
else if (DEMORALIZING_SHOUT > 0 && ai->GetRageAmount() >= 10 && !pTarget->HasAura(DEMORALIZING_SHOUT, EFFECT_INDEX_0) && ai->CastSpell(DEMORALIZING_SHOUT, *pTarget))
out << " > Demoralizing Shout";
else if (SWEEPING_STRIKES > 0 && ai->GetRageAmount() >= 30 && ai->GetAttackerCount() >= 2 && !m_bot->HasAura(SWEEPING_STRIKES, EFFECT_INDEX_0) && ai->CastSpell(SWEEPING_STRIKES, *m_bot))
out << " > Sweeping Strikes!";
else if (BLADESTORM > 0 && ai->GetRageAmount() >= 25 && pVictim == m_bot && !m_bot->HasAura(BLADESTORM, EFFECT_INDEX_0) && ai->GetAttackerCount() >= 3 && ai->CastSpell(BLADESTORM, *pTarget))
out << " > Bladestorm!";
else if (MORTAL_STRIKE > 0 && ai->GetRageAmount() >= 30 && !pTarget->HasAura(MORTAL_STRIKE, EFFECT_INDEX_0) && ai->CastSpell(MORTAL_STRIKE, *pTarget))
out << " > Mortal Strike";
else if (INTIMIDATING_SHOUT > 0 && ai->GetRageAmount() >= 25 && ai->GetAttackerCount() > 5 && ai->CastSpell(INTIMIDATING_SHOUT, *pTarget))
out << " > Intimidating Shout";
else if (THUNDER_CLAP > 0 && ai->GetRageAmount() >= 20 && pVictim == m_bot && !pTarget->HasAura(THUNDER_CLAP, EFFECT_INDEX_0) && ai->CastSpell(THUNDER_CLAP, *pTarget))
out << " > Thunder Clap";
else if (ENRAGED_REGENERATION > 0 && ai->GetRageAmount() >= 15 && !m_bot->HasAura(BERSERKER_RAGE, EFFECT_INDEX_0) && !m_bot->HasAura(ENRAGED_REGENERATION, EFFECT_INDEX_0) && m_bot->GetHealth() < m_bot->GetMaxHealth() * 0.5 && ai->CastSpell(ENRAGED_REGENERATION, *m_bot))
out << " > Enraged Regeneration";
else if (SHOCKWAVE > 0 && ai->GetRageAmount() >= 15 && pVictim == m_bot && !pTarget->HasAura(WAR_STOMP, EFFECT_INDEX_0) && !pTarget->HasAura(PIERCING_HOWL, EFFECT_INDEX_0) && !pTarget->HasAura(SHOCKWAVE, EFFECT_INDEX_0) && !pTarget->HasAura(CONCUSSION_BLOW, EFFECT_INDEX_0) && ai->CastSpell(SHOCKWAVE, *pTarget))
out << " > Shockwave";
else if (REND > 0 && ai->GetRageAmount() >= 10 && !pTarget->HasAura(REND, EFFECT_INDEX_0) && ai->CastSpell(REND, *pTarget))
out << " > Rend";
else if (HAMSTRING > 0 && ai->GetRageAmount() >= 10 && !pTarget->HasAura(HAMSTRING, EFFECT_INDEX_0) && ai->CastSpell(HAMSTRING, *pTarget))
out << " > Hamstring";
else if (CHALLENGING_SHOUT > 0 && ai->GetRageAmount() >= 5 && pVictim != m_bot && ai->GetHealthPercent() > 25 && !pTarget->HasAura(MOCKING_BLOW, EFFECT_INDEX_0) && !pTarget->HasAura(CHALLENGING_SHOUT, EFFECT_INDEX_0) && ai->CastSpell(CHALLENGING_SHOUT, *pTarget))
out << " > Challenging Shout";
//.........这里部分代码省略.........
示例5: 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");
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(CAT_FORM, EFFECT_INDEX_0))
m_bot->RemoveAurasDueToSpell(768);
//ai->TellMaster("FormClearCat");
if (MOONKIN_FORM > 0 && !m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
ai->CastSpell (MOONKIN_FORM);
else if (DIRE_BEAR_FORM > 0 && !m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && !m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
ai->CastSpell (DIRE_BEAR_FORM);
else if (BEAR_FORM > 0 && !m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && !m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) && !m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
ai->CastSpell (BEAR_FORM);
else if (DEMORALIZING_ROAR > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) || m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0)) && !m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && !pTarget->HasAura(DEMORALIZING_ROAR, EFFECT_INDEX_0) && ai->GetRageAmount() >= 10)
ai->CastSpell(DEMORALIZING_ROAR, *pTarget);
if (FAERIE_FIRE > 0 && DruidSpellCombat < 1 && !pTarget->HasAura(FAERIE_FIRE, EFFECT_INDEX_0))
{
ai->CastSpell(FAERIE_FIRE, *pTarget);
DruidSpellCombat++;
break;
}
else if (MOONFIRE > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 2 && !pTarget->HasAura(MOONFIRE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 24)
{
ai->CastSpell(MOONFIRE, *pTarget);
DruidSpellCombat++;
break;
}
else if (ROOTS > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 3 && !pTarget->HasAura(ROOTS, EFFECT_INDEX_0) && ai->GetManaPercent() >= 8)
{
ai->CastSpell(ROOTS, *pTarget);
DruidSpellCombat++;
break;
}
else if (HURRICANE > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && ai->GetAttackerCount() >= 5 && DruidSpellCombat < 4 && ai->GetManaPercent() >= 91)
{
//ai->TellMaster("casting hurricane!");
ai->CastSpell(HURRICANE, *pTarget);
ai->SetIgnoreUpdateTime(10);
DruidSpellCombat++;
break;
}
else if (WRATH > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 5 && ai->GetManaPercent() >= 13)
{
ai->CastSpell(WRATH, *pTarget);
DruidSpellCombat++;
break;
}
else if (INSECT_SWARM > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 6 && !pTarget->HasAura(INSECT_SWARM, EFFECT_INDEX_0) && ai->GetManaPercent() >= 9)
{
ai->CastSpell(INSECT_SWARM, *pTarget);
DruidSpellCombat++;
break;
}
else if (STARFIRE > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 7 && ai->GetManaPercent() >= 18)
{
ai->CastSpell(STARFIRE, *pTarget);
DruidSpellCombat++;
break;
}
else if (FORCE_OF_NATURE > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 8 && ai->GetManaPercent() >= 12)
{
//ai->TellMaster("summoning treants.");
ai->CastSpell(FORCE_OF_NATURE);
DruidSpellCombat++;
//.........这里部分代码省略.........
示例6: DoNextCombatManeuver
void PlayerbotDruidAI::DoNextCombatManeuver(Unit *pTarget)
{
PlayerbotAI *ai = GetAI();
if (!ai)
return;
Player * m_bot = GetPlayerBot();
if (!m_bot)
return;
Player* m_master = ai->GetLeader();
if (!m_master)
return;
uint32 masterHP = m_master->GetHealth() * 100 / m_master->GetMaxHealth();
ai->SetInFront(pTarget);
Unit* pVictim = pTarget->getVictim();
if (pVictim && ai->GetHealthPercent() >= 40 && m_master->GetHealth() >= m_master->GetMaxHealth() * 0.4)
{
if (pVictim == m_bot)
SpellSequence = DruidTank;
}
else if (pTarget->GetHealth() > pTarget->GetMaxHealth() * 0.8 && pVictim)
{
if (pVictim != m_bot)
SpellSequence = DruidSpell;
}
else if (ai->GetHealthPercent() <= 40 || m_master->GetHealth() <= m_master->GetMaxHealth() * 0.4)
SpellSequence = DruidHeal;
else
SpellSequence = DruidCombat;
switch (SpellSequence)
{
case DruidTank: // Its now a tank druid!
if (!m_bot->HasInArc(M_PI_F, pTarget))
{
m_bot->SetInFront(pTarget);
}
if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
m_bot->RemoveAurasDueToSpell(768);
if (MOONKIN_FORM > 0 && !m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
ai->CastSpell (MOONKIN_FORM);
else if (DIRE_BEAR_FORM > 0 && !m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && !m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
ai->CastSpell (DIRE_BEAR_FORM);
else if (BEAR_FORM > 0 && !m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && !m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) && !m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
ai->CastSpell (BEAR_FORM);
else if (DEMORALIZING_ROAR > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) || m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0)) && !m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && !pTarget->HasAura(DEMORALIZING_ROAR, EFFECT_INDEX_0) && ai->GetRageAmount() >= 10)
ai->CastSpell(DEMORALIZING_ROAR, pTarget);
if (FAERIE_FIRE > 0 && DruidSpellCombat < 1 && !pTarget->HasAura(FAERIE_FIRE, EFFECT_INDEX_0))
{
ai->CastSpell(FAERIE_FIRE, pTarget);
DruidSpellCombat++;
break;
}
else if (MOONFIRE > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 2 && !pTarget->HasAura(MOONFIRE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 24)
{
ai->CastSpell(MOONFIRE, pTarget);
DruidSpellCombat++;
break;
}
else if (ROOTS > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 3 && !pTarget->HasAura(ROOTS, EFFECT_INDEX_0) && ai->GetManaPercent() >= 8)
{
ai->CastSpell(ROOTS, pTarget);
DruidSpellCombat++;
break;
}
else if (HURRICANE > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 4 && ai->GetManaPercent() >= 91)
{
ai->CastSpell(HURRICANE, pTarget);
ai->SetIgnoreUpdateTime(10);
DruidSpellCombat++;
break;
}
else if (WRATH > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 5 && ai->GetManaPercent() >= 13)
{
ai->CastSpell(WRATH, pTarget);
DruidSpellCombat++;
break;
}
else if (INSECT_SWARM > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 6 && !pTarget->HasAura(INSECT_SWARM, EFFECT_INDEX_0) && ai->GetManaPercent() >= 9)
{
ai->CastSpell(INSECT_SWARM, pTarget);
DruidSpellCombat++;
break;
}
else if (STARFIRE > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 7 && ai->GetManaPercent() >= 18)
{
ai->CastSpell(STARFIRE, pTarget);
DruidSpellCombat++;
break;
}
else if (FORCE_OF_NATURE > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 8 && ai->GetManaPercent() >= 12)
{
ai->CastSpell(FORCE_OF_NATURE);
DruidSpellCombat++;
break;
}
//.........这里部分代码省略.........
示例7: DoNextCombatManeuver
bool PlayerbotDruidAI::DoNextCombatManeuver(Unit *pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return false;
Player* pMaster = ai->GetMaster();
if (!pMaster)
return false;
uint32 masterHP = pMaster->GetHealth() * 100 / pMaster->GetMaxHealth();
ai->SetInFront(pTarget);
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
if (pVictim
&& (ai->GetHealthPercent() >= 40)
&& (pMaster->GetHealth() >= pMaster->GetMaxHealth() * 0.4))
{
if (pVictim == m_bot)
SpellSequence = DruidTank;
}
else if (pVictim
&& (pTarget->GetHealth() > pTarget->GetMaxHealth() * 0.8))
{
if (pVictim != m_bot)
SpellSequence = DruidSpell;
}
else if (ai->GetHealthPercent() <= 40 || pMaster->GetHealth() <= pMaster->GetMaxHealth() * 0.4)
SpellSequence = DruidHeal;
else
SpellSequence = DruidCombat;
switch (SpellSequence)
{
case DruidTank:
m_bot->SetInFront(pTarget);
if (pVictim)
pVictim->Attack(pTarget, true);
if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
m_bot->RemoveAurasDueToSpell(768);
if ((MOONKIN_FORM > 0)
&& (!m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
&& (ai->CastSpell(MOONKIN_FORM)))
return true;
if ((DIRE_BEAR_FORM > 0)
&& (!m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
&& (!m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
&& (ai->CastSpell(DIRE_BEAR_FORM)))
return true;
if ((BEAR_FORM > 0)
&& (!m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
&& (!m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
&& (!m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
&& (ai->CastSpell(BEAR_FORM)))
return true;
if ((DEMORALIZING_ROAR > 0)
&& ((m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))|| m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
&& (!m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
&& (!pTarget->HasAura(DEMORALIZING_ROAR, EFFECT_INDEX_0))
&& (ai->GetRageAmount() >= 10)
&& (ai->CastSpell(DEMORALIZING_ROAR, *pTarget)))
return true;
if ((FAERIE_FIRE > 0)
&& (DruidSpellCombat < 1)
&& (!pTarget->HasAura(FAERIE_FIRE, EFFECT_INDEX_0))
&& (ai->CastSpell(FAERIE_FIRE, *pTarget)))
{
DruidSpellCombat++;
return true;
}
if ((MOONFIRE > 0)
&& (m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
&& (DruidSpellCombat < 2)
&& (!pTarget->HasAura(MOONFIRE, EFFECT_INDEX_0))
&& (ai->GetManaPercent() >= 24)
&& (ai->CastSpell(MOONFIRE, *pTarget)))
{
DruidSpellCombat++;
return true;
}
if ((ROOTS > 0)
&& (m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
&& (DruidSpellCombat < 3)
&& (!pTarget->HasAura(ROOTS, EFFECT_INDEX_0))
&& (ai->GetManaPercent() >= 8)
&& (ai->CastSpell(ROOTS, *pTarget)))
{
DruidSpellCombat++;
return true;
//.........这里部分代码省略.........
示例8: DoNextCombatManeuver
void PlayerbotWarriorAI::DoNextCombatManeuver(Unit *pTarget)
{
PlayerbotAI* ai = GetAI();
if (!ai)
return;
switch (ai->GetScenarioType())
{
case PlayerbotAI::SCENARIO_DUEL:
if (HEROIC_STRIKE > 0)
ai->CastSpell(HEROIC_STRIKE);
return;
}
// ------- Non Duel combat ----------
//ai->Follow(*GetMaster()); // dont want to melee mob
// Damage Attacks
Player *m_bot = GetPlayerBot();
Unit* pVictim = pTarget->getVictim();
if( !m_bot->HasInArc(M_PI, pTarget))
m_bot->SetInFront(pTarget);
if (SHIELD_WALL > 0 && ai->GetHealthPercent() < 20)
ai->CastSpell (SHIELD_WALL, *m_bot);
if (DEVASTATE > 0 && ai->GetRageAmount() >= 15)
ai->CastSpell (DEVASTATE);
else if (SUNDER_ARMOR > 0 && ai->GetRageAmount() >= 15)
ai->CastSpell (SUNDER_ARMOR);
if (pTarget->IsNonMeleeSpellCasted(true))
SpellSequence = SpellPreventing;
if (pTarget->GetHealth() < pTarget->GetMaxHealth()*0.2 && pTarget->getLevel() <= m_bot->getLevel() )
SpellSequence = Berserker;
else
SpellSequence = Tanking;
switch (SpellSequence)
{
case Tanking:
//ai->TellMaster("Tanking");
if (DEFENSIVE_STANCE > 0 && !m_bot->HasAura(DEFENSIVE_STANCE, 0))
ai->CastSpell (DEFENSIVE_STANCE);
if (DEMORALIZING_SHOUT > 0 && !pTarget->HasAura(DEMORALIZING_SHOUT, 0) && ai->GetRageAmount() >= 10)
ai->CastSpell (DEMORALIZING_SHOUT);
else if (SHIELD_BLOCK > 0 && TankCounter < 1 && pVictim)
{
if (pVictim == m_bot)
{
ai->CastSpell (SHIELD_BLOCK);
TankCounter++;
break;
}
}
else if (SHIELD_SLAM > 0 && TankCounter < 2 && ai->GetRageAmount() >= 20)
{
ai->CastSpell (SHIELD_SLAM, *pTarget);
TankCounter++;
break;
}
else if (CONCUSSION_BLOW > 0 && TankCounter < 3 && ai->GetRageAmount() >= 20)
{
ai->CastSpell (CONCUSSION_BLOW, *pTarget);
TankCounter++;
break;
}
else if (SHOCKWAVE > 0 && TankCounter < 4 && ai->GetRageAmount() >= 15)
{
ai->CastSpell (SHOCKWAVE);
TankCounter++;
break;
}
else if (REVENGE > 0 && TankCounter < 5 && ai->GetRageAmount() >= 5)
{
ai->CastSpell (REVENGE, *pTarget);
TankCounter++;
break;
}
else if (THUNDER_CLAP > 0 && TankCounter < 6 && ai->GetRageAmount() >= 5)
{
ai->CastSpell (THUNDER_CLAP, *pTarget);
TankCounter++;
break;
}
else if (SHIELD_BLOCK > 0 && TankCounter < 7 && pVictim)
{
if (pVictim == m_bot)
{
ai->CastSpell (SHIELD_BLOCK);
TankCounter++;
break;
}
}
else if (HEROIC_STRIKE > 0 && TankCounter < 8 && ai->GetRageAmount() >= 15)
{
//.........这里部分代码省略.........