Package net.sf.l2j.gameserver.model

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


    }

    private void setEnchant(L2PcInstance activeChar, int ench, int armorType)
    {
        // get the target
        L2Object target = activeChar.getTarget();
        if (target == null) target = activeChar;
        L2PcInstance player = null;
        if (target instanceof L2PcInstance)
        {
            player = (L2PcInstance) target;
View Full Code Here


        if (CastleManorManager.getInstance().isDisabled())
          return;

        _activeChar = (L2PcInstance)playable;
        L2Object target = _activeChar.getTarget();

        if(!(target instanceof L2NpcInstance))
        {
            _activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
            _activeChar.sendPacket(new ActionFailed());
View Full Code Here

    if (!(playable instanceof L2PcInstance)) return;

    L2PcInstance activeChar = (L2PcInstance) playable;
    int itemId = item.getItemId();
    L2Skill skill = SkillTable.getInstance().getInfo(2229, itemId-6664);//box key skill
    L2Object target = activeChar.getTarget();

    if (!(target instanceof L2ChestInstance))
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
      activeChar.sendPacket(new ActionFailed());
View Full Code Here

        }

        if (template1 == null)
            return;

        L2Object target = activeChar.getTarget();
        if (target == null)
            target = activeChar;

        try
        {
            L2Spawn spawn = new L2Spawn(template1);
            spawn.setId(IdFactory.getInstance().getNextId());
            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);
View Full Code Here

    handleRes(activeChar, null);
  }

  private void handleRes(L2PcInstance activeChar, String resParam)
  {
    L2Object obj = activeChar.getTarget();

    if (resParam != null)
    {
      // Check if a player name was specified as a param.
      L2PcInstance plyr = L2World.getInstance().getPlayer(resParam);

      if (plyr != null)
      {
        obj = plyr;
      }
      else
      {
        // Otherwise, check if the param was a radius.
        try
        {
          int radius = Integer.parseInt(resParam);

          for (L2PcInstance knownPlayer : activeChar.getKnownList().getKnownPlayersInRadius(radius))
            doResurrect(knownPlayer);

          activeChar.sendMessage("Resurrected all players within a " + radius + " unit radius.");
          return;
        }
        catch (NumberFormatException e) {
          activeChar.sendMessage("Enter a valid player name or radius.");
          return;
        }
      }
    }

    if (obj == null)
      obj = activeChar;

        if (obj instanceof L2ControllableMobInstance)
        {
            activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
            return;
        }

    doResurrect((L2Character)obj);

    if (Config.DEBUG)
      _log.fine("GM: "+activeChar.getName()+"("+activeChar.getObjectId()+") resurrected character "+ obj.getObjectId());
  }
View Full Code Here

    handleNonPlayerRes(activeChar, "");
  }

  private void handleNonPlayerRes(L2PcInstance activeChar, String radiusStr)
  {
    L2Object obj = activeChar.getTarget();

    try {
      int radius = 0;

      if (!radiusStr.equals(""))
View Full Code Here

  @Override
  protected void runImpl()
  {
    L2PcInstance player = getClient().getActiveChar();
    if (player == null) return;
    L2Object object = L2World.getInstance().findObject(_storePlayerId);
    if (object == null || !(object instanceof L2PcInstance)) return;
    L2PcInstance storePlayer = (L2PcInstance)object;
    if (storePlayer.getPrivateStoreType() != L2PcInstance.STORE_PRIVATE_BUY) return;
    TradeList storeList = storePlayer.getBuyList();
    if (storeList == null) return;
View Full Code Here

        if (activeChar == null) return false;

        if (!Config.ALT_PRIVILEGES_ADMIN)
            if (activeChar.getAccessLevel() < REQUIRED_LEVEL) return false;

    L2Object targetChar = activeChar.getTarget();
    String target = (targetChar != null ? targetChar.getName() : "no-target");
        GMAudit.auditGMAction(activeChar.getName(), command, target, "");

        StringTokenizer st = new StringTokenizer(command, " ");
        String actualCommand = st.nextToken(); // Get actual command
View Full Code Here

      else
        activeChar.sendMessage("Usage: //del_drop <npc_id> <item_id> <category>");
    }
    else if(command.startsWith("admin_box_access"))
    {
      L2Object target = activeChar.getTarget();
      String[] players = command.split(" ");
      if (target instanceof L2BoxInstance)
      {
        L2BoxInstance box = (L2BoxInstance) target;
        if (players.length > 1)
View Full Code Here

  {
    if (!(playable instanceof L2PcInstance))
      return;

    L2PcInstance activeChar = (L2PcInstance)playable;
    L2Object target = activeChar.getTarget();
    if (!(target instanceof L2MonsterInstance))
    {
      // Send a System Message to the caster
            SystemMessage sm = new SystemMessage(SystemMessageId.INCORRECT_TARGET);
      activeChar.sendPacket(sm);
View Full Code Here

TOP

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

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.