Package l2p.gameserver.model.base

Examples of l2p.gameserver.model.base.Transaction


    if (activeChar.isFishing())
    {
      activeChar.sendPacket(Msg.YOU_CANNOT_DO_THAT_WHILE_FISHING);
      return;
    }
    new Transaction(TransactionType.TRADE_REQUEST, activeChar, pcTarget, 10000);
    pcTarget.sendPacket(new SendTradeRequest(activeChar.getObjectId()));
    activeChar.sendPacket(new SystemMessage(SystemMessage.YOU_HAVE_REQUESTED_A_TRADE_WITH_C1).addString(pcTarget.getName()));
  }
View Full Code Here


    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    Transaction transaction = activeChar.getTransaction();
    if(transaction == null)
    {
      return;
    }
    if(!transaction.isValid() || !transaction.isTypeOf(TransactionType.FRIEND))
    {
      transaction.cancel();
      activeChar.sendPacket(Msg.TIME_EXPIRED, Msg.ActionFail);
      return;
    }
    L2Player requestor = transaction.getOtherPlayer(activeChar);
    transaction.cancel();
    if(_response == 1 && !FriendsTable.getInstance().checkIsFriends(requestor.getObjectId(), activeChar.getObjectId()))
    {
      FriendsTable.getInstance().addFriend(requestor, activeChar);
    }
    else
View Full Code Here

  public void runImpl()
  {
    L2Player activeChar = getClient().getActiveChar();
    if(activeChar != null)
    {
      Transaction transaction = activeChar.getTransaction();
      if(transaction == null)
      {
        return;
      }
      if(!transaction.isValid() || !transaction.isTypeOf(TransactionType.ALLY))
      {
        transaction.cancel();
        activeChar.sendPacket(Msg.TIME_EXPIRED, Msg.ActionFail);
        return;
      }
      L2Player requestor = transaction.getOtherPlayer(activeChar);
      transaction.cancel();
      if(requestor.getAlliance() == null)
      {
        return;
      }
      if(_response == 1)
View Full Code Here

        return;
      }
      // Send request to target's party leader
      if(!targetLeader.isInTransaction())
      {
        new Transaction(TransactionType.DUEL, activeChar, targetLeader, 10000);
        targetLeader.sendPacket(new ExDuelAskStart(activeChar.getName(), _duelType));
        SystemMessage msg = new SystemMessage(SystemMessage.S1S_PARTY_HAS_BEEN_CHALLENGED_TO_A_DUEL);
        msg.addString(targetLeader.getName());
        activeChar.sendPacket(msg);
        msg = new SystemMessage(SystemMessage.S1S_PARTY_HAS_CHALLENGED_YOUR_PARTY_TO_A_DUEL);
        msg.addString(activeChar.getName());
        targetChar.sendPacket(msg);
      }
      else
      {
        activeChar.sendPacket(new SystemMessage(SystemMessage.S1_IS_BUSY_PLEASE_TRY_AGAIN_LATER).addString(targetLeader.getName()));
      }
    }
    else if(!targetChar.isInTransaction())
    {
      Transaction transaction = new Transaction(TransactionType.DUEL, activeChar, targetChar, 10000);
      activeChar.setTransaction(transaction);
      targetChar.setTransaction(transaction);
      SystemMessage msg = new SystemMessage(SystemMessage.S1_HAS_BEEN_CHALLENGED_TO_A_DUEL);
      msg.addString(targetChar.getName());
      activeChar.sendPacket(msg);
View Full Code Here

    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    Transaction transaction = activeChar.getTransaction();
    if(transaction == null)
    {
      return;
    }
    if(!transaction.isValid() || !transaction.isTypeOf(TransactionType.PARTY))
    {
      transaction.cancel();
      activeChar.sendPacket(Msg.TIME_EXPIRED, Msg.ActionFail);
      return;
    }
    L2Player requestor = transaction.getOtherPlayer(activeChar);
    L2Party party = requestor.getParty();
    transaction.cancel();
    if(party == null || party.getPartyLeader() == null)
    {
      activeChar.sendPacket(Msg.ActionFail);
      requestor.sendPacket(new JoinParty(0));
      return;
View Full Code Here

      {
        activeChar.sendPacket(Msg.THE_ACADEMY_ROYAL_GUARD_ORDER_OF_KNIGHTS_IS_FULL_AND_CANNOT_ACCEPT_NEW_MEMBERS_AT_THIS_TIME);
      }
      return;
    }
    new Transaction(TransactionType.CLAN, activeChar, member, 10000);
    member.setPledgeType(_pledgeType);
    member.sendPacket(new AskJoinPledge(activeChar.getObjectId(), activeChar.getClan().getName()));
  }
View Full Code Here

    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    Transaction transaction = activeChar.getTransaction();
    if(transaction == null)
    {
      return;
    }
    if(!transaction.isValid() || !transaction.isTypeOf(TransactionType.CLAN))
    {
      transaction.cancel();
      activeChar.sendPacket(Msg.TIME_EXPIRED, Msg.ActionFail);
      return;
    }
    L2Player requestor = transaction.getOtherPlayer(activeChar);
    transaction.cancel();
    if(requestor.getClan() == null)
    {
      return;
    }
    if(_response == 1)
View Full Code Here

    if(FriendsTable.getInstance().checkIsFriends(activeChar.getObjectId(), activeChar.getObjectId()))
    {
      activeChar.sendPacket(new SystemMessage(SystemMessage.S1_IS_ALREADY_ON_YOUR_FRIEND_LIST).addString(friendChar.getName()));
      return false;
    }
    new Transaction(TransactionType.FRIEND, activeChar, friendChar, 10000);
    friendChar.sendPacket(new SystemMessage(SystemMessage.S1_HAS_REQUESTED_TO_BECOME_FRIENDS).addString(activeChar.getName()), new FriendAddRequest(activeChar.getName()));
    return true;
  }
View Full Code Here

      }
  }

  private void sendInvite(L2Player requestor, L2Player target)
  {
    new Transaction(TransactionType.CHANNEL, requestor, target, 30000);
    target.sendPacket(new ExAskJoinMPCC(requestor.getName()));
    requestor.sendMessage("You invited " + target.getName() + " to your Command Channel.");
  }
View Full Code Here

    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    Transaction transaction = activeChar.getTransaction();
    if(transaction == null)
    {
      return;
    }
    if(!transaction.isValid() || !transaction.isTypeOf(TransactionType.CHANNEL))
    {
      transaction.cancel();
      activeChar.sendPacket(Msg.TIME_EXPIRED, Msg.ActionFail);
      return;
    }
    L2Player requestor = transaction.getOtherPlayer(activeChar);
    transaction.cancel();
    if(!requestor.isInParty() || !activeChar.isInParty() || activeChar.getParty().isInCommandChannel())
    {
      requestor.sendPacket(Msg.NO_USER_HAS_BEEN_INVITED_TO_THE_COMMAND_CHANNEL);
      return;
    }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.base.Transaction

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.