Package net.sf.l2j.gameserver.model

Examples of net.sf.l2j.gameserver.model.L2Skill


      {
        activeChar.sendPacket(new SystemMessage(SystemMessageId.SKILL_NOT_AVAILABLE));
        return;
      }

      L2Skill skill = _skills.get(skillId);

      if (skill == null)
      {
        if (Config.DEBUG)
          _log.warning("Skill " + skillId + " missing from npcskills.sql for a summon id " + activeSummon.getNpcId());
View Full Code Here


        player.broadcastPacket(MSU);
        MSU = new MagicSkillUser(ptarget, ptarget, 2230, 1, 1, 0);
        ptarget.broadcastPacket(MSU);

        // fireworks
        L2Skill skill = SkillTable.getInstance().getInfo(2025,1);
        if (skill != null)
        {
            MSU = new MagicSkillUser(player, player, 2025, 1, 1, 0);
            player.sendPacket(MSU);
            player.broadcastPacket(MSU);
View Full Code Here

    L2SkillLearn[] skills = SkillTreeTable.getInstance().getAvailableSkills(player, player.getClassId());
    while(skills.length > unLearnable)
    {
      for (L2SkillLearn s : skills)
      {
        L2Skill sk = SkillTable.getInstance().getInfo(s.getId(), s.getLevel());
        if (sk == null || !sk.getCanLearn(player.getClassId()))
        {
          if(countUnlearnable)
            unLearnable++;
          continue;
        }
        if(player.getSkillLevel(sk.getId()) == -1)
          skillCounter++;
        player.addSkill(sk, true);
      }
      countUnlearnable = false;
      skills = SkillTreeTable.getInstance().getAvailableSkills(player, player.getClassId());
View Full Code Here

    {
      showMainPage(activeChar);
    }
    else
    {
      L2Skill skill=null;
      try
      {
        String id = st.nextToken();
        String level = st.nextToken();
        int idval = Integer.parseInt(id);
        int levelval = Integer.parseInt(level);
        skill = SkillTable.getInstance().getInfo(idval,levelval);
      }
      catch (Exception e) {}
      if (skill != null)
      {
        String name = skill.getName();
        player.sendMessage("Admin gave you the skill "+name+".");
        player.addSkill(skill, true);
        //Admin information
        activeChar.sendMessage("You gave the skill "+name+" to "+player.getName()+".");
        if (Config.DEBUG)
View Full Code Here

    else
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
      return;
    }
    L2Skill skill = SkillTable.getInstance().getInfo(idval,player.getSkillLevel(idval));
    if (skill != null)
    {
      String skillname = skill.getName();
      player.sendMessage("Admin removed the skill "+skillname+" from your skills list.");
      player.removeSkill(skill);
      //Admin information 
      activeChar.sendMessage("You removed the skill "+skillname+" from "+player.getName()+".");
      if (Config.DEBUG)
View Full Code Here

      activeChar.sendMessage("Usage: //add_clan_skill <skill_id> <level>");
      showMainPage(activeChar);
    }
    else
    {
      L2Skill skill = SkillTable.getInstance().getInfo(id,level);
      if (skill != null)
      {
        String skillname = skill.getName();
        SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_SKILL_S1_ADDED);
        sm.addSkillName(id);
        player.sendPacket(sm);
        player.getClan().broadcastToOnlineMembers(sm);
        player.getClan().addNewSkill(skill);
View Full Code Here

      activeChar.sendPacket(new ActionFailed());
      return;
    }

    // Get the L2Skill template corresponding to the skillID received from the client
    L2Skill skill = SkillTable.getInstance().getInfo(_magicId, level);

    // Check the validity of the skill
    if (skill != null)
    {
      // _log.fine("  skill:"+skill.getName() + " level:"+skill.getLevel() + " passive:"+skill.isPassive());
      // _log.fine("  range:"+skill.getCastRange()+" targettype:"+skill.getTargetType()+" optype:"+skill.getOperateType()+" power:"+skill.getPower());
      // _log.fine("  reusedelay:"+skill.getReuseDelay()+" hittime:"+skill.getHitTime());
      // _log.fine("  currentState:"+activeChar.getCurrentState());  //for debug

      // If Alternate rule Karma punishment is set to true, forbid skill Return to player with Karma
      if (skill.getSkillType() == L2Skill.SkillType.RECALL && !Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT && activeChar.getKarma() > 0)
        return;

      // activeChar.stopMove();
      activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);
    }
View Full Code Here

    L2FolkInstance trainer = activeChar.getLastFolkNPC();

        if ((trainer == null || !activeChar.isInsideRadius(trainer, L2NpcInstance.INTERACTION_DISTANCE, false, false)) && !activeChar.isGM())
            return;

    L2Skill skill = SkillTable.getInstance().getInfo(_id, _level);

    boolean canteach = false;

    if (skill == null)
    {
      if (Config.DEBUG)
        _log.warning("skill id " + _id + " level " + _level
          + " is undefined. aquireSkillInfo failed.");
      return;
    }

    if (_skillType == 0)
    {
      if (!trainer.getTemplate().canTeach(activeChar.getSkillLearningClassId()))
                return; // cheater

      L2SkillLearn[] skills = SkillTreeTable.getInstance().getAvailableSkills(activeChar, activeChar.getSkillLearningClassId());

      for (L2SkillLearn s : skills)
      {
        if (s.getId() == _id && s.getLevel() == _level)
        {
          canteach = true;
          break;
        }
      }

      if (!canteach)
        return; // cheater

      int requiredSp = SkillTreeTable.getInstance().getSkillCost(activeChar, skill);
      AquireSkillInfo asi = new AquireSkillInfo(skill.getId(), skill.getLevel(), requiredSp,0);

            if (Config.SP_BOOK_NEEDED)
            {
                int spbId = SkillSpellbookTable.getInstance().getBookForSkill(skill);

                if (skill.getLevel() == 1 && spbId > -1)
                    asi.addRequirement(99, spbId, 1, 50);
            }

      sendPacket(asi);
    }
    else if (_skillType == 2)
        {
            int requiredRep = 0;
            int itemId = 0;
            L2PledgeSkillLearn[] skills = SkillTreeTable.getInstance().getAvailablePledgeSkills(activeChar);

            for (L2PledgeSkillLearn s : skills)
            {
                if (s.getId() == _id && s.getLevel() == _level)
                {
                    canteach = true;
                    requiredRep = s.getRepCost();
                    itemId = s.getItemId();
                    break;
                }
            }

            if (!canteach)
                return; // cheater


            AquireSkillInfo asi = new AquireSkillInfo(skill.getId(), skill.getLevel(), requiredRep,2);

            if (Config.LIFE_CRYSTAL_NEEDED)
            {
                asi.addRequirement(1, itemId, 1, 0);
            }

            sendPacket(asi);
        }
    else // Common Skills
    {
      int costid = 0;
      int costcount = 0;
      int spcost = 0;

      L2SkillLearn[] skillsc = SkillTreeTable.getInstance().getAvailableSkills(activeChar);

      for (L2SkillLearn s : skillsc)
      {
        L2Skill sk = SkillTable.getInstance().getInfo(s.getId(), s.getLevel());

        if (sk == null || sk != skill)
                    continue;

        canteach = true;
View Full Code Here

        }
        if (attrs.getNamedItem("lvl") != null)
        {
            lvl = Integer.decode(getValue(attrs.getNamedItem("lvl").getNodeValue(), template));
        }
        L2Skill skill = SkillTable.getInstance().getInfo(id, lvl);
        if (attrs.getNamedItem("chance") != null)
        {
          if (template instanceof L2Weapon || template instanceof L2Item)
          {
            skill.attach(new ConditionGameChance(Integer.decode(getValue(attrs.getNamedItem("chance").getNodeValue(), template))), true);
          }
          else
          {
            skill.attach(new ConditionGameChance(Integer.decode(getValue(attrs.getNamedItem("chance").getNodeValue(), template))), false);
          }
        }
        if (template instanceof L2Weapon)
        {
            if (attrs.getNamedItem("onUse") != null
View Full Code Here

  }

  public void updateBuff()
  {
    exit();
    L2Skill newSkill = SkillTable.getInstance().getInfo(getSkill().getId(), forces);
    newSkill.getEffects(getEffector(), getEffected());
  }
View Full Code Here

TOP

Related Classes of net.sf.l2j.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.