Core/Spells: corrected Furor behaivior and fixed an exploit that was allowing druids to get full energy when turning into cat form

This commit is contained in:
Ovahlord
2020-08-28 15:51:29 +02:00
parent 2b2fc5fb8a
commit 89fdfd5d7f
3 changed files with 19 additions and 42 deletions

View File

@@ -0,0 +1,2 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_dru_furor';
DELETE FROM `spell_proc` WHERE `SpellId`= -17056;

View File

@@ -1843,12 +1843,27 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
if (PowerType != POWER_MANA)
{
int32 oldPower = target->GetPower(PowerType);
// reset power to default values only at power change
if (target->GetPowerType() != PowerType)
target->SetPowerType(PowerType);
if (form == FORM_CAT)
target->SetPower(POWER_ENERGY, 0);
if (form == FORM_CAT || form == FORM_BEAR)
{
AuraEffect const* furorEffect = target->GetDummyAuraEffect(SPELLFAMILY_DRUID, 238, 0);
if (form == FORM_CAT)
{
target->SetPower(POWER_ENERGY, 0);
if (furorEffect)
{
// Allow to retain up to x% of the caster's energy when shape shifting into cat form
int32 basePoints = std::min<int32>(oldPower, furorEffect->GetAmount());
target->CastCustomSpell(target, 17099, &basePoints, nullptr, nullptr, true, nullptr, this);
}
}
else if (furorEffect && roll_chance_i(furorEffect->GetAmount())) // x% chance to gain 10 rage when shape shifting into bear form
target->CastSpell(target, 17057, true);
}
}
// stop handling the effect if it was removed by linked event
if (aurApp->GetRemoveMode().HasAnyFlag())

View File

@@ -65,8 +65,6 @@ enum DruidSpells
SPELL_DRUID_FUNGAL_GROWTH_R2 = 78789,
SPELL_DRUID_FUNGAL_GROWTH_SUMMON_R1 = 81291,
SPELL_DRUID_FUNGAL_GROWTH_SUMMON_R2 = 81283,
SPELL_DRUID_FUROR_ENERGIZE_RAGE = 17057,
SPELL_DRUID_FUROR_ENERGIZE_ENERGY = 17099,
SPELL_DRUID_FRENZIED_REGENERATION_HEAL = 22845,
SPELL_DRUID_EMPOWERED_TOUCH_SCRIPT = 88433,
SPELL_DRUID_FURY_OF_STORMRAGE = 81093,
@@ -1535,43 +1533,6 @@ class spell_dru_moonfire : public AuraScript
}
};
class spell_dru_furor : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_DRUID_FUROR_ENERGIZE_ENERGY,
SPELL_DRUID_FUROR_ENERGIZE_RAGE
});
}
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
return roll_chance_i(GetEffect(EFFECT_0)->GetAmount());
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
Unit* target = GetTarget();
if (target->GetShapeshiftForm() == FORM_BEAR)
target->CastSpell(target, SPELL_DRUID_FUROR_ENERGIZE_RAGE, true, nullptr, aurEff);
else if (target->GetShapeshiftForm() == FORM_CAT)
{
int32 amount = CalculatePct(100, aurEff->GetAmount());
target->CastCustomSpell(SPELL_DRUID_FUROR_ENERGIZE_ENERGY, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
}
void Register() override
{
DoCheckProc.Register(&spell_dru_furor::CheckProc);
OnEffectProc.Register(&spell_dru_furor::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 22568 - Ferocious Bite
class spell_dru_ferocious_bite : public SpellScript
{
@@ -1952,7 +1913,6 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_enrage);
RegisterSpellScript(spell_dru_ferocious_bite);
RegisterSpellScript(spell_dru_frenzied_regeneration);
RegisterSpellScript(spell_dru_furor);
RegisterSpellScript(spell_dru_glyph_of_starfire);
RegisterSpellScript(spell_dru_glyph_of_starfire_proc);
RegisterSpellScript(spell_dru_harmony);