mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
fix(Scripts/Spells): General's Heart trinket (#19756)
* handle aura with spell_gen_absorb0_hitlimit1 * refactor enscapsulate limit
This commit is contained in:
@@ -1195,29 +1195,31 @@ class spell_gen_haunted_aura : public AuraScript
|
||||
};
|
||||
|
||||
/* 39228 - Argussian Compass
|
||||
60218 - Essence of Gossamer */
|
||||
60218 - Essence of Gossamer
|
||||
64765 - The General's Heart */
|
||||
class spell_gen_absorb0_hitlimit1 : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_absorb0_hitlimit1);
|
||||
|
||||
uint32 limit;
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
// Max absorb stored in 1 dummy effect
|
||||
limit = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
||||
_limit = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
||||
return true;
|
||||
}
|
||||
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
|
||||
{
|
||||
absorbAmount = std::min(limit, absorbAmount);
|
||||
absorbAmount = std::min(_limit, absorbAmount);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectAbsorb += AuraEffectAbsorbFn(spell_gen_absorb0_hitlimit1::Absorb, EFFECT_0);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _limit;
|
||||
};
|
||||
|
||||
enum AdaptiveWarding
|
||||
|
||||
Reference in New Issue
Block a user