Package l2p.gameserver.templates

Examples of l2p.gameserver.templates.L2PlayerTemplate


      super(Stats.MAX_HP, 0x10, null);
    }

    @Override
    public void calc(Env env) {
      L2PlayerTemplate t = (L2PlayerTemplate) env.character.getTemplate();
      int lvl = Math.max(0, env.character.getLevel() - t.classBaseLevel);
      double hpmod = t.lvlHpMod * lvl;
      double hpmax = (t.lvlHpAdd + hpmod) * lvl;
      double hpmin = t.lvlHpAdd * lvl + hpmod;
      env.value += (hpmax + hpmin) / 2;
View Full Code Here


      super(Stats.MAX_CP, 0x10, null);
    }

    @Override
    public void calc(Env env) {
      L2PlayerTemplate t = (L2PlayerTemplate) env.character.getTemplate();
      int lvl = Math.max(0, env.character.getLevel() - t.classBaseLevel);
      double cpmod = t.lvlCpMod * lvl;
      double cpmax = (t.lvlCpAdd + cpmod) * lvl;
      double cpmin = t.lvlCpAdd * lvl + cpmod;
      env.value += (cpmax + cpmin) / 2;
View Full Code Here

      super(Stats.MAX_MP, 0x10, null);
    }

    @Override
    public void calc(Env env) {
      L2PlayerTemplate t = (L2PlayerTemplate) env.character.getTemplate();
      int lvl = Math.max(0, env.character.getLevel() - t.classBaseLevel);
      double mpmod = t.lvlMpMod * lvl;
      double mpmax = (t.lvlMpAdd + mpmod) * lvl;
      double mpmin = t.lvlMpAdd * lvl + mpmod;
      env.value += (mpmax + mpmin) / 2;
View Full Code Here

    initNewChar(getClient(), newChar);
  }

  private void initNewChar(L2GameClient client, L2Player newChar)
  {
    L2PlayerTemplate template = newChar.getTemplate();
    L2Player.restoreCharSubClasses(newChar);
    if(Config.STARTING_ADENA > 0)
    {
      newChar.addAdena(Config.STARTING_ADENA);
    }
    newChar.setXYZInvisible(template.spawnLoc);
    if(Config.CHAR_TITLE)
    {
      newChar.setTitle(Config.ADD_CHAR_TITLE);
    }
    else
    {
      newChar.setTitle("");
    }
    ItemTable itemTable = ItemTable.getInstance();
    for(L2Item i : template.getItems())
    {
      L2ItemInstance item = itemTable.createItem(i.getItemId());
      newChar.getInventory().addItem(item);
      if(item.getItemId() == 5588) // tutorial book
      {
View Full Code Here

        set.set("baseShldRate", 0);
        set.set("baseAtkRange", 40);
        set.set("spawnX", rset.getInt("char_templates.x"));
        set.set("spawnY", rset.getInt("char_templates.y"));
        set.set("spawnZ", rset.getInt("char_templates.z"));
        L2PlayerTemplate ct;
        //
        // Male class
        //
        set.set("isMale", true);
        // set.setMUnk1(rset.getDouble(27));
        // set.setMUnk2(rset.getDouble(28));
        set.set("collision_radius", rset.getDouble("char_templates.m_col_r"));
        set.set("collision_height", rset.getDouble("char_templates.m_col_h"));
        ct = new L2PlayerTemplate(set);
        // 5items must go here
        for(int x = 1; x < 6; x++)
        {
          if(rset.getInt("char_templates.items" + x) != 0)
          {
            ct.addItem(rset.getInt("char_templates.items" + x));
          }
        }
        _templates.put(ct.classId.getId(), ct);
        //
        // Female class
        //
        set.set("isMale", false);
        // set.setFUnk1(rset.getDouble(31));
        // set.setFUnk2(rset.getDouble(32));
        set.set("collision_radius", rset.getDouble("char_templates.f_col_r"));
        set.set("collision_height", rset.getDouble("char_templates.f_col_h"));
        ct = new L2PlayerTemplate(set);
        // 5items must go here
        for(int x = 1; x < 6; x++)
        {
          int itemId = rset.getInt("char_templates.items" + x);
          if(itemId != 0)
          {
            ct.addItem(itemId);
          }
        }
        _templates.put(ct.classId.getId() | 0x100, ct);
      }
    }
View Full Code Here

    try
    {
      int objectId = chardata.getInt("obj_Id");
      int classid = charclass.getInt("class_id");
      boolean female = chardata.getInt("sex") == 1;
      L2PlayerTemplate templ = CharTemplateTable.getInstance().getTemplate(classid, female);
      if(templ == null)
      {
        _log.log(Level.WARNING, "restoreChar fail | templ == null | objectId: " + objectId + " | classid: " + classid + " | female: " + female);
        return null;
      }
View Full Code Here

      broadcastPacket(new MagicSkillUse(this, this, 5103, 1, 1000, 0));
      //broadcastPacket(new SocialAction(getObjectId(), 16));
      sendPacket(new PlaySound("ItemSound.quest_fanfare_2"));
      broadcastUserInfo(true);
    }
    L2PlayerTemplate t = CharTemplateTable.getInstance().getTemplate(id, getSex() == 1);
    if(t == null)
    {
      _log.severe("Missing template for classId: " + id);
      // do not throw error - only print error
      return;
View Full Code Here

   * @param face  The face type Identifier of the L2Player
   * @return The L2Player added to the database or null
   */
  public static L2Player create(int classId, byte sex, String accountName, final String name, final byte hairStyle, final byte hairColor, final byte face)
  {
    L2PlayerTemplate template = CharTemplateTable.getInstance().getTemplate(classId, sex != 0);
    // Create a new L2Player with an account name
    L2Player player = new L2Player(IdFactory.getInstance().getNextId(), template, accountName);
    player.setName(name);
    player.setTitle("");
    player.setHairStyle(hairStyle);
View Full Code Here

      ps_rset = statement2.executeQuery("SELECT `class_id` FROM `character_subclasses` WHERE `char_obj_id`=" + objectId + " AND `isBase`=1 LIMIT 1");
      if(pl_rset.next() && ps_rset.next())
      {
        final int classId = ps_rset.getInt("class_id");
        final boolean female = pl_rset.getInt("sex") == 1;
        final L2PlayerTemplate template = CharTemplateTable.getInstance().getTemplate(classId, female);
        player = new L2Player(objectId, template);
        player.loadVariables();
        player.bookmarks.setCapacity(pl_rset.getInt("bookmarks"));
        player.setBaseClass(classId);
        player._accountName = pl_rset.getString("account_name");
View Full Code Here

TOP

Related Classes of l2p.gameserver.templates.L2PlayerTemplate

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.