From b8c5f90abba1cab0a6db419810bbe20528a5a302 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 21 Nov 2017 18:02:21 +0000 Subject: [PATCH] Lucky chance calculation improvement. --- .../l2jmobius/gameserver/model/actor/instance/L2PcInstance.java | 2 +- .../l2jmobius/gameserver/model/actor/instance/L2PcInstance.java | 2 +- .../l2jmobius/gameserver/model/actor/instance/L2PcInstance.java | 2 +- .../l2jmobius/gameserver/model/actor/instance/L2PcInstance.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 2989be8b1a..7f5114956a 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -13966,7 +13966,7 @@ public final class L2PcInstance extends L2Playable public boolean tryLuck() { - if ((Rnd.nextDouble() < BaseStats.LUC.getValue(getLUC())) && !hasSkillReuse(CommonSkill.LUCKY_CLOVER.getSkill().getReuseHashCode())) + if (((Rnd.nextDouble() * 100) < BaseStats.LUC.getValue(getLUC())) && !hasSkillReuse(CommonSkill.LUCKY_CLOVER.getSkill().getReuseHashCode())) { SkillCaster.triggerCast(this, this, CommonSkill.LUCKY_CLOVER.getSkill()); sendPacket(SystemMessageId.LADY_LUCK_SMILES_UPON_YOU); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index ab0081ccd5..6a4bd24efe 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -13950,7 +13950,7 @@ public final class L2PcInstance extends L2Playable public boolean tryLuck() { - if ((Rnd.nextDouble() < BaseStats.LUC.getValue(getLUC())) && !hasSkillReuse(CommonSkill.LUCKY_CLOVER.getSkill().getReuseHashCode())) + if (((Rnd.nextDouble() * 100) < BaseStats.LUC.getValue(getLUC())) && !hasSkillReuse(CommonSkill.LUCKY_CLOVER.getSkill().getReuseHashCode())) { SkillCaster.triggerCast(this, this, CommonSkill.LUCKY_CLOVER.getSkill()); sendPacket(SystemMessageId.LADY_LUCK_SMILES_UPON_YOU); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 57ac57b050..fc00a851c3 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -14008,7 +14008,7 @@ public final class L2PcInstance extends L2Playable public boolean tryLuck() { - if ((Rnd.nextDouble() < BaseStats.LUC.getValue(getLUC())) && !hasSkillReuse(CommonSkill.LUCKY_CLOVER.getSkill().getReuseHashCode())) + if (((Rnd.nextDouble() * 100) < BaseStats.LUC.getValue(getLUC())) && !hasSkillReuse(CommonSkill.LUCKY_CLOVER.getSkill().getReuseHashCode())) { SkillCaster.triggerCast(this, this, CommonSkill.LUCKY_CLOVER.getSkill()); sendPacket(SystemMessageId.LADY_LUCK_SMILES_UPON_YOU); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index b0865357f1..c41f46c7d1 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -14027,7 +14027,7 @@ public final class L2PcInstance extends L2Playable public boolean tryLuck() { - if ((Rnd.nextDouble() < BaseStats.LUC.getValue(getLUC())) && !hasSkillReuse(CommonSkill.LUCKY_CLOVER.getSkill().getReuseHashCode())) + if (((Rnd.nextDouble() * 100) < BaseStats.LUC.getValue(getLUC())) && !hasSkillReuse(CommonSkill.LUCKY_CLOVER.getSkill().getReuseHashCode())) { SkillCaster.triggerCast(this, this, CommonSkill.LUCKY_CLOVER.getSkill()); sendPacket(SystemMessageId.LADY_LUCK_SMILES_UPON_YOU);