Package net.sf.l2j.gameserver.model

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


    L2Henna template = HennaTable.getInstance().getTemplate(_symbolId);
        if(template == null)
        {
            return;
        }
      L2HennaInstance temp = new L2HennaInstance(template);

    HennaItemInfo hii = new HennaItemInfo(temp,activeChar);
    activeChar.sendPacket(hii);
  }
View Full Code Here


    _activeChar = player;

    int j = 0;
    for (int i = 0; i < 3; i++)
    {
      L2HennaInstance h = _activeChar.getHenna(i+1);
      if (h != null)
      {
        _hennas[j++] = h;
      }
    }
View Full Code Here

                      statement2.close();
                      classlist.close();
                      statement.close();
                        return;
                    }
            L2HennaInstance temp = new L2HennaInstance(template);
          temp.setSymbolId(id);
          temp.setItemIdDye(template.getDyeId());
          temp.setAmountDyeRequire(template.getAmountDyeRequire());
          temp.setPrice(template.getPrice());
          temp.setStatINT(template.getStatINT());
          temp.setStatSTR(template.getStatSTR());
          temp.setStatCON(template.getStatCON());
          temp.setStatMEM(template.getStatMEM());
          temp.setStatDEX(template.getStatDEX());
          temp.setStatWIT(template.getStatWIT());

          list.add(temp);
        }
        _hennaTrees.put(ClassId.values()[classId], list);
        hennatree.close();
View Full Code Here

    }


    for (int i = 0; i < henna.size(); i++)
    {
      L2HennaInstance temp = henna.get(i);
      result.add(temp);
    }

    return result.toArray(new L2HennaInstance[result.size()]);
  }
View Full Code Here

    html1.append("Select symbol you would like to remove:<br><br>");
    boolean hasHennas = false;

    for (int i=1;i<=3;i++)
    {
      L2HennaInstance henna = player.getHenna(i);

      if (henna != null)
      {
        hasHennas = true;
        html1.append("<a action=\"bypass -h npc_%objectId%_Remove "+i+"\">"+henna.getName()+"</a><br>");
      }
    }
    if (!hasHennas)
      html1.append("You don't have any symbol to remove!");
    html1.append("</body></html>");
View Full Code Here

          continue;
        }
       
        int symbol_id = rset.getInt("symbol_id");
       
        L2HennaInstance sym = null;
       
        if (symbol_id != 0)
        {
          L2Henna tpl = HennaTable.getInstance().getTemplate(symbol_id);
         
          if (tpl != null)
          {
            sym = new L2HennaInstance(tpl);
            _henna[slot - 1] = sym;
          }
        }
      }
     
View Full Code Here

    if (_henna[slot] == null)
    {
      return false;
    }
   
    L2HennaInstance henna = _henna[slot];
    _henna[slot] = null;
   
    java.sql.Connection con = null;
   
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      PreparedStatement statement = con.prepareStatement(DELETE_CHAR_HENNA);
      statement.setInt(1, getObjectId());
      statement.setInt(2, slot + 1);
      statement.setInt(3, getClassIndex());
      statement.execute();
      statement.close();
    }
    catch (Exception e)
    {
      _log.warning("could not remove char henna: " + e);
    }
    finally
    {
      try
      {
        con.close();
      }
      catch (Exception e)
      {
      }
    }
   
    // Calculate Henna modifiers of this L2PcInstance
    recalcHennaStats();
   
    // Send Server->Client HennaInfo packet to this L2PcInstance
    sendPacket(new HennaInfo(this));
   
    // Send Server->Client UserInfo packet to this L2PcInstance
    sendPacket(new UserInfo(this));
   
    // Add the recovered dyes to the player's inventory and notify them.
    getInventory().addItem("Henna", henna.getItemIdDye(), henna.getAmountDyeRequire() / 2, this, null);
   
    SystemMessage sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
    sm.addItemName(henna.getItemIdDye());
    sm.addNumber(henna.getAmountDyeRequire() / 2);
    sendPacket(sm);
   
    return true;
  }
View Full Code Here

    L2Henna template = HennaTable.getInstance().getTemplate(_symbolId);

        if (template == null)
            return;

      L2HennaInstance temp = new L2HennaInstance(template);
      int _count = 0;

    try{
      _count = activeChar.getInventory().getItemByItemId(temp.getItemIdDye()).getCount();
    }
    catch(Exception e){}

    if ((_count >= temp.getAmountDyeRequire())&& (activeChar.getAdena()>= temp.getPrice()) && activeChar.addHenna(temp))
    {
      SystemMessage sm = new SystemMessage(SystemMessageId.S1_DISAPPEARED);
      sm.addNumber(temp.getItemIdDye());
      activeChar.sendPacket(sm);
      sm = null;
      activeChar.sendPacket(new SystemMessage(SystemMessageId.SYMBOL_ADDED));

      //HennaInfo hi = new HennaInfo(temp,activeChar);
      //activeChar.sendPacket(hi);

      activeChar.getInventory().reduceAdena("Henna", temp.getPrice(), activeChar, activeChar.getLastFolkNPC());
      L2ItemInstance dyeToUpdate = activeChar.getInventory().destroyItemByItemId("Henna", temp.getItemIdDye(),temp.getAmountDyeRequire(), activeChar, activeChar.getLastFolkNPC());

      //update inventory
      InventoryUpdate iu = new InventoryUpdate();
            iu.addModifiedItem(activeChar.getInventory().getAdenaInstance());
      iu.addModifiedItem(dyeToUpdate);
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.L2HennaInstance

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.