Skip to content

Commit

Permalink
Repair Lifesteal and Manasteal
Browse files Browse the repository at this point in the history
  • Loading branch information
cydyn committed Mar 24, 2024
1 parent b4df5ed commit 7dee27b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Intersect.Server.Core/Entities/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,10 @@ public void Attack(
if (this is Player && !(enemy is Resource))
{
var lifestealRate = thisPlayer.GetEquipmentBonusEffect(ItemEffect.Lifesteal) / 100f;
if (lifestealRate < 0)
{
lifestealRate = 0; // Jeśli lifestealRate jest ujemny, ustaw na zero
}
var idealHealthRecovered = lifestealRate * baseDamage;
var actualHealthRecovered = Math.Min(enemyVitals[(int)Vital.Health], idealHealthRecovered);

Expand All @@ -2085,6 +2089,10 @@ public void Attack(
}

var manastealRate = (thisPlayer.GetEquipmentBonusEffect(ItemEffect.Manasteal) / 100f);
if (manastealRate < 0)
{
manastealRate = 0; // Jeśli manastealRate jest ujemny, ustaw na zero
}
var idealManaRecovered = manastealRate * baseDamage;
var actualManaRecovered = Math.Min(enemyVitals[(int)Vital.Mana], idealManaRecovered);

Expand Down

0 comments on commit 7dee27b

Please sign in to comment.