Examples of MerchantGuard


Examples of lineage2.gameserver.templates.item.support.MerchantGuard

        if (_oldOwner != null) {
            addObject(DEFENDERS, new SiegeClanObject(DEFENDERS, _oldOwner, 0));

            if (getResidence().getSpawnMerchantTickets().size() > 0) {
                for (ItemInstance item : getResidence().getSpawnMerchantTickets()) {
                    MerchantGuard guard = getResidence().getMerchantGuard(item.getItemId());

                    addObject(HIRED_GUARDS, new SpawnSimpleObject(guard.getNpcId(), item.getLoc()));

                    item.deleteMe();
                }

                CastleHiredGuardDAO.getInstance().delete(getResidence());
View Full Code Here

Examples of lineage2.gameserver.templates.item.support.MerchantGuard

            if (q.equalsIgnoreCase("cabal_null"))
            {
              intSet.add(0);
            }
          }
          ((Castle) residence).addMerchantGuard(new MerchantGuard(itemId, npcId2, maxGuard, intSet));
        }
      }
      if (function != null)
      {
        function.addLease(level, lease);
View Full Code Here

Examples of lineage2.gameserver.templates.item.support.MerchantGuard

      player.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_THE_AUTHORITY_TO_POSITION_MERCENARIES, ActionFail.STATIC);
      return;
    }
   
    final Castle castle = player.getCastle();
    final MerchantGuard guard = castle.getMerchantGuard(item.getItemId());
    if ((guard == null) || !castle.checkIfInZone(loc, ReflectionManager.DEFAULT) || player.isActionBlocked(Zone.BLOCKED_ACTION_DROP_MERCHANT_GUARD))
    {
      player.sendPacket(SystemMsg.YOU_CANNOT_POSITION_MERCENARIES_HERE, ActionFail.STATIC);
      return;
    }
   
    if (castle.getSiegeEvent().isInProgress())
    {
      player.sendPacket(SystemMsg.A_MERCENARY_CAN_BE_ASSIGNED_TO_A_POSITION_FROM_THE_BEGINNING_OF_THE_SEAL_VALIDATION_PERIOD_UNTIL_THE_TIME_WHEN_A_SIEGE_STARTS, ActionFail.STATIC);
      return;
    }
   
    int countOfGuard = 0;
    for (ItemInstance $item : castle.getSpawnMerchantTickets())
    {
      if (PositionUtils.getDistance($item.getLoc(), loc) < 200)
      {
        player.sendPacket(SystemMsg.POSITIONING_CANNOT_BE_DONE_HERE_BECAUSE_THE_DISTANCE_BETWEEN_MERCENARIES_IS_TOO_SHORT, ActionFail.STATIC);
        return;
      }
      if ($item.getItemId() == guard.getItemId())
      {
        countOfGuard++;
      }
    }
   
    if (countOfGuard >= guard.getMax())
    {
      player.sendPacket(SystemMsg.THIS_MERCENARY_CANNOT_BE_POSITIONED_ANYMORE, ActionFail.STATIC);
      return;
    }
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.