Package lineage2.gameserver.model.entity.events.impl

Examples of lineage2.gameserver.model.entity.events.impl.ClanHallSiegeEvent


   */
  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    ClanHall clanHall = getClanHall();
    ClanHallSiegeEvent siegeEvent = clanHall.getSiegeEvent();
    if ((clanHall.getOwner() != null) && (clanHall.getOwner() == player.getClan()))
    {
      showChatWindow(player, _ownerDialog);
    }
    else if (siegeEvent.isInProgress())
    {
      showChatWindow(player, _siegeDialog);
    }
    else
    {
View Full Code Here


  {
    final NpcInstance actor = getActor();
    super.onEvtDead(killer);
    ZONE_3.setActive(false);
    Functions.npcShout(actor, NpcString.AARGH_IF_I_DIE_THEN_THE_MAGIC_FORCE_FIELD_OF_BLOOD_WILL);
    final ClanHallSiegeEvent siegeEvent = actor.getEvent(ClanHallSiegeEvent.class);
    if (siegeEvent == null)
    {
      return;
    }
    final SpawnExObject spawnExObject = siegeEvent.getFirstObject(ClanHallSiegeEvent.BOSS);
    final NpcInstance lidiaNpc = spawnExObject.getFirstSpawned();
    if (lidiaNpc.getCurrentHpRatio() == 1.)
    {
      lidiaNpc.setCurrentHp(lidiaNpc.getMaxHp() >> 1, true);
    }
View Full Code Here

   * @param clanHall ClanHall
   * @param join boolean
   */
  private static void registerAtClanHall(Player player, ClanHall clanHall, boolean join)
  {
    ClanHallSiegeEvent siegeEvent = clanHall.getSiegeEvent();
    Clan playerClan = player.getClan();
    SiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, playerClan);
    if (join)
    {
      if (playerClan.getHasHideout() > 0)
      {
        player.sendPacket(SystemMsg.A_CLAN_THAT_OWNS_A_CLAN_HALL_MAY_NOT_PARTICIPATE_IN_A_CLAN_HALL_SIEGE);
        return;
      }
      if (siegeClan != null)
      {
        player.sendPacket(SystemMsg.YOU_ARE_ALREADY_REGISTERED_TO_THE_ATTACKER_SIDE_AND_MUST_CANCEL_YOUR_REGISTRATION_BEFORE_SUBMITTING_YOUR_REQUEST);
        return;
      }
      if (playerClan.getLevel() < 4)
      {
        player.sendPacket(SystemMsg.ONLY_CLANS_WHO_ARE_LEVEL_4_OR_ABOVE_CAN_REGISTER_FOR_BATTLE_AT_DEVASTATED_CASTLE_AND_FORTRESS_OF_THE_DEAD);
        return;
      }
      if (siegeEvent.isRegistrationOver())
      {
        player.sendPacket(SystemMsg.YOU_ARE_TOO_LATE_THE_REGISTRATION_PERIOD_IS_OVER);
        return;
      }
      int allSize = siegeEvent.getObjects(SiegeEvent.ATTACKERS).size();
      if (allSize >= CastleSiegeEvent.MAX_SIEGE_CLANS)
      {
        player.sendPacket(SystemMsg.NO_MORE_REGISTRATIONS_MAY_BE_ACCEPTED_FOR_THE_ATTACKER_SIDE);
        return;
      }
      siegeClan = new SiegeClanObject(SiegeEvent.ATTACKERS, playerClan, 0);
      siegeEvent.addObject(SiegeEvent.ATTACKERS, siegeClan);
      SiegeClanDAO.getInstance().insert(clanHall, siegeClan);
    }
    else
    {
      if (siegeClan == null)
      {
        player.sendPacket(SystemMsg.YOU_ARE_NOT_YET_REGISTERED_FOR_THE_CASTLE_SIEGE);
        return;
      }
      if (siegeEvent.isRegistrationOver())
      {
        player.sendPacket(SystemMsg.YOU_ARE_TOO_LATE_THE_REGISTRATION_PERIOD_IS_OVER);
        return;
      }
      siegeEvent.removeObject(siegeClan.getType(), siegeClan);
      SiegeClanDAO.getInstance().delete(clanHall, siegeClan);
    }
    player.sendPacket(new CastleSiegeAttackerList(clanHall));
  }
View Full Code Here

      Player pk = (Player) killer;
      if (isInZone(ZoneType.SIEGE))
      {
        return;
      }
      DuelEvent duelEvent = getEvent(DuelEvent.class);
      if ((owner.getPvpFlag() > 0) || owner.atMutualWarWith(pk))
      {
        pk.setPvpKills(pk.getPvpKills() + 1);
      }
      else if (((duelEvent == null) || (duelEvent != pk.getEvent(DuelEvent.class))) && (getKarma() <= 0))
View Full Code Here

    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final int castleId = (param.length > 4) ? Integer.parseInt(param[3]) : 0;
    if (player.getReflection().isDefault())
    {
      final Castle castle = (castleId > 0) ? ResidenceHolder.getInstance().getResidence(Castle.class, castleId) : null;
      if ((castle != null) && castle.getSiegeEvent().isInProgress())
      {
        player.sendPacket(Msg.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
        return;
      }
    }
View Full Code Here

    public void onZoneEnter(Zone zone, Creature cha)
    {
      if (zone.getParams() == null || !cha.isPlayer())
        return;

      Castle castle = ResidenceHolder.getInstance().getResidence(zone.getTemplate().getIndex());

      if (castle != null)
      { 
        if(_side.ordinal()==1 || _side.ordinal()==0)
        {
View Full Code Here

   * Method enter_dc.
   */
  public void enter_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
View Full Code Here

   * Method exit_dc.
   */
  public void exit_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
View Full Code Here

   * @return boolean
   */
  @Override
  protected boolean thinkActive()
  {
    final NpcInstance actor = getActor();
    if (actor == null)
    {
      return true;
    }
    for (Player player : World.getAroundPlayers(actor, 200, 200))
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if (_firstTimeAttacked)
    {
      _firstTimeAttacked = false;
      if (Rnd.chance(25))
      {
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.entity.events.impl.ClanHallSiegeEvent

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.