Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sql/item_latents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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%

@Xaver-DaRed Xaver-DaRed Nov 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X <= 75 is the same as X < 76
The calculations use <= so the number needed is 75
Revert this

@9001-Sols 9001-Sols Nov 24, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculations aren't flooring the result though, they're cast to a float.

((float)m_POwner->health.hp / m_POwner->GetMaxHP()) * 100

That prevents 75.01 from triggering the latent, when the JP wiki states it should be active while the HP % is between 75 and 76.

image

https://wiki.ffo.jp/html/7159.html

なお、[HP]が76%未満かつ75%よりも多ければ[HP]白色状態のまま[潜在能力]が発動する。

I pattern matched the Sorc Ring implementation already in LSB - although the more proper implementation would likely be to floor the result. But this has implications as some gear hasn't been proven to use the floor value (Carapace set I think?)


-- Tracker's Ring
INSERT INTO `item_latents` VALUES (13296,27,-2,2,75); -- Enmity-2 while HP <=75% and TP <=100%
Expand Down
10 changes: 5 additions & 5 deletions src/map/latent_effect_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading