mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 20:02:25 +01:00
Scripts/Spells: Touch of the Magi - accumulate damage and DoT duration
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
-- Attach touch of the magi aura script
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_mage_touch_of_the_magi_aura';
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(210824,'spell_mage_touch_of_the_magi_aura');
|
||||
@@ -64,6 +64,8 @@ enum MageSpells
|
||||
SPELL_MAGE_ICY_VEINS = 12472,
|
||||
SPELL_MAGE_CHAIN_REACTION_DUMMY = 278309,
|
||||
SPELL_MAGE_CHAIN_REACTION = 278310,
|
||||
SPELL_MAGE_TOUCH_OF_THE_MAGI_AURA = 210824,
|
||||
SPELL_MAGE_TOUCH_OF_THE_MAGI_EXPLODE = 210833,
|
||||
};
|
||||
|
||||
enum MiscSpells
|
||||
@@ -753,6 +755,47 @@ class spell_mage_time_warp : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 210824 - Touch of the Magi (Aura)
|
||||
class spell_mage_touch_of_the_magi_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_touch_of_the_magi_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_MAGE_TOUCH_OF_THE_MAGI_EXPLODE });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (damageInfo)
|
||||
{
|
||||
if (damageInfo->GetAttacker() == GetCaster() && damageInfo->GetVictim() == GetTarget())
|
||||
{
|
||||
uint32 extra = CalculatePct(damageInfo->GetDamage(), 25);
|
||||
if (extra > 0)
|
||||
aurEff->ChangeAmount(aurEff->GetAmount() + extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
int32 amount = aurEff->GetAmount();
|
||||
if (!amount || GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastCustomSpell(SPELL_MAGE_TOUCH_OF_THE_MAGI_EXPLODE, SPELLVALUE_BASE_POINT0, amount, GetTarget(), TRIGGERED_FULL_MASK);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_touch_of_the_magi_aura::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_touch_of_the_magi_aura::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
/* 228597 - Frostbolt
|
||||
84721 - Frozen Orb
|
||||
190357 - Blizzard */
|
||||
@@ -824,6 +867,7 @@ void AddSC_mage_spell_scripts()
|
||||
RegisterAuraScript(spell_mage_ring_of_frost);
|
||||
RegisterSpellAndAuraScriptPair(spell_mage_ring_of_frost_freeze, spell_mage_ring_of_frost_freeze_AuraScript);
|
||||
RegisterSpellScript(spell_mage_time_warp);
|
||||
RegisterAuraScript(spell_mage_touch_of_the_magi_aura);
|
||||
RegisterSpellScript(spell_mage_trigger_chilled);
|
||||
RegisterSpellScript(spell_mage_water_elemental_freeze);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user