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

Examples of net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance


  @Override
  protected void onEvtThink() {}
    @Override
  protected void onEvtAttacked(L2Character attacker)
    {
      L2DoorInstance me = (L2DoorInstance)_actor;
        ThreadPoolManager.getInstance().executeTask(new onEventAttackedDoorTask(me, attacker));
  }
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();
          }

      }
      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();
          }

      }
      else if(command.startsWith("ride wyvern")&&target.equals("castle")){
        if(activeChar.getClan().getHasCastle()>0&&activeChar.isClanLeader()){
View Full Code Here

      while ((line = lnr.readLine()) != null)
      {
        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());
        }
      }

      _log.config("DoorTable: Loaded " + _staticItems.size() + " Door Templates.");
    }
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);
    try
    {
      door.setMapRegion(MapRegionTable.getInstance().getMapRegion(x,y));
    }
    catch (Exception e)
    {
      _log.severe("Error in door data, ID:"+id);
    }
    door.setCurrentHpMp(door.getMaxHp(), door.getMaxMp());
    door.setOpen(1);
    door.setXYZInvisible(x,y,z);

    return door;
  }
View Full Code Here

      L2Object target = targetList[index];

      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(new ActionFailed());
          return;
        }

        if (success && (door.getOpen() == 1))
        {
          door.openMe();
          door.onOpen();
          SystemMessage systemmessage = new SystemMessage(SystemMessageId.S1_S2);

          systemmessage.addString("Unlock the door!");
          activeChar.sendPacket(systemmessage);
        }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance

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.