Package l2p.gameserver.model.entity.residence

Examples of l2p.gameserver.model.entity.residence.ClanHall


    Commands command = (Commands) comm;
    if(!activeChar.getPlayerAccess().CanEditNPC)
    {
      return false;
    }
    ClanHall clanhall = null;
    if(wordList.length > 1)
    {
      clanhall = ClanHallManager.getInstance().getClanHall(Integer.parseInt(wordList[1]));
    }
    if(clanhall == null)
    {
      showClanHallSelectPage(activeChar);
      return true;
    }
    switch(command)
    {
      case admin_clanhall:
        showClanHallSelectPage(activeChar);
        break;
      case admin_clanhallset:
        L2Object target = activeChar.getTarget();
        L2Player player = activeChar;
        if(target != null && target.isPlayer())
        {
          player = (L2Player) target;
        }
        if(player.getClan() == null)
        {
          activeChar.sendPacket(Msg.THAT_IS_THE_INCORRECT_TARGET);
        }
        else
        {
          clanhall.changeOwner(player.getClan());
          Auction auction = AuctionManager.getInstance().getAuction(clanhall.getId());
          if(auction != null)
          {
            auction.cancelAuction();
          }
          _log.fine("ClanHall " + clanhall.getName() + "(id: " + clanhall.getId() + ") owned by clan " + player.getClan().getName());
        }
        break;
      case admin_clanhalldel:
        clanhall.changeOwner(null);
        break;
      case admin_clanhallopendoors:
        clanhall.openCloseDoors(activeChar, true);
        break;
      case admin_clanhallclosedoors:
        clanhall.openCloseDoors(activeChar, false);
        break;
      case admin_clanhallteleportself:
        L2Zone zone = clanhall.getZone();
        if(zone != null)
        {
          activeChar.teleToLocation(zone.getSpawn());
        }
        break;
View Full Code Here


    int condition = validateCondition(player);
    if(condition != Cond_Owner)
    {
      return;
    }
    ClanHall ch = getClanHall();
    if(ch.getOwner() == null)
    {
      return;
    }
    long lease = ch.getLease();
    Castle castle = CastleManager.getInstance().getCastleByIndex(ch.getZone().getTaxById());
    long tax = lease * castle.getTaxPercent() / 100;
    lease += tax;
    if(ch.getOwner().getAdenaCount() >= lease)
    {
      return;
    }
    if(ch.getPaidUntil() <= System.currentTimeMillis() + 24 * 60 * 60 * 1000L && ch.getPaidUntil() >= System.currentTimeMillis() + 12 * 60 * 60 * 1000L)
    {
      player.sendPacket(new SystemMessage(SystemMessage.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW).addNumber(lease));
    }
    else if(ch.isInDebt())
    {
      player.sendPacket(Msg.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE_THEREFORE_THE_CLAN_HALL_OWNERSHIP_HAS_BEEN_REVOKED);
    }
  }
View Full Code Here

    return getClanHall();
  }

  public void sendDecoInfo(L2Player player)
  {
    ClanHall clanHall = getClanHall();
    if(clanHall != null)
    {
      player.sendPacket(new AgitDecoInfo(getClanHall()));
    }
  }
View Full Code Here

    {
      cancelAuction();
      PlayerMessageStack.getInstance().mailto(_SellerId, Msg.THE_CLAN_HALL_WHICH_HAD_BEEN_PUT_UP_FOR_AUCTION_WAS_NOT_SOLD_AND_THEREFORE_HAS_BEEN_RELISTED);
      return;
    }
    ClanHall ch = ClanHallManager.getInstance().getClanHall(getId());
    if(ch == null)
    {
      _log.warning("ClanHall is null for id " + _Id + ". WTF?");
    }
    L2Clan HighestBidderClan = null;
    if(_bidders.get(_HighestBidderId) == null)
    {
      _log.warning("Bidder with id " + _HighestBidderId + "is null. WTF?");
    }
    else
    {
      HighestBidderClan = ClanTable.getInstance().getClanByName(_bidders.get(_HighestBidderId).getClanName());
      if(HighestBidderClan == null)
      {
        _log.warning("Clan with name " + _bidders.get(_HighestBidderId).getClanName() + "is null. WTF?");
      }
    }
    if(ch != null && HighestBidderClan != null)
    {
      if(_SellerId > 0)
      {
        returnItem(_SellerClanName, _HighestBidderMaxBid, true);
        returnItem(_SellerClanName, ch.getLease(), false);
        PlayerMessageStack.getInstance().mailto(_SellerId, new SystemMessage(SystemMessage.THE_CLAN_HALL_WHICH_WAS_PUT_UP_FOR_AUCTION_HAS_BEEN_AWARDED_TO_S1_CLAN).addString(HighestBidderClan.getName()));
      }
      ch.setLease(Math.max(ch.getPrice() / 100, _HighestBidderMaxBid / 100)); // Аренда - 1% от стоимости в неделю
      ch.changeOwner(HighestBidderClan);
      PlayerMessageStack.getInstance().mailto(HighestBidderClan.getLeaderId(), new SystemMessage("Congratulation! You have won ClanHall " + getItemName() + ". " + ch.getDesc()));
    }
    cancelAuction();
  }
View Full Code Here

    _data.loadBid();
  }

  private int getClanHallGrade()
  {
    ClanHall ch = ClanHallManager.getInstance().getClanHall(getId());
    return ch == null ? 0 : ch.getGrade();
  }
View Full Code Here

          && player.getInResidence() != ResidenceType.None) {
        switch (player.getInResidence()) {
        case Clanhall:
          int clanHallIndex = player.getClan().getHasHideout();
          if (clanHallIndex > 0) {
            ClanHall clansHall = ClanHallManager.getInstance()
                .getClanHall(clanHallIndex);
            if (clansHall != null
                && (clansHall.getSiege() == null || clansHall
                    .getSiege() != null
                    && !clansHall.getSiege().isInProgress())) {
              if (clansHall
                  .isFunctionActive(ResidenceFunction.RESTORE_HP)) {
                init *= 1. + clansHall.getFunction(
                    ResidenceFunction.RESTORE_HP)
                    .getLevel() / 100.;
              }
            }
          }
View Full Code Here

        if (clan != null) {
          switch (player.getInResidence()) {
          case Clanhall:
            int clanHallIndex = clan.getHasHideout();
            if (clanHallIndex > 0) {
              ClanHall clansHall = ClanHallManager.getInstance()
                  .getClanHall(clanHallIndex);
              if (clansHall != null) {
                if (clansHall
                    .isFunctionActive(ResidenceFunction.RESTORE_MP)) {
                  init *= 1. + clansHall.getFunction(
                      ResidenceFunction.RESTORE_MP)
                      .getLevel() / 100.;
                }
              }
            }
View Full Code Here

          {
            loc = MapRegion.getTeleToClosestTown(activeChar);
          }
          else
          {
            ClanHall clanHall = activeChar.getClanHall();
            loc = MapRegion.getTeleToClanHall(activeChar);
            if(clanHall.getFunction(ResidenceFunction.RESTORE_EXP) != null)
            {
              activeChar.restoreExp(clanHall.getFunction(ResidenceFunction.RESTORE_EXP).getLevel());
            }
          }
          break;
        case TO_CASTLE:
          isInDefense = false;
View Full Code Here

    }
    else
    {
      for(L2Zone zone : zones)
      {
        ClanHall clanhall = new ClanHall(zone.getIndex());
        clanhall.init();
        getClanHalls().put(zone.getIndex(), clanhall);
      }
    }
    _log.info("Loaded: " + getClanHalls().size() + " ClanHalls.");
    int door_count = 0;
    for(L2DoorInstance door : DoorTable.getInstance().getDoors())
    {
      ClanHall clanhall = ClanHallManager.getInstance().findNearestClanHall(door.getX(), door.getY(), 1500);
      if(clanhall != null)
      {
        clanhall.getDoors().add(door);
        door.setSiegeUnit(clanhall);
        door_count++;
      }
    }
    _log.info(door_count + " doors attached to ClanHalls");
View Full Code Here

      return;
    }
    int clanHallIndex = clan.getHasHideout();
    if(clanHallIndex != 0)
    {
      ClanHall clansHall = ClanHallManager.getInstance().getClanHall(clanHallIndex);
      if(clansHall != null && clansHall.checkIfInZone(getX(), getY()))
      {
        setInResidence(ResidenceType.Clanhall);
        return;
      }
    }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.entity.residence.ClanHall

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.