Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.L2Skill


   */
  @Override
  protected void onEvtFinishCasting()
  {
    // forget interupted actions after offensive skill
    final L2Skill skill = get_skill();
   
    if(skill != null && skill.isOffensive())
    {
      getInterruptedIntentions().clear();
    }

    if(getIntention() == AI_INTENTION_CAST)
View Full Code Here


  private void thinkCast()
  {

    final L2Character target = getCastTarget();
    final L2Skill skill = get_skill();
    //if (Config.DEBUG) _log.warning("L2PlayerAI: thinkCast -> Start");

    if(checkTargetLost(target))
    {
      if(skill.isOffensive() && getAttackTarget() != null)
      {
        //Notify the target
        setCastTarget(null);
      }
      return;
    }

    if(target != null)
      if(maybeMoveToPawn(target, _actor.getMagicalAttackRange(skill)))
        return;

    if(skill.getHitTime() > 50)
    {
      clientStopMoving(null);
    }

    final L2Object oldTarget = _actor.getTarget();
View Full Code Here

      return;
    }
    // Iterate through all effects currently on the character.
    for (L2Effect currenteffect : getAllEffects())
    {
      L2Skill effectSkill = currenteffect.getSkill();
      // Ignore all buff skills that are party related (ie. songs, dances) while still remaining weapon dependant on cast though.
      if (!effectSkill.isOffensive() && !(effectSkill.getTargetType() == SkillTargetType.TARGET_PARTY && effectSkill.getSkillType() == SkillType.BUFF))
      {
        // Check to rest to assure current effect meets weapon requirements.
        if (!effectSkill.getWeaponDependancy(this))
        {
          sendMessage(effectSkill.getName() + " cannot be used with this weapon.");
          if (Config.DEBUG)
          {
            _log.info("   | Skill " + effectSkill.getName() + " has been disabled for (" + getName() + "); Reason: Incompatible Weapon Type.");
          }
          currenteffect.exit();
        }
      }
      continue;
View Full Code Here

    int lvl = getLevel();

    // Remove beginner Lucky skill
    if(lvl == 10)
    {
      L2Skill skill = SkillTable.getInstance().getInfo(194, 1);
      skill = removeSkill(skill);

      if(Config.DEBUG && skill != null)
      {
        _log.fine("removed skill 'Lucky' from " + getName());
      }

      skill = null;
    }

    // Calculate the current higher Expertise of the L2PcInstance
    for(int i = 0; i < EXPERTISE_LEVELS.length; i++)
    {
      if(lvl >= EXPERTISE_LEVELS[i])
      {
        setExpertiseIndex(i);
      }
    }

    // Add the Expertise skill corresponding to its Expertise level
    if(getExpertiseIndex() > 0)
    {
      L2Skill skill = SkillTable.getInstance().getInfo(239, getExpertiseIndex());
      addSkill(skill, true);

      if(Config.DEBUG)
      {
        _log.fine("awarded " + getName() + " with new expertise.");
      }

      skill = null;
    }
    else
    {
      if(Config.DEBUG)
      {
        _log.fine("No skills awarded at lvl: " + lvl);
      }
    }

    //Active skill dwarven craft

    if(getSkillLevel(1321) < 1 && getRace() == Race.dwarf)
    {
      L2Skill skill = SkillTable.getInstance().getInfo(1321, 1);
      addSkill(skill, true);
      skill = null;
    }

    //Active skill common craft
    if(getSkillLevel(1322) < 1)
    {
      L2Skill skill = SkillTable.getInstance().getInfo(1322, 1);
      addSkill(skill, true);
      skill = null;
    }

    for(int i = 0; i < COMMON_CRAFT_LEVELS.length; i++)
    {
      if(lvl >= COMMON_CRAFT_LEVELS[i] && getSkillLevel(1320) < i + 1)
      {
        L2Skill skill = SkillTable.getInstance().getInfo(1320, (i + 1));
        addSkill(skill, true);
        skill = null;
      }
    }
View Full Code Here

   */
  public synchronized L2Skill addSkill(L2Skill newSkill, boolean store)
  {
    _learningSkill = true;
    // Add a skill to the L2PcInstance _skills and its Func objects to the calculator set of the L2PcInstance
    L2Skill oldSkill = super.addSkill(newSkill);

    // Add or update a L2PcInstance skill in the character_skills table of the database
    if(store)
    {
      storeSkill(newSkill, oldSkill, -1);
View Full Code Here

   */
  @Override
  public L2Skill removeSkill(L2Skill skill)
  {
    // Remove a skill from the L2Character and its Func objects from calculator set of the L2Character
    L2Skill oldSkill = super.removeSkill(skill);

    Connection con = null;

    try
    {
      // Remove or update a L2PcInstance skill from the character_skills table of the database
      con = L2DatabaseFactory.getInstance().getConnection(false);
      PreparedStatement statement;

      if(oldSkill != null)
      {
        statement = con.prepareStatement(DELETE_SKILL_FROM_CHAR);
        statement.setInt(1, oldSkill.getId());
        statement.setInt(2, getObjectId());
        statement.setInt(3, getClassIndex());
        statement.execute();
        statement.close();
        statement = null;
View Full Code Here

          {
            continue; // fake skills for base stats
          }

          // Create a L2Skill object for each record
          L2Skill skill = SkillTable.getInstance().getInfo(id, level);

          // Add the L2Skill object to the L2Character _skills and its Func objects to the calculator set of the L2Character
          super.addSkill(skill);
        }

        rset.close();
        statement.close();
        rset = null;
        statement = null;
      }
      else
      {
        // Retrieve all skills of this L2PcInstance from the database
        con = L2DatabaseFactory.getInstance().getConnection(false);
        PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR_ALT_SUBCLASS);
        statement.setInt(1, getObjectId());
        ResultSet rset = statement.executeQuery();

        // Go though the recordset of this SQL query
        while(rset.next())
        {
          int id = rset.getInt("skill_id");
          int level = rset.getInt("skill_level");

          if(id > 9000)
          {
            continue; // fake skills for base stats
          }

          // Create a L2Skill object for each record
          L2Skill skill = SkillTable.getInstance().getInfo(id, level);

          // Add the L2Skill object to the L2Character _skills and its Func objects to the calculator set of the L2Character
          super.addSkill(skill);
        }
View Full Code Here

          continue;
        }

        if(activateEffects){
         
          L2Skill skill = SkillTable.getInstance().getInfo(skillId, skillLvl);

          skill.getEffects(this, this,false,false,false);
          skill = null;

          for(L2Effect effect : getAllEffects())
          {
            if(effect.getSkill().getId() == skillId)
View Full Code Here

        break; //Dismounted
      case 1:
        setIsRiding(true);
        if(isNoble())
        {
          L2Skill striderAssaultSkill = SkillTable.getInstance().getInfo(325, 1);
          addSkill(striderAssaultSkill, false); // not saved to DB
        }
        break;
      case 2:
        setIsFlying(true);
View Full Code Here

      for(L2SkillLearn skillInfo : skillTree)
      {
        if(skillInfo.getMinLevel() <= 40)
        {
          final L2Skill prevSkill = prevSkillList.get(skillInfo.getId());
          final L2Skill newSkill = SkillTable.getInstance().getInfo(skillInfo.getId(), skillInfo.getLevel());

          if(newSkill== null || prevSkill != null && prevSkill.getLevel() > newSkill.getLevel())
          {
            continue;
          }

          prevSkillList.put(newSkill.getId(), newSkill);
          storeSkill(newSkill, prevSkill, classIndex);
        }
      }
      skillTree = null;
      prevSkillList = null;
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.L2Skill

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.