Scripts/Spells: Migrate Some Scripted Spells to Scripts

Port From (https://github.com/TrinityCore/TrinityCore/commit/d72e809ecf9349d45127e743d23a8391bddabc41)
This commit is contained in:
hondacrx
2021-12-01 11:29:31 -05:00
parent c59535dc05
commit 0257f00aab
5 changed files with 174 additions and 156 deletions
+37
View File
@@ -553,6 +553,43 @@ namespace Scripts.Spells.DeathKnight
}
}
[Script] // 69961 - Glyph of Scourge Strike
class spell_dk_glyph_of_scourge_strike_script : SpellScript
{
void HandleScriptEffect(uint effIndex)
{
Unit caster = GetCaster();
Unit target = GetHitUnit();
var mPeriodic = target.GetAuraEffectsByType(AuraType.PeriodicDamage);
foreach (var aurEff in mPeriodic)
{
SpellInfo spellInfo = aurEff.GetSpellInfo();
// search our Blood Plague and Frost Fever on target
if (spellInfo.SpellFamilyName == SpellFamilyNames.Deathknight && spellInfo.SpellFamilyFlags[2].HasAnyFlag(0x2u) &&
aurEff.GetCasterGUID() == caster.GetGUID())
{
int countMin = aurEff.GetBase().GetMaxDuration();
int countMax = spellInfo.GetMaxDuration();
// this Glyph
countMax += 9000;
if (countMin < countMax)
{
aurEff.GetBase().SetDuration(aurEff.GetBase().GetDuration() + 3000);
aurEff.GetBase().SetMaxDuration(countMin + 3000);
}
}
}
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
}
}
[Script] // 206940 - Mark of Blood
class spell_dk_mark_of_blood : AuraScript
{