Scripts/Spells: Fix mage Flame On talent (#27622)

This commit is contained in:
Aqua Deus
2022-01-17 23:36:12 +01:00
committed by GitHub
parent 92335bf900
commit d8efda4ff3
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_mage_flame_on';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (205029, 'spell_mage_flame_on');

View File

@@ -22,6 +22,7 @@
*/
#include "ScriptMgr.h"
#include "DB2Stores.h"
#include "GridNotifiers.h"
#include "ObjectAccessor.h"
#include "Pet.h"
@@ -51,6 +52,7 @@ enum MageSpells
SPELL_MAGE_DRAGONHAWK_FORM = 32818,
SPELL_MAGE_EVERWARM_SOCKS = 320913,
SPELL_MAGE_FINGERS_OF_FROST = 44544,
SPELL_MAGE_FIRE_BLAST = 108853,
SPELL_MAGE_FIRESTARTER = 205026,
SPELL_MAGE_FROST_NOVA = 122,
SPELL_MAGE_GIRAFFE_FORM = 32816,
@@ -564,6 +566,30 @@ class spell_mage_firestarter_dots : public AuraScript
}
};
// 205029 - Flame On
class spell_mage_flame_on : public AuraScript
{
PrepareAuraScript(spell_mage_flame_on);
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellInfo({ SPELL_MAGE_FIRE_BLAST })
&& sSpellCategoryStore.HasRecord(sSpellMgr->AssertSpellInfo(SPELL_MAGE_FIRE_BLAST, DIFFICULTY_NONE)->ChargeCategoryId)
&& spellInfo->GetEffects().size() > EFFECT_2;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{
canBeRecalculated = false;
amount = -GetPctOf(GetEffectInfo(EFFECT_2).CalcValue() * IN_MILLISECONDS, sSpellCategoryStore.AssertEntry(sSpellMgr->AssertSpellInfo(SPELL_MAGE_FIRE_BLAST, DIFFICULTY_NONE)->ChargeCategoryId)->ChargeRecoveryTime);
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_flame_on::CalculateAmount, EFFECT_1, SPELL_AURA_CHARGE_RECOVERY_MULTIPLIER);
}
};
// 11426 - Ice Barrier
class spell_mage_ice_barrier : public AuraScript
{
@@ -1205,6 +1231,7 @@ void AddSC_mage_spell_scripts()
RegisterAuraScript(spell_mage_fingers_of_frost);
RegisterSpellScript(spell_mage_firestarter);
RegisterAuraScript(spell_mage_firestarter_dots);
RegisterAuraScript(spell_mage_flame_on);
RegisterAuraScript(spell_mage_ice_barrier);
RegisterSpellScript(spell_mage_ice_block);
RegisterSpellScript(spell_mage_ice_lance);