Core/Creatures: Changed the spawn health field in creature table to a percentage

Port From (https://github.com/TrinityCore/TrinityCore/commit/def601b4ff82ec8a90af60408a87cac92fdf070d)
This commit is contained in:
Hondacrx
2024-08-04 16:31:25 -04:00
parent 8969d59a41
commit cb16de1f15
10 changed files with 112 additions and 87 deletions
+28
View File
@@ -5102,4 +5102,32 @@ namespace Scripts.Spells.Generic
DoEffectCalcDamageAndHealing.Add(new(CalculateHealingBonus, SpellConst.EffectAll, AuraType.Any));
}
}
// 24931 - 100 Health
// 24959 - 500 Health
// 28838 - 1 Health
// 43645 - 1 Health
// 73342 - 1 Health
[Script] // 86562 - 1 Health
class spell_gen_set_health : SpellScript
{
ulong _health;
public spell_gen_set_health(ulong health)
{
_health = health;
}
void HandleHit(uint effIndex)
{
if (GetHitUnit().IsAlive() && _health > 0)
GetHitUnit().SetHealth(_health);
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleHit, 0, SpellEffectName.ScriptEffect));
}
}
}