From e52a1fdc7d277153f0e7ea765420016ecaa0bf6f Mon Sep 17 00:00:00 2001 From: 9001-Sols <9001.sols@gmail.com> Date: Fri, 21 Nov 2025 18:35:24 -0500 Subject: [PATCH] [cpp] [sql] Fix HP Latent Calculations and Minstrel's Ring --- sql/item_latents.sql | 2 +- src/map/latent_effect_container.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sql/item_latents.sql b/sql/item_latents.sql index 030e462fc8b..627e152c20c 100644 --- a/sql/item_latents.sql +++ b/sql/item_latents.sql @@ -454,7 +454,7 @@ INSERT INTO `item_latents` VALUES (13294,237,3,2,75); -- Enhances "Luminian K INSERT INTO `item_latents` VALUES (13294,238,3,2,75); -- Enhances "Luminion Killer" effect while HP <=75% and TP <=100% -- Minstrel's Ring -INSERT INTO `item_latents` VALUES (13295,455,25,2,75); -- Song Spellcast -25% while HP <=75% and TP <=100% +INSERT INTO `item_latents` VALUES (13295,455,25,2,76); -- Song Spellcast -25% while HP <76% and TP <=100% -- Tracker's Ring INSERT INTO `item_latents` VALUES (13296,27,-2,2,75); -- Enmity-2 while HP <=75% and TP <=100% diff --git a/src/map/latent_effect_container.cpp b/src/map/latent_effect_container.cpp index f562be2d0a8..5c1e6338d9f 100644 --- a/src/map/latent_effect_container.cpp +++ b/src/map/latent_effect_container.cpp @@ -740,19 +740,19 @@ bool CLatentEffectContainer::ProcessLatentEffect(CLatentEffect& latentEffect, bo switch (latentEffect.GetConditionsID()) { case LATENT::HP_UNDER_PERCENT: - expression = ((float)m_POwner->health.hp / m_POwner->health.maxhp) * 100 <= latentEffect.GetConditionsValue(); + expression = ((float)m_POwner->health.hp / m_POwner->GetMaxHP()) * 100 <= latentEffect.GetConditionsValue(); break; case LATENT::HP_OVER_PERCENT: - expression = ((float)m_POwner->health.hp / m_POwner->health.maxhp) * 100 >= latentEffect.GetConditionsValue(); + expression = ((float)m_POwner->health.hp / m_POwner->GetMaxHP()) * 100 >= latentEffect.GetConditionsValue(); break; case LATENT::HP_UNDER_TP_UNDER_100: - expression = ((float)m_POwner->health.hp / m_POwner->health.maxhp) * 100 <= latentEffect.GetConditionsValue() && m_POwner->health.tp < 1000; + expression = ((float)m_POwner->health.hp / m_POwner->GetMaxHP()) * 100 <= latentEffect.GetConditionsValue() && m_POwner->health.tp < 1000; break; case LATENT::HP_OVER_TP_UNDER_100: - expression = ((float)m_POwner->health.hp / m_POwner->health.maxhp) * 100 >= latentEffect.GetConditionsValue() && m_POwner->health.tp < 1000; + expression = ((float)m_POwner->health.hp / m_POwner->GetMaxHP()) * 100 >= latentEffect.GetConditionsValue() && m_POwner->health.tp < 1000; break; case LATENT::MP_UNDER_PERCENT: - expression = m_POwner->health.maxmp && ((float)m_POwner->health.mp / m_POwner->health.maxmp) * 100 <= latentEffect.GetConditionsValue(); + expression = m_POwner->health.maxmp && ((float)m_POwner->health.mp / m_POwner->GetMaxMP()) * 100 <= latentEffect.GetConditionsValue(); break; case LATENT::MP_UNDER: expression = m_POwner->health.mp <= latentEffect.GetConditionsValue();