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

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


   */
  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 = DoorTable.parseList(_doorDefault.get(i));

        if(isDoorWeak)
        {
          door.setCurrentHpDirect(door.getMaxHp() / 2);
        }
        else {
          door.setCurrentHpDirect(door.getMaxHp());
        }

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

      door = null;
    }
    loadDoorUpgrade(); // Check for any upgrade the doors may have
View Full Code Here


  }

  // This method upgrade door
  public void upgradeDoor(int doorId, int hp, int pDef, int mDef)
  {
    L2DoorInstance door = getDoor(doorId);
    if(door == null)
      return;

    if(door.getDoorId() == doorId)
    {
      door.setCurrentHpDirect(door.getMaxHp() + hp);

      saveDoorUpgrade(doorId, hp, pDef, mDef);
      return;
    }
  }
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

    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

    {
      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("Too far.");
      activeChar.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }
   
    if (activeChar.getAbnormalEffect() > 0 || activeChar.isInCombat())
    {
      activeChar.sendMessage("You cannot use the key now.");
      activeChar.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }
   
    int openChance = 35;
   
    if (!playable.destroyItem("Consume", item.getObjectId(), 1, null, false))
      return;
   
    switch (itemId)
    {
      case 8273: // AnteroomKey
        if (door.getDoorName().startsWith("Anteroom"))
        {
          if (openChance > 0 && Rnd.get(100) < openChance)
          {
            activeChar.sendMessage("You opened Anterooms Door.");
            door.openMe();
            door.onOpen(); // Closes the door after 60sec
            activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 3));
          }
          else
          {
            // test with: activeChar.sendPacket(new SystemMessage(SystemMessage.FAILED_TO_UNLOCK_DOOR));
            activeChar.sendMessage("You failed to open Anterooms Door.");
            activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 13));
            PlaySound playSound = new PlaySound("interfacesound.system_close_01");
            activeChar.sendPacket(playSound);
          }
        }
        else
        {
          activeChar.sendMessage("Incorrect Door.");
        }
        break;
      case 8274: // Chapelkey, Capel Door has a Gatekeeper?? I use this key for Altar Entrance and Chapel_Door
        if (door.getDoorName().startsWith("Altar_Entrance") || door.getDoorName().startsWith("Chapel_Door"))
        {
          if (openChance > 0 && Rnd.get(100) < openChance)
          {
            activeChar.sendMessage("You opened Altar Entrance.");
            door.openMe();
            door.onOpen();
            activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 3));
          }
          else
          {
            activeChar.sendMessage("You failed to open Altar Entrance.");
            activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 13));
            PlaySound playSound = new PlaySound("interfacesound.system_close_01");
            activeChar.sendPacket(playSound);
          }
        }
        else
        {
          activeChar.sendMessage("Incorrect Door.");
        }
        break;
      case 8275: // Key of Darkness
        if (door.getDoorName().startsWith("Door_of_Darkness"))
        {
          if (openChance > 0 && Rnd.get(100) < openChance)
          {
            activeChar.sendMessage("You opened Door of Darkness.");
            door.openMe();
            door.onOpen();
            activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 3));
          }
          else
          {
            activeChar.sendMessage("You failed to open Door of Darkness.");
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

   */
  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 = DoorTable.parseList(_doorDefault.get(i));

        if(isDoorWeak)
        {
          door.setCurrentHp(door.getMaxHp() / 2);
        }
        else {
          door.setCurrentHp(door.getMaxHp());
        }

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

      door = null;
    }

View Full Code Here

  }

  // This method upgrade door
  public void upgradeDoor(int doorId, int hp, int pDef, int mDef)
  {
    L2DoorInstance door = getDoor(doorId);

    if(door == null)
      return;

    if(door.getDoorId() == doorId)
    {
      door.setCurrentHp(door.getMaxHp() + hp);

      saveDoorUpgrade(doorId, hp, pDef, mDef);
      return;
    }
  }
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

    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

TOP

Related Classes of com.l2jfrozen.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.