void HandleScript(SpellEffIndex /*eff*/) { Unit* caster = GetCaster(); if (!caster) return; if (GetHitDamage() >= int32(GetHitUnit()->GetHealth())) if (caster->GetAI()) caster->GetAI()->SetData(DATA_GRAVITY_BOMB_CASUALTY, 1); }
void CalculateDamage(SpellEffIndex /*effect*/) { // Formula: AttackPower * BasePoints / 100 if (Unit* caster = GetCaster()) { int32 dmg = int32(GetHitDamage() * caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100); SetHitDamage(dmg); caster->CastCustomSpell(caster, 23885, &dmg, NULL, NULL, true); } }
void RecalculateDamage(SpellEffIndex /*effIndex*/) { int32 dmg = GetHitDamage(); float distance = GetHitUnit()->GetExactDist2d(GetCaster()); if (distance < 5.0f) return; float distVar = distance >= 20.0f ? 4 : (10.0f/3.0f); SetHitDamage(int32(dmg * distVar / distance)); }
void HandleDamage() { int32 damage = GetHitDamage(); // Pain and Suffering reduces damage if (AuraEffect* aurEff = GetCaster()->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_PAIN_AND_SUFFERING, EFFECT_1)) AddPct(damage, aurEff->GetAmount()); GetCaster()->CastCustomSpell(GetCaster(), SPELL_PRIEST_SHADOW_WORD_DEATH, &damage, nullptr, nullptr, true); }
void SplitDamage() { // Mark the unit as hit, even if the spell missed or was dodged/parried GetCaster()->GetAI()->SetGUID(GetHitUnit()->GetGUID(), DATA_SPIKE_IMMUNE); if (!_targetCount) return; // This spell can miss all targets SetHitDamage(GetHitDamage() / _targetCount); }
void HandleScript(SpellEffIndex /*eff*/) { Unit* caster = GetCaster(); if (!caster || !GetHitUnit()) return; if (GetHitDamage() >= int32(GetHitUnit()->GetHealth())) if (InstanceScript* instance = caster->GetInstanceScript()) if (Creature* Heigan = ObjectAccessor::GetCreature(*caster, instance->GetGuidData(DATA_HEIGAN))) Heigan->AI()->KilledUnit(GetHitUnit()); }
void CalcDamage() { if (!GetHitUnit() || !GetCaster()) return; float distance = GetHitUnit()->GetExactDist2d(GetCaster()); if (distance < 10.0f) return; SetHitDamage(int32(GetHitDamage() * 10 / distance)); }
void HandleScript(SpellEffIndex /*eff*/) { Unit* caster = GetCaster(); if (!caster || !GetHitPlayer()) return; if (GetHitDamage() >= int32(GetHitPlayer()->GetHealth())) if (InstanceScript* instance = caster->GetInstanceScript()) if (Creature* Heigan = ObjectAccessor::GetCreature(*caster, instance->GetData64(BOSS_HEIGAN))) Heigan->AI()->SetData(DATA_SAFETY_DANCE, 0); }
void CalcDamage(SpellEffIndex /*effIndex*/) { if (!GetHitUnit() || !GetTargetDest()) return; float distance = GetHitUnit()->GetExactDist2d(GetTargetDest()); if (distance < 3.4f) return; SetHitDamage(int32(GetHitDamage() * 10.0f / pow(distance, 1.9f))); }
void HandleOnHit() { int32 damage = 0; if (Unit* target = GetHitUnit()) { float dist = target->GetDistance(GetCaster()); damage = int32(GetHitDamage() * (70.0f - std::min(70.0f, dist)) / 70.0f); } SetHitDamage(damage); }
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 CalcDamage() { int32 damage = GetHitDamage(); if (Unit* target = GetHitUnit()) if (Aura* aura = target->GetAura(SPELL_AMBER_SHOCK_CHARGE, GetCaster()->GetGUID())) // shock charges from same caster { damage += aura->GetStackAmount()*6525; aura->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 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 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 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 (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 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 HandleAfterHit() { Unit* caster = GetCaster(); if (Unit* unitTarget = GetHitUnit()) { int32 bp = GetHitDamage() * multiplier; if (AuraEffect* aurEff = caster->GetAuraEffectOfRankedSpell(SPELL_DK_BLACK_ICE_R1, EFFECT_0)) AddPct(bp, aurEff->GetAmount()); caster->CastCustomSpell(unitTarget, SPELL_DK_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true); } }
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 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 HandleOnHit () { if (Unit* caster = GetCaster()->GetOwner()) { // Searing Flames if (AuraEffect * aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 680, 0)) if (roll_chance_i(aurEff->GetAmount())) { int32 damage = GetHitDamage(); int32 bp0 = damage + GetHitUnit()->GetRemainingDotDamage(caster->GetGUID(), SHAMAN_SPELL_SEARING_FLAMES); caster->CastCustomSpell(GetHitUnit(), SHAMAN_SPELL_SEARING_FLAMES, &bp0, NULL, NULL, true, 0, 0, caster->GetGUID()); } } }
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 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 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 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 /*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 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); } } } }