Hellbent Commander

This commit is contained in:
luis
2026-09-15 22:59:58 -03:00
parent de6731c35d
commit 18ed96f0b5
+34
View File
@@ -6939,6 +6939,35 @@ void Unit::EnergizeBySpell(Unit* victim, SpellInfo const* spellInfo, int32 damag
SendEnergizeSpellLog(victim, spellInfo->Id, gain, overEnergize, powerType); SendEnergizeSpellLog(victim, spellInfo->Id, gain, overEnergize, powerType);
} }
namespace
{
uint8 GetControlledDemonCount(Unit const* owner)
{
uint8 count = 0;
for (Unit const* controlled : owner->m_Controlled)
if (controlled->IsAlive() && controlled->IsCreature() && controlled->GetCreatureType() == CREATURE_TYPE_DEMON)
++count;
return count;
}
// Hellbent Commander (1250897) - each demon the warlock controls grants 1% (spell aura amount)
// increased damage to every demon the player controls.
void ApplyHellbentCommanderDamageMod(Unit const* damageDealer, float& pctMod)
{
if (!damageDealer->IsCreature() || damageDealer->GetCreatureType() != CREATURE_TYPE_DEMON)
return;
Unit* owner = damageDealer->GetOwner();
Player* player = owner ? owner->ToPlayer() : nullptr;
if (!player)
return;
if (AuraEffect const* hellbent = player->GetAuraEffect(1250897, EFFECT_0))
AddPct(pctMod, hellbent->GetAmount() * GetControlledDemonCount(player));
}
}
int32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, int32 pdamage, DamageEffectType damagetype, SpellEffectInfo const& spellEffectInfo, uint32 stack /*= 1*/, Spell* spell /*= nullptr*/, AuraEffect const* aurEff /*= nullptr*/) const int32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, int32 pdamage, DamageEffectType damagetype, SpellEffectInfo const& spellEffectInfo, uint32 stack /*= 1*/, Spell* spell /*= nullptr*/, AuraEffect const* aurEff /*= nullptr*/) const
{ {
if (!spellProto || !victim) if (!spellProto || !victim)
@@ -6959,6 +6988,7 @@ int32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, int3
if (damagetype == DIRECT_DAMAGE || spellProto->HasAttribute(SPELL_ATTR3_IGNORE_CASTER_MODIFIERS)) if (damagetype == DIRECT_DAMAGE || spellProto->HasAttribute(SPELL_ATTR3_IGNORE_CASTER_MODIFIERS))
{ {
callDamageScript(pdamage, DoneTotal, DoneTotalMod); callDamageScript(pdamage, DoneTotal, DoneTotalMod);
ApplyHellbentCommanderDamageMod(this, DoneTotalMod);
return int32(std::max(float(pdamage + DoneTotal) * DoneTotalMod, 0.0f)); return int32(std::max(float(pdamage + DoneTotal) * DoneTotalMod, 0.0f));
} }
@@ -7152,6 +7182,8 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
break; break;
} }
ApplyHellbentCommanderDamageMod(this, DoneTotalMod);
return DoneTotalMod; return DoneTotalMod;
} }
@@ -8295,6 +8327,8 @@ int32 Unit::MeleeDamageBonusDone(Unit* pVictim, int32 damage, WeaponAttackType a
else if (aurEff) else if (aurEff)
aurEff->GetBase()->CallScriptCalcDamageAndHealingHandlers(aurEff, aurEff->GetBase()->GetApplicationOfTarget(pVictim->GetGUID()), pVictim, damage, DoneFlatBenefit, DoneTotalMod); aurEff->GetBase()->CallScriptCalcDamageAndHealingHandlers(aurEff, aurEff->GetBase()->GetApplicationOfTarget(pVictim->GetGUID()), pVictim, damage, DoneFlatBenefit, DoneTotalMod);
ApplyHellbentCommanderDamageMod(this, DoneTotalMod);
float damageF = float(damage + DoneFlatBenefit) * DoneTotalMod; float damageF = float(damage + DoneFlatBenefit) * DoneTotalMod;
// apply spellmod to Done damage // apply spellmod to Done damage