예제 #1
0
            void DoNonCombatActions()
            {
                //if eating or drinking don't do anything
                if (me->HasAura(10256) || me->HasAura(1137))
                    return;

                Feast();

                //buff master
                if (!HasAuraName(master, SPELL_PRAYER_OF_SHADOW, 0) && isTimerReady(uiGc_Timer))
                    doCast(master, SPELL_PRAYER_OF_SHADOW, true);

                if (!HasAuraName(master, SPELL_FEAR_WARD, 0) && isTimerReady(uiGc_Timer))
                    doCast(master, SPELL_FEAR_WARD, true);

                if (!HasAuraName(master, SPELL_DIVINE_SPIRIT, 0) && isTimerReady(uiGc_Timer))
                {
                    doCast(master, SPELL_DIVINE_SPIRIT, true);
                    GiveManaBack();
                }

                //buff myself
                if (!me->HasAura(SPELL_INNER_FIRE, 0) && isTimerReady(uiGc_Timer))
                    doCast(me, SPELL_INNER_FIRE, true);

                if (!me->HasAura(SPELL_PW_FORTITUDE, 0) && isTimerReady(uiGc_Timer))
                    doCast(me, SPELL_PW_FORTITUDE, true);

                //buff and heal master's group
                if (master->GetGroup())
                    RezGroup(SPELL_RESURRECTION, master);
            }
예제 #2
0
            void DoNonCombatActions()
            {
                if (me->HasAura(SPELL_DEVOTION_AURA))
                Aura = DevotionAura;
                else if (me->HasAura(SPELL_FIRE_RESISTANCE_AURA))
                    Aura = FireResistanceAura;
                else
                    Aura = NoAura;

                //buff myself
                if (!master->HasAura(SPELL_DEVOTION_AURA) && isTimerReady(uiGc_Timer))
                    doCast(me, SPELL_DEVOTION_AURA, true);
                else
                    // I already have devotion aura and its not mine, cast different aura
                    if (master->HasAura(SPELL_DEVOTION_AURA) && !master->HasAura(SPELL_DEVOTION_AURA, me->GetGUID()) && Aura == NoAura && isTimerReady(uiGc_Timer))
                    doCast(me, SPELL_FIRE_RESISTANCE_AURA, true);

                if (!me->HasAura(SPELL_SEAL_OF_LIGHT) && isTimerReady(uiGc_Timer))
                    doCast(me, SPELL_SEAL_OF_LIGHT, true);

                //buff and heal master's group
                if (master->GetGroup())
                {
                    RezGroup(SPELL_REDEMPTION, master);
                    BuffAndHealGroup(master);
                    CureGroup(master);
                }
            }
예제 #3
0
            void DoNonCombatActions()
            {
                Feast();

                if (isTimerReady(uiGc_Timer) && !me->HasAura(SPELL_LIGHTNING_SHIELD, 0))
                doCast(me, SPELL_LIGHTNING_SHIELD);

                if (master->GetGroup())
                {
                    RezGroup(SPELL_ANCESTRAL_SPIRIT, master);
                    BuffAndHealGroup(master);
                }

                /* TESTING */
                Group::MemberSlotList const &a =((Player*)master)->GetGroup()->GetMemberSlots();

                for (Group::member_citerator itr = a.begin(); itr != a.end(); itr++)
                {
                    Player* tPlayer = ((Player *)master)->GetObjPlayer(itr->guid);
            
                    if (tPlayer == NULL)
                        continue;
            
                    //healing others
                    if (tPlayer->isAlive() && isTimerReady(uiOthersHeal_Timer) && tPlayer->GetGUID() != master->GetGUID() && tPlayer->GetHealth() * 100 / tPlayer->GetMaxHealth() < 75 && CanCast(tPlayer, GetSpellStore()->LookupEntry(SPELL_CHAIN_HEAL)))
                    {
                        doCast(tPlayer, SPELL_CHAIN_HEAL, false);
                        uiOthersHeal_Timer = 100;
                    }

                    //rezzes
                    if (tPlayer->isDead() && !me->isInCombat() && me->GetDistance(tPlayer) < 40 && isTimerReady(uiRez_Timer))
                    {
                        char* str = (char *)malloc(32);
                        sprintf(str, "Resucitando a %s", tPlayer->GetName());
                        me->MonsterSay(str, LANG_UNIVERSAL, NULL);
                        free(str);
                        doCast(tPlayer, SPELL_ANCESTRAL_SPIRIT, false);
                        uiRez_Timer = 160;
                    }
                }

                /* TESTING */
                if ((master->GetHealth() * 100 / master->GetMaxHealth() < 90) && uiLesserHealing_Timer <= 0)
                {
                    doCast(master, SPELL_LESSER_HEALING);
                    uiLesserHealing_Timer = 90;
                    uiHeal_Timer = uiHeal_Timer + 5; //wait 5 seconds before casting a real heal
                    return;
                }
                else if (uiLesserHealing_Timer >= 0)
                    --uiLesserHealing_Timer;

                if ((master->GetHealth() * 100 / master->GetMaxHealth() < 75) && isTimerReady(uiHeal_Timer))
                {
                    doCast(master, SPELL_CHAIN_HEAL);
                    uiHeal_Timer = 10;
                }

                if (me->GetHealth() * 100 / me->GetMaxHealth() < 90)
                {
                    if (uiSelfLesserHealing_Timer <= 0)
                    {
                        doCast(me, SPELL_LESSER_HEALING);
                        uiSelfLesserHealing_Timer = 90;
                        return;
                    }
                    else if (uiSelfLesserHealing_Timer >= 0)
                    --uiSelfLesserHealing_Timer;
                }
            }
    void DoNonCombatActions()
    {
        Feast();

        if(isTimerReady(GC_Timer) && !m_creature->HasAura(SPELL_LIGHTNING_SHIELD, 0))
            doCast(m_creature, SPELL_LIGHTNING_SHIELD);

        //Casts buffs
       // if(!m_creature->isInCombat())
       // {
            //if(!m_creature->HasAura(SPELL_WINDFURY_WEAPON, 0)) doCast(m_creature, SPELL_WINDFURY_WEAPON);
 //           if(isTimerReady(GC_Timer) && !m_creature->HasAura(SPELL_LIGHTNING_SHIELD, 0))
   //             doCast(m_creature, SPELL_LIGHTNING_SHIELD);
       // }


        //Heal/rez others
        //
        //check group members, this doesn't check bots/pets.  They will be done later.  Preference
        //goes to real players first.
        //
        //buff and heal group
        if(master->GetGroup())
        {
            RezGroup(SPELL_SHAMAN_REZZ, master);
            BuffAndHealGroup(master);
           // CureGroup(master);
        }


        /* TESTING */
        Group::MemberSlotList const &a =((Player*)master)->GetGroup()->GetMemberSlots();
        for(Group::member_citerator itr = a.begin(); itr != a.end(); itr++)
        {
            Player *tPlayer = ((Player *)master)->GetObjPlayer(itr->guid);
            if(tPlayer == NULL) continue;
            //healing others
            if(tPlayer->isAlive() &&
            isTimerReady(Others_Heal_Timer) &&
            tPlayer->GetGUID() != master->GetGUID() &&
            tPlayer->GetHealth()*100 / tPlayer->GetMaxHealth() < 75 &&
            CanCast(tPlayer, GetSpellStore()->LookupEntry (SPELL_CHAIN_HEAL)))
            {
                doCast(tPlayer, SPELL_CHAIN_HEAL, false);
                Others_Heal_Timer = 100;
            }

            //rezzes
            if(tPlayer->isDead() &&
            !m_creature->isInCombat() &&
            //CanCast(tPlayer, GetSpellStore()->LookupEntry (SPELL_SHAMAN_REZZ)) &&
            m_creature->GetDistance(tPlayer) < 40 &&
            isTimerReady(Rez_Timer))
            {
                char *str = (char *)malloc(32);
                sprintf(str, "Rezzing %s", tPlayer->GetName());
                m_creature->MonsterSay(str, LANG_UNIVERSAL, NULL);
                free(str);
                doCast(tPlayer, SPELL_SHAMAN_REZZ, false);
                Rez_Timer = 160;
            }
        }
        /* TESTING */



/* TESTING */
        if((master->GetHealth()*100 / master->GetMaxHealth() < 90) && Lesser_Healing_Timer <= 0)
        {
            doCast(master, SPELL_LESSER_HEALING);
            Lesser_Healing_Timer = 90;
            Heal_Timer = Heal_Timer + 5; //wait 5 seconds before casting a real heal
            //if(master->isInCombat()) && master->getVictim() == NULL) return;
            return;
        } else if(Lesser_Healing_Timer >= 0) --Lesser_Healing_Timer;

        if((master->GetHealth()*100 / master->GetMaxHealth() < 75) && isTimerReady(Heal_Timer))
        {
            doCast(master, SPELL_CHAIN_HEAL);
            Heal_Timer = 10;
        }

        if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 90)
        {
            if(Self_Lesser_Healing_Timer <= 0)
            {
                doCast(m_creature, SPELL_LESSER_HEALING);
                Self_Lesser_Healing_Timer = 90;
                return;
            } else if(Self_Lesser_Healing_Timer >= 0)
                --Self_Lesser_Healing_Timer;
        }
/* TESTING */
        }