Spells/Scripts: Implement Critical Thinking (#29005)

This commit is contained in:
SargeroDeV
2023-05-21 07:27:02 -04:00
committed by GitHub
parent 907d9f1a79
commit f0aa85c99e
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
DELETE FROM `spell_script_names` WHERE `spell_id`= 389306;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(389306,'spell_warr_critical_thinking');
DELETE FROM `spell_proc` WHERE `SpellId` IN (389306);
INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES
(389306,0x00,4,0x20000000,0x00000000,0x00000000,0x00000000,0x0,0x0,0x4,0x2,0x1,0x4,0x0,0,0,0,0); -- Critical Thinking

View File

@@ -43,6 +43,7 @@ enum WarriorSpells
SPELL_WARRIOR_CHARGE_SLOW_EFFECT = 236027,
SPELL_WARRIOR_COLOSSUS_SMASH = 167105,
SPELL_WARRIOR_COLOSSUS_SMASH_AURA = 208086,
SPELL_WARRIOR_CRITICAL_THINKING_ENERGIZE = 392776,
SPELL_WARRIOR_EXECUTE = 20647,
SPELL_WARRIOR_FUELED_BY_VIOLENCE_HEAL = 383104,
SPELL_WARRIOR_GLYPH_OF_THE_BLAZING_TRAIL = 123779,
@@ -272,6 +273,29 @@ private:
bool _bonusHaste = false;
};
// 389306 - Critical Thinking
class spell_warr_critical_thinking : public AuraScript
{
PrepareAuraScript(spell_warr_critical_thinking);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_CRITICAL_THINKING_ENERGIZE });
}
void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
{
if (Optional<int32> rageCost = eventInfo.GetProcSpell()->GetPowerTypeCostAmount(POWER_RAGE))
GetTarget()->CastSpell(nullptr, SPELL_WARRIOR_CRITICAL_THINKING_ENERGIZE, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
.AddSpellBP0(CalculatePct(*rageCost, aurEff->GetAmount())));
}
void Register() override
{
AfterEffectProc += AuraEffectProcFn(spell_warr_critical_thinking::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
};
// 383103 - Fueled by Violence
class spell_warr_fueled_by_violence : public AuraScript
{
@@ -796,6 +820,7 @@ void AddSC_warrior_spell_scripts()
RegisterSpellScript(spell_warr_charge_drop_fire_periodic);
RegisterSpellScript(spell_warr_charge_effect);
RegisterSpellScript(spell_warr_colossus_smash);
RegisterSpellScript(spell_warr_critical_thinking);
RegisterSpellScript(spell_warr_fueled_by_violence);
RegisterSpellScript(spell_warr_heroic_leap);
RegisterSpellScript(spell_warr_heroic_leap_jump);