Package net.sf.l2j.gameserver.model.actor.instance

Examples of net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.destroyItem()


        if (castle == null || !checkIfOkToUseStriderSiegeAssault(player, castle, true)) return;

        try
        {
            L2ItemInstance itemToTake = player.getInventory().getItemByItemId(skill.getItemConsumeId());
            if(!player.destroyItem("Consume", itemToTake.getObjectId(), skill.getItemConsume(), null, true))
              return;

            // damage calculation
            int damage = 0;
View Full Code Here


    // Update the changed stat for the character in the DB.
    activeChar.store();

        // Remove the item from inventory.
    activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);

    // Broadcast the changes to the char and all those nearby.
    UserInfo ui = new UserInfo(activeChar);
    activeChar.broadcastPacket(ui);
  }
View Full Code Here

              activeChar.sendPacket(sm);
        }
        else
          {
              activeChar.registerDwarvenRecipeList(rp);
              activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
              SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
              sm.addString("Added recipe \"" + rp.getRecipeName() + "\" to Dwarven RecipeBook");
              activeChar.sendPacket(sm);
          }
            }
View Full Code Here

              activeChar.sendPacket(sm);
        }
        else
          {
              activeChar.registerCommonRecipeList(rp);
              activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
              SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
              sm.addString("Added recipe \"" + rp.getRecipeName() + "\" to Common RecipeBook");
              activeChar.sendPacket(sm);
          }
            }
View Full Code Here

                {
                  player.sendPacket(new SystemMessage(SystemMessageId.YOU_DONT_HAVE_ALL_OF_THE_ITEMS_NEEDED_TO_ENCHANT_THAT_SKILL));
                  return;
                }
                // ok
                player.destroyItem("Consume", spb, trainer, true);
              }
          }
          else
          {
            SystemMessage sm = new SystemMessage(SystemMessageId.YOU_DONT_HAVE_ENOUGH_EXP_TO_ENCHANT_THAT_SKILL);
View Full Code Here

    else if (itemId == 8555) { //VVKorea
      MagicSkillUser MSU = new MagicSkillUser(playable, activeChar, 2272, 1, 1, 0);
      activeChar.broadcastPacket(MSU);
      //playCrystalSound(activeChar,"EtcSound.VVKorea");
    }
    activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
  }

  @Override
  public int[] getItemIds()
  {
View Full Code Here

            spawn.setLocx(target.getX());
            spawn.setLocy(target.getY());
            spawn.setLocz(target.getZ());
            L2World.getInstance().storeObject(spawn.spawnOne());

            activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);

            SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString("Created " + template1.name + " at x: " + spawn.getLocx() + " y: " + spawn.getLocy() + " z: " + spawn.getLocz());
            activeChar.sendPacket(sm);
        }
View Full Code Here

    MagicSkillUser MSU = new MagicSkillUser(playable, playable, 2103, 1, 0, 0);
    activeChar.sendPacket(MSU);
    activeChar.broadcastPacket(MSU);

    activeChar.startAbnormalEffect(BIGHEAD_EFFECT);
    activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);

    SystemMessage sm = new SystemMessage(SystemMessageId.USE_S1);
    sm.addSkillName(MYSTERY_POTION_SKILL);
    activeChar.sendPacket(sm);
View Full Code Here

                spawn.setId(IdFactory.getInstance().getNextId());
                spawn.setLocx(activeChar.getX());
                spawn.setLocy(activeChar.getY());
                spawn.setLocz(activeChar.getZ());
                L2World.getInstance().storeObject(spawn.spawnOne());
                activeChar.destroyItem("Summon", item.getObjectId(), 1, null, false);
                activeChar.sendMessage("Created " + npcTemplate.name + " at x: " + spawn.getLocx() + " y: " + spawn.getLocy() + " z: " + spawn.getLocz());
            }
            catch (Exception e)
            {
                activeChar.sendMessage("Target is not ingame.");
View Full Code Here

                MagicSkillUser MSU = new MagicSkillUser(playable, activeChar, _skill.getId(), 1, 1, 0);
                activeChar.sendPacket(MSU);
                activeChar.broadcastPacket(MSU);
                _effect.addNumCharges(1);
                activeChar.sendPacket(new EtcStatusUpdate(activeChar));
                activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
            }
            else if (_effect.getLevel() == 2)
            {
                activeChar.sendPacket(new SystemMessage(SystemMessageId.FORCE_MAXLEVEL_REACHED));
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.