void PlayerbotPriestAI::DoNextCombatManeuver(Unit *pTarget) { Unit* pVictim = pTarget->getVictim(); PlayerbotAI* ai = GetAI(); if (!ai) return; switch (ai->GetScenarioType()) { case PlayerbotAI::SCENARIO_PVP_DUEL: (ai->HasAura(SCREAM, *pTarget) && ai->GetHealthPercent() < 60 && ai->CastSpell(HEAL)) || ai->CastSpell(SHADOW_WORD_PAIN) || (ai->GetHealthPercent() < 80 && ai->CastSpell(RENEW)) || (ai->GetPlayerBot()->GetDistance(pTarget) <= 5 && ai->CastSpell(SCREAM)) || ai->CastSpell(MIND_BLAST) || (ai->GetHealthPercent() < 50 && ai->CastSpell(GREATER_HEAL)) || ai->CastSpell(SMITE); return; default: break; } // ------- Non Duel combat ---------- Player *m_bot = GetPlayerBot(); Group *m_group = m_bot->GetGroup(); bool meleeReach = m_bot->CanReachWithMeleeAttack(pTarget); if (ai->GetCombatStyle() != PlayerbotAI::COMBAT_RANGED && !meleeReach) ai->SetCombatStyle(PlayerbotAI::COMBAT_RANGED); // if in melee range OR can't shoot OR have no ranged (wand) equipped else if (ai->GetCombatStyle() != PlayerbotAI::COMBAT_MELEE && (meleeReach || SHOOT == 0 || !m_bot->GetWeaponForAttack(RANGED_ATTACK, true, true)) && !ai->IsHealer()) ai->SetCombatStyle(PlayerbotAI::COMBAT_MELEE); if (SHOOT > 0 && ai->GetCombatStyle() == PlayerbotAI::COMBAT_RANGED && !m_bot->FindCurrentSpellBySpellId(SHOOT)) ai->CastSpell(SHOOT, *pTarget); //ai->TellMaster( "started auto shot." ); else if (SHOOT > 0 && m_bot->FindCurrentSpellBySpellId(SHOOT)) m_bot->InterruptNonMeleeSpells(true, SHOOT); // Heal myself if (ai->GetHealthPercent() < 15 && FADE > 0 && !m_bot->HasAura(FADE, EFFECT_INDEX_0)) { ai->TellMaster("I'm casting fade."); ai->CastSpell(FADE, *m_bot); } else if (ai->GetHealthPercent() < 25 && POWER_WORD_SHIELD > 0 && !m_bot->HasAura(POWER_WORD_SHIELD, EFFECT_INDEX_0)) { ai->TellMaster("I'm casting pws on myself."); ai->CastSpell(POWER_WORD_SHIELD); } else if (ai->GetHealthPercent() < 35 && DESPERATE_PRAYER > 0) { ai->TellMaster("I'm casting desperate prayer."); ai->CastSpell(DESPERATE_PRAYER, *m_bot); } else if (ai->GetHealthPercent() < 80) HealTarget (m_bot); // Heal master uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth(); if (GetMaster()->isAlive()) { if (masterHP < 25 && POWER_WORD_SHIELD > 0 && !GetMaster()->HasAura(POWER_WORD_SHIELD, EFFECT_INDEX_0)) ai->CastSpell(POWER_WORD_SHIELD, *(GetMaster())); else if (masterHP < 80) HealTarget (GetMaster()); } // Heal group if (m_group) { Group::MemberSlotList const& groupSlot = m_group->GetMemberSlots(); for (Group::member_citerator itr = groupSlot.begin(); itr != groupSlot.end(); itr++) { Player *m_groupMember = sObjectMgr.GetPlayer(itr->guid); if (!m_groupMember || !m_groupMember->isAlive()) continue; uint32 memberHP = m_groupMember->GetHealth() * 100 / m_groupMember->GetMaxHealth(); if (memberHP < 25) HealTarget(m_groupMember); } } // Damage Spells switch (SpellSequence) { case SPELL_HOLY: if (SMITE > 0 && ai->In_Reach(pTarget,SMITE) && LastSpellHoly < 1 && !pTarget->HasAura(SMITE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 17) { ai->CastSpell(SMITE, *pTarget); SpellSequence = SPELL_SHADOWMAGIC; LastSpellHoly = LastSpellHoly + 1; break; } else if (MANA_BURN > 0 && ai->In_Reach(pTarget,MANA_BURN) && LastSpellHoly < 2 && pTarget->GetPower(POWER_MANA) > 0 && ai->GetManaPercent() < 70 && ai->GetManaPercent() >= 14) { //ai->TellMaster("I'm casting mana burn."); ai->CastSpell(MANA_BURN, *pTarget); ai->SetIgnoreUpdateTime(3); SpellSequence = SPELL_SHADOWMAGIC; LastSpellHoly = LastSpellHoly + 1; break; } else if (HOLY_NOVA > 0 && ai->In_Reach(pTarget,HOLY_NOVA) && LastSpellHoly < 3 && meleeReach && ai->GetManaPercent() >= 22) { //ai->TellMaster("I'm casting holy nova."); ai->CastSpell(HOLY_NOVA); SpellSequence = SPELL_SHADOWMAGIC; LastSpellHoly = LastSpellHoly + 1; break; } else if (HOLY_FIRE > 0 && ai->In_Reach(pTarget,HOLY_FIRE) && LastSpellHoly < 4 && !pTarget->HasAura(HOLY_FIRE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 13) { //ai->TellMaster("I'm casting holy fire."); ai->CastSpell(HOLY_FIRE, *pTarget); SpellSequence = SPELL_SHADOWMAGIC; LastSpellHoly = LastSpellHoly + 1; break; } else if (PRAYER_OF_MENDING > 0 && ai->In_Reach(pTarget,PRAYER_OF_MENDING) && LastSpellHoly < 5 && pVictim == GetMaster() && GetMaster()->GetHealth() <= GetMaster()->GetMaxHealth() * 0.7 && !GetMaster()->HasAura(PRAYER_OF_MENDING, EFFECT_INDEX_0) && ai->GetManaPercent() >= 15) { //ai->TellMaster("I'm casting prayer of mending on master."); ai->CastSpell(PRAYER_OF_MENDING, *GetMaster()); SpellSequence = SPELL_SHADOWMAGIC; LastSpellHoly = LastSpellHoly + 1; break; } else if (LastSpellHoly > 6) { LastSpellHoly = 0; SpellSequence = SPELL_SHADOWMAGIC; break; } LastSpellHoly = LastSpellHoly + 1; //SpellSequence = SPELL_SHADOWMAGIC; //break; case SPELL_SHADOWMAGIC: if (SHADOW_WORD_PAIN > 0 && ai->In_Reach(pTarget,SHADOW_WORD_PAIN) && LastSpellShadowMagic < 1 && !pTarget->HasAura(SHADOW_WORD_PAIN, EFFECT_INDEX_0) && ai->GetManaPercent() >= 25) { //ai->TellMaster("I'm casting pain."); ai->CastSpell(SHADOW_WORD_PAIN, *pTarget); SpellSequence = SPELL_DISCIPLINE; LastSpellShadowMagic = LastSpellShadowMagic + 1; break; } else if (MIND_BLAST > 0 && ai->In_Reach(pTarget,MIND_BLAST) && LastSpellShadowMagic < 2 && ai->GetManaPercent() >= 19) { //ai->TellMaster("I'm casting mind blast."); ai->CastSpell(MIND_BLAST, *pTarget); SpellSequence = SPELL_DISCIPLINE; LastSpellShadowMagic = LastSpellShadowMagic + 1; break; } else if (SCREAM > 0 && ai->In_Reach(pTarget,SCREAM) && LastSpellShadowMagic < 3 && ai->GetAttackerCount() >= 3 && ai->GetManaPercent() >= 15) { ai->TellMaster("I'm casting scream."); ai->CastSpell(SCREAM); SpellSequence = SPELL_DISCIPLINE; (LastSpellShadowMagic = LastSpellShadowMagic + 1); break; } else if (MIND_FLAY > 0 && LastSpellShadowMagic < 4 && !pTarget->HasAura(MIND_FLAY, EFFECT_INDEX_0) && ai->GetManaPercent() >= 10) { //ai->TellMaster("I'm casting mind flay."); ai->CastSpell(MIND_FLAY, *pTarget); ai->SetIgnoreUpdateTime(3); SpellSequence = SPELL_DISCIPLINE; LastSpellShadowMagic = LastSpellShadowMagic + 1; break; } else if (DEVOURING_PLAGUE > 0 && ai->In_Reach(pTarget,DEVOURING_PLAGUE) && LastSpellShadowMagic < 5 && !pTarget->HasAura(DEVOURING_PLAGUE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 28) { ai->CastSpell(DEVOURING_PLAGUE, *pTarget); SpellSequence = SPELL_DISCIPLINE; LastSpellShadowMagic = LastSpellShadowMagic + 1; break; } else if (SHADOW_PROTECTION > 0 && ai->In_Reach(pTarget,SHADOW_PROTECTION) && LastSpellShadowMagic < 6 && ai->GetManaPercent() >= 60) { ai->CastSpell(SHADOW_PROTECTION, *pTarget); SpellSequence = SPELL_DISCIPLINE; LastSpellShadowMagic = LastSpellShadowMagic + 1; break; } else if (VAMPIRIC_TOUCH > 0 && LastSpellShadowMagic < 7 && !pTarget->HasAura(VAMPIRIC_TOUCH, EFFECT_INDEX_0) && ai->GetManaPercent() >= 18) { ai->CastSpell(VAMPIRIC_TOUCH, *pTarget); SpellSequence = SPELL_DISCIPLINE; LastSpellShadowMagic = LastSpellShadowMagic + 1; break; } else if (SHADOWFIEND > 0 && ai->In_Reach(pTarget,SHADOWFIEND) && LastSpellShadowMagic < 8) { ai->CastSpell(SHADOWFIEND); SpellSequence = SPELL_DISCIPLINE; LastSpellShadowMagic = LastSpellShadowMagic + 1; break; } else if (MIND_SEAR > 0 && ai->In_Reach(pTarget,MIND_SEAR) && LastSpellShadowMagic < 9 && ai->GetAttackerCount() >= 3 && ai->GetManaPercent() >= 28) { ai->CastSpell(MIND_SEAR, *pTarget); ai->SetIgnoreUpdateTime(5); SpellSequence = SPELL_DISCIPLINE; LastSpellShadowMagic = LastSpellShadowMagic + 1; break; } else if (LastSpellShadowMagic > 10) { LastSpellShadowMagic = 0; SpellSequence = SPELL_DISCIPLINE; break; } LastSpellShadowMagic = LastSpellShadowMagic + 1; //SpellSequence = SPELL_DISCIPLINE; //break; case SPELL_DISCIPLINE: if (FEAR_WARD > 0 && ai->In_Reach(pTarget,FEAR_WARD) && LastSpellDiscipline < 1 && ai->GetManaPercent() >= 3) { //ai->TellMaster("I'm casting fear ward"); ai->CastSpell(FEAR_WARD, *(GetMaster())); SpellSequence = SPELL_HOLY; LastSpellDiscipline = LastSpellDiscipline + 1; break; } else if (POWER_INFUSION > 0 && LastSpellDiscipline < 2 && ai->GetManaPercent() >= 16) { //ai->TellMaster("I'm casting power infusion"); ai->CastSpell(POWER_INFUSION, *(GetMaster())); SpellSequence = SPELL_HOLY; LastSpellDiscipline = LastSpellDiscipline + 1; break; } else if (MASS_DISPEL > 0 && ai->In_Reach(pTarget,MASS_DISPEL) && LastSpellDiscipline < 3 && ai->GetManaPercent() >= 33) { //ai->TellMaster("I'm casting mass dispel"); ai->CastSpell(MASS_DISPEL); SpellSequence = SPELL_HOLY; LastSpellDiscipline = LastSpellDiscipline + 1; break; } else if (INNER_FOCUS > 0 && !m_bot->HasAura(INNER_FOCUS, EFFECT_INDEX_0) && LastSpellDiscipline < 4) { //ai->TellMaster("I'm casting inner focus"); ai->CastSpell(INNER_FOCUS, *m_bot); SpellSequence = SPELL_HOLY; LastSpellDiscipline = LastSpellDiscipline + 1; break; } else if (PENANCE > 0 && LastSpellDiscipline < 5 && ai->GetManaPercent() >= 16) { //ai->TellMaster("I'm casting PENANCE"); ai->CastSpell(PENANCE); SpellSequence = SPELL_HOLY; LastSpellDiscipline = LastSpellDiscipline + 1; break; } else if (LastSpellDiscipline > 6) { LastSpellDiscipline = 0; SpellSequence = SPELL_HOLY; break; } else { LastSpellDiscipline = LastSpellDiscipline + 1; SpellSequence = SPELL_HOLY; } } } // end DoNextCombatManeuver
void PlayerbotDruidAI::DoNextCombatManeuver(Unit *pTarget) { PlayerbotAI* ai = GetAI(); if (!ai) return; switch (ai->GetScenarioType()) { case PlayerbotAI::SCENARIO_PVP_DUEL: ai->CastSpell(MOONFIRE); return; default: break; } uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth(); Player *m_bot = GetPlayerBot(); Unit* pVictim = pTarget->getVictim(); if (ai->IsTank()) SpellSequence = DruidTank; else if (ai->IsDPS()) SpellSequence = DruidSpell; else if (ai->IsHealer()) SpellSequence = DruidHeal; else SpellSequence = DruidCombat; switch (SpellSequence) { case DruidTank: // Its now a tank druid! //ai->TellMaster("DruidTank"); if (!m_bot->HasInArc(M_PI_F, 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 && ai->In_Reach(pTarget,FAERIE_FIRE) && DruidSpellCombat < 1 && !pTarget->HasAura(FAERIE_FIRE, EFFECT_INDEX_0)) { ai->CastSpell(FAERIE_FIRE, *pTarget); DruidSpellCombat++; break; } else if (MOONFIRE > 0 && ai->In_Reach(pTarget,MOONFIRE) && 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 && ai->In_Reach(pTarget,HURRICANE) && 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 && ai->In_Reach(pTarget,WRATH) && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 5 && ai->GetManaPercent() >= 13) { ai->CastSpell(WRATH, *pTarget); DruidSpellCombat++; break; } else if (INSECT_SWARM > 0 && ai->In_Reach(pTarget,INSECT_SWARM) && 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 && ai->In_Reach(pTarget,STARFIRE) && 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 && ai->In_Reach(pTarget,FORCE_OF_NATURE) && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && DruidSpellCombat < 8 && ai->GetManaPercent() >= 12) { //ai->TellMaster("summoning treants."); ai->CastSpell(FORCE_OF_NATURE); DruidSpellCombat++; break; } else if (STARFALL > 0 && ai->In_Reach(pTarget,STARFALL) && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && !m_bot->HasAura(STARFALL, EFFECT_INDEX_0) && ai->GetAttackerCount() >= 3 && DruidSpellCombat < 9 && ai->GetManaPercent() >= 39) { ai->CastSpell(STARFALL, *pTarget); DruidSpellCombat++; break; } else if (BARKSKIN > 0 && pVictim == m_bot && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && ai->GetHealthPercent() < 75 && DruidSpellCombat < 10 && !m_bot->HasAura(BARKSKIN, EFFECT_INDEX_0)) { ai->CastSpell(BARKSKIN, *m_bot); DruidSpellCombat++; break; } else if (INNERVATE > 0 && ai->In_Reach(pTarget,INNERVATE) && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && ai->GetManaPercent() < 50 && DruidSpellCombat < 11 && !m_bot->HasAura(INNERVATE, EFFECT_INDEX_0)) { ai->CastSpell(INNERVATE, *m_bot); DruidSpellCombat++; break; } else if (ENRAGE > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) || m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0)) && DruidSpellCombat < 2 && !m_bot->HasAura(ENRAGE, EFFECT_INDEX_0)) { ai->CastSpell(ENRAGE, *m_bot); DruidSpellCombat = DruidSpellCombat + 2; break; } else if (SWIPE > 0 && ai->In_Reach(pTarget,SWIPE) && (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) || m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0)) && DruidSpellCombat < 4 && ai->GetRageAmount() >= 20) { ai->CastSpell(SWIPE, *pTarget); DruidSpellCombat = DruidSpellCombat + 2; break; } else if (MAUL > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) || m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0)) && DruidSpellCombat < 6 && ai->GetRageAmount() >= 15) { ai->CastSpell(MAUL, *pTarget); DruidSpellCombat = DruidSpellCombat + 2; break; } else if (BASH > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) || m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0)) && !pTarget->HasAura(BASH, EFFECT_INDEX_0) && DruidSpellCombat < 8 && ai->GetRageAmount() >= 10) { ai->CastSpell(BASH, *pTarget); DruidSpellCombat = DruidSpellCombat + 2; break; } else if (CHALLENGING_ROAR > 0 && (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) || m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0)) && pVictim != m_bot && DruidSpellCombat < 10 && !pTarget->HasAura(CHALLENGING_ROAR, EFFECT_INDEX_0) && !pTarget->HasAura(GROWL, EFFECT_INDEX_0) && ai->GetRageAmount() >= 15) { ai->CastSpell(CHALLENGING_ROAR, *pTarget); DruidSpellCombat = DruidSpellCombat + 2; break; } else if (GROWL > 0 && ai->In_Reach(pTarget,GROWL) && (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0) || m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0)) && pVictim != m_bot && DruidSpellCombat < 12 && !pTarget->HasAura(CHALLENGING_ROAR, EFFECT_INDEX_0) && !pTarget->HasAura(GROWL, EFFECT_INDEX_0)) { ai->CastSpell(GROWL, *pTarget); DruidSpellCombat = DruidSpellCombat + 2; break; } else if (DruidSpellCombat > 13) { DruidSpellCombat = 0; break; } else { DruidSpellCombat = 0; break; } break; case DruidSpell: //ai->TellMaster("DruidSpell"); if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0)) { m_bot->RemoveAurasDueToSpell(768); //ai->TellMaster("FormClearCat"); break; } 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 (FAERIE_FIRE > 0 && ai->In_Reach(pTarget,FAERIE_FIRE) && DruidSpellCombat < 1 && !pTarget->HasAura(FAERIE_FIRE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 8) { ai->CastSpell(FAERIE_FIRE, *pTarget); DruidSpellCombat++; break; } else if (MOONFIRE > 0 && ai->In_Reach(pTarget,MOONFIRE) && DruidSpellCombat < 2 && !pTarget->HasAura(MOONFIRE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 24) { ai->CastSpell(MOONFIRE, *pTarget); DruidSpellCombat++; break; } else if (ROOTS > 0 && DruidSpellCombat < 3 && !pTarget->HasAura(ROOTS, EFFECT_INDEX_0) && ai->GetManaPercent() >= 8) { ai->CastSpell(ROOTS, *pTarget); DruidSpellCombat++; break; } else if (HURRICANE > 0 && ai->In_Reach(pTarget,HURRICANE) && 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 && ai->In_Reach(pTarget,WRATH) && DruidSpellCombat < 5 && ai->GetManaPercent() >= 13) { ai->CastSpell(WRATH, *pTarget); DruidSpellCombat++; break; } else if (INSECT_SWARM > 0 && ai->In_Reach(pTarget,INSECT_SWARM) && DruidSpellCombat < 6 && !pTarget->HasAura(INSECT_SWARM, EFFECT_INDEX_0) && ai->GetManaPercent() >= 9) { ai->CastSpell(INSECT_SWARM, *pTarget); DruidSpellCombat++; break; } else if (STARFIRE > 0 && ai->In_Reach(pTarget,STARFIRE) && DruidSpellCombat < 7 && ai->GetManaPercent() >= 18) { ai->CastSpell(STARFIRE, *pTarget); DruidSpellCombat++; break; } else if (FORCE_OF_NATURE > 0 && ai->In_Reach(pTarget,FORCE_OF_NATURE) && DruidSpellCombat < 8 && ai->GetManaPercent() >= 12) { //ai->TellMaster("summoning treants."); ai->CastSpell(FORCE_OF_NATURE); DruidSpellCombat++; break; } else if (STARFALL > 0 && ai->In_Reach(pTarget,STARFALL) && !m_bot->HasAura(STARFALL, EFFECT_INDEX_0) && ai->GetAttackerCount() >= 3 && DruidSpellCombat < 9 && ai->GetManaPercent() >= 39) { ai->CastSpell(STARFALL, *pTarget); DruidSpellCombat++; break; } else if (BARKSKIN > 0 && pVictim == m_bot && ai->GetHealthPercent() < 75 && DruidSpellCombat < 10 && !m_bot->HasAura(BARKSKIN, EFFECT_INDEX_0)) { ai->CastSpell(BARKSKIN, *m_bot); DruidSpellCombat++; break; } else if (INNERVATE > 0 && ai->In_Reach(pTarget,INNERVATE) && ai->GetManaPercent() < 50 && DruidSpellCombat < 11 && !m_bot->HasAura(INNERVATE, EFFECT_INDEX_0)) { ai->CastSpell(INNERVATE, *m_bot); DruidSpellCombat++; break; } else if (DruidSpellCombat > 13) { DruidSpellCombat = 0; break; } else { DruidSpellCombat = 0; break; } break; case DruidHeal: //ai->TellMaster("DruidHeal"); if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0)) { m_bot->RemoveAurasDueToSpell(768); //ai->TellMaster("FormClearCat"); break; } 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 (ai->GetHealthPercent() <= 40) { HealTarget (m_bot); break; } if (masterHP <= 40) { HealTarget (GetMaster()); break; } else { DruidSpellCombat = 0; break; } break; case DruidCombat: //ai->TellMaster("DruidCombat"); if (!m_bot->HasInArc(M_PI_F, 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 (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); //ai->TellMaster("Claw2"); break; } if (m_bot->GetComboPoints() == 5) { if (RIP > 0 && pTarget->getClass() == CLASS_ROGUE && ai->GetEnergyAmount() >= 30) ai->CastSpell(RIP, *pTarget); //ai->TellMaster("Rogue Rip"); else if (MAIM > 0 && pTarget->getClass() == CLASS_DRUID && ai->GetEnergyAmount() >= 35) ai->CastSpell(MAIM, *pTarget); //ai->TellMaster("Druid Maim"); else if (MAIM > 0 && pTarget->getClass() == CLASS_SHAMAN && ai->GetEnergyAmount() >= 35) ai->CastSpell(MAIM, *pTarget); //ai->TellMaster("Shaman Maim"); else if (MAIM > 0 && pTarget->getClass() == CLASS_WARLOCK && ai->GetEnergyAmount() >= 35) ai->CastSpell(MAIM, *pTarget); //ai->TellMaster("Warlock Maim"); else if (FEROCIOUS_BITE > 0 && pTarget->getClass() == CLASS_HUNTER && ai->GetEnergyAmount() >= 35) ai->CastSpell(FEROCIOUS_BITE, *pTarget); //ai->TellMaster("Hunter Ferocious Bite"); else if (FEROCIOUS_BITE > 0 && pTarget->getClass() == CLASS_WARRIOR && ai->GetEnergyAmount() >= 35) ai->CastSpell(FEROCIOUS_BITE, *pTarget); //ai->TellMaster("Warrior Ferocious Bite"); else if (FEROCIOUS_BITE > 0 && pTarget->getClass() == CLASS_PALADIN && ai->GetEnergyAmount() >= 35) ai->CastSpell(FEROCIOUS_BITE, *pTarget); //ai->TellMaster("Paladin Ferocious Bite"); else if (MAIM > 0 && pTarget->getClass() == CLASS_MAGE && ai->GetEnergyAmount() >= 35) ai->CastSpell(MAIM, *pTarget); //ai->TellMaster("Mage Maim"); else if (MAIM > 0 && pTarget->getClass() == CLASS_PRIEST && ai->GetEnergyAmount() >= 35) ai->CastSpell(MAIM, *pTarget); //ai->TellMaster("Priest Maim"); else if (MAIM > 0 && ai->GetEnergyAmount() >= 35) ai->CastSpell(MAIM, *pTarget); //ai->TellMaster("Else Maim"); break; } else { DruidSpellCombat = 0; break; } break; } } // end DoNextCombatManeuver