Skip to content

Commit

Permalink
Paladin: Roll crusader strike damage bonus of seal of the crusader in…
Browse files Browse the repository at this point in the history
…to its spell script
  • Loading branch information
killerwife committed Sep 17, 2023
1 parent 87a3af6 commit ca0f698
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 deletions.
25 changes: 0 additions & 25 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7943,31 +7943,6 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType
if (!owner)
owner = this;

if (spellInfo)
{
// dummies
AuraList const& auraDummy = owner->GetAurasByType(SPELL_AURA_DUMMY);
for (auto i : auraDummy)
{
if (!i->isAffectedOnSpell(spellInfo))
continue;
switch (i->GetSpellProto()->Id)
{
case 20162: // Seal of the Crusader - all ranks
case 20305:
case 20306:
case 20307:
case 20308:
case 21082:
case 27158:
{
DoneTotalMod *= 1.4f;
break;
}
}
}
}

for (auto i : GetScriptedLocationAuras(SCRIPT_LOCATION_MELEE_DAMAGE_DONE))
{
if (!i->isAffectedOnSpell(spellInfo))
Expand Down
23 changes: 18 additions & 5 deletions src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,30 @@
#include "Spells/SpellAuras.h"
#include "Spells/SpellMgr.h"

// 21082 - Seal of the Crusader
struct SealOfTheCrusader : public AuraScript
{
void OnApply(Aura* aura, bool apply) const
{
if (aura->GetEffIndex() != EFFECT_INDEX_1)
if (aura->GetEffIndex() == EFFECT_INDEX_1)
{
// Seal of the Crusader damage reduction
// SotC increases attack speed but reduces damage to maintain the same DPS
float reduction = (-100.0f * aura->GetModifier()->m_amount) / (aura->GetModifier()->m_amount + 100.0f);
aura->GetTarget()->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, reduction, apply);
return;
}

if (aura->GetEffIndex() == EFFECT_INDEX_2)
{
aura->GetTarget()->RegisterScriptedLocationAura(aura, SCRIPT_LOCATION_MELEE_DAMAGE_DONE, apply);
return;
}
}

// Seal of the Crusader damage reduction
// SotC increases attack speed but reduces damage to maintain the same DPS
float reduction = (-100.0f * aura->GetModifier()->m_amount) / (aura->GetModifier()->m_amount + 100.0f);
aura->GetTarget()->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, reduction, apply);
void OnDamageCalculate(Aura* /*aura*/, Unit* /*attacker*/, Unit* /*victim*/, int32& /*advertisedBenefit*/, float& totalMod) const override
{
totalMod *= 1.4f; // Patch 2.4.2 - Increases damage of Crusader Strike by 40%
}
};

Expand Down

0 comments on commit ca0f698

Please sign in to comment.