Ejemplo n.º 1
0
        void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
        {
            if (Unit* pUnit = GetUnitOwner())
            {
                Pet* pPet = pUnit->ToPet();
                if (!pPet)
                    return;

                if (Player* pPlayerOwner = pPet->GetOwner()->ToPlayer())
                {
                    float add = 0.0f;
                    float bonus = 0.0f;

                    PetSpellMap::const_iterator itr = (pPet->m_spells.find(TALENT_PET_WILD_HUNT_1));
                    if (itr == pPet->m_spells.end())
                        itr = pPet->m_spells.find(TALENT_PET_WILD_HUNT_2);

                    if (itr != pPet->m_spells.end()) // If pet has Wild Hunt
                    {
                        SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
                        if (spellInfo)
                            add += spellInfo->Effects[EFFECT_1].CalcValue();
                    }

                    if (pPet->GetOwnerScaling())
                        bonus += int32(pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_SPELL_POWER, SPELL_SCHOOL_NORMAL,
                                        pPet->GetOwnerAttackPower(RANGED_ATTACK), add));

                    amount += int32(bonus);
                }
            }
        }
Ejemplo n.º 2
0
        void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
        {
            if (Unit* pUnit = GetUnitOwner())
            {
                Pet* pPet = pUnit->ToPet();
                if (!pPet)
                    return;

                float add = 0.0f;

                if (Player* pPlayerOwner = pPet->GetOwner()->ToPlayer())
                {
                    PetSpellMap::const_iterator itr = pPet->m_spells.find(TALENT_PET_WILD_HUNT_1);
                    if (itr == pPet->m_spells.end())
                        itr = pPet->m_spells.find(TALENT_PET_WILD_HUNT_2);

                    if (itr != pPet->m_spells.end()) // If pet has Wild Hunt
                    {
                        const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
                        if (spellInfo)
                            add += spellInfo->Effects[EFFECT_0].CalcValue();
                    }
                }

                if (pPet->GetOwnerScaling())
                    amount += int32(pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_UNIT_MOD, UNIT_MOD_STAT_STAMINA,
                                    pPet->GetOwnerStat(STAT_STAMINA), add));
            }
        }