Package com.l2jfrozen.gameserver.model.actor.instance

Examples of com.l2jfrozen.gameserver.model.actor.instance.L2DoorInstance$CloseTask


        if(line.trim().length() == 0 || line.startsWith("#"))
        {
          continue;
        }

        L2DoorInstance door = parseList(line);
        _staticItems.put(door.getDoorId(), door);
        door.spawnMe(door.getX(), door.getY(), door.getZ());
        ClanHall clanhall = ClanHallManager.getInstance().getNearbyClanHall(door.getX(), door.getY(), 500);
        if(clanhall != null)
        {
          clanhall.getDoors().add(door);
          door.setClanHall(clanhall);
          if(Config.DEBUG)
          {
            _log.warning("door " + door.getDoorName() + " attached to ch " + clanhall.getName());
          }
        }
     
      }
View Full Code Here


    npcDat.set("baseMpReg", 3.e-3f);
    npcDat.set("basePDef", pdef);
    npcDat.set("baseMDef", mdef);

    L2CharTemplate template = new L2CharTemplate(npcDat);
    L2DoorInstance door = new L2DoorInstance(IdFactory.getInstance().getNextId(), template, id, name, unlockable);
    door.setRange(rangeXMin, rangeYMin, rangeZMin, rangeXMax, rangeYMax, rangeZMax);
    name = null;
    npcDat = null;
    template = null;
    try
    {
      door.setMapRegion(MapRegionTable.getInstance().getMapRegion(x, y));
    }
    catch(Exception e)
    {
      if(Config.ENABLE_ALL_EXCEPTIONS)
        e.printStackTrace();
     
      _log.severe("Error in door data, ID:" + id);
    }
    door.setCurrentHpMp(door.getMaxHp(), door.getMaxMp());
    door.setOpen(autoOpen);
    door.setXYZInvisible(x, y, z);

    return door;
  }
View Full Code Here

    if(doorId <= 0)
      return null;

    for(int i = 0; i < getDoors().size(); i++)
    {
      L2DoorInstance door = getDoors().get(i);

      if(door.getDoorId() == doorId)
        return door;

      door = null;
    }
    return null;
View Full Code Here

   */
  public void spawnDoor()
  {
    for(int i = 0; i < getDoors().size(); i++)
    {
      L2DoorInstance door = getDoors().get(i);

      if(door.getCurrentHp() <= 0)
      {
        door.decayMe(); // Kill current if not killed already
        door = DoorTable.parseList(_doorDefault.get(i));

        door.spawnMe(door.getX(), door.getY(), door.getZ());
        getDoors().set(i, door);
      }
      else if(door.getOpen())
      {
        door.closeMe();
      }

      door.setCurrentHp(door.getMaxHp());

      door = null;
    }
  }
View Full Code Here

      while(rs.next())
      {
        // Create list of the door default for use when respawning dead doors
        _doorDefault.add(rs.getString("name") + ";" + rs.getInt("id") + ";" + rs.getInt("x") + ";" + rs.getInt("y") + ";" + rs.getInt("z") + ";" + rs.getInt("range_xmin") + ";" + rs.getInt("range_ymin") + ";" + rs.getInt("range_zmin") + ";" + rs.getInt("range_xmax") + ";" + rs.getInt("range_ymax") + ";" + rs.getInt("range_zmax") + ";" + rs.getInt("hp") + ";" + rs.getInt("pDef") + ";" + rs.getInt("mDef"));

        L2DoorInstance door = DoorTable.parseList(_doorDefault.get(_doorDefault.size() - 1));
        door.spawnMe(door.getX(), door.getY(), door.getZ());
        _doors.add(door);
        DoorTable.getInstance().putDoor(door);

        door = null;
      }
View Full Code Here

      L2Object target = element;
     
      boolean success = Formulas.getInstance().calculateUnlockChance(skill);
      if (target instanceof L2DoorInstance)
      {
        L2DoorInstance door = (L2DoorInstance) target;
        if (!door.isUnlockable())
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.UNABLE_TO_UNLOCK_DOOR));
          activeChar.sendPacket(ActionFailed.STATIC_PACKET);
          return;
        }
       
        if (success && (!door.getOpen()))
        {
          door.openMe();
          door.onOpen();
          SystemMessage msg = new SystemMessage(SystemMessageId.S1_S2);
          msg.addString("Unlock the door!");
          activeChar.sendPacket(msg);
          msg = null;
        }
View Full Code Here

  @Override
  public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  {
    if(command.startsWith("open doors") && target.equals("castle") && activeChar.isClanLeader())
    {
      L2DoorInstance door = (L2DoorInstance) activeChar.getTarget();
      Castle castle = CastleManager.getInstance().getCastleById(activeChar.getClan().getHasCastle());

      if(door == null || castle == null)
        return false;

      if(castle.checkIfInZone(door.getX(), door.getY(), door.getZ()))
      {
        door.openMe();
      }

      door = null;
      castle = null;
    }
    else if(command.startsWith("close doors") && target.equals("castle") && activeChar.isClanLeader())
    {
      L2DoorInstance door = (L2DoorInstance) activeChar.getTarget();
      Castle castle = CastleManager.getInstance().getCastleById(activeChar.getClan().getHasCastle());

      if(door == null || castle == null)
        return false;

      if(castle.checkIfInZone(door.getX(), door.getY(), door.getZ()))
      {
        door.closeMe();
      }
      door = null;
      castle = null;
    }
    else if(command.startsWith("ride wyvern") && target.equals("castle"))
View Full Code Here

  }

  @Override
  protected void onEvtAttacked(L2Character attacker)
  {
    L2DoorInstance me = (L2DoorInstance) _actor;
    ThreadPoolManager.getInstance().executeTask(new onEventAttackedDoorTask(me, attacker));
    me = null;
  }
View Full Code Here

    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
      activeChar.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }
    L2DoorInstance door = (L2DoorInstance) target;

    target = null;

    if(!activeChar.isInsideRadius(door, INTERACTION_DISTANCE, false, false))
    {
      activeChar.sendMessage("Door is to far.");
      activeChar.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }

    if(activeChar.getAbnormalEffect() > 0 || activeChar.isInCombat())
    {
      activeChar.sendMessage("You can`t use the key right now.");
      activeChar.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }

    if(LAST_OPEN + 1800000 > System.currentTimeMillis()) // 30 * 60 * 1000 = 1800000
    {
      activeChar.sendMessage("You can`t use the key right now.");
      activeChar.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }

    if(!playable.destroyItem("Consume", item.getObjectId(), 1, null, false))
      return;

    if(itemId == 8056)
    {
      if(door.getDoorId() == 23150003 || door.getDoorId() == 23150004)
      {
        DoorTable.getInstance().getDoor(23150003).openMe();
        DoorTable.getInstance().getDoor(23150004).openMe();
        DoorTable.getInstance().getDoor(23150003).onOpen();
        DoorTable.getInstance().getDoor(23150004).onOpen();
View Full Code Here

  public void openCloseDoor(L2PcInstance activeChar, int doorId, boolean open)
  {
    if(activeChar.getClanId() != getOwnerId())
      return;

    L2DoorInstance door = getDoor(doorId);
    if(door != null)
    {
      if(open)
      {
        door.openMe();
      }
      else
      {
        door.closeMe();
      }
    }

    door = null;
  }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.actor.instance.L2DoorInstance$CloseTask

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.