Config to disable stun cancel chance upon hit.

This commit is contained in:
MobiusDev
2018-11-13 19:59:12 +00:00
parent 098d5a4462
commit 12ad31c6dd
30 changed files with 80 additions and 20 deletions

View File

@ -170,6 +170,7 @@ public final class Config
public static boolean ALT_GAME_CANCEL_BOW;
public static boolean ALT_GAME_CANCEL_CAST;
public static boolean ALT_GAME_MAGICFAILURES;
public static boolean ALT_GAME_STUN_BREAK;
public static int PLAYER_FAKEDEATH_UP_PROTECTION;
public static boolean STORE_SKILL_COOLTIME;
public static boolean SUBCLASS_STORE_SKILL_COOLTIME;
@ -1495,6 +1496,7 @@ public final class Config
ALT_GAME_CANCEL_BOW = Character.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
ALT_GAME_CANCEL_CAST = Character.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
ALT_GAME_MAGICFAILURES = Character.getBoolean("MagicFailures", true);
ALT_GAME_STUN_BREAK = Character.getBoolean("BreakStun", false);
PLAYER_FAKEDEATH_UP_PROTECTION = Character.getInt("PlayerFakeDeathUpProtection", 0);
STORE_SKILL_COOLTIME = Character.getBoolean("StoreSkillCooltime", true);
SUBCLASS_STORE_SKILL_COOLTIME = Character.getBoolean("SubclassStoreSkillCooltime", false);

View File

@ -1397,8 +1397,8 @@ public final class Formulas
*/
public static boolean calcStunBreak(L2Character activeChar)
{
// Check if target is stunned and 10% chance (retail is 14% and 35% on crit?)
if (activeChar.hasBlockActions() && (Rnd.get(10) == 0))
// Check if target is stunned and break it with 14% chance. (retail is 14% and 35% on crit?)
if (Config.ALT_GAME_STUN_BREAK && activeChar.hasBlockActions() && (Rnd.get(14) == 0))
{
// Any stun that has double duration due to skill mastery, doesn't get removed until its time reaches the usual abnormal time.
return activeChar.getEffectList().hasAbnormalType(AbnormalType.STUN, info -> info.getTime() <= info.getSkill().getAbnormalTime());