void HandlePeriodic(AuraEffect const* aurEff) { PreventDefaultAction(); if (aurEff->GetAmount() <= 0) { Unit* target = GetTarget(); uint32 spellId = SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_HUNTER_SNIPER_TRAINING_R1; target->CastSpell(target, spellId, true, 0, aurEff); if (Player* playerTarget = GetUnitOwner()->ToPlayer()) { int32 baseAmount = aurEff->GetBaseAmount(); int32 amount = playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount); GetEffect(EFFECT_0)->SetAmount(amount); } } }
void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { //the damage bonus used for pets is either fire or shadow damage, whatever is higher int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); int32 maximum = (fire > shadow) ? fire : shadow; float bonusDamage = 0.0f; if (maximum > 0) bonusDamage = maximum * 0.15f; amount += bonusDamage; } }
void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Pet* pPet = GetUnitOwner()->ToPet()) { if (pPet->GetOwnerScaling()) { float bonus = 0.0f; float hitchance = std::max(pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_COMBAT_RATING, CR_HIT_MELEE, pPet->GetOwnerCombatRating(CR_HIT_MELEE)), pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_COMBAT_RATING, CR_HIT_SPELL, pPet->GetOwnerCombatRating(CR_HIT_SPELL))); // Expertise should be at max if player has hit cap if (hitchance >= PetSpellHitCapPct) bonus = pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_COMBAT_RATING, CR_EXPERTISE, 60.0f); else bonus = pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_COMBAT_RATING, CR_EXPERTISE, pPet->GetOwnerCombatRating(CR_EXPERTISE)); amount += int32(bonus); } } }
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated) { if (Unit* caster = GetCaster()) { canBeRecalculated = false; // $0.2 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK); int32 mws = caster->GetAttackTime(BASE_ATTACK); float mwbMin = caster->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE); float mwbMax = caster->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE); float mwb = ((mwbMin + mwbMax) / 2 + ap * mws / 14000) * 0.2f; amount += int32(caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), mwb)); // "If used while your target is above 75% health, Rend does 35% more damage." // as for 3.1.3 only ranks above 9 (wrong tooltip?) if (GetSpellInfo()->GetRank() >= 9) { if (GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, GetSpellInfo(), caster)) AddPct(amount, GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)); } } }
void CalculateStrengthAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Guardian* pPet = GetUnitOwner()->ToGuardian()) { if (Player* pPlayerOwner = pPet->GetOwner()->ToPlayer()) { float add = 0.0f; float bonusStr = 0.0f; if (Aura* pAura = pPlayerOwner->GetAuraOfRankedSpell(TALENT_DK_RAVENOUS_DEAD)) add += pAura->GetSpellInfo()->Effects[EFFECT_1].BasePoints; if (const AuraEffect* pAuraEffect = pPlayerOwner->GetAuraEffect(GLYPH_DK_GLYPH_OF_GHOUL, EFFECT_0)) add += pAuraEffect->GetAmount(); if (pPet->GetOwnerScaling()) bonusStr = pPet->GetOwnerScaling()->CalculateScaling(STAT_IDENTIFIER_UNIT_MOD, UNIT_MOD_STAT_STRENGTH, pPet->GetOwnerStat(STAT_STRENGTH), add); amount += int32(bonusStr); } } }
void HandleDispel(DispelInfo* dispelInfo) { if (Unit* target = GetUnitOwner()) { if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) { // final heal int32 healAmount = aurEff->GetAmount(); if (Unit* caster = GetCaster()) { healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); // restore mana int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2; caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID()); return; } target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); } } }
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { amount = GetUnitOwner()->CountPctFromMaxHealth(amount); }
bool Load() { absorbChance = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0); return GetUnitOwner()->ToPlayer(); }
bool Load() { healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1); absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0); return GetUnitOwner()->ToPlayer(); }
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { // Remove all auras with spell id 46221, except the one currently being applied while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, 0, 0, 0, GetAura())) GetUnitOwner()->RemoveOwnedAura(aur); }
bool Load() { absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); return GetUnitOwner()->ToPlayer(); }
void HandlePeriodic(AuraEffect const* aurEff) { PreventDefaultAction(); GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL1, SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL2), true); }
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { amount = CalculatePct(int32(GetUnitOwner()->GetCreatePowers(POWER_MANA) / aurEff->GetTotalTicks()), amount); }
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & /*absorbAmount*/) { if (Unit* owner = GetUnitOwner()) { if (dmgInfo.GetSpellInfo()) { if (uint32 poweringUp = sSpellMgr->GetSpellIdForDifficulty(SPELL_POWERING_UP, owner)) { if (urand(0, 99) < 5) GetTarget()->CastSpell(GetTarget(), spellId, true); // Twin Vortex part uint32 lightVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_LIGHT_VORTEX_DAMAGE, owner); uint32 darkVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_DARK_VORTEX_DAMAGE, owner); int32 stacksCount = int32(dmgInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue()) * 0.001 - 1; if (lightVortex && darkVortex && stacksCount) { if (dmgInfo.GetSpellInfo()->Id == darkVortex || dmgInfo.GetSpellInfo()->Id == lightVortex) { Aura* pAura = owner->GetAura(poweringUp); if (pAura) { pAura->ModStackAmount(stacksCount); owner->CastSpell(owner, poweringUp, true); } else { owner->CastSpell(owner, poweringUp, true); if (Aura* pTemp = owner->GetAura(poweringUp)) pTemp->ModStackAmount(stacksCount); } } } // Picking floating balls uint32 unleashedDark = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNLEASHED_DARK, owner); uint32 unleashedLight = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNLEASHED_LIGHT, owner); if (unleashedDark && unleashedLight) { if (dmgInfo.GetSpellInfo()->Id == unleashedDark || dmgInfo.GetSpellInfo()->Id == unleashedLight) { // need to do the things in this order, else players might have 100 charges of Powering Up without anything happening Aura* pAura = owner->GetAura(poweringUp); if (pAura) { // 2 lines together add the correct amount of buff stacks pAura->ModStackAmount(stacksCount); owner->CastSpell(owner, poweringUp, true); } else { owner->CastSpell(owner, poweringUp, true); if (Aura* pTemp = owner->GetAura(poweringUp)) pTemp->ModStackAmount(stacksCount); } } } } } } }
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { if (GetUnitOwner()->GetAuraCount(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell) == 5) GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_STONED, true); }
bool Load() { healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER; }
void OnPeriodic(AuraEffect const* /*aurEffect*/) { PreventDefaultAction(); GetUnitOwner()->CastSpell(GetUnitOwner(), RandomBeam[urand(0, 3)], true); }
bool Load() override { // 6.x has basepoint = 0 ! absorbChance = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(); return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER; }
bool Load() override { return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER; }
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (GetUnitOwner()->IsInWater()) GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SPAWN_BLOOD_POOL, true); }
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { int32 duration = urand(15,60); if (GetUnitOwner()->HasAura(SPELL_SEARING_SEEDS)) GetUnitOwner()->GetAura(SPELL_SEARING_SEEDS)->SetDuration(duration*IN_MILLISECONDS); }
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { amount = CalculatePct(GetUnitOwner()->GetCreatePowers(POWER_MANA), amount); }
void OnPeriodic(AuraEffect const* aurEff) { PreventDefaultAction(); if (Unit* victim = GetUnitOwner()->GetVictim()) GetUnitOwner()->CastSpell(victim, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); }
bool Load() override { absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER; }
bool Load() { healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); return GetUnitOwner()->ToPlayer(); }
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SPECTRAL_EXHAUSTION, true); GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_TELEPORT_NORMAL_REALM, true); }
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { if (InstanceScript* instance = GetUnitOwner()->GetInstanceScript()) if (instance->IsEncounterInProgress()) GetUnitOwner()->CastCustomSpell(SPELL_CURSE_OF_BOUNDLESS_AGONY_PLR, SPELLVALUE_MAX_TARGETS, 1, GetUnitOwner(), true); }
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* owner = GetUnitOwner()) amount = CalculatePct(owner->GetPower(POWER_MANA), 5); }
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { // do not set speed if not in cat form if (GetUnitOwner()->GetShapeshiftForm() != FORM_CAT) amount = 0; }
void Update(AuraEffect const* effect) { PreventDefaultAction(); if (Unit* target = GetUnitOwner()->GetVictim()) GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true); }