Package lineage2.gameserver.model

Examples of lineage2.gameserver.model.Skill$AddedSkill


      return false;
    }
    activeChar.abortAttack(true, true);
    activeChar.abortCast(true, true);
    activeChar.stopMove();
    Skill skill;
    if (activeChar.getPlayerAccess().FastUnstuck)
    {
      skill = SkillTable.getInstance().getInfo(1050, 2);
    }
    else
    {
      skill = SkillTable.getInstance().getInfo(2099, 1);
    }
    if ((skill != null) && skill.checkCondition(activeChar, activeChar, false, false, true))
    {
      activeChar.getAI().Cast(skill, activeChar, false, true);
    }
    return true;
  }
View Full Code Here


          for (Iterator<org.dom4j.Element> nextIterator = subElement.elementIterator(); nextIterator.hasNext();)
          {
            org.dom4j.Element nextElement = nextIterator.next();
            int id = Integer.parseInt(nextElement.attributeValue("id"));
            int level = Integer.parseInt(nextElement.attributeValue("level"));
            Skill skill = SkillTable.getInstance().getInfo(id, level);
            if (skill != null)
            {
              template.attachSkill(skill);
            }
            else
            {
              info("Skill not found(" + id + "," + level + ") for item:" + set.getObject("item_id") + "; file:" + getCurrentFileName());
            }
          }
        }
        else if (subName.equalsIgnoreCase("enchant4_skill"))
        {
          int id = Integer.parseInt(subElement.attributeValue("id"));
          int level = Integer.parseInt(subElement.attributeValue("level"));
          Skill skill = SkillTable.getInstance().getInfo(id, level);
          if (skill != null)
          {
            template.setEnchant4Skill(skill);
          }
        }
        else if (subName.equalsIgnoreCase("unequip_skill"))
        {
          int id = Integer.parseInt(subElement.attributeValue("id"));
          int level = Integer.parseInt(subElement.attributeValue("level"));
          Skill skill = SkillTable.getInstance().getInfo(id, level);
          if (skill != null)
          {
            template.setUnequipeSkill(skill);
          }
        }
View Full Code Here

    final double distance = actor.getDistance(attacker);
    if ((distance > 300) && (distance < 1000) && (_damSkills.length > 0) && Rnd.chance(10))
    {
      Functions.npcSay(actor, MsgOnRecall[Rnd.get(MsgOnRecall.length - 1)].sprintf(attacker.getName()));
      teleToLocation(attacker, Location.findFrontPosition(actor, attacker, 0, 50));
      final Skill r_skill = _damSkills[Rnd.get(_damSkills.length)];
      if (canUseSkill(r_skill, attacker, -1))
      {
        addTaskAttack(attacker, r_skill, 1000000);
      }
    }
    else if ((_paralyze.length > 0) && Rnd.chance(20))
    {
      final Skill r_skill = _paralyze[Rnd.get(_paralyze.length)];
      if (canUseSkill(r_skill, attacker, -1))
      {
        addTaskAttack(attacker, r_skill, 1000000);
      }
    }
View Full Code Here

    final double distance = actor.getDistance(caster);
    if ((_damSkills.length > 0) && (skill.getEffectPoint() > 0) && (distance < 1000) && Rnd.chance(20))
    {
      Functions.npcSay(actor, MsgOnRecall[Rnd.get(MsgOnRecall.length)].sprintf(caster.getName()));
      teleToLocation(caster, Location.findFrontPosition(actor, caster, 0, 50));
      final Skill r_skill = _damSkills[Rnd.get(_damSkills.length)];
      if (canUseSkill(r_skill, caster, -1))
      {
        addTaskAttack(caster, r_skill, 1000000);
      }
    }
View Full Code Here

      return chooseTaskAndTargets(null, target, distance);
    }
    final Map<Skill, Integer> d_skill = new HashMap<>();
    addDesiredSkill(d_skill, target, distance, KechiDoubleCutter);
    addDesiredSkill(d_skill, target, distance, KechiAirBlade);
    final Skill r_skill = selectTopSkill(d_skill);
    return chooseTaskAndTargets(r_skill, target, distance);
  }
View Full Code Here

    if (!first)
    {
      if (activeChar.isCastingNow())
      {
        Creature castingTarget = activeChar.getCastingTarget();
        Skill castingSkill = activeChar.getCastingSkill();
        long animationEndTime = activeChar.getAnimationEndTime();
        if ((castingSkill != null) && (castingTarget != null) && castingTarget.isCreature() && (activeChar.getAnimationEndTime() > 0))
        {
          sendPacket(new MagicSkillUse(activeChar, castingTarget, castingSkill.getId(), castingSkill.getLevel(), (int) (animationEndTime - System.currentTimeMillis()), 0));
        }
      }
      if (activeChar.isInBoat())
      {
        activeChar.sendPacket(activeChar.getBoat().getOnPacket(activeChar, activeChar.getInBoatPosition()));
View Full Code Here

   * @param store boolean
   * @return Skill
   */
  public Skill addSkill(Skill newSkill, boolean store)
  {
    Skill oldSkill = null;
    if (newSkill != null)
    {
      oldSkill = _skills.put(newSkill.getId(), newSkill);
      if (store)
      {
        Connection con = null;
        PreparedStatement statement = null;
        try
        {
          con = DatabaseFactory.getInstance().getConnection();
          if (oldSkill != null)
          {
            statement = con.prepareStatement("UPDATE clan_subpledges_skills SET skill_level=? WHERE skill_id=? AND clan_id=? AND type=?");
            statement.setInt(1, newSkill.getLevel());
            statement.setInt(2, oldSkill.getId());
            statement.setInt(3, _clan.getClanId());
            statement.setInt(4, _type);
            statement.execute();
          }
          else
View Full Code Here

      rset = statement.executeQuery();
      while (rset.next())
      {
        int id = rset.getInt("skill_id");
        int level = rset.getInt("skill_level");
        Skill skill = SkillTable.getInstance().getInfo(id, level);
        _skills.put(skill.getId(), skill);
      }
    }
    catch (Exception e)
    {
      _log.warn("Exception: " + e, e);
View Full Code Here

   * @param def int
   * @return int
   */
  public int getSkillLevel(int id, int def)
  {
    Skill skill = _skills.get(id);
    return skill == null ? def : skill.getLevel();
  }
View Full Code Here

  @Override
  public void onUnequip(int slot, ItemInstance item, Playable actor)
  {
    Player player = (Player) actor;
    Skill[] itemSkills = null;
    Skill enchant4Skill = null;
    Skill unequipeSkill = null;
    ItemTemplate it = item.getTemplate();
    itemSkills = it.getAttachedSkills();
    enchant4Skill = it.getEnchant4Skill();
    unequipeSkill = it.getUnequipeSkill();
    player.removeTriggers(it);
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.Skill$AddedSkill

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.