Scripts/Spells: Runic Healing Injector

Port From (https://github.com/TrinityCore/TrinityCore/commit/66f5275d2683a292afae3acdded4d252e29a2703)
This commit is contained in:
hondacrx
2022-01-04 17:49:24 -05:00
parent 96e750cdfb
commit 66df29db11
3 changed files with 25 additions and 8 deletions
-8
View File
@@ -784,14 +784,6 @@ namespace Game.Spells
addhealth += damageAmount;
}
// Runic Healing Injector (heal increased by 25% for engineers - 3.2.0 patch change)
else if (m_spellInfo.Id == 67489)
{
Player player = unitCaster.ToPlayer();
if (player != null)
if (player.HasSkill(SkillType.Engineering))
MathFunctions.AddPct(ref addhealth, 25);
}
// Death Pact - return pct of max health to caster
else if (m_spellInfo.SpellFamilyName == SpellFamilyNames.Deathknight && m_spellInfo.SpellFamilyFlags[0].HasAnyFlag(0x00080000u))
addhealth = (int)unitCaster.SpellHealingBonusDone(unitTarget, m_spellInfo, (uint)unitCaster.CountPctFromMaxHealth(damage), DamageEffectType.Heal, effectInfo);
+22
View File
@@ -2976,6 +2976,28 @@ namespace Scripts.Spells.Items
}
}
[Script] // 67489 - Runic Healing Injector
class spell_item_runic_healing_injector : SpellScript
{
public override bool Load()
{
return GetCaster().IsPlayer();
}
void HandleHeal(uint effIndex)
{
Player caster = GetCaster().ToPlayer();
if (caster != null)
if (caster.HasSkill(SkillType.Engineering))
SetHitHeal((int)(GetHitHeal() * 1.25f));
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleHeal, 0, SpellEffectName.Heal));
}
}
[Script]
class spell_item_pygmy_oil : SpellScript
{
@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_item_runic_healing_injector';
INSERT INTO `spell_script_names` VALUES
(67489,'spell_item_runic_healing_injector');