Ejemplo n.º 1
0
bool PlayerbotWarriorAI::DoCombatManeuver(Unit *pTarget, bool cac)
{
    PlayerbotAI* ai = GetAI();
    Player* m_bot = GetPlayerBot();
    Player* m_master = ai->GetLeader();

    switch (m_bot->getRole())
    {
        case WarriorArms:
        {
            static const uint32 SpellArms[] = {BLOODTHIRST, WHIRLWIND, BLOODTHIRST, BLOODTHIRST, CLEAVE,
                WHIRLWIND, BLOODTHIRST, BLOODTHIRST, WHIRLWIND, BLOODTHIRST, HEROIC_STRIKE};
            static uint32 elt = sizeof(SpellArms)/sizeof(uint32);

            for (uint32 i = 1; i <= elt; ++i)
            {
                if (ai->CastSpell(SpellArms[(i+LastSpellArms)%elt], pTarget))
                {
                    LastSpellArms = (i+LastSpellArms)%elt;
                    return true;
                }
            }
            break;
        }
        case WarriorProtection:
        {
            static const uint32 SpellProtection[] = {CHARGE, REND, THUNDER_CLAP, CLEAVE, SHOCKWAVE,
                SUNDER_ARMOR, HEROIC_STRIKE, DEVASTATE, SHIELD_SLAM, REVENGE};
            static uint32 elt = sizeof(SpellProtection)/sizeof(uint32);

            for (uint32 i = 1; i <= elt; ++i)
            {
                if (ai->CastSpell(SpellProtection[(i+LastSpellProtection)%elt], pTarget))
                {
                    LastSpellProtection = (i+LastSpellProtection)%elt;
                    return true;
                }
            }
            break;
        }
        case WarriorFury:
        {
            static const uint32 SpellFury[] = {BLOODTHIRST, WHIRLWIND, BLOODTHIRST, BLOODTHIRST, CLEAVE,
                WHIRLWIND, BLOODTHIRST, BLOODTHIRST, WHIRLWIND, BLOODTHIRST, HEROIC_STRIKE};
            static uint32 elt = sizeof(SpellFury)/sizeof(uint32);

            for (uint32 i = 1; i <= elt; ++i)
            {
                if (ai->CastSpell(SpellFury[(i+LastSpellFury)%elt], pTarget))
                {
                    LastSpellFury = (i+LastSpellFury)%elt;
                    return true;
                }
            }
            break;
        }
    }
    return false;
}
Ejemplo n.º 2
0
void PlayerbotWarriorAI::DoNonCombatActions()
{
    PlayerbotAI* ai = GetAI();
    Player* m_bot = GetPlayerBot();
    Player* m_master = ai->GetLeader();

    if (m_bot->getRole() == WarriorProtection && ai->Cast(DEFENSIVE_STANCE))
        return;
    else if (ai->Cast(BERSERKER_STANCE))
        return;
    else if (ai->Cast(BATTLE_STANCE))
        return;
}
Ejemplo n.º 3
0
void PlayerbotShamanAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    if (!ai)
        return;

    Player * m_bot = GetPlayerBot();
    if (!m_bot)
        return;

    Player* m_master = ai->GetLeader();
    if (!m_master)
        return;

    SpellSequence = SPELL_ENHANCEMENT;

    // buff master with EARTH_SHIELD
    if (EARTH_SHIELD > 0)
        (!m_master->HasAura(EARTH_SHIELD, EFFECT_INDEX_0) && ai->CastSpell(EARTH_SHIELD, m_master));

    // buff myself with WATER_SHIELD, LIGHTNING_SHIELD
    if (WATER_SHIELD > 0)
        (!m_bot->HasAura(WATER_SHIELD, EFFECT_INDEX_0) && !m_bot->HasAura(LIGHTNING_SHIELD, EFFECT_INDEX_0) && ai->CastSpell(WATER_SHIELD, m_bot));
    else if (LIGHTNING_SHIELD > 0)
        (!m_bot->HasAura(LIGHTNING_SHIELD, EFFECT_INDEX_0) && !m_bot->HasAura(WATER_SHIELD, EFFECT_INDEX_0) && ai->CastSpell(LIGHTNING_SHIELD, m_bot));
    /*
           // buff myself weapon
           if (ROCKBITER_WEAPON > 0)
                (!m_bot->HasAura(ROCKBITER_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(EARTHLIVING_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(WINDFURY_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(FLAMETONGUE_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(FROSTBRAND_WEAPON, EFFECT_INDEX_0) && ai->CastSpell(ROCKBITER_WEAPON,*m_bot) );
           else if (EARTHLIVING_WEAPON > 0)
                (!m_bot->HasAura(EARTHLIVING_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(EARTHLIVING_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(FLAMETONGUE_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(FROSTBRAND_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(ROCKBITER_WEAPON, EFFECT_INDEX_0) && ai->CastSpell(WINDFURY_WEAPON,*m_bot) );
           else if (WINDFURY_WEAPON > 0)
                (!m_bot->HasAura(WINDFURY_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(EARTHLIVING_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(FLAMETONGUE_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(FROSTBRAND_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(ROCKBITER_WEAPON, EFFECT_INDEX_0) && ai->CastSpell(WINDFURY_WEAPON,*m_bot) );
           else if (FLAMETONGUE_WEAPON > 0)
                (!m_bot->HasAura(FLAMETONGUE_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(EARTHLIVING_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(WINDFURY_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(FROSTBRAND_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(ROCKBITER_WEAPON, EFFECT_INDEX_0) && ai->CastSpell(FLAMETONGUE_WEAPON,*m_bot) );
           else if (FROSTBRAND_WEAPON > 0)
                (!m_bot->HasAura(FROSTBRAND_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(EARTHLIVING_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(WINDFURY_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(FLAMETONGUE_WEAPON, EFFECT_INDEX_0) && !m_bot->HasAura(ROCKBITER_WEAPON, EFFECT_INDEX_0) && ai->CastSpell(FROSTBRAND_WEAPON,*m_bot) );
     */
    // 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->UseItem(pItem);
        return;
    }

    // hp check
    if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
        m_bot->SetStandState(UNIT_STAND_STATE_STAND);

    pItem = ai->FindFood();

    if (pItem != NULL && ai->GetHealthPercent() < 30)
    {
        ai->UseItem(pItem);
        return;
    }
    else if (pItem == NULL && fItem != NULL && !m_bot->HasAura(RECENTLY_BANDAGED, EFFECT_INDEX_0) && ai->GetHealthPercent() < 70)
    {
        ai->UseItem(fItem);
        return;
    }

    // heal master's group
    if (m_master->GetGroup())
    {
        Group::MemberSlotList const& groupSlot = m_master->GetGroup()->GetMemberSlots();
        for (Group::member_citerator itr = groupSlot.begin(); itr != groupSlot.end(); itr++)
        {
            Player *tPlayer = sObjectMgr.GetPlayer(itr->guid);
            if (!tPlayer || !tPlayer->isAlive())
                continue;

            // heal
            (HealTarget(tPlayer, tPlayer->GetHealth() * 100 / tPlayer->GetMaxHealth()));
        }
    }
} // end DoNonCombatActions
Ejemplo n.º 4
0
void PlayerbotShamanAI::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;

    //ai->SetMovementTarget(PlayerbotAI::MOVEMENT_FOLLOW, m_master);   // dont want to melee mob <----changed

    Group *m_group = m_bot->GetGroup();

    // Heal myself
    if (ai->GetHealthPercent() < 30 && ai->GetManaPercent() >= 32)
        ai->CastSpell(HEALING_WAVE);
    else if (ai->GetHealthPercent() < 50 && ai->GetManaPercent() >= 19)
        ai->CastSpell(LESSER_HEALING_WAVE);
    else if (ai->GetHealthPercent() < 70)
        HealTarget(m_bot, ai->GetHealthPercent());

    // Heal master
    uint32 masterHP = m_master->GetHealth() * 100 / m_master->GetMaxHealth();
    if (m_master->isAlive())
    {
        if (masterHP < 30 && ai->GetManaPercent() >= 32)
            ai->CastSpell(HEALING_WAVE, m_master);
        else if (masterHP < 70)
            HealTarget(m_master, masterHP);
    }

    // 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 < 30)
                HealTarget(m_groupMember, memberHP);
        }
    }

    // Damage Spells
    ai->SetInFront(pTarget);

    switch (SpellSequence)
    {
    case SPELL_ENHANCEMENT:
        if (STRENGTH_OF_EARTH_TOTEM > 0 && LastSpellEnhancement == 1 && (!m_bot->HasAura(STRENGTH_OF_EARTH_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 13)
        {
            ai->CastSpell(STRENGTH_OF_EARTH_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (STONESKIN_TOTEM > 0 && LastSpellEnhancement == 5 && (!m_bot->HasAura(STONESKIN_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(STRENGTH_OF_EARTH_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 13)
        {
            ai->CastSpell(STONESKIN_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (FOCUSED > 0 && LastSpellEnhancement == 2)
        {
            ai->CastSpell(FOCUSED, pTarget);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (FROST_RESISTANCE_TOTEM > 0 && LastSpellEnhancement == 10 && (!m_bot->HasAura(FROST_RESISTANCE_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(TOTEM_OF_WRATH, EFFECT_INDEX_0)) && (!m_bot->HasAura(FLAMETONGUE_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 10)
        {
            ai->CastSpell(FROST_RESISTANCE_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (FLAMETONGUE_TOTEM > 0 && LastSpellEnhancement == 15 && (!m_bot->HasAura(FLAMETONGUE_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(TOTEM_OF_WRATH, EFFECT_INDEX_0)) && (!m_bot->HasAura(FROST_RESISTANCE_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 14)
        {
            ai->CastSpell(FLAMETONGUE_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (FIRE_RESISTANCE_TOTEM > 0 && LastSpellEnhancement == 20 && (!m_bot->HasAura(FIRE_RESISTANCE_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(HEALING_STREAM_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(MANA_SPRING_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 10)
        {
            ai->CastSpell(FIRE_RESISTANCE_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (GROUNDING_TOTEM > 0 && LastSpellEnhancement == 25 && (!m_bot->HasAura(GROUNDING_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(WRATH_OF_AIR_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(WIND_FURY_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 5)
        {
            ai->CastSpell(GROUNDING_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (NATURE_RESISTANCE_TOTEM > 0 && LastSpellEnhancement == 30 && (!m_bot->HasAura(NATURE_RESISTANCE_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(WRATH_OF_AIR_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(GROUNDING_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(WIND_FURY_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 10)
        {
            ai->CastSpell(NATURE_RESISTANCE_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (WIND_FURY_TOTEM > 0 && LastSpellEnhancement == 35 && (!m_bot->HasAura(WIND_FURY_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(WRATH_OF_AIR_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(GROUNDING_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 11)
        {
            ai->CastSpell(WIND_FURY_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (STORMSTRIKE > 0 && LastSpellEnhancement == 4 && (!pTarget->HasAura(STORMSTRIKE, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 8)
        {
            ai->CastSpell(STORMSTRIKE, pTarget);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (LAVA_LASH > 0 && LastSpellEnhancement == 6 && ai->GetManaPercent() >= 4)
        {
            ai->CastSpell(LAVA_LASH, pTarget);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (FERAL_SPIRIT > 0 && LastSpellEnhancement == 7 && ai->GetManaPercent() >= 12)
        {
            ai->CastSpell(FERAL_SPIRIT);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (WRATH_OF_AIR_TOTEM > 0 && (!m_bot->HasAura(WRATH_OF_AIR_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(GROUNDING_TOTEM, EFFECT_INDEX_0)) && LastSpellEnhancement == 40)
        {
            ai->CastSpell(WRATH_OF_AIR_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (EARTH_ELEMENTAL_TOTEM > 0 && LastSpellEnhancement == 45 && ai->GetManaPercent() >= 24)
        {
            ai->CastSpell(EARTH_ELEMENTAL_TOTEM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (BLOODLUST > 0 && LastSpellEnhancement == 8 && (!m_master->HasAura(BLOODLUST, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 26)
        {
            ai->CastSpell(BLOODLUST);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (HEROISM > 0 && LastSpellEnhancement == 10 && (!m_master->HasAura(HEROISM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 26)
        {
            ai->CastSpell(HEROISM);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (SHAMANISTIC_RAGE > 0 && (!m_bot->HasAura(SHAMANISTIC_RAGE, EFFECT_INDEX_0)) && LastSpellEnhancement == 11)
        {
            ai->CastSpell(SHAMANISTIC_RAGE, m_bot);
            SpellSequence = SPELL_RESTORATION;
            LastSpellEnhancement = LastSpellEnhancement + 1;
            break;
        }
        else if (LastSpellEnhancement > 50)
        {
            LastSpellEnhancement = 1;
            SpellSequence = SPELL_RESTORATION;
            break;
        }
        LastSpellEnhancement = LastSpellEnhancement + 1;
    //SpellSequence = SPELL_RESTORATION;
    //break;

    case SPELL_RESTORATION:
        if (HEALING_STREAM_TOTEM > 0 && LastSpellRestoration < 3 && ai->GetHealthPercent() < 50 && (!m_bot->HasAura(HEALING_STREAM_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(MANA_SPRING_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 4)
        {
            ai->CastSpell(HEALING_STREAM_TOTEM);
            SpellSequence = SPELL_ELEMENTAL;
            LastSpellRestoration = LastSpellRestoration + 1;
            break;
        }
        else if (MANA_SPRING_TOTEM > 0 && LastSpellRestoration < 4 && (!m_bot->HasAura(MANA_SPRING_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(HEALING_STREAM_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 5)
        {
            ai->CastSpell(MANA_SPRING_TOTEM);
            SpellSequence = SPELL_ELEMENTAL;
            LastSpellRestoration = LastSpellRestoration + 1;
            break;
        }
        else if (MANA_TIDE_TOTEM > 0 && LastSpellRestoration < 5 && ai->GetManaPercent() < 50 && ai->GetManaPercent() >= 3)
        {
            ai->CastSpell(MANA_TIDE_TOTEM);
            SpellSequence = SPELL_ELEMENTAL;
            LastSpellRestoration = LastSpellRestoration + 1;
            break;
        }
        /*else if (TREMOR_TOTEM > 0 && LastSpellRestoration < 6 && (!m_bot->HasAura(STRENGTH_OF_EARTH_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 2)
           {
            ai->CastSpell(TREMOR_TOTEM);
            SpellSequence = SPELL_ELEMENTAL;
            LastSpellRestoration = LastSpellRestoration +1;
            break;
           }*/
        else if (LastSpellRestoration > 6)
        {
            LastSpellRestoration = 0;
            SpellSequence = SPELL_ELEMENTAL;
            break;
        }
        LastSpellRestoration = LastSpellRestoration + 1;
    //SpellSequence = SPELL_ELEMENTAL;
    //break;

    case SPELL_ELEMENTAL:
        if (LIGHTNING_BOLT > 0 && LastSpellElemental == 1 && ai->GetManaPercent() >= 13)
        {
            ai->CastSpell(LIGHTNING_BOLT, pTarget);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (SEARING_TOTEM > 0 && LastSpellElemental == 2 && (!pTarget->HasAura(SEARING_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(TOTEM_OF_WRATH, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 9)
        {
            ai->CastSpell(SEARING_TOTEM);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (STONECLAW_TOTEM > 0 && ai->GetHealthPercent() < 51 && LastSpellElemental == 3 && (!pTarget->HasAura(STONECLAW_TOTEM, EFFECT_INDEX_0)) && (!pTarget->HasAura(EARTHBIND_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(STRENGTH_OF_EARTH_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 8)
        {
            ai->CastSpell(STONECLAW_TOTEM);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (FLAME_SHOCK > 0 && LastSpellElemental == 4 && (!pTarget->HasAura(FLAME_SHOCK, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 22)
        {
            ai->CastSpell(FLAME_SHOCK, pTarget);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (LAVA_BURST > 0 && LastSpellElemental == 5 && (pTarget->HasAura(FLAME_SHOCK, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 10)
        {
            ai->CastSpell(LAVA_BURST, pTarget);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (MAGMA_TOTEM > 0 && LastSpellElemental == 6 && (!m_bot->HasAura(TOTEM_OF_WRATH, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 35)
        {
            ai->CastSpell(MAGMA_TOTEM);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (EARTHBIND_TOTEM > 0 && LastSpellElemental == 7 && (!pTarget->HasAura(EARTHBIND_TOTEM, EFFECT_INDEX_0)) && (!m_bot->HasAura(STRENGTH_OF_EARTH_TOTEM, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 5)
        {
            ai->CastSpell(EARTHBIND_TOTEM);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (EARTH_SHOCK > 0 && LastSpellElemental == 8 && ai->GetManaPercent() >= 23)
        {
            ai->CastSpell(EARTH_SHOCK, pTarget);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (PURGE > 0 && LastSpellElemental == 9 && ai->GetManaPercent() >= 8)
        {
            ai->CastSpell(PURGE, pTarget);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (WIND_SHOCK > 0 && LastSpellElemental == 10 && ai->GetManaPercent() >= 8)
        {
            ai->CastSpell(WIND_SHOCK, pTarget);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (FIRE_NOVA_TOTEM > 0 && LastSpellElemental == 11 && ai->GetManaPercent() >= 33)
        {
            ai->CastSpell(FIRE_NOVA_TOTEM);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (FROST_SHOCK > 0 && LastSpellElemental == 12 && (!pTarget->HasAura(FROST_SHOCK, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 23)
        {
            ai->CastSpell(FROST_SHOCK, pTarget);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (CHAIN_LIGHTNING > 0 && LastSpellElemental == 13 && ai->GetManaPercent() >= 33)
        {
            ai->CastSpell(CHAIN_LIGHTNING, pTarget);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (TOTEM_OF_WRATH > 0 && LastSpellElemental == 14 && (!m_bot->HasAura(TOTEM_OF_WRATH, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 5)
        {
            ai->CastSpell(TOTEM_OF_WRATH);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        else if (FIRE_ELEMENTAL_TOTEM > 0 && LastSpellElemental == 15 && ai->GetManaPercent() >= 23)
        {
            ai->CastSpell(FIRE_ELEMENTAL_TOTEM);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
        }
        /*else if (HEX > 0 && LastSpellElemental == 16 && (!pTarget->HasAura(HEX, EFFECT_INDEX_0)) && ai->GetManaPercent() >= 3)
           {
            ai->CastSpell(HEX);
            SpellSequence = SPELL_ENHANCEMENT;
            LastSpellElemental = LastSpellElemental + 1;
            break;
           }*/
        else if (LastSpellElemental > 16)
        {
            LastSpellElemental = 1;
            SpellSequence = SPELL_ENHANCEMENT;
            break;
        }
        else
        {
            LastSpellElemental = LastSpellElemental + 1;
            SpellSequence = SPELL_ENHANCEMENT;
        }
    }
} // end DoNextCombatManeuver
Ejemplo n.º 5
0
void PlayerbotHunterAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    Player * m_bot = GetPlayerBot();
    Player* m_master = ai->GetLeader();

    static const uint32 MinorGlyphs[] = {57903, 57866, 57870};           // feigh death - revive pet - healing pet
    static const uint32 SurvivalMajorGlyphs[] = {56832, 56826, 63066};     // serpent sting - steady shot - explosive shot

    for (uint32 i = 0; i < 3; i++)
    {
        if (!m_bot->HasSpell(MinorGlyphs[i]))
            m_bot->learnSpell(MinorGlyphs[i], true);

        if (!m_bot->HasSpell(SurvivalMajorGlyphs[i]))
            m_bot->learnSpell(SurvivalMajorGlyphs[i], true);
    }

    if (!m_bot->HasAura(TRUESHOT_AURA, EFFECT_INDEX_0))
        ai->CastSpell(TRUESHOT_AURA, m_bot);

    if (!m_bot->HasAura(ASPECT_OF_THE_VIPER, EFFECT_INDEX_0) && ai->GetManaPercent() < 90 && ai->CastSpell(ASPECT_OF_THE_VIPER, m_bot))
        return;
    else if (!m_bot->HasAura(ASPECT_OF_THE_DRAGONHAWK, EFFECT_INDEX_0) && ai->GetManaPercent() >= 90 && ai->CastSpell(ASPECT_OF_THE_DRAGONHAWK, m_bot))
        return;

    // reset ranged combat state
    if (!m_rangedCombat)
        m_rangedCombat = true;

    // check for pet
    if (PET_SUMMON > 0 && !m_petSummonFailed && HasPet(m_bot))
    {
        // we can summon pet, and no critical summon errors before
        Pet *pet = m_bot->GetPet();
        if (!pet)
        {
            // summon pet
            if (PET_SUMMON > 0 && ai->CastSpell(PET_SUMMON, m_bot))
            {
            }
            else
            {
                m_petSummonFailed = true;
            }
        }
        else if (pet->getDeathState() != ALIVE)
        {
            // revive pet
            if (PET_REVIVE > 0 && ai->GetManaPercent() >= 80 && ai->CastSpell(PET_REVIVE, m_bot))
            {
            }
        }
        else if (((float) pet->GetHealth() / (float) pet->GetMaxHealth()) < 0.5f)
        {
            // heal pet when health lower 50%
            if (PET_MEND > 0 && !pet->getDeathState() != ALIVE && !pet->HasAura(PET_MEND, EFFECT_INDEX_0) && ai->GetManaPercent() >= 13 && ai->CastSpell(PET_MEND, m_bot))
            {
            }
        }
        else if (pet->GetHappinessState() != HAPPY) // if pet is hungry
        {
            Unit *caster = (Unit*) m_bot;
            // list out items in main backpack
            for (uint8 slot = INVENTORY_SLOT_ITEM_START; slot < INVENTORY_SLOT_ITEM_END; slot++)
            {
                Item* const pItem = m_bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
                if (pItem)
                {
                    const ItemPrototype* const pItemProto = pItem->GetProto();
                    if (!pItemProto)
                        continue;

                    if (pet->HaveInDiet(pItemProto)) // is pItem in pets diet
                    {
                        caster->CastSpell(caster, 51284, true); // pet feed visual
                        uint32 count = 1; // number of items used
                        int32 benefit = pet->GetCurrentFoodBenefitLevel(pItemProto->ItemLevel); // nutritional value of food
                        m_bot->DestroyItemCount(pItem, count, true); // remove item from inventory
                        m_bot->CastCustomSpell(m_bot, PET_FEED, &benefit, NULL, NULL, true); // feed pet

                        ai->SetIgnoreUpdateTime(10);
                        return;
                    }
                }
            }
            // list out items in other removable backpacks
            for (uint8 bag = INVENTORY_SLOT_BAG_START; bag < INVENTORY_SLOT_BAG_END; ++bag)
            {
                const Bag* const pBag = (Bag*) m_bot->GetItemByPos(INVENTORY_SLOT_BAG_0, bag);
                if (pBag)
                    for (uint8 slot = 0; slot < pBag->GetBagSize(); ++slot)
                    {
                        Item* const pItem = m_bot->GetItemByPos(bag, slot);
                        if (pItem)
                        {
                            const ItemPrototype* const pItemProto = pItem->GetProto();
                            if (!pItemProto)
                                continue;

                            if (pet->HaveInDiet(pItemProto)) // is pItem in pets diet
                            {
                                caster->CastSpell(caster, 51284, true); // pet feed visual
                                uint32 count = 1; // number of items used
                                int32 benefit = pet->GetCurrentFoodBenefitLevel(pItemProto->ItemLevel); // nutritional value of food
                                m_bot->DestroyItemCount(pItem, count, true); // remove item from inventory
                                m_bot->CastCustomSpell(m_bot, PET_FEED, &benefit, NULL, NULL, true); // feed pet

                                ai->SetIgnoreUpdateTime(10);
                                return;
                            }
                        }
                    }
            }
            if (pet->HasAura(PET_MEND, EFFECT_INDEX_0) && !pet->HasAura(PET_FEED, EFFECT_INDEX_0))

            ai->SetIgnoreUpdateTime(7);
        }
    }
}
Ejemplo n.º 6
0
bool PlayerbotHunterAI::DoCombatManeuver(Unit *pTarget, bool cac)
{
    PlayerbotAI *ai = GetAI();
    Player * m_bot = GetPlayerBot();
    Player* m_master = ai->GetLeader();

    // Hunter
    Unit* pVictim = pTarget->getVictim();
    /*
    // check for pet and heal if neccessary
    Pet *pet = m_bot->GetPet();
    if ((pet)
        && (((float) pet->GetHealth() / (float) pet->GetMaxHealth()) < 0.5f)
        && (PET_MEND > 0 && !pet->getDeathState() != ALIVE && pVictim != m_bot && !pet->HasAura(PET_MEND, EFFECT_INDEX_0) && ai->GetManaPercent() >= 13 && ai->CastSpell(PET_MEND, m_bot)))
    {

        return true;
    }
    else if ((pet)
             && (INTIMIDATION > 0 && pVictim == pet && !pet->HasAura(INTIMIDATION, EFFECT_INDEX_0) && ai->CastSpell(INTIMIDATION, m_bot)))

        return true;*/

    // racial traits
    if (m_bot->getRace() == RACE_ORC && !m_bot->HasAura(BLOOD_FURY, EFFECT_INDEX_0) && ai->CastSpell(BLOOD_FURY, m_bot))
        return true;
    else if (m_bot->getRace() == RACE_TROLL && !m_bot->HasAura(BERSERKING, EFFECT_INDEX_0) && ai->CastSpell(BERSERKING, m_bot))
        return true;

    if (m_bot->IsWithinDist(pTarget, ATTACK_DISTANCE))
        m_rangedCombat = false;
    else
        m_rangedCombat = true;

    if (!m_bot->HasAura(ASPECT_OF_THE_VIPER) && ai->GetManaPercent() < 50 && ai->CastSpell(ASPECT_OF_THE_VIPER, m_bot))
        return true;
    else if (!m_bot->HasAura(ASPECT_OF_THE_DRAGONHAWK) && ai->GetManaPercent() >= 80 && ai->CastSpell(ASPECT_OF_THE_DRAGONHAWK, m_bot))
        return true;

    // damage spells
    if (!pTarget->HasAura(HUNTERS_MARK) && ai->CastSpell(HUNTERS_MARK, pTarget))
        return true;

    if (m_bot->HasAura(ASPECT_OF_THE_VIPER) && ai->CastSpell(RAPID_FIRE))
        return true;

    static const uint32 RangedSpell[] = {KILL_SHOT, EXPLOSIVE_SHOT, SERPENT_STING, BLACK_ARROW, ARCANE_SHOT, AIMED_SHOT, STEADY_SHOT};
    static const uint32 MeleeSpell[] = {MONGOOSE_BITE, RAPTOR_STRIKE, IMMOLATION_TRAP, EXPLOSIVE_TRAP};
    static const uint32 eltRanged = sizeof(RangedSpell)/sizeof(uint32);
    static const uint32 eltMelee = sizeof(MeleeSpell)/sizeof(uint32);
    char *RangedSpellEnabled = "001110F";
    char *MeleeSpellEnabled = "1110";
    uint32 numberTargets = 0;

    if (m_bot->getLevel() >= 34)
        MeleeSpellEnabled = "1101";

    if (m_bot->getLevel() >= 60)
        RangedSpellEnabled = "111101F";

    // Count number of targets
    Group* m_group = m_bot->GetGroup();
    GroupReference *ref = (m_group) ? m_group->GetFirstMember() : NULL;
    do
    {
        Player *g_member = (ref) ? ref->getSource() : m_bot;

        if (!g_member->isAlive())
            continue;

        for (Unit::AttackerSet::const_iterator itr = g_member->getAttackers().begin(); itr != g_member->getAttackers().end(); itr++)
            if ((*itr)->IsWithinDist(m_bot, 36.0f))
                numberTargets++;

    }while(ref = (ref) ? ref->next() : NULL);

    // Spells with Area of Effect
    if (m_rangedCombat && numberTargets >= 3 && ai->CastSpell(MULTI_SHOT, pTarget))
        return true;

    if (numberTargets >= 5 && ai->CastSpell(VOLLEY, pTarget))
        return true;

    // Casting spell cycle
    if (m_rangedCombat)
    {
        for (uint32 i = 0; i < eltRanged; ++i)
        {
            if (RangedSpellEnabled[i] == 'F')
            {
                if (m_bot->HasAura(ASPECT_OF_THE_DRAGONHAWK) && !pTarget->HasAuraFromUnit(RangedSpell[i], m_bot) && ai->CastSpell(RangedSpell[i], pTarget))
                    return true;
                else
                    continue;
            }
            else if (RangedSpellEnabled[i] == '1')
            {
                if (!pTarget->HasAuraFromUnit(RangedSpell[i], m_bot) && ai->CastSpell(RangedSpell[i], pTarget))
                    return true;
            }
        }
    }
    else
    {
        for (uint32 i = 0; i < eltMelee; ++i)
        {
            if (!pTarget->HasAuraFromUnit(MeleeSpell[i], m_bot) && ai->CastSpell(MeleeSpell[i], pTarget))
                return true;
        }
    }
    return false;
}
Ejemplo n.º 7
0
void PlayerbotDruidAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    if (!ai)
        return;

    Player * m_bot = GetPlayerBot();
    if (!m_bot)
        return;

    Player* m_master = ai->GetLeader();
    if (!m_master)
        return;

    // mana check
    if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
        m_bot->SetStandState(UNIT_STAND_STATE_STAND);

    Item* pItem = ai->FindDrink();
    Item* fItem = ai->FindBandage();

    if (pItem != NULL && ai->GetManaPercent() < 30)
    {

        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->UseItem(pItem);
        return;
    }
    else if (pItem == NULL && fItem != NULL && !m_bot->HasAura(RECENTLY_BANDAGED, EFFECT_INDEX_0) && ai->GetHealthPercent() < 70)
    {

        ai->UseItem(fItem);
        return;
    }

    // buff and heal master's group
    if (m_master->GetGroup())
    {
        // Buff master with group buff
       if (m_master->isAlive() && GIFT_OF_THE_WILD && ai->HasSpellReagents(GIFT_OF_THE_WILD) && ai->Buff(GIFT_OF_THE_WILD, m_master))
           return;

        Group::MemberSlotList const& groupSlot = m_master->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;

            // Resurrect member if needed
            if (!tPlayer->isAlive())
            {
                if (ai->CastSpell(REVIVE, tPlayer))
                    return;
                else
                    continue;
            }
            else
            {
                // buff and heal
                if (BuffPlayer(tPlayer))
                    return;

                if (HealTarget(tPlayer))
                    return;
            }
        }
    }
    else
    {
        if (m_master->isAlive())
        {
            if (BuffPlayer(m_master))
                return;
            if (HealTarget(m_master))
                return;
        }
        else
            ai->CastSpell(REVIVE, m_master);

    }

    BuffPlayer(m_bot);
} // end DoNonCombatActions
Ejemplo n.º 8
0
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;
            }
            else if (STARFALL > 0 && m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0) && !m_bot->HasAura(STARFALL, EFFECT_INDEX_0) && 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 && 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 && (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 && (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:
            if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
            {
                m_bot->RemoveAurasDueToSpell(768);

                break;
            }
            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 (FAERIE_FIRE > 0 && DruidSpellCombat < 1 && !pTarget->HasAura(FAERIE_FIRE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 8)
            {
                ai->CastSpell(FAERIE_FIRE, pTarget);
                DruidSpellCombat++;
                break;
            }
            else if (MOONFIRE > 0 && 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 && DruidSpellCombat < 4 && ai->GetManaPercent() >= 91)
            {

                ai->CastSpell(HURRICANE, pTarget);
                ai->SetIgnoreUpdateTime(10);
                DruidSpellCombat++;
                break;
            }
            else if (WRATH > 0 && DruidSpellCombat < 5 && ai->GetManaPercent() >= 13)
            {
                ai->CastSpell(WRATH, pTarget);
                DruidSpellCombat++;
                break;
            }
            else if (INSECT_SWARM > 0 && DruidSpellCombat < 6 && !pTarget->HasAura(INSECT_SWARM, EFFECT_INDEX_0) && ai->GetManaPercent() >= 9)
            {
                ai->CastSpell(INSECT_SWARM, pTarget);
                DruidSpellCombat++;
                break;
            }
            else if (STARFIRE > 0 && DruidSpellCombat < 7 && ai->GetManaPercent() >= 18)
            {
                ai->CastSpell(STARFIRE, pTarget);
                DruidSpellCombat++;
                break;
            }
            else if (FORCE_OF_NATURE > 0 && DruidSpellCombat < 8 && ai->GetManaPercent() >= 12)
            {

                ai->CastSpell(FORCE_OF_NATURE);
                DruidSpellCombat++;
                break;
            }
            else if (STARFALL > 0 && !m_bot->HasAura(STARFALL, EFFECT_INDEX_0) && 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->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:

            if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
            {
                m_bot->RemoveAurasDueToSpell(768);

                break;
            }
            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 (ai->GetHealthPercent() <= 40)
            {
                HealTarget (m_bot);
                break;
            }
            if (masterHP <= 40)
            {
                HealTarget (m_master);
                break;
            }
            else
            {
                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);

                break;
            }

            if (m_bot->GetComboPoints() == 5)
            {
                if (RIP > 0 && pTarget->getClass() == CLASS_ROGUE && ai->GetEnergyAmount() >= 30)
                    ai->CastSpell(RIP, pTarget);

                else if (MAIM > 0 && pTarget->getClass() == CLASS_DRUID && ai->GetEnergyAmount() >= 35)
                    ai->CastSpell(MAIM, pTarget);

                else if (MAIM > 0 && pTarget->getClass() == CLASS_SHAMAN && ai->GetEnergyAmount() >= 35)
                    ai->CastSpell(MAIM, pTarget);

                else if (MAIM > 0 && pTarget->getClass() == CLASS_WARLOCK && ai->GetEnergyAmount() >= 35)
                    ai->CastSpell(MAIM, pTarget);

                else if (FEROCIOUS_BITE > 0 && pTarget->getClass() == CLASS_HUNTER && ai->GetEnergyAmount() >= 35)
                    ai->CastSpell(FEROCIOUS_BITE, pTarget);

                else if (FEROCIOUS_BITE > 0 && pTarget->getClass() == CLASS_WARRIOR && ai->GetEnergyAmount() >= 35)
                    ai->CastSpell(FEROCIOUS_BITE, pTarget);

                else if (FEROCIOUS_BITE > 0 && pTarget->getClass() == CLASS_PALADIN && ai->GetEnergyAmount() >= 35)
                    ai->CastSpell(FEROCIOUS_BITE, pTarget);

                else if (FEROCIOUS_BITE > 0 && pTarget->getClass() == CLASS_DEATH_KNIGHT && ai->GetEnergyAmount() >= 25)
                    ai->CastSpell(FEROCIOUS_BITE, pTarget);

                else if (MAIM > 0 && pTarget->getClass() == CLASS_MAGE && ai->GetEnergyAmount() >= 35)
                    ai->CastSpell(MAIM, pTarget);

                else if (MAIM > 0 && pTarget->getClass() == CLASS_PRIEST && ai->GetEnergyAmount() >= 35)
                    ai->CastSpell(MAIM, pTarget);

                else if (MAIM > 0 && ai->GetEnergyAmount() >= 35)
                    ai->CastSpell(MAIM, pTarget);

                break;
            }
            else
            {
                DruidSpellCombat = 0;
                break;
            }
            break;
    }
} // end DoNextCombatManeuver
Ejemplo n.º 9
0
void PlayerbotPriestAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    if (!ai)
        return;

    Player * m_bot = GetPlayerBot();
    if (!m_bot)
        return;

    Player* m_master = ai->GetLeader();
    if (!m_master)
        return;

    SpellSequence = SPELL_HOLY;

    // selfbuff goes first
    if (ai->SelfBuff(INNER_FIRE))
        return;

    // mana check
    if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
        m_bot->SetStandState(UNIT_STAND_STATE_STAND);

    Item* pItem = ai->FindDrink();
    Item* fItem = ai->FindBandage();

    if (pItem != NULL && ai->GetManaPercent() < 30)
    {
        ai->UseItem(pItem);
        return;
    }

    // hp check
    if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
        m_bot->SetStandState(UNIT_STAND_STATE_STAND);

    pItem = ai->FindFood();

    if (pItem != NULL && ai->GetHealthPercent() < 30)
    {
        ai->UseItem(pItem);
        return;
    }
    else if (pItem == NULL && fItem != NULL && !m_bot->HasAura(RECENTLY_BANDAGED, EFFECT_INDEX_0) && ai->GetHealthPercent() < 70)
    {
        ai->UseItem(fItem);
        return;
    }

    // buff and heal master's group
    if (m_master->GetGroup())
    {
        // Buff master with group buffs
        if (m_master->isAlive())
        {
            if (PRAYER_OF_FORTITUDE && ai->HasSpellReagents(PRAYER_OF_FORTITUDE) && ai->Buff(PRAYER_OF_FORTITUDE, m_master))
                return;

            if (PRAYER_OF_SPIRIT && ai->HasSpellReagents(PRAYER_OF_SPIRIT) && ai->Buff(PRAYER_OF_SPIRIT, m_master))
                return;
        }

        Group::MemberSlotList const& groupSlot = m_master->GetGroup()->GetMemberSlots();
        for (Group::member_citerator itr = groupSlot.begin(); itr != groupSlot.end(); itr++)
        {
            Player *tPlayer = sObjectMgr.GetPlayer(itr->guid);
            if (!tPlayer || tPlayer == m_bot)
                continue;

            // first rezz em
            if (!tPlayer->isAlive())
            {
                if (ai->CastSpell(RESURRECTION, tPlayer))
                {
                    std::string msg = "Resurrecting ";
                    msg += tPlayer->GetName();
                    m_bot->Say(msg, LANG_UNIVERSAL);
                    return;
                }
                else
                    continue;
            }
            else
            {
                // buff and heal
                if (BuffPlayer(tPlayer))
                    return;

                if (HealTarget(tPlayer))
                    return;
            }
        }
    }
    else
    {
        if (m_master->isAlive())
        {
            if (BuffPlayer(m_master))
                return;
            if (HealTarget(m_master))
                return;
        }
        else
            ai->CastSpell(RESURRECTION, m_master);
    }

    BuffPlayer(m_bot);
} // end DoNonCombatActions
Ejemplo n.º 10
0
void PlayerbotPriestAI::DoNextCombatManeuver(Unit *pTarget)
{
    Unit* pVictim = pTarget->getVictim();
    PlayerbotAI* ai = GetAI();
    if (!ai)
        return;

    Player* m_master = ai->GetLeader();
    if (!m_master)
        return;

    //ai->SetMovementTarget(PlayerbotAI::MOVEMENT_FOLLOW, m_master);   // dont want to melee mob

    Player *m_bot = GetPlayerBot();
    Group *m_group = m_bot->GetGroup();

    // Heal myself
    if (ai->GetHealthPercent() < 15 && FADE > 0 && !m_bot->HasAura(FADE, EFFECT_INDEX_0))
    {

        ai->CastSpell(FADE, m_bot);
    }
    else if (ai->GetHealthPercent() < 25 && POWER_WORD_SHIELD > 0 && !m_bot->HasAura(POWER_WORD_SHIELD, EFFECT_INDEX_0))
    {

        ai->CastSpell(POWER_WORD_SHIELD);
    }
    else if (ai->GetHealthPercent() < 35 && DESPERATE_PRAYER > 0)
    {

        ai->CastSpell(DESPERATE_PRAYER, m_bot);
    }
    else if (ai->GetHealthPercent() < 80)
        HealTarget (m_bot);

    // Heal master
    uint32 masterHP = m_master->GetHealth() * 100 / m_master->GetMaxHealth();
    if (m_master->isAlive())
    {
        if (masterHP < 25 && POWER_WORD_SHIELD > 0 && !m_master->HasAura(POWER_WORD_SHIELD, EFFECT_INDEX_0))
            ai->CastSpell(POWER_WORD_SHIELD, m_master);
        else if (masterHP < 80)
            HealTarget (m_master);
    }

    // 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
    ai->SetInFront(pTarget);
    float dist = m_bot->GetDistance(pTarget);

    switch (SpellSequence)
    {
    case SPELL_HOLY:
        if (SMITE > 0 && 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 && LastSpellHoly < 2 && pTarget->GetPower(POWER_MANA) > 0 && ai->GetManaPercent() < 70 && ai->GetManaPercent() >= 14)
        {

            ai->CastSpell(MANA_BURN, pTarget);
            ai->SetIgnoreUpdateTime(3);
            SpellSequence = SPELL_SHADOWMAGIC;
            LastSpellHoly = LastSpellHoly + 1;
            break;
        }
        else if (HOLY_NOVA > 0 && LastSpellHoly < 3 && dist <= ATTACK_DISTANCE && ai->GetManaPercent() >= 22)
        {

            ai->CastSpell(HOLY_NOVA);
            SpellSequence = SPELL_SHADOWMAGIC;
            LastSpellHoly = LastSpellHoly + 1;
            break;
        }
        else if (HOLY_FIRE > 0 && LastSpellHoly < 4 && !pTarget->HasAura(HOLY_FIRE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 13)
        {

            ai->CastSpell(HOLY_FIRE, pTarget);
            SpellSequence = SPELL_SHADOWMAGIC;
            LastSpellHoly = LastSpellHoly + 1;
            break;
        }
        else if (PRAYER_OF_MENDING > 0 && LastSpellHoly < 5 && pVictim == m_master && m_master->GetHealth() <= m_master->GetMaxHealth() * 0.7 && !m_master->HasAura(PRAYER_OF_MENDING, EFFECT_INDEX_0) && ai->GetManaPercent() >= 15)
        {

            ai->CastSpell(PRAYER_OF_MENDING, m_master);
            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 && LastSpellShadowMagic < 1 && !pTarget->HasAura(SHADOW_WORD_PAIN, EFFECT_INDEX_0) && ai->GetManaPercent() >= 25)
        {

            ai->CastSpell(SHADOW_WORD_PAIN, pTarget);
            SpellSequence = SPELL_DISCIPLINE;
            LastSpellShadowMagic = LastSpellShadowMagic + 1;
            break;
        }
        else if (MIND_BLAST > 0 && LastSpellShadowMagic < 2 && ai->GetManaPercent() >= 19)
        {

            ai->CastSpell(MIND_BLAST, pTarget);
            SpellSequence = SPELL_DISCIPLINE;
            LastSpellShadowMagic = LastSpellShadowMagic + 1;
            break;
        }
        else if (SCREAM > 0 && LastSpellShadowMagic < 3 && ai->GetManaPercent() >= 15)
        {

            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->CastSpell(MIND_FLAY, pTarget);
            ai->SetIgnoreUpdateTime(3);
            SpellSequence = SPELL_DISCIPLINE;
            LastSpellShadowMagic = LastSpellShadowMagic + 1;
            break;
        }
        else if (DEVOURING_PLAGUE > 0 && 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 && 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 && LastSpellShadowMagic < 8)
        {
            ai->CastSpell(SHADOWFIEND);
            SpellSequence = SPELL_DISCIPLINE;
            LastSpellShadowMagic = LastSpellShadowMagic + 1;
            break;
        }
        else if (MIND_SEAR > 0 && LastSpellShadowMagic < 9 && 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 && LastSpellDiscipline < 1 && ai->GetManaPercent() >= 3)
        {

            ai->CastSpell(FEAR_WARD, m_master);
            SpellSequence = SPELL_HOLY;
            LastSpellDiscipline = LastSpellDiscipline + 1;
            break;
        }
        else if (POWER_INFUSION > 0 && LastSpellDiscipline < 2 && ai->GetManaPercent() >= 16)
        {

            ai->CastSpell(POWER_INFUSION, m_master);
            SpellSequence = SPELL_HOLY;
            LastSpellDiscipline = LastSpellDiscipline + 1;
            break;
        }
        else if (MASS_DISPEL > 0 && LastSpellDiscipline < 3 && ai->GetManaPercent() >= 33)
        {

            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->CastSpell(INNER_FOCUS, m_bot);
            SpellSequence = SPELL_HOLY;
            LastSpellDiscipline = LastSpellDiscipline + 1;
            break;
        }
        else if (PENANCE > 0 && LastSpellDiscipline < 5 && ai->GetManaPercent() >= 16)
        {

            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