Browse Source

PlayerCombatStats proc chances

lakebane-dex-penalty
FatBoy-DOTC 6 days ago
parent
commit
a7ee8f553b
  1. 31
      src/engine/gameManager/CombatManager.java

31
src/engine/gameManager/CombatManager.java

@ -902,27 +902,18 @@ public enum CombatManager {
if (weapon != null && tarAc != null && tarAc.isAlive()) { if (weapon != null && tarAc != null && tarAc.isAlive()) {
ConcurrentHashMap<String, Effect> effects = weapon.getEffects(); if(weapon.effects != null){
for (Effect eff : weapon.effects.values()){
for (Effect eff : effects.values()) { for(AbstractEffectModifier mod : eff.getEffectModifiers()){
if (eff == null) if(mod.modType.equals(ModType.WeaponProc)){
continue;
HashSet<AbstractEffectModifier> aems = eff.getEffectModifiers();
if (aems != null) {
for (AbstractEffectModifier aem : aems) {
if (!tarAc.isAlive())
break;
if (aem instanceof WeaponProcEffectModifier) {
int procChance = ThreadLocalRandom.current().nextInt(100); int procChance = ThreadLocalRandom.current().nextInt(100);
if (procChance < MBServerStatics.PROC_CHANCE) {
if (procChance < MBServerStatics.PROC_CHANCE) try {
((WeaponProcEffectModifier) aem).applyProc(ac, target); ((WeaponProcEffectModifier) mod).applyProc(ac, target);
}catch(Exception e){
Logger.error(eff.getName() + " Failed To Cast Proc");
}
}
} }
} }
} }

Loading…
Cancel
Save