mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-15 06:29:13 +01:00
Core/Utilities: Use generic templates with AddPct, ApplyPct and CalculatePct
This commit is contained in:
@@ -1585,7 +1585,7 @@ class spell_valanar_kinetic_bomb_absorb : public SpellScriptLoader
|
||||
|
||||
void OnAbsorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), aurEff->GetAmount());
|
||||
absorbAmount = CalculatePct(dmgInfo.GetDamage(), aurEff->GetAmount());
|
||||
RoundToInterval<uint32>(absorbAmount, 0, dmgInfo.GetDamage());
|
||||
dmgInfo.AbsorbDamage(absorbAmount);
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ class boss_algalon_the_observer : public CreatureScript
|
||||
if (Creature* wormHole = DoSummon(NPC_WORM_HOLE, CollapsingStarPos[i], TEMPSUMMON_MANUAL_DESPAWN))
|
||||
wormHole->m_Events.AddEvent(new SummonUnleashedDarkMatter(wormHole), wormHole->m_Events.CalculateTime(i >= 2 ? 8000 : 6000));
|
||||
}
|
||||
else if ((int32(me->GetHealth()) - int32(damage)) < CalculatePctF<int32>(int32(me->GetMaxHealth()), 2.5f) && !_fightWon)
|
||||
else if ((int32(me->GetHealth()) - int32(damage)) < CalculatePct<int32>(int32(me->GetMaxHealth()), 2.5f) && !_fightWon)
|
||||
{
|
||||
_fightWon = true;
|
||||
damage = 0;
|
||||
|
||||
Reference in New Issue
Block a user