Added logic for lair interactivity

This commit is contained in:
Heron
2026-05-11 22:38:15 -04:00
parent ba7a1962e5
commit 0a8d775b02
3 changed files with 494 additions and 1 deletions
@@ -51,4 +51,34 @@ public class luck extends script.base_script
pp = prose.setStringId(pp, new string_id("system_msg", "lucky_fly_text"));
showFlyTextPrivateProseWithFlags(player, player, pp, 1.5f, colors.GOLD, FLY_TEXT_FLAG_IS_LUCKY);
}
public static float getLevelCappedLuck(obj_id player) throws InterruptedException
{
if (!isPlayer(player))
{
return 0.0f;
}
int level = getLevel(player);
int cap = level * 5;
float luckValue = getSkillStatisticModifier(player, "luck");
float luckBonus = getEnhancedSkillStatisticModifierUncapped(player, "luck_modified");
luckValue += luckBonus;
if (luckValue < 0.0f)
{
return 0.0f;
}
if (luckValue > cap)
{
return cap;
}
return luckValue;
}
}