PlayerCombatStats proc chances
This commit is contained in:
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user