Browse Source

BETA: Retail like chance multiplier and level check for `Lethal` effect.

Reviewed by: !UnAfraid
Nos 11 years ago
parent
commit
a057be0550

+ 8 - 3
L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/Lethal.java

@@ -66,14 +66,19 @@ public final class Lethal extends AbstractEffect
 			return;
 		}
 		
+		if (info.getSkill().getMagicLevel() < (target.getLevel() - 6))
+		{
+			return;
+		}
+		
 		if (!target.isLethalable() || target.isInvul())
 		{
 			return;
 		}
 		
-		double levelBonus = Formulas.calcLvlBonusMod(activeChar, target, info.getSkill());
+		double chanceMultiplier = Formulas.calcAttributeBonus(activeChar, target, info.getSkill()) * Formulas.calcGeneralTraitBonus(activeChar, target, info.getSkill().getTraitType(), false);
 		// Lethal Strike
-		if (Rnd.get(100) < (_fullLethal * levelBonus))
+		if (Rnd.get(100) < (_fullLethal * chanceMultiplier))
 		{
 			// for Players CP and HP is set to 1.
 			if (target.isPlayer())
@@ -92,7 +97,7 @@ public final class Lethal extends AbstractEffect
 			activeChar.sendPacket(SystemMessageId.LETHAL_STRIKE_SUCCESSFUL);
 		}
 		// Half-Kill
-		else if (Rnd.get(100) < (_halfLethal * levelBonus))
+		else if (Rnd.get(100) < (_halfLethal * chanceMultiplier))
 		{
 			// for Players CP is set to 1.
 			if (target.isPlayer())