Package net.sf.l2j.gameserver.model.base

Examples of net.sf.l2j.gameserver.model.base.ClassId


          // make a list of classes
          if (_classesToTeach != null)
                    {
            int count = 0;
            ClassId classCheck = player.getClassId();

            while ((count == 0) && (classCheck != null))
            {
                for (ClassId cid : _classesToTeach)
                {
                    if (cid.level() != classCheck.level())
                        continue;

                    if (SkillTreeTable.getInstance().getAvailableSkills(player, cid).length == 0)
                        continue;

                    text += "<a action=\"bypass -h npc_%objectId%_SkillList "+cid.getId()+"\">Learn "+cid+"'s class Skills</a><br>\n";
                    count++;
                }
                classCheck = classCheck.getParent();
            }
            classCheck = null;
                    }
                    else
                    {
View Full Code Here


    }

    public int getSkillCost(L2PcInstance player, L2Skill skill)
    {
        int skillCost = 100000000;
        ClassId classId = player.getSkillLearningClassId();
        int skillHashCode = SkillTable.getSkillHashCode(skill);

        if (getSkillTrees().get(classId).containsKey(skillHashCode))
        {
          L2SkillLearn skillLearn = getSkillTrees().get(classId).get(skillHashCode);
          if (skillLearn.getMinLevel() <= player.getLevel())
            {
                skillCost = skillLearn.getSpCost();
                if (!player.getClassId().equalsOrChildOf(classId))
                {
                    if (skill.getCrossLearnAdd() < 0)
                        return skillCost;

                    skillCost += skill.getCrossLearnAdd();
                    skillCost *= skill.getCrossLearnMul();
                }

                if ((classId.getRace() != player.getRace()) && !player.isSubClassActive())
                    skillCost *= skill.getCrossLearnRace();

                if (classId.isMage() != player.getClassId().isMage())
                    skillCost *= skill.getCrossLearnProf();
            }
        }

        return skillCost;
View Full Code Here

    if (Config.DEBUG)
    {
      _log.info(getName() + " added class ID " + classId + " as a sub class at index " + classIndex + ".");
    }
   
    ClassId subTemplate = ClassId.values()[classId];
    Collection<L2SkillLearn> skillTree = SkillTreeTable.getInstance().getAllowedSkills(subTemplate);
   
    if (skillTree == null)
    {
      return true;
View Full Code Here

      }

      if (Config.DEBUG)
        _log.fine("ClassMaster activated");

      ClassId classId = player.getClassId();

      int jobLevel = 0;
      int level = player.getLevel();
      ClassLevel lvl = PlayerClass.values()[classId.getId()].getLevel();
      switch (lvl)
      {
        case First:
          jobLevel = 1;
          break;
        case Second:
          jobLevel = 2;
          break;
        default:
          jobLevel = 3;
      }

      if (!Config.ALLOW_CLASS_MASTERS)
        jobLevel = 3;

      if(player.isGM())
      {
        showChatWindowChooseClass(player);
      }
      else if (((level >= 20 && jobLevel == 1 ) ||
        (level >= 40 && jobLevel == 2 )) && Config.ALLOW_CLASS_MASTERS)
      {
        showChatWindow(player, classId.getId());
      }
      else if (level >= 76 && Config.ALLOW_CLASS_MASTERS && classId.getId() < 88)
      {
        for (int i = 0; i < SECONDN_CLASS_IDS.length; i++)
        {
          if (classId.getId() == SECONDN_CLASS_IDS[i])
          {
                        NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
                        TextBuilder sb = new TextBuilder();
                        sb.append("<html><body<table width=200>");
                        sb.append("<tr><td><center>"+CharTemplateTable.getClassNameById(player.getClassId().getId())+" Class Master:</center></td></tr>");
View Full Code Here

    else if(command.startsWith("change_class"))
    {
            int val = Integer.parseInt(command.substring(13));

            // Exploit prevention
            ClassId classId = player.getClassId();
            int level = player.getLevel();
            int jobLevel = 0;
            int newJobLevel = 0;

            ClassLevel lvlnow = PlayerClass.values()[classId.getId()].getLevel();

            if(player.isGM())
            {
              changeClass(player, val);
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.base.ClassId

Copyright © 2018 www.massapicom. 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.