武器用毒液标飞刀飞!黑骑士灵魂助力掉线问题!求大神解答
武器用毒液标飞刀飞!黑骑士灵魂助力掉线问题!求大神解答这两个技能!用了之后会掉线,有时候自己掉线,有时候队友掉线~~~想问下怎么去修复这技能
帮忙看看是不是这段代码有问题!萌新学习研究冒险岛,日后完善,必将源码分享给大家
if (poison && getHp() > 1) {//设置中毒的持续时间
final int poisonDamage = (int) Math.min(Short.MAX_VALUE, (long) (getMobMaxHp() / (70.0 - from.getSkillLevel(status.getSkill())) + 0.999));
status.setValue(MonsterStatus.POISON, Integer.valueOf(poisonDamage));
status.setPoisonSchedule(timerManager.register(new PoisonTask(poisonDamage, from, status, cancelTask, false), 1000, 1000));
} else if (venom) {
int poisonLevel = 0;
int matk = 0;
switch (from.getJob()) {
case 412:
poisonLevel = from.getSkillLevel(SkillFactory.getSkill(4120005));//4120005 - 武器用毒液 - 在飞镖上涂抹毒药攻击敌人使它一定几率中毒受持续伤害.最多可重复3次,敌人的HP不会掉落1以下.
if (poisonLevel <= 0) {
return;
}
matk = SkillFactory.getSkill(4120005).getEffect(poisonLevel).getMatk();
break;
case 422:
poisonLevel = from.getSkillLevel(SkillFactory.getSkill(4220005));
if (poisonLevel <= 0) {
return;
}
matk = SkillFactory.getSkill(4220005).getEffect(poisonLevel).getMatk();
break;
case 1411:
case 1412:
poisonLevel = from.getSkillLevel(SkillFactory.getSkill(14110004));
if (poisonLevel <= 0) {
return;
}
matk = SkillFactory.getSkill(14110004).getEffect(poisonLevel).getMatk();
break;
case 434:
poisonLevel = from.getSkillLevel(SkillFactory.getSkill(4340001));
if (poisonLevel <= 0) {
return;
}
matk = SkillFactory.getSkill(4340001).getEffect(poisonLevel).getMatk();
break;
default:
return; // Hack, using venom without the job required
}
final int luk = from.getStat().getLuk();
final int maxDmg = (int) Math.ceil(Math.min(Short.MAX_VALUE, 0.2 * luk * matk));
final int minDmg = (int) Math.ceil(Math.min(Short.MAX_VALUE, 0.1 * luk * matk));
int gap = maxDmg - minDmg;
if (gap == 0) {
gap = 1;
}
int poisonDamage = 0;
for (int i = 0; i < getVenomMulti(); i++) {
poisonDamage = poisonDamage + (Randomizer.nextInt(gap) + minDmg);
}
poisonDamage = Math.min(Short.MAX_VALUE, poisonDamage);
status.setValue(MonsterStatus.POISON, Integer.valueOf(poisonDamage));
status.setPoisonSchedule(timerManager.register(new PoisonTask(poisonDamage, from, status, cancelTask, false), 1000, 1000));
// 4111003 夜行者- 影网术 - [最高等级:20]\n以自身的影子做成蜘蛛网,缠住6个以下的多个怪物。被缠住的怪物无法动弹。
} else if (statusSkill == 4111003 || statusSkill == 14111001) { //14111001 夜行者- 影网术 - [最高等级:20]\n以自身的影子做成蜘蛛网,缠住6个以下的多个怪物。被缠住的怪物无法动弹。
status.setPoisonSchedule(timerManager.schedule(new PoisonTask((int) (getMobMaxHp() / 50.0 + 0.999), from, status, cancelTask, true), 3500));
//4121004 - 忍者伏击 - [最高等级 : 30]\n给一定范围内的敌人持续的伤害.一次不能攻击6只以上,HP不掉到1以下.\n必要技能 : #c假动作等级5以上#
} else if (statusSkill == 4121004 || statusSkill == 4221004) {// - 忍者伏击 - 躲藏的同伴突然出现在一定时间内持续攻击敌人.\n一次无法攻击6只以上,HP不会掉到1以下.\n必要技能 : #c假动作 5级 以上#
final int damage = (from.getStat().getStr() + from.getStat().getLuk()) * 2 * (60 / 100);
status.setPoisonSchedule(timerManager.register(new PoisonTask(damage, from, status, cancelTask, false), 1000, 1000));
}
stati.put(stat, status);
map.broadcastMessage(MobPacket.applyMonsterStatus(getObjectId(), status), getPosition());
if (getController() != null && !getController().isMapObjectVisible(this)) {
getController().getClient().getSession().write(MobPacket.applyMonsterStatus(getObjectId(), status));
}
int aniTime = 0;
if (skilz != null) {
aniTime = skilz.getAnimationTime();
}
ScheduledFuture<?> schedule = timerManager.schedule(cancelTask, duration + aniTime);
status.setCancelTask(schedule);
}
页:
[1]