void RecalculateDamage(SpellEffIndex /*effIndex*/) { if (GetHitUnit() && GetHitUnit()->HasAuraState(AURA_STATE_FROZEN, GetSpellInfo(), GetCaster())) { if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_SHATTER, EFFECT_1)) { int32 damage = GetHitDamage(); AddPct(damage, aurEff->GetAmount()); SetHitDamage(damage); } } }
void HandleDamage(SpellEffIndex /*effIndex*/) { if(!GetCaster() || !GetHitUnit()) return; PreventHitDamage(); uint32 ticks = 1; if (constAuraEffectPtr aurEff = GetCaster()->GetAuraEffect(SPELL_BLADE_DANCE_AURA_2, EFFECT_0)) ticks = std::max(aurEff->GetTickNumber(), ticks); SetHitDamage(urand(11875, 13125) * ticks); }
void HandleDamage(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)); if (Unit* target = GetHitUnit()) { damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE); damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE); } SetHitDamage(damage); }
void CalcDamage() { int32 damage = GetHitDamage(); if (Unit* target = GetHitUnit()) if (AuraEffect const* shockCharges = target->GetAuraEffect(SPELL_AMBER_SHOCK_CHARGE, EFFECT_0, GetCaster()->GetGUID())) { damage += shockCharges->GetAmount(); shockCharges->GetBase()->Remove(); } SetHitDamage(damage); }
void RecalculateDamage() { if (GetHitUnit()->getPowerType() != POWER_MANA) return; const int32 maxDamage = GetCaster()->GetMap()->GetSpawnMode() == 1 ? 15000 : 10000; int32 newDamage = GetHitDamage(); newDamage += GetHitUnit()->GetMaxPower(POWER_MANA)/2; newDamage = std::min<int32>(maxDamage, newDamage); SetHitDamage(newDamage); }
void CalculateDamage() { if (!GetHitUnit()) return; float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); if (!radius) return; float distance = GetCaster()->GetDistance2d(GetHitUnit()); if (distance > 1.0f) SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius))); }
void HandleOnHit(SpellEffIndex effIndex) { if (Unit* caster = GetCaster()) { if (caster->HasAura(44544)) SetHitDamage(int32(GetHitDamage() * 1.25f)); if (GetHitUnit()) caster->SetIciclesTarget(GetHitUnit()->GetGUID()); caster->CastSpell(caster, SPELL_MAGE_ICICLE_PERIODIC_TRIGGER, true); } }
void DealDamage() { Unit* caster = GetCaster(); Unit* target = GetHitUnit(); if (!caster || !target) return; float distance = caster->GetExactDist2d(target); if (distance >= 0 && distance <= 60) SetHitDamage(GetHitDamage() * (distance / MAX_DIST)); }
void HandleOnHit() { if (Unit* caster = GetCaster()) { int32 damage = GetHitDamage(); // Mastery: Emberstorm if (AuraEffect* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 2129, EFFECT_0)) AddPct(damage, aurEff->GetAmount()); SetHitDamage(damage); } }
void HandleOnHit() { if (Player* _player = GetCaster()->ToPlayer()) { if (Unit* unitTarget = GetHitUnit()) { if (unitTarget->IsImmunedToSpellEffect(sSpellMgr->GetSpellInfo(WARRIOR_SPELL_STORM_BOLT_STUN), 0)) SetHitDamage(GetHitDamage() * 4); _player->CastSpell(unitTarget, WARRIOR_SPELL_STORM_BOLT_STUN, true); } } }
void RecalculateDamage(SpellEffIndex /*effIndex*/) { if (!GetCaster()) return; int32 baseDamages = GetHitDamage(); int32 additionalDamages = GetCaster()->GetPower(POWER_ENERGY) * 100; SetHitDamage(baseDamages + additionalDamages); GetCaster()->SetPower(POWER_ENERGY, 0); }
void HandleEffect(SpellEffIndex effIndex) { if (Unit* caster = GetCaster()) { if (Unit* target = GetHitUnit()) { if (Aura* cancellingAura = target->GetAura(SPELL_NOISE_CANCELLING_BUFF)) { float reducePct = cancellingAura->GetEffect(1)->GetBaseAmount(); SetHitDamage(GetHitDamage() * (reducePct / 100)); } } } }
void ChangeDamage(SpellEffIndex /*effIndex*/) { int32 damage = GetHitDamage(); // Because 1 Holy Power (HP) is consumed when casting spell, // GetPower(POWER_HOLY_POWER) will return 0 when player has 1 HP, // return 1 at 2 HP, and 2 at 3 HP int32 hp = GetCaster()->GetPower(POWER_HOLY_POWER); // Holy Power Scaling: 3 times damage at 2 HP, 6 times at 3 HP damage *= 0.5*hp*hp + 1.5*hp + 1; SetHitDamage(damage); }
void CalculateDamage(SpellEffIndex /*effIndex*/) { int32 damagePerCombo = GetHitDamage(); if (AuraEffect const* t5 = GetCaster()->GetAuraEffect(SPELL_ROGUE_T5_2P_SET_BONUS, EFFECT_0)) damagePerCombo += t5->GetAmount(); int32 finalDamage = damagePerCombo; std::vector<SpellPowerCost> const& costs = GetSpell()->GetPowerCost(); auto c = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_COMBO_POINTS; }); if (c != costs.end()) finalDamage *= c->Amount; SetHitDamage(finalDamage); }
void DealDamage() { if (Unit* target = GetHitUnit()) { if (AuraPtr aura = target->GetAura(SPELL_JASPER_CHAINS)) { uint8 stacks = aura->GetStackAmount(); int32 damage = GetHitDamage(); if (damage && stacks) SetHitDamage(damage * stacks); } } }
void HandleDummy(SpellEffIndex /*effIndex*/) { if (Player* caster = GetCaster()->ToPlayer()) { int32 damage = GetEffectValue(); int32 hitDamage = GetHitDamage(); if (caster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) { // Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue. if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0)) AddPct(hitDamage, damage); SetHitDamage(hitDamage); } } }
void CalculateDamage(SpellEffIndex effect) { // Formula: [Effect2BasePoints] / 100 * AttackPower if (Unit* caster = GetCaster()) { int32 rank1 = caster->GetAuraCount(87095); int32 rank2 = caster->GetAuraCount(87096); int32 modify = rank1*5 + rank2*10 + 100; //int32 bp2 = caster->CalculateSpellDamage(GetHitUnit(), GetSpellInfo(), EFFECT_2); SetHitDamage((caster->GetTotalAttackPowerValue(BASE_ATTACK)*75/100) * modify / 100); caster->RemoveAura(87095); // Remove Thunderstruck buff rank1 caster->RemoveAura(87096); // Remove Thunderstruck buff rank2 } }
void CalculateDamage(SpellEffIndex /*effIndex*/) { if (Unit* caster = GetCaster()) { if (caster->GetTypeId() != TYPEID_PLAYER) return; int32 damage = GetHitDamage(); float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK); float multiple = ap / 410 + GetSpellInfo()->Effects[EFFECT_1].CalcValue(); int32 energy = -(caster->ModifyPower(POWER_ENERGY, -30)); damage += int32(energy * multiple); damage += int32(CalculatePctN(caster->ToPlayer()->GetComboPoints() * ap, 7)); SetHitDamage(damage); } }
void HandleDamage(SpellEffIndex /*effIndex*/) { if (!GetTriggeringSpell()) return; Unit* target = GetHitUnit(); Unit* caster = GetOriginalCaster(); if (target->HasAura(GetTriggeringSpell()->Id)) SetHitDamage(0); else { if (target->GetTypeId() == TYPEID_PLAYER && caster->IsAIEnabled) caster->ToCreature()->AI()->SetData(DATA_POLARITY_SWITCH, 1); } }
void CalculateDamage(SpellEffIndex /*effIndex*/) { if (!GetCaster() || !GetHitUnit()) return; int32 amount = GetHitDamage(); if (GetHitUnit()->HasAura(SPELL_DRAIN_LIFE_DAMAGE)) amount += (amount * 0.60)*GetHitUnit()->GetAura(SPELL_DRAIN_LIFE_DAMAGE)->GetStackAmount(); int32 bp = amount * 25; std::list<Creature*> durumu; GetCreatureListWithEntryInGrid(durumu, GetCaster(), 68036, 100.0f); for (auto durumuTarget : durumu) durumuTarget->CastCustomSpell(durumuTarget,SPELL_DRAIN_LIFE_HEAL,&bp,NULL,NULL,true); SetHitDamage(amount); }
void HandleOnHit() { if (Player* _player = GetCaster()->ToPlayer()) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARRIOR_SPELL_STORM_BOLT_STUN); if (spellInfo) { if (Unit* unitTarget = GetHitUnit()) { if (unitTarget->IsImmunedToSpellEffect(spellInfo, 0)) SetHitDamage(GetHitDamage() * 4); _player->CastSpell(unitTarget, WARRIOR_SPELL_STORM_BOLT_STUN); // Make sure storm bolt actually hit first, since this spell is in two parts, one part could miss if (unitTarget->HasAura(WARRIOR_SPELL_STORM_BOLT_STUN)) _player->CastSpell(unitTarget, WARRIOR_SPELL_STORM_BOLT_DAMAGE); } } } }
void ChangeDamage(SpellEffIndex effIndex) { Unit* caster = GetCaster(); Unit* target = GetHitUnit(); if (!target) return; int32 rageUsed = std::min<int32>(300 - GetSpellInfo()->CalcPowerCost(caster, SpellSchoolMask(GetSpellInfo()->SchoolMask)), caster->GetPower(POWER_RAGE)); int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed); // Sudden Death rage refund if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0)) { int32 ragesave = aurEff->GetAmount() * 10; newRage = std::max(newRage, ragesave); } caster->SetPower(POWER_RAGE, uint32(newRage)); // DBC formula: ap * 0.874 * 100 / 100 - rageUsed int32 rageBonus = ((caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.874f) * 1000) / (1000 - rageUsed); int32 totalDamage = (GetHitDamage() + rageBonus); SetHitDamage(totalDamage); }
void RecalculateDamage() { SetHitDamage(int32(GetHitDamage() / std::max(sqrtf(GetHitUnit()->GetExactDist2d(GetCaster())), 1.0f))); }
void CalculateDamage() { // Slashes the target with darkness, dealing damage equal to half the target's current health. SetHitDamage(int32(ceil(GetHitUnit()->GetHealth() / 2.f))); }
void HandleDamageCalc(SpellEffIndex /*effIndex*/) { SetHitDamage(int32(GetCaster()->CountPctFromMaxHealth(30))); }
void HandleDummy(SpellEffIndex /*effIndex*/) { SetHitDamage(CalculatePct(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue())); }
void CalculateDamage(SpellEffIndex effect) { // Formula: 8 + AttackPower * 60 / 100 if (Unit* caster = GetCaster()) SetHitDamage(int32(8 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 60 / 100)); }
void CalculateDamage(SpellEffIndex effect) { // Formula: 1 + AttackPower * 0.12 if (Unit* caster = GetCaster()) SetHitDamage(int32(1 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.12f)); }
void CalculateDamage(SpellEffIndex effect) { // Formula: AttackPower * BasePoints / 100 if (Unit* caster = GetCaster()) SetHitDamage(int32(GetHitDamage() * caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100)); }
void RecalculateDamage() { SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(GetHitDamage())); }