Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.L2Object


  {
    L2PcInstance player = getClient().getActiveChar();
    if(player == null)
      return;

    L2Object target = player.getTarget();

    if(!(target instanceof L2ManorManagerInstance))
    {
      target = player.getLastFolkNPC();
    }
View Full Code Here


   
    // Alt game - Karma punishment
    if(!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && player.getKarma() > 0)
      return;

    L2Object target = player.getTarget();
    if(!player.isGM() && (target == null // No target (ie GM Shop)
        || !(target instanceof L2MerchantInstance || target instanceof L2FishermanInstance || target instanceof L2MercManagerInstance || target instanceof L2ClanHallManagerInstance || target instanceof L2CastleChamberlainInstance) // Target not a merchant, fisherman or mercmanager
    || !player.isInsideRadius(target, L2NpcInstance.INTERACTION_DISTANCE, false, false) // Distance is too far
    ))
      return;
View Full Code Here

    {
      sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }

    L2Object target = player.getTarget();

    if(!(target instanceof L2ManorManagerInstance))
    {
      target = player.getLastFolkNPC();
    }
View Full Code Here

    if(/*activeChar.isAttackingNow() || */activeChar.isCastingNow() || activeChar.isCastingPotionNow())
      return;

    if(activeChar.isMoving() && activeChar.isAttackingNow() && (_slot == L2Item.SLOT_LR_HAND || _slot == L2Item.SLOT_L_HAND || _slot == L2Item.SLOT_R_HAND))
    {
      L2Object target = activeChar.getTarget();
      activeChar.setTarget(null);
      activeChar.stopMove(null);
      activeChar.setTarget(target);
      activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK);
    }
View Full Code Here

      getClient().sendPacket(new SystemMessage(SystemMessageId.OBSERVERS_CANNOT_PARTICIPATE));
      getClient().sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }
   
    final L2Object obj;
   
    if (activeChar.getTargetId() == _objectId)
      obj = activeChar.getTarget();
    else
      obj = L2World.getInstance().findObject(_objectId);
   
    // If object requested does not exist, add warn msg into logs
    if (obj == null)
    {
      // pressing e.g. pickup many times quickly would get you here
      // _log.warning("Character: " + activeChar.getName() + " request action with non existent ObjectID:" + _objectId);
      getClient().sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }

    // Players can't interact with objects in the other instances except from multiverse
    if (obj.getInstanceId() != activeChar.getInstanceId()
        && activeChar.getInstanceId() != -1)
    {
      getClient().sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }
   
    // Only GMs can directly interact with invisible characters
    if (obj instanceof L2PcInstance) {
      L2PcInstance player = (L2PcInstance)obj;
        if (player.getAppearance().getInvisible() && !activeChar.isGM()
          || player.isInArenaEvent() && !activeChar.isInArenaEvent()
          || !player.isInArenaEvent() && activeChar.isInArenaEvent())
        {
          getClient().sendPacket(ActionFailed.STATIC_PACKET);
          return;
        }
    }
 
    // Check if the target is valid, if the player haven't a shop or isn't the requester of a transaction (ex : FriendInvite, JoinAlly, JoinParty...)
    if (activeChar.getPrivateStoreType() == 0/* && activeChar.getActiveRequester() == null*/)
    {
      switch(_actionId)
      {
        case 0:
          obj.onAction(activeChar);
          break;
        case 1:
          if (obj instanceof L2Character && ((L2Character) obj).isAlikeDead())
            obj.onAction(activeChar);
          else
            obj.onActionShift(getClient());
          break;
        default:
          // Invalid action detected (probably client cheating), log this
          _log.warning("Character: " + activeChar.getName() + " requested invalid action: " + _actionId);
          getClient().sendPacket(ActionFailed.STATIC_PACKET);
View Full Code Here

   
    // Alt game - Karma punishment
    if(!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && player.getKarma() > 0)
      return;

    L2Object target = player.getTarget();
    if(!player.isGM() && (target == null // No target (ie GM Shop)
        || !(target instanceof L2MerchantInstance) // Target not a merchant and not mercmanager
    || !player.isInsideRadius(target, L2NpcInstance.INTERACTION_DISTANCE, false, false)))
      return; // Distance is too far
   
View Full Code Here

    {
      player.sendMessage("You buying items too fast.");
      return;
    }
   
    L2Object object = L2World.getInstance().findObject(_storePlayerId);
    if (object == null || !(object instanceof L2PcInstance))
      return;
   
    L2PcInstance storePlayer = (L2PcInstance) object;
    if (!(storePlayer.getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_SELL || storePlayer.getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_PACKAGE_SELL))
View Full Code Here

          id = _command.substring(4);
        }

        try
        {
          L2Object object = L2World.getInstance().findObject(Integer.parseInt(id));

          if(_command.substring(endOfId + 1).startsWith("event_participate"))
          {
            L2Event.inscribePlayer(activeChar);
          }
          else if(_command.substring(endOfId + 1).startsWith("tvt_player_join "))
          {
            String teamName = _command.substring(endOfId + 1).substring(16);

            if(TvT.is_joining())
            {
              TvT.addPlayer(activeChar, teamName);
            }
            else
            {
              activeChar.sendMessage("The event is already started. You can not join now!");
            }
          }

          else if(_command.substring(endOfId + 1).startsWith("tvt_player_leave"))
          {
            if(TvT.is_joining())
            {
              TvT.removePlayer(activeChar);
            }
            else
            {
              activeChar.sendMessage("The event is already started. You can not leave now!");
            }
          }

          else if(_command.substring(endOfId+1).startsWith("dmevent_player_join"))
          {
            if(DM.is_joining())
              DM.addPlayer(activeChar);
            else
              activeChar.sendMessage("The event is already started. You can't join now!");
          }

          else if(_command.substring(endOfId+1).startsWith("dmevent_player_leave"))
          {
            if(DM.is_joining())
              DM.removePlayer(activeChar);
            else
              activeChar.sendMessage("The event is already started. You can't leave now!");
          }
         
          else if (_command.substring(endOfId+1).startsWith("raid_player_join"))
          {
            if (Raid._joining)
              Raid.addPlayer(activeChar);
            else
              activeChar.sendMessage("The event has already started. You cant join now!");
          }
         
          else if (_command.substring(endOfId+1).startsWith("raid_player_leave"))
          {
            if (Raid._joining)
              Raid.removePlayer(activeChar);
            else
              activeChar.sendMessage("The event has already started. You cant leave now!");
          }

          else if(_command.substring(endOfId+1).startsWith("ctf_player_join "))
          {
            String teamName = _command.substring(endOfId+1).substring(16);
            if(CTF.is_joining())
              CTF.addPlayer(activeChar, teamName);
            else
              activeChar.sendMessage("The event is already started. You can't join now!");
          }

          else if(_command.substring(endOfId+1).startsWith("ctf_player_leave"))
          {
            if(CTF.is_joining())
              CTF.removePlayer(activeChar);
            else
              activeChar.sendMessage("The event is already started. You can't leave now!");
          }

          if(_command.substring(endOfId+1).startsWith("vip_joinVIPTeam"))
          {
              VIP.addPlayerVIP(activeChar);
          }

          if(_command.substring(endOfId+1).startsWith("vip_joinNotVIPTeam"))
          {
              VIP.addPlayerNotVIP(activeChar);
          }

          if(_command.substring(endOfId+1).startsWith("vip_finishVIP"))
          {
              VIP.vipWin(activeChar);
          }

          if(_command.substring(endOfId+1).startsWith("event_participate"))
          {
            L2Event.inscribePlayer(activeChar);
          }

          else if((Config.ALLOW_CLASS_MASTERS && Config.ALLOW_REMOTE_CLASS_MASTERS && object instanceof L2ClassMasterInstance)
            || (object instanceof L2NpcInstance && endOfId > 0 && activeChar.isInsideRadius(object, L2NpcInstance.INTERACTION_DISTANCE, false, false)))
          {
            ((L2NpcInstance) object).onBypassFeedback(activeChar, _command.substring(endOfId + 1));
          }

          activeChar.sendPacket(ActionFailed.STATIC_PACKET);
        }
        catch(NumberFormatException nfe)
        {
          if(Config.ENABLE_ALL_EXCEPTIONS)
            nfe.printStackTrace();
         
        }
      }
      //  Draw a Symbol
      else if(_command.equals("Draw"))
      {
        L2Object object = activeChar.getTarget();
        if(object instanceof L2NpcInstance)
        {
          ((L2SymbolMakerInstance) object).onBypassFeedback(activeChar, _command);
        }
      }
      else if(_command.equals("RemoveList"))
      {
        L2Object object = activeChar.getTarget();
        if(object instanceof L2NpcInstance)
        {
          ((L2SymbolMakerInstance) object).onBypassFeedback(activeChar, _command);
        }
      }
      else if(_command.equals("Remove "))
      {
        L2Object object = activeChar.getTarget();

        if(object instanceof L2NpcInstance)
        {
          ((L2SymbolMakerInstance) object).onBypassFeedback(activeChar, _command);
        }
      }
      // Navigate throught Manor windows
      else if(_command.startsWith("manor_menu_select?"))
      {
        L2Object object = activeChar.getTarget();
        if(object instanceof L2NpcInstance)
        {
          ((L2NpcInstance) object).onBypassFeedback(activeChar, _command);
        }
      }
View Full Code Here

  /**
   * @param activeChar
   */
  private void comeHere(L2PcInstance activeChar)
  {
    L2Object obj = activeChar.getTarget();
    if(obj == null)
      return;

    if(obj instanceof L2NpcInstance)
    {
View Full Code Here

   *
   * @param activeChar the gm char
   */
  private void adminGiveAllSkills(L2PcInstance activeChar)
  {
    L2Object target = activeChar.getTarget();
    L2PcInstance player = null;

    if(target instanceof L2PcInstance)
    {
      player = (L2PcInstance) target;
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.L2Object

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.