Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2DoorInstance


  {
    if(activeChar.getTarget() == null || !activeChar.getTarget().isDoor() || activeChar.getClan() == null)
    {
      return false;
    }
    L2DoorInstance door = (L2DoorInstance) activeChar.getTarget();
    Residence castle = CastleManager.getInstance().getCastleByIndex(activeChar.getClan().getHasCastle());
    if(door == null || castle == null)
    {
      return false;
    }
    if(target.equals("doors") && activeChar.isClanLeader() && castle.checkIfInZone(door.getX(), door.getY()))
    {
      if(command.startsWith("open"))
      {
        door.openMe();
      }
      else if(command.startsWith("close"))
      {
        door.closeMe();
      }
    }
    return true;
  }
View Full Code Here


    public boolean OnActionShift_L2DoorInstance(L2Player player, L2Object object) {
        if (player == null || object == null || !player.getPlayerAccess().Door || !object.isDoor()) {
            return false;
        }
        String dialog;
        L2DoorInstance door = (L2DoorInstance) object;
        dialog = Files.read("data/scripts/actions/admin.L2DoorInstance.onActionShift.htm", player);
        dialog = dialog.replaceFirst("%CurrentHp%", String.valueOf((int) door.getCurrentHp()));
        dialog = dialog.replaceFirst("%MaxHp%", String.valueOf(door.getMaxHp()));
        dialog = dialog.replaceFirst("%ObjectId%", String.valueOf(door.getObjectId()));
        dialog = dialog.replaceFirst("%doorId%", String.valueOf(door.getDoorId()));
        dialog = dialog.replaceFirst("%pdef%", String.valueOf(door.getPDef(null)));
        dialog = dialog.replaceFirst("%mdef%", String.valueOf(door.getMDef(null, null)));
        dialog = dialog.replaceFirst("%siege%", door.isSiegeWeaponOnlyAttackable() ? "Siege weapon only attackable." : "");
        dialog = dialog.replaceFirst("bypass -h admin_open", "bypass -h admin_open " + door.getDoorId());
        dialog = dialog.replaceFirst("bypass -h admin_close", "bypass -h admin_close " + door.getDoorId());
        show(dialog, player);
        return true;
    }
View Full Code Here

  private static void doors(boolean open)
  {
    for(int i : doors)
    {
      L2DoorInstance door = DoorTable.getInstance().getDoor(i);
      if(open)
      {
        door.openMe();
      }
      else
      {
        door.closeMe();
      }
    }
  }
View Full Code Here

    L2Player player = (L2Player) getSelf();
    if(!L2NpcInstance.canBypassCheck(player, player.getLastNpc()))
    {
      return;
    }
    L2DoorInstance door = DoorTable.getInstance().getDoor(DoorId);
    door.openMe();
  }
View Full Code Here

    L2Player player = (L2Player) getSelf();
    if(player == null || !L2NpcInstance.canBypassCheck(player, player.getLastNpc()))
    {
      return;
    }
    L2DoorInstance door = DoorTable.getInstance().getDoor(DoorId);
    door.closeMe();
  }
View Full Code Here

  }

  private static void openDoor(int doorId)
  {
    final int CLOSE_TIME = 10000; // 10 секунд
    L2DoorInstance door = DoorTable.getInstance().getDoor(doorId);
    if(!door.isOpen())
    {
      door.openMe();
      door.scheduleCloseMe(CLOSE_TIME);
    }
  }
View Full Code Here

      {
        //if(player.getClassId().getId() == 118 || Rnd.chance(25))
        {
          for(int door : index[1])
          {
            L2DoorInstance doorObj = DoorTable.getInstance().getDoor(door);
            if(door != 19260051 && door != 19260052)
            {
              ThreadPoolManager.getInstance().scheduleAi(new CloseDoor(door), 60000, false);
            }
            doorObj.openMe();
          }
        }
        //saveGlobalQuestVar("OpenDoor - " + npc.getNpcId(), String.valueOf(Calendar.getInstance().getTimeInMillis() + 120000));
      }
    }
View Full Code Here

    {
      return null;
    }
    for(int i = 0; i < getDoors().size(); i++)
    {
      L2DoorInstance door = getDoors().get(i);
      if(door.getDoorId() == doorId)
      {
        return door;
      }
    }
    return null;
View Full Code Here

   */
  public void spawnDoor(boolean isDoorWeak)
  {
    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.spawnMe();
      }
      door.setCurrentHp(isDoorWeak ? door.getMaxHp() / 2 : door.getMaxHp(), true);
      door.closeMe();
    }
    loadDoorUpgrade(); // Check for any upgrade the doors may have
  }
View Full Code Here

  FastMap<Integer, Integer> doorUpgrades = new FastMap<Integer, Integer>().setShared(true);
  // This method upgrade door

  public void upgradeDoor(int doorId, int hp, boolean db)
  {
    L2DoorInstance door = getDoor(doorId);
    if(door == null)
    {
      return;
    }
    if(door.getDoorId() == doorId)
    {
      door.setUpgradeHp(hp);
      door.setCurrentHp(door.getMaxHp(), false);
      door.broadcastStatusUpdate();
      if(db)
      {
        saveDoorUpgrade(doorId, hp);
      }
      doorUpgrades.put(doorId, hp);
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.instances.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.