Core/Spells: fixed Entangling Root's proc number calculation
The number of procs before the roots break depend on the level difference between caster and target
This commit is contained in:
1 parent
61e5798e31
commit
b0ff954322
2 files changed
+47
No files matched your search
@@ -0,0 +1,7 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_dru_entangling_roots';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(339, 'spell_dru_entangling_roots');
|
||||
|
||||
DELETE FROM `spell_proc` WHERE `SpellId`= 339;
|
||||
INSERT INTO `spell_proc` (`SpellId`, `SpellTypeMask`, `Charges`) VALUES
|
||||
(339, 0x1, 1);
|
||||
@@ -2080,6 +2080,45 @@ private:
|
||||
bool _bountyActive = false;
|
||||
};
|
||||
|
||||
// 339 - Entangling Roots
|
||||
class spell_dru_entangling_roots : public AuraScript
|
||||
{
|
||||
static constexpr uint8 DEFAULT_PROCS = 4; // The number of allowed procs for a target of the same level as the caster
|
||||
static constexpr uint8 MINIMUM_PROCS = 2; // The minimum amount of procs
|
||||
|
||||
void CalculateProcAmount(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
// Every two level difference increase or reduce the chance of breaking. Tree of Life enhances this effect
|
||||
int16 offset = (caster->getLevel() - GetTarget()->getLevel()) / 2;
|
||||
_allowedProcs = std::max<int16>(MINIMUM_PROCS, DEFAULT_PROCS + offset);
|
||||
if (caster->GetShapeshiftForm() == FORM_TREE)
|
||||
++_allowedProcs;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
if (_allowedProcs != 0)
|
||||
--_allowedProcs;
|
||||
|
||||
if (_allowedProcs == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply.Register(&spell_dru_entangling_roots::CalculateProcAmount, EFFECT_0, SPELL_AURA_MOD_ROOT, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
DoCheckProc.Register(&spell_dru_entangling_roots::CheckProc);
|
||||
}
|
||||
private:
|
||||
uint8 _allowedProcs = 0;
|
||||
};
|
||||
|
||||
void AddSC_druid_spell_scripts()
|
||||
{
|
||||
RegisterSpellScript(spell_dru_astral_alignment);
|
||||
@@ -2095,6 +2134,7 @@ void AddSC_druid_spell_scripts()
|
||||
RegisterSpellScript(spell_dru_empowered_touch);
|
||||
RegisterSpellScript(spell_dru_empowered_touch_script);
|
||||
RegisterSpellScript(spell_dru_enrage);
|
||||
RegisterSpellScript(spell_dru_entangling_roots);
|
||||
RegisterSpellScript(spell_dru_ferocious_bite);
|
||||
RegisterSpellScript(spell_dru_firebloom);
|
||||
RegisterSpellScript(spell_dru_frenzied_regeneration);
|
||||
|
||||
Reference in new issue
Block a user