Scripts/Auras: Lookup aura scripts by their type, not name

Port From (https://github.com/TrinityCore/TrinityCore/commit/9fc8c86e9a47194a1b271fbcf7bf9e85cb3f0826)
This commit is contained in:
hondacrx
2021-11-03 12:31:46 -04:00
parent b1e6aabee7
commit 5a90a3ddde
6 changed files with 15 additions and 14 deletions
+2 -2
View File
@@ -103,7 +103,7 @@ namespace Scripts.Spells.DemonHunter
if (firstTargetGUID.IsEmpty())
firstTargetGUID = targetList[0].GetGUID();
spell_dh_first_blood script = aura.GetScript<spell_dh_first_blood>(nameof(spell_dh_first_blood));
spell_dh_first_blood script = aura.GetScript<spell_dh_first_blood>();
if (script != null)
script.SetFirstTarget(firstTargetGUID);
}
@@ -132,7 +132,7 @@ namespace Scripts.Spells.DemonHunter
AuraEffect aurEff = GetCaster().GetAuraEffect(SpellIds.FirstBlood, 0);
if (aurEff != null)
{
spell_dh_first_blood script = aurEff.GetBase().GetScript<spell_dh_first_blood>(nameof(spell_dh_first_blood));
spell_dh_first_blood script = aurEff.GetBase().GetScript<spell_dh_first_blood>();
if (script != null)
if (GetHitUnit().GetGUID() == script.GetFirstTarget())
MathFunctions.AddPct(ref damage, aurEff.GetAmount());