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

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


    if (!checkPlayer() || player.isTeleporting())
    {
      _player = null;
      return;
    }
    DuelEvent duel = player.getEvent(DuelEvent.class);
    if (duel != null)
    {
      duel.abortDuel(player);
    }
    _returnLoc = player._stablePoint == null ? player.getReflection().getReturnLoc() == null ? player.getLoc() : player.getReflection().getReturnLoc() : player._stablePoint;
    if (player.isDead())
    {
      player.setPendingRevive(true);
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

    {
      request.cancel();
      activeChar.sendActionFailed();
      return;
    }
    DuelEvent duelEvent = EventHolder.getInstance().getEvent(EventType.PVP_EVENT, _duelType);
    switch (_response)
    {
      case 0:
        request.cancel();
        if (_duelType == 1)
        {
          requestor.sendPacket(SystemMsg.THE_OPPOSING_PARTY_HAS_DECLINED_YOUR_CHALLENGE_TO_A_DUEL);
        }
        else
        {
          requestor.sendPacket(new SystemMessage2(SystemMsg.C1_HAS_DECLINED_YOUR_CHALLENGE_TO_A_PARTY_DUEL).addName(activeChar));
        }
        break;
      case -1:
        request.cancel();
        requestor.sendPacket(new SystemMessage2(SystemMsg.C1_IS_SET_TO_REFUSE_DUEL_REQUESTS_AND_CANNOT_RECEIVE_A_DUEL_REQUEST).addName(activeChar));
        break;
      case 1:
        if (!duelEvent.canDuel(requestor, activeChar, false))
        {
          request.cancel();
          return;
        }
        SystemMessage2 msg1,
        msg2;
        if (_duelType == 1)
        {
          msg1 = new SystemMessage2(SystemMsg.YOU_HAVE_ACCEPTED_C1S_CHALLENGE_TO_A_PARTY_DUEL);
          msg2 = new SystemMessage2(SystemMsg.S1_HAS_ACCEPTED_YOUR_CHALLENGE_TO_DUEL_AGAINST_THEIR_PARTY);
        }
        else
        {
          msg1 = new SystemMessage2(SystemMsg.YOU_HAVE_ACCEPTED_C1S_CHALLENGE_A_DUEL);
          msg2 = new SystemMessage2(SystemMsg.C1_HAS_ACCEPTED_YOUR_CHALLENGE_TO_A_DUEL);
        }
        activeChar.sendPacket(msg1.addName(requestor));
        requestor.sendPacket(msg2.addName(activeChar));
        try
        {
          duelEvent.createDuel(requestor, activeChar);
        }
        finally
        {
          request.done();
        }
View Full Code Here

    if ((target == null) || (target == player))
    {
      player.sendPacket(SystemMsg.THERE_IS_NO_OPPONENT_TO_RECEIVE_YOUR_CHALLENGE_FOR_A_DUEL);
      return;
    }
    DuelEvent duelEvent = EventHolder.getInstance().getEvent(EventType.PVP_EVENT, _duelType);
    if (duelEvent == null)
    {
      return;
    }
    if (!duelEvent.canDuel(player, target, true))
    {
      return;
    }
    if (target.isBusy())
    {
      player.sendPacket(new SystemMessage2(SystemMsg.C1_IS_ON_ANOTHER_TASK).addName(target));
      return;
    }
    duelEvent.askDuel(player, target);
  }
View Full Code Here

        }
        setCurrentCp(cp);
      }
    }
    double hp = getCurrentHp();
    DuelEvent duelEvent = getEvent(DuelEvent.class);
    if (duelEvent != null)
    {
      if ((hp - damage) <= 1)
      {
        setCurrentHp(1, false);
        duelEvent.onDie(this);
        return;
      }
    }
    if (isInOlympiadMode())
    {
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

TOP

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

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.