Package net.sf.l2j.gameserver.model

Examples of net.sf.l2j.gameserver.model.L2Object


        }
        else if (cw.isActive())
          activeChar.sendMessage("This cursed weapon is already active.");
        else
        {
          L2Object target = activeChar.getTarget();
          if (target != null && target instanceof L2PcInstance)
            ((L2PcInstance)target).addItem("AdminCursedWeaponAdd", id, 1, target, true);
          else
            activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
        }
View Full Code Here


    }

    // TODO: add possibility to delete any L2Object (except L2PcInstance)
    private void handleDelete(L2PcInstance activeChar)
    {
        L2Object obj = activeChar.getTarget();
        if ((obj != null) && (obj instanceof L2NpcInstance))
        {
            L2NpcInstance target = (L2NpcInstance) obj;
            target.deleteMe();
View Full Code Here

        // If Alternate rule Karma punishment is set to true, forbid Wear to player with Karma
        if (!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && player.getKarma() > 0) return;

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

    if (targetList == null) return;

    for (int index = 0; index < targetList.length; index++)
    {
      L2Object target = targetList[index];

      boolean success = Formulas.getInstance().calculateUnlockChance(skill);
      if (target instanceof L2DoorInstance)
      {
        L2DoorInstance door = (L2DoorInstance) target;
View Full Code Here

  protected void runImpl()
  {
    L2PcInstance activeChar = getClient().getActiveChar();
    if (activeChar == null) return;
    // avoid using expensive operations if not needed
    L2Object target;
    if (activeChar.getTargetId() == _objectId)
      target = activeChar.getTarget();
    else
      target = L2World.getInstance().findObject(_objectId);
    if (target == null) return;
    if (activeChar.getTarget() != target)
    {
      target.onAction(activeChar);
    }
    else
    {
      if ((target.getObjectId() != activeChar.getObjectId())
          && activeChar.getPrivateStoreType() ==0
          && activeChar.getActiveRequester() ==null)
      {
        //_log.config("Starting ForcedAttack");
        target.onForcedAttack(activeChar);
        //_log.config("Ending ForcedAttack");
      }
      else
      {
        sendPacket(new ActionFailed());
View Full Code Here

            sendPacket(new ActionFailed());
            return;
        }


    L2Object target = L2World.getInstance().findObject(_objectId);
        if (target == null || !player.getKnownList().knowsObject(target)
            || !(target instanceof L2PcInstance) || (target.getObjectId() == player.getObjectId()))
    {
      player.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
      return;
    }
View Full Code Here

    if (player.getMountType() != 0) //prevent sit/stand if you riding
    {
      return;
    }
   
    final L2Object target = player.getTarget();
    if (target != null
        && !player.isSitting()
        && target instanceof L2StaticObjectInstance
        && ((L2StaticObjectInstance)target).getType() == 1
        && CastleManager.getInstance().getCastle(target) != null
View Full Code Here

      return true;
    }

    // Choosing randomly a new target
    int nextTargetIdx = Rnd.nextInt(targetList.size());
    L2Object target = targetList.get(nextTargetIdx);

    // Attacking the target
    //getEffected().setTarget(target);
    getEffected().setTarget(target);
    getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK,target);
View Full Code Here

      return true;
    }

    // Choosing randomly a new target
    int nextTargetIdx = Rnd.nextInt(targetList.size());
    L2Object target = targetList.get(nextTargetIdx);

    // Attacking the target
    //getEffected().setTarget(target);
    getEffected().setTarget(target);
    getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK,target);
View Full Code Here

    }
    if (qs != null)
    {
      if (getLastQuestNpcObject() > 0)
      {
        L2Object object = L2World.getInstance().findObject(getLastQuestNpcObject());
        if ((object instanceof L2NpcInstance) && isInsideRadius(object, L2NpcInstance.INTERACTION_DISTANCE, false, false))
        {
          L2NpcInstance npc = (L2NpcInstance) object;
          QuestState[] states = getQuestsForTalk(npc.getNpcId());
         
View Full Code Here

TOP

Related Classes of net.sf.l2j.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.