Package lineage2.gameserver.model.base

Examples of lineage2.gameserver.model.base.Element


      StringTokenizer st = new StringTokenizer(command, ";");
      st.nextToken();
      st.nextToken();
      int EchantVal = Integer.parseInt(st.nextToken());
      int AtrType = Integer.parseInt(st.nextToken());
      Element el = Element.getElementById(AtrType);
      int EchantPrice = Integer.parseInt(st.nextToken());
      int EchantObjID = Integer.parseInt(st.nextToken());
      ItemTemplate item = ItemHolder.getInstance().getTemplate(Config.ENCHANTER_ITEM_ID);
      ItemInstance pay = activeChar.getInventory().getItemByItemId(item.getItemId());
      ItemInstance EhchantItem = activeChar.getInventory().getItemByObjectId(EchantObjID);
View Full Code Here


   * @return boolean
   */
  @SuppressWarnings("unused")
  private boolean canEnchantArmorAttribute(int attr, ItemInstance item)
  {
    Element elm = Element.getElementById(attr);
    switch (attr)
    {
      case 0:
        if (item.getDefenceWater() != 0)
        {
View Full Code Here

    {
      activeChar.sendActionFailed();
      return;
    }
    ItemAttributes set = itemToUnnchant.getAttributes();
    Element element = Element.getElementById(_attributeId);
    if ((element == Element.NONE) || (set.getValue(element) <= 0))
    {
      activeChar.sendPacket(new ExBaseAttributeCancelResult(false, itemToUnnchant, element), ActionFail.STATIC);
      return;
    }
View Full Code Here

    ItemTemplate i = ItemHolder.getInstance().getTemplate(item.getItemId());
    if (item.getItemAttributes().getValue() > 0)
    {
      if (i.isWeapon())
      {
        Element e = item.getItemAttributes().getElement();
        writeH(e.getId()); // attack element (-1 - none)
        writeH(item.getItemAttributes().getValue(e) + i.getBaseAttributeValue(e)); // attack element value
        writeH(0);
        writeH(0);
        writeH(0);
        writeH(0);
View Full Code Here

          {
            activeChar.sendMessage("Improper element value");
            return false;
          }
          ItemInstance item = createItem(activeChar, item_id, 1);
          Element element = Element.getElementById(elementId);
          item.setAttributeElement(element, item.getAttributeElementValue(element, false) + value);
          item.setJdbcState(JdbcEntityState.UPDATED);
          item.update();
          activeChar.sendPacket(new InventoryUpdate().addModifiedItem(item));
        }
View Full Code Here

    AttributeStoneInfo asi = AttributeStoneManager.getStoneInfo(stone.getItemId());
    if (asi == null)
    {
      return;
    }
    Element element = itemToEnchant.isArmor() ? Element.getReverseElement(asi.getElement()) : asi.getElement();
    if (itemToEnchant.isArmor())
    {
      if (itemToEnchant.getAttributeElementValue(Element.getReverseElement(element), false) != 0)
      {
        activeChar.sendPacket(Msg.ANOTHER_ELEMENTAL_POWER_HAS_ALREADY_BEEN_ADDED_THIS_ELEMENTAL_POWER_CANNOT_BE_ADDED, ActionFail.STATIC);
View Full Code Here

   * @param isArmor boolean
   * @return Element
   */
  public static Element getEnchantAttributeStoneElement(int itemId, boolean isArmor)
  {
    Element element = Element.NONE;
    switch (itemId)
    {
      case 9546:
      case 9552:
      case 10521:
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

TOP

Related Classes of lineage2.gameserver.model.base.Element

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.