/** * @param skillTemplate * @param effector * @param skillLvl * @param firstTarget */ public Skill( SkillTemplate skillTemplate, Creature effector, int skillLvl, Creature firstTarget, ItemTemplate itemTemplate) { this.effectedList = new ArrayList<Creature>(); this.conditionChangeListener = new StartMovingListener(); this.firstTarget = firstTarget; this.skillLevel = skillLvl; this.skillStackLvl = skillTemplate.getLvl(); this.skillTemplate = skillTemplate; this.effector = effector; this.duration = skillTemplate.getDuration(); this.itemTemplate = itemTemplate; if (itemTemplate != null) skillMethod = SkillMethod.ITEM; else if (skillTemplate.isPassive()) skillMethod = SkillMethod.PASSIVE; else if (skillTemplate.isProvoked()) skillMethod = SkillMethod.PROVOKED; else if (skillTemplate.isCharge()) skillMethod = SkillMethod.CHARGE; }
protected void calculateSkillDuration() { // Skills that are not affected by boost casting time duration = 0; if (isCastTimeFixed()) { duration = skillTemplate.getDuration(); return; } duration = effector .getGameStats() .getPositiveReverseStat(StatEnum.BOOST_CASTING_TIME, skillTemplate.getDuration()); switch (skillTemplate.getSubType()) { case SUMMON: duration = effector .getGameStats() .getPositiveReverseStat(StatEnum.BOOST_CASTING_TIME_SUMMON, duration); break; case SUMMONHOMING: duration = effector .getGameStats() .getPositiveReverseStat(StatEnum.BOOST_CASTING_TIME_SUMMONHOMING, duration); break; case SUMMONTRAP: duration = effector .getGameStats() .getPositiveReverseStat(StatEnum.BOOST_CASTING_TIME_TRAP, duration); break; case HEAL: duration = effector .getGameStats() .getPositiveReverseStat(StatEnum.BOOST_CASTING_TIME_HEAL, duration); break; case ATTACK: if (skillTemplate.getType() == SkillType.MAGICAL) { duration = effector .getGameStats() .getPositiveReverseStat(StatEnum.BOOST_CASTING_TIME_ATTACK, duration); } break; } // 70% of base skill duration cap // No cast speed cap for skill Summoning Alacrity I(skillId: 1778) and Nimble Fingers I(skillId: // 2386) if (!effector.getEffectController().hasAbnormalEffect(1778) && !effector.getEffectController().hasAbnormalEffect(2386)) { int baseDurationCap = Math.round(skillTemplate.getDuration() * 0.3f); if (duration < baseDurationCap) { duration = baseDurationCap; } } if (effector instanceof Player) { if (this.isMulticast() && ((Player) effector) .getChainSkills() .getChainCount((Player) effector, this.getSkillTemplate(), this.chainCategory) != 0) { duration = 0; } } if (duration < 0) { duration = 0; } }