Package lineage2.gameserver.model.base

Examples of lineage2.gameserver.model.base.ClassId


    player.sendActionFailed();
  }
 
  public void showTransferSkillList(Player player)
  {
    ClassId classId = player.getClassId();
    if (classId == null)
    {
      return;
    }
    if ((player.getLevel() < 76) || (classId.getClassLevel().ordinal() < 4))
    {
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      StringBuilder sb = new StringBuilder();
      sb.append("<html><head><body>");
      sb.append("You must have 3rd class change quest completed.");
View Full Code Here


   * @param noban boolean
   * @param bity boolean
   */
  public synchronized void setClassId(final int id, boolean noban, boolean bity)
  {
    ClassId classId = ClassId.VALUES[id];
    if (!noban && !classId.equalsOrChildOf(ClassId.VALUES[getActiveClassId()]) && !getVarB("awakenByStoneOfDestiny",false) && !(getPlayerAccess().CanChangeClass || Config.EVERYBODY_HAS_ADMIN_RIGHTS))
    {
      Thread.dumpStack();
      return;
    }
    ClassId oldClassId = getClassId();
    if (!_subClassList.containsClassId(id))
    {
      final SubClass cclass = getActiveSubClass();
      final int oldClass = cclass.getClassId();
      _subClassList.changeSubClassId(oldClass, id);
      changeClassInDb(oldClass, id, cclass.getDefaultClassId() == 0 ? getSubClassList().getBaseSubClass().getDefaultClassId() : cclass.getDefaultClassId());
      if (cclass.isBase())
      {
        addClanPointsOnProfession(id);
      }
      switch (classId)
      {
        case CARDINAL:
          ItemFunctions.addItem(this, 15307, 7, true);
          break;
        case EVAS_SAINT:
          ItemFunctions.addItem(this, 15308, 7, true);
          break;
        case SHILLIEN_SAINT:
          ItemFunctions.addItem(this, 15309, 7, true);
          break;
        default:
          break;
      }
      rewardSkills(true,false);
      storeCharSubClasses();
      broadcastCharInfo();
    }
    if ((oldClassId == null) || !oldClassId.isOfRace(getClassId().getRace()) || !oldClassId.isOfType(getClassId().getType()))
    {
      PlayerTemplate t = PlayerTemplateHolder.getInstance().getPlayerTemplate(getRace(), classId, Sex.VALUES[getSex()]);
      if (t == null)
      {
        _log.error("Missing template for classId: " + id);
View Full Code Here

  public void rewardSkills(boolean send, boolean isSubclassAdd)
  {
    boolean update = false;
    if (Config.AUTO_LEARN_SKILLS || isSubclassAdd)
    {
      ClassId _cId = null;
      int unLearnable = 0;
      Collection<SkillLearn> skills = SkillAcquireHolder.getInstance().getAvailableSkills(this, AcquireType.NORMAL);
      while (skills.size() > unLearnable)
      {
        unLearnable = 0;
View Full Code Here

   * @param face int
   * @return Player
   */
  public static Player create(int classId, int sex, String accountName, final String name, final int hairStyle, final int hairColor, final int face)
  {
    ClassId class_id = ClassId.VALUES[classId];
    PlayerTemplate template = PlayerTemplateHolder.getInstance().getPlayerTemplate(class_id.getRace(), class_id, Sex.VALUES[sex]);
    Player player = new Player(IdFactory.getInstance().getNextId(), template, accountName);
    player.setName(name);
    player.setTitle("");
    player.setHairStyle(hairStyle);
    player.setHairColor(hairColor);
View Full Code Here

      statement2 = con.createStatement();
      rset = statement.executeQuery("SELECT * FROM `characters` WHERE `obj_Id`=" + objectId + " LIMIT 1");
      rset2 = statement2.executeQuery("SELECT `class_id`, `default_class_id` FROM `character_subclasses` WHERE `char_obj_id`=" + objectId + " AND `type`=" + SubClassType.BASE_CLASS.ordinal() + " LIMIT 1");
      if (rset.next() && rset2.next())
      {
        final ClassId classId = ClassId.VALUES[rset2.getInt("class_id")];
        final ClassId defaultClassId = ClassId.VALUES[rset2.getInt("default_class_id")];
        final PlayerTemplate template = PlayerTemplateHolder.getInstance().getPlayerTemplate(defaultClassId.getRace(), classId, Sex.VALUES[rset.getInt("sex")]);
        player = new Player(objectId, template);
        player.loadVariables();
        player.loadInstanceReuses();
        player.loadPremiumItemList();
        player.bookmarks.setCapacity(rset.getInt("bookmarks"));
View Full Code Here

      }
      if (change != 1)
      {
        return;
      }
      ClassId classId = player.getClassId();
      for (ClassId cid : ClassId.VALUES)
      {
        if (cid.childOf(classId) && (cid.getClassLevel().ordinal() == (classId.getClassLevel().ordinal() + 1)))
        {
          if (player.getInventory().getCountOf(SCROLL_OF_AFTERLIFE) > 0)
          {
            player.getInventory().destroyItemByItemId(SCROLL_OF_AFTERLIFE, 1);
            if(player.getVarB("awakenByStoneOfDestiny", false))
View Full Code Here

    {
      return;
    }
    if (command.equalsIgnoreCase("request_nightzaken"))
    {
      Reflection r = player.getActiveReflection();
      if (r != null)
      {
        if (player.canReenterInstance(nightZakenIzId))
        {
          player.teleToLocation(r.getTeleportLoc(), r);
        }
      }
      else if (player.canEnterInstance(nightZakenIzId))
      {
        ReflectionUtils.enterReflection(player, new ZakenNight(), nightZakenIzId);
      }
    }
    else if (command.equalsIgnoreCase("request_dayzaken"))
    {
      Reflection r = player.getActiveReflection();
      if (r != null)
      {
        if (player.canReenterInstance(dayZakenIzId))
        {
          player.teleToLocation(r.getTeleportLoc(), r);
        }
      }
      else if (player.canEnterInstance(dayZakenIzId))
      {
        ReflectionUtils.enterReflection(player, new ZakenDay(), dayZakenIzId);
      }
    }
    else if (command.equalsIgnoreCase("request_ultrazaken"))
    {
      Reflection r = player.getActiveReflection();
      if (r != null)
      {
        if (player.canReenterInstance(ultraZakenIzId))
        {
          player.teleToLocation(r.getTeleportLoc(), r);
        }
      }
      else if (player.canEnterInstance(ultraZakenIzId))
      {
        ReflectionUtils.enterReflection(player, new ZakenDay83(), ultraZakenIzId);
View Full Code Here

    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final int castleId = (param.length > 4) ? Integer.parseInt(param[3]) : 0;
    if (player.getReflection().isDefault())
    {
      final Castle castle = (castleId > 0) ? ResidenceHolder.getInstance().getResidence(Castle.class, castleId) : null;
      if ((castle != null) && castle.getSiegeEvent().isInProgress())
      {
        player.sendPacket(Msg.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
        return;
      }
    }
View Full Code Here

    public void onZoneEnter(Zone zone, Creature cha)
    {
      if (zone.getParams() == null || !cha.isPlayer())
        return;

      Castle castle = ResidenceHolder.getInstance().getResidence(zone.getTemplate().getIndex());

      if (castle != null)
      { 
        if(_side.ordinal()==1 || _side.ordinal()==0)
        {
View Full Code Here

   * Method enter_dc.
   */
  public void enter_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
View Full Code Here

TOP

Related Classes of lineage2.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.