From 7dee27b959a2e660465adf60838cd468a6cc2da4 Mon Sep 17 00:00:00 2001 From: cydyn <144380768+cydyn@users.noreply.github.com> Date: Sun, 24 Mar 2024 22:13:13 +0100 Subject: [PATCH] Repair Lifesteal and Manasteal --- Intersect.Server.Core/Entities/Entity.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Intersect.Server.Core/Entities/Entity.cs b/Intersect.Server.Core/Entities/Entity.cs index 9a25df46de..1bc460ed77 100644 --- a/Intersect.Server.Core/Entities/Entity.cs +++ b/Intersect.Server.Core/Entities/Entity.cs @@ -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); @@ -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);