Examples of SkillType


Examples of com.gmail.nossr50.datatypes.skills.SkillType

     *
     * @throws InvalidSkillException if the given skill is not valid
     * @throws UnsupportedOperationException if the given skill is a child skill
     */
    public static int getXPRemaining(Player player, String skillType) {
        SkillType skill = getNonChildSkillType(skillType);

        PlayerProfile profile = getPlayer(player).getProfile();

        return profile.getXpToLevel(skill) - profile.getSkillXpLevel(skill);
    }
View Full Code Here

Examples of com.gmail.nossr50.datatypes.skills.SkillType

     * @throws InvalidPlayerException if the given player does not exist in the database
     * @throws UnsupportedOperationException if the given skill is a child skill
     */
    @Deprecated
    public static int getOfflineXPRemaining(String playerName, String skillType) {
        SkillType skill = getNonChildSkillType(skillType);
        PlayerProfile profile = getOfflineProfile(playerName);

        return profile.getXpToLevel(skill) - profile.getSkillXpLevel(skill);
    }
View Full Code Here

Examples of com.gmail.nossr50.datatypes.skills.SkillType

     * @throws InvalidSkillException if the given skill is not valid
     * @throws InvalidPlayerException if the given player does not exist in the database
     * @throws UnsupportedOperationException if the given skill is a child skill
     */
    public static float getOfflineXPRemaining(UUID uuid, String skillType) {
        SkillType skill = getNonChildSkillType(skillType);
        PlayerProfile profile = getOfflineProfile(uuid);

        return profile.getXpToLevel(skill) - profile.getSkillXpLevelRaw(skill);
    }
View Full Code Here

Examples of com.gmail.nossr50.datatypes.skills.SkillType

     * @throws InvalidPlayerException if the given player does not exist in the database
     */
    @Deprecated
    public static void addLevelOffline(String playerName, String skillType, int levels) {
        PlayerProfile profile = getOfflineProfile(playerName);
        SkillType skill = getSkillType(skillType);

        if (skill.isChildSkill()) {
            Set<SkillType> parentSkills = FamilyTree.getParents(skill);

            for (SkillType parentSkill : parentSkills) {
                profile.addLevels(parentSkill, (levels / parentSkills.size()));
            }
View Full Code Here

Examples of com.gmail.nossr50.datatypes.skills.SkillType

     * @throws InvalidSkillException if the given skill is not valid
     * @throws InvalidPlayerException if the given player does not exist in the database
     */
    public static void addLevelOffline(UUID uuid, String skillType, int levels) {
        PlayerProfile profile = getOfflineProfile(uuid);
        SkillType skill = getSkillType(skillType);

        if (skill.isChildSkill()) {
            Set<SkillType> parentSkills = FamilyTree.getParents(skill);

            for (SkillType parentSkill : parentSkills) {
                profile.addLevels(parentSkill, (levels / parentSkills.size()));
            }
View Full Code Here

Examples of com.gmail.nossr50.datatypes.skills.SkillType

        return profile;
    }

    private static SkillType getSkillType(String skillType) throws InvalidSkillException {
        SkillType skill = SkillType.getSkill(skillType);

        if (skill == null) {
            throw new InvalidSkillException();
        }
View Full Code Here

Examples of com.gmail.nossr50.datatypes.skills.SkillType

        return skill;
    }

    private static SkillType getNonChildSkillType(String skillType) throws InvalidSkillException, UnsupportedOperationException {
        SkillType skill = getSkillType(skillType);

        if (skill.isChildSkill()) {
            throw new UnsupportedOperationException("Child skills do not have XP");
        }

        return skill;
    }
View Full Code Here

Examples of com.gmail.nossr50.datatypes.skills.SkillType

                    }
                }
            }

            McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
            SkillType skill = mcMMOPlayer.getAbilityMode(AbilityType.SUPER_BREAKER) ? SkillType.MINING : SkillType.EXCAVATION;
            int ticks = PerksUtils.handleActivationPerks(player, 2 + (mcMMOPlayer.getSkillLevel(skill) / AdvancedConfig.getInstance().getAbilityLength()), skill.getAbility().getMaxLength()) * Misc.TICK_CONVERSION_FACTOR;

            PotionEffect abilityBuff = new PotionEffect(PotionEffectType.FAST_DIGGING, duration + ticks, amplifier + 10);
            player.addPotionEffect(abilityBuff, true);
        }
    }
View Full Code Here

Examples of com.gmail.nossr50.datatypes.skills.SkillType

            EnumSet<SkillType> parentSkills = EnumSet.noneOf(SkillType.class);
            boolean useDefaults = false; // If we had an error we back out and use defaults

            for (String name : config.getStringList(StringUtils.getCapitalized(skill.name()))) {
                try {
                    SkillType parentSkill = SkillType.valueOf(name.toUpperCase());
                    FamilyTree.enforceNotChildSkill(parentSkill);
                    parentSkills.add(parentSkill);
                }
                catch (IllegalArgumentException ex) {
                    plugin.getLogger().warning(name + " is not a valid skill type, or is a child skill!");
                    useDefaults = true;
                    break;
                }
            }

            if (useDefaults) {
                parentSkills.clear();
                for (String name : config.getDefaults().getStringList(StringUtils.getCapitalized(skill.name()))) {
                    /* We do less checks in here because it's from inside our jar.
                     * If they're dedicated enough to have modified it, they can have the errors it may produce.
                     * Alternatively, this can be used to allow child skills to be parent skills, provided there are no circular dependencies this is an advanced sort of configuration.
                     */
                    parentSkills.add(SkillType.valueOf(name.toUpperCase()));
                }
            }

            // Register them
            for (SkillType parentSkill : parentSkills) {
                plugin.debug("Registering " + parentSkill.name() + " as parent of " + skill.name());
                FamilyTree.registerParent(skill, parentSkill);
            }
        }

        FamilyTree.closeRegistration();
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.L2Skill.SkillType

  private int _negateId = 0;

  @Override
  public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets)
  {
    SkillType type = skill.getSkillType();

    boolean bss = activeChar.checkBss();
    boolean sps = activeChar.checkSps();
    boolean ss = activeChar.checkSs();
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.