mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Scripts/Spells: Implement warrior talent Frothing Berserker (#31518)
This commit is contained in:
7
sql/updates/world/master/2026_02_04_03_world.sql
Normal file
7
sql/updates/world/master/2026_02_04_03_world.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
DELETE FROM `spell_proc` WHERE `SpellId` IN (392792);
|
||||
INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES
|
||||
(392792,0x00,4,0x02400400,0x00000000,0x00000000,0x08040000,0x0,0x0,0x0,0x1,0x0,0x4,0x0,0,0,0,0); -- Frothing Berserker
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_warr_frothing_berserker';
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(392792,'spell_warr_frothing_berserker');
|
||||
@@ -57,6 +57,7 @@ enum WarriorSpells
|
||||
SPELL_WARRIOR_FRENZY_BUFF = 335082,
|
||||
SPELL_WARRIOR_FRESH_MEAT_DEBUFF = 316044,
|
||||
SPELL_WARRIOR_FRESH_MEAT_TALENT = 215568,
|
||||
SPELL_WARRIOR_FROTHING_BERSERKER_ENERGIZE = 392793,
|
||||
SPELL_WARRIOR_FUELED_BY_VIOLENCE_HEAL = 383104,
|
||||
SPELL_WARRIOR_GLYPH_OF_THE_BLAZING_TRAIL = 123779,
|
||||
SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP = 159708,
|
||||
@@ -751,6 +752,49 @@ class spell_warr_frenzy_rampage : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 392792 - Frothing Berserker
|
||||
class spell_warr_frothing_berserker : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_FROTHING_BERSERKER_ENERGIZE });
|
||||
}
|
||||
|
||||
static bool CheckProc(AuraScript const&, ProcEventInfo const& eventInfo)
|
||||
{
|
||||
Spell const* procSpell = eventInfo.GetProcSpell();
|
||||
return procSpell && procSpell->GetPowerTypeCostAmount(POWER_RAGE) > 0;
|
||||
}
|
||||
|
||||
template <ChrSpecialization Spec>
|
||||
static bool CheckSpecialization(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
|
||||
{
|
||||
return eventInfo.GetActor()->IsPlayer() && eventInfo.GetActor()->ToPlayer()->GetPrimarySpecialization() == Spec;
|
||||
}
|
||||
|
||||
static void HandleProc(AuraScript const&, AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
|
||||
{
|
||||
Unit* target = eventInfo.GetActor();
|
||||
Spell const* procSpell = eventInfo.GetProcSpell();
|
||||
int32 spentRage = *procSpell->GetPowerTypeCostAmount(POWER_RAGE);
|
||||
target->CastSpell(target, SPELL_WARRIOR_FROTHING_BERSERKER_ENERGIZE, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringSpell = procSpell,
|
||||
.TriggeringAura = aurEff,
|
||||
.SpellValueOverrides = { { SPELLVALUE_BASE_POINT0, CalculatePct(spentRage, aurEff->GetAmount()) } }
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_warr_frothing_berserker::CheckProc);
|
||||
DoCheckEffectProc += AuraCheckEffectProcFn(spell_warr_frothing_berserker::CheckSpecialization<ChrSpecialization::WarriorArms>, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
DoCheckEffectProc += AuraCheckEffectProcFn(spell_warr_frothing_berserker::CheckSpecialization<ChrSpecialization::WarriorFury>, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
DoCheckEffectProc += AuraCheckEffectProcFn(spell_warr_frothing_berserker::CheckSpecialization<ChrSpecialization::WarriorProtection>, EFFECT_2, SPELL_AURA_DUMMY);
|
||||
OnEffectProc += AuraEffectProcFn(spell_warr_frothing_berserker::HandleProc, EFFECT_ALL, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 440277 - Powerful Enrage (attached to 184362 - Enrage)
|
||||
class spell_warr_powerful_enrage : public SpellScript
|
||||
{
|
||||
@@ -1647,6 +1691,7 @@ void AddSC_warrior_spell_scripts()
|
||||
RegisterSpellScript(spell_warr_frenzied_enrage);
|
||||
RegisterSpellScript(spell_warr_frenzy);
|
||||
RegisterSpellScript(spell_warr_frenzy_rampage);
|
||||
RegisterSpellScript(spell_warr_frothing_berserker);
|
||||
RegisterSpellScript(spell_warr_fueled_by_violence);
|
||||
RegisterSpellScript(spell_warr_heroic_leap);
|
||||
RegisterSpellScript(spell_warr_heroic_leap_damage);
|
||||
|
||||
Reference in New Issue
Block a user