Package net.sf.l2j.gameserver.templates

Examples of net.sf.l2j.gameserver.templates.L2PcTemplate


    }

    if (Config.DEBUG)
      _log.fine("charname: " + _name + " classId: " + _classId);

    L2PcTemplate template = CharTemplateTable.getInstance().getTemplate(_classId);
    if(template == null || template.classBaseLevel > 1)
    {
      CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED);
      sendPacket(ccf);
      return;
View Full Code Here


  private void initNewChar(L2GameClient client, L2PcInstance newChar)
  {
    if (Config.DEBUG) _log.fine("Character init start");
    L2World.getInstance().storeObject(newChar);

    L2PcTemplate template = newChar.getTemplate();

    newChar.addAdena("Init", Config.STARTING_ADENA, null, false);

    newChar.setXYZInvisible(template.spawnX, template.spawnY, template.spawnZ);
    newChar.setTitle("");

    L2ShortCut shortcut;
    //add attack shortcut
    shortcut = new L2ShortCut(0,0,3,2,-1,1);
    newChar.registerShortCut(shortcut);
    //add take shortcut
    shortcut = new L2ShortCut(3,0,3,5,-1,1);
    newChar.registerShortCut(shortcut);
    //add sit shortcut
    shortcut = new L2ShortCut(10,0,3,0,-1,1);
    newChar.registerShortCut(shortcut);

    ItemTable itemTable = ItemTable.getInstance();
    L2Item[] items = template.getItems();
    for (int i = 0; i < items.length; i++)
    {
      L2ItemInstance item = newChar.getInventory().addItem("Init", items[i].getItemId(), 1, newChar, null);
      if (item.getItemId()==5588){
          //add tutbook shortcut
View Full Code Here

        set.set("spawnX", rset.getInt("x"));
        set.set("spawnY", rset.getInt("y"));
        set.set("spawnZ", rset.getInt("z"));

        L2PcTemplate ct;

        set.set("collision_radius", rset.getDouble("m_col_r"));
        set.set("collision_height", rset.getDouble("m_col_h"));
        ct = new L2PcTemplate(set);
        //5items must go here
        for (int x=1; x < 6 ;x++)
        {
          if (rset.getInt("items"+x) != 0)
          {
            ct.addItem(rset.getInt("items"+x));
          }
        }
        _templates.put(ct.classId.getId(), ct);
      }
View Full Code Here

  {
    if (Config.DEBUG) _log.fine("CreateNewChar");

    CharTemplates ct = new CharTemplates();

    L2PcTemplate template = CharTemplateTable.getInstance().getTemplate(0);
    ct.addChar(template);

    template = CharTemplateTable.getInstance().getTemplate(ClassId.fighter)// human fighter
    ct.addChar(template);
View Full Code Here

    }

    @Override
    public void calc(Env env)
    {
      L2PcTemplate t = (L2PcTemplate) env.player.getTemplate();
      int lvl = env.player.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

    }

    @Override
    public void calc(Env env)
    {
      L2PcTemplate t = (L2PcTemplate) env.player.getTemplate();
      int lvl = env.player.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

    }

    @Override
    public void calc(Env env)
    {
      L2PcTemplate t = (L2PcTemplate) env.player.getTemplate();
      int lvl = env.player.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

    if (!isSubClassActive())
    {
      return getTemplate().race;
    }
   
    L2PcTemplate charTemp = CharTemplateTable.getInstance().getTemplate(_baseClass);
    return charTemp.race;
  }
View Full Code Here

     
      while (rset.next())
      {
        final int activeClassId = rset.getInt("classid");
        final boolean female = rset.getInt("sex") != 0;
        final L2PcTemplate template = CharTemplateTable.getInstance().getTemplate(activeClassId);
        PcAppearance app = new PcAppearance(rset.getByte("face"), rset.getByte("hairColor"), rset.getByte("hairStyle"), female);
       
        player = new L2PcInstance(objectId, template, rset.getString("account_name"), app);
        player.setName(rset.getString("char_name"));
        player._lastAccess = rset.getLong("lastAccess");
View Full Code Here

   */
  private void setClassTemplate(int classId)
  {
    _activeClass = classId;
   
    L2PcTemplate t = CharTemplateTable.getInstance().getTemplate(classId);
   
    if (t == null)
    {
      _log.severe("Missing template for classId: " + classId);
      throw new Error();
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.templates.L2PcTemplate

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.