Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2HennaInstance


    L2Henna template = HennaTable.getInstance().getTemplate(_symbolId);
    if(template == null)
    {
      return;
    }
    L2HennaInstance temp = new L2HennaInstance(template);
    boolean cheater = true;
    for(L2HennaInstance h : HennaTreeTable.getInstance().getAvailableHenna(activeChar.getClassId(), activeChar.getSex()))
    {
      if(h.getSymbolId() == temp.getSymbolId())
      {
        cheater = false;
        break;
      }
    }
    if(cheater)
    {
      activeChar.sendPacket(Msg.THE_SYMBOL_CANNOT_BE_DRAWN);
      return;
    }
    PcInventory inventory = activeChar.getInventory();
    L2ItemInstance item = inventory.getItemByItemId(temp.getItemIdDye());
    if(item != null && item.getCount() >= temp.getAmountDyeRequire() && activeChar.getAdena() >= temp.getPrice() && activeChar.addHenna(temp))
    {
      activeChar.sendPacket(new SystemMessage(SystemMessage.S1_HAS_DISAPPEARED).addString(temp.getName()), Msg.THE_SYMBOL_HAS_BEEN_ADDED);
      inventory.reduceAdena(temp.getPrice());
      if(inventory.destroyItemByItemId(temp.getItemIdDye(), temp.getAmountDyeRequire(), true) == null)
      {
        _log.info("RequestHennaEquip[50]: Item not found!!!");
      }
    }
    else
View Full Code Here


  private int _count;

  public HennaInfo(L2Player player)
  {
    _count = 0;
    L2HennaInstance h;
    for(int i = 0; i < 3; i++)
    {
      if((h = player.getHenna(i + 1)) != null)
      {
        _hennas[_count++] = h;
View Full Code Here

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

          L2Henna template = HennaTable.getInstance().getTemplate(id);
          if(template == null)
          {
            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);
        count += list.size();
        _log.fine("Henna Tree for Class: " + classId + " has " + list.size() + " Henna Templates.");
View Full Code Here

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

    slot--;
    if(_henna[slot] == null)
    {
      return false;
    }
    final L2HennaInstance henna = _henna[slot];
    final short dyeID = henna.getItemIdDye();
    // Added by Tempy - 10 Aug 05
    // Gives amount equal to half of the dyes needed for the henna back.
    final L2ItemInstance hennaDyes = ItemTable.getInstance().createItem(dyeID);
    hennaDyes.setCount(henna.getAmountDyeRequire() / 2);
    _henna[slot] = null;
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM character_hennas where char_obj_id=? and slot=? and class_index=?");
      statement.setInt(1, getObjectId());
      statement.setInt(2, slot + 1);
      statement.setInt(3, getActiveClassId());
      statement.execute();
    }
    catch(final Exception e)
    {
      _log.warning("could not remove char henna: " + e);
    }
    finally
    {
      DatabaseUtils.closeDatabaseCS(con, statement);
    }
    // Calculate Henna modifiers of this L2Player
    recalcHennaStats();
    // Send Server->Client HennaInfo packet to this L2Player
    sendPacket(new HennaInfo(this));
    // Send Server->Client UserInfo packet to this L2Player
    sendUserInfo(false);
    // Add the recovered dyes to the player's inventory and notify them.
    getInventory().addItem(hennaDyes);
    sendPacket(SystemMessage.obtainItems(henna.getItemIdDye(), henna.getAmountDyeRequire() / 2, 0));
    return true;
  }
View Full Code Here

      return;
    }
    L2Henna template = HennaTable.getInstance().getTemplate(SymbolId);
    if(template != null)
    {
      activeChar.sendPacket(new HennaItemInfo(new L2HennaInstance(template), activeChar));
    }
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.instances.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.