Examples of AquireSkillInfo


Examples of com.l2jfrozen.gameserver.network.serverpackets.AquireSkillInfo

      if(!canteach)
        return; // cheater

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

      int spbId = -1;
      if(Config.DIVINE_SP_BOOK_NEEDED && skill.getId() == L2Skill.SKILL_DIVINE_INSPIRATION)
      {
        spbId = SkillSpellbookTable.getInstance().getBookForSkill(skill, _level);
      }
      else if(Config.SP_BOOK_NEEDED && skill.getLevel() == 1)
      {
        spbId = SkillSpellbookTable.getInstance().getBookForSkill(skill);
      }

      if(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;
        costid = s.getIdCost();
        costcount = s.getCostCount();
        spcost = s.getSpCost();
      }

      AquireSkillInfo asi = new AquireSkillInfo(skill.getId(), skill.getLevel(), spcost, 1);
      asi.addRequirement(4, costid, costcount, 0);
      sendPacket(asi);
    }
  }
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.AquireSkillInfo

      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;
        costid = s.getIdCost();
        costcount = s.getCostCount();
        spcost = s.getSpCost();
      }

      AquireSkillInfo asi = new AquireSkillInfo(skill.getId(), skill.getLevel(), spcost, 1);
      asi.addRequirement(4, costid, costcount, 0);
      sendPacket(asi);
    }
  }
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.