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:
@@ -56,6 +56,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.Vaelastrasz
|
||||
{
|
||||
_Reset();
|
||||
|
||||
me.SetSpawnHealth();
|
||||
me.SetStandState(UnitStandStateType.Dead);
|
||||
Initialize();
|
||||
}
|
||||
@@ -65,7 +66,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.Vaelastrasz
|
||||
base.JustEngagedWith(who);
|
||||
|
||||
DoCast(me, SpellIds.Essenceofthered);
|
||||
me.SetHealth(me.CountPctFromMaxHealth(30));
|
||||
// now drop damage requirement to be able to take loot
|
||||
me.ResetPlayerDamageReq();
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -868,7 +868,7 @@ namespace Scripts.World.NpcsSpecial
|
||||
|
||||
me.SetStandState(UnitStandStateType.Kneel);
|
||||
// expect database to have RegenHealth=0
|
||||
me.SetHealth(me.CountPctFromMaxHealth(70));
|
||||
me.SetSpawnHealth();
|
||||
}
|
||||
|
||||
public override void JustEngagedWith(Unit who) { }
|
||||
|
||||
Reference in New Issue
Block a user