Package lineage2.gameserver.model

Examples of lineage2.gameserver.model.Request


  /**
   * Method NoblessTeleport.
   */
  public void NoblessTeleport()
  {
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    if (player.isNoble() || Config.ALLOW_NOBLE_TP_TO_ALL)
    {
      show("scripts/noble.htm", player);
    }
    else
    {
View Full Code Here


  {
    if (param.length < 2)
    {
      throw new IllegalArgumentException();
    }
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    final String page = param[0];
    final int item = Integer.parseInt(param[1]);
    final long price = Long.parseLong(param[2]);
    if (getItemCount(player, item) < price)
    {
      player.sendPacket((item == 57) ? Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA : SystemMsg.INCORRECT_ITEM_COUNT);
      return;
    }
    removeItem(player, item, price);
    show(page, player);
  }
View Full Code Here

  /**
   * Method TakeNewbieWeaponCoupon.
   */
  public void TakeNewbieWeaponCoupon()
  {
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    if (!Config.ALT_ALLOW_SHADOW_WEAPONS)
    {
      show(new CustomMessage("common.Disabled", player), player);
      return;
    }
    if ((player.getLevel() > 19) || (player.getClassLevel() > 1))
    {
      show("Your level is too high!", player);
      return;
    }
    if (player.getLevel() < 6)
    {
      show("Your level is too low!", player);
      return;
    }
    if (player.getVarB("newbieweapon"))
    {
      show("Your already got your newbie weapon!", player);
      return;
    }
    addItem(player, 7832, 5);
    player.setVar("newbieweapon", "true", -1);
  }
View Full Code Here

  /**
   * Method TakeAdventurersArmorCoupon.
   */
  public void TakeAdventurersArmorCoupon()
  {
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    if (!Config.ALT_ALLOW_SHADOW_WEAPONS)
    {
      show(new CustomMessage("common.Disabled", player), player);
      return;
    }
    if ((player.getLevel() > 39) || (player.getClassLevel() > 2))
    {
      show("Your level is too high!", player);
      return;
    }
    if ((player.getLevel() < 20) || (player.getClassLevel() < 2))
    {
      show("Your level is too low!", player);
      return;
    }
    if (player.getVarB("newbiearmor"))
    {
      show("Your already got your newbie weapon!", player);
      return;
    }
    addItem(player, 7833, 1);
    player.setVar("newbiearmor", "true", -1);
  }
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))
    {
      return;
    }
    player.setVar("DCBackCoords", player.getLoc().toXYZString(), -1);
    player.teleToLocation(-114582, -152635, -6742);
  }
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))
    {
      return;
    }
    final String var = player.getVar("DCBackCoords");
    if ((var == null) || var.isEmpty())
    {
      player.teleToLocation(new Location(43768, -48232, -800), 0);
      return;
    }
    player.teleToLocation(Location.parseLoc(var), 0);
    player.unsetVar("DCBackCoords");
  }
View Full Code Here

      }
      if (!cha.isPlayer())
      {
        return;
      }
      Player player = cha.getPlayer();
     
      QuestState qs = player.getQuestState(_10301_ShadowOfTerrorBlackishRedFog.class);
      if(qs != null && qs.getCond() == 3 && player.getVar("instance10301") == null)
      {
        Quest q = QuestManager.getQuest(10301);
        player.processQuestEvent(q.getName(), "enterInstance", null);
        //player.setVar("instance10301", "true", -1);
        return;
      }
      if (!player.getVarB("@25_20_telzone_to_magmeld"))
      {
        player.showQuestMovie(SceneMovie.si_arkan_enter);
        player.setVar("@25_20_telzone_to_magmeld", "true", -1);
      }
      cha.teleToLocation(Location.parseLoc(zone.getParams().getString("tele")));
    }
View Full Code Here

  @Override
  public String onTalk(NpcInstance npc, QuestState st)
  {
    String htmltext = "noquest";
    int npcId = npc.getNpcId();
    Player player = st.getPlayer();
    int cond = st.getCond();
    if (npcId == TEPIOS)
    {
      if (cond == 0)
      {
        if (player.getLevel() >= 75)
        {
          if ((st.getQuestItemsCount(MARK_OF_KEUCEREUS_STAGE_1) > 0) || (st.getQuestItemsCount(MARK_OF_KEUCEREUS_STAGE_2) > 0))
          {
            htmltext = "tepios_q696_1.htm";
          }
View Full Code Here

    Player activeChar = getClient().getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    Request request = activeChar.getRequest();
    if ((request == null) || !request.isTypeOf(L2RequestType.COUPLE_ACTION))
    {
      return;
    }
    if (!request.isInProgress())
    {
      request.cancel();
      activeChar.sendActionFailed();
      return;
    }
    if (activeChar.isOutOfControl())
    {
      request.cancel();
      activeChar.sendActionFailed();
      return;
    }
    Player requestor = request.getRequestor();
    if (requestor == null)
    {
      request.cancel();
      activeChar.sendPacket(SystemMsg.THAT_PLAYER_IS_NOT_ONLINE);
      activeChar.sendActionFailed();
      return;
    }
    if ((requestor.getObjectId() != _charObjId) || (requestor.getRequest() != request))
    {
      request.cancel();
      activeChar.sendActionFailed();
      return;
    }
    switch (_answer)
    {
      case -1:
        requestor.sendPacket(new SystemMessage2(SystemMsg.C1_IS_SET_TO_REFUSE_COUPLE_ACTIONS_AND_CANNOT_BE_REQUESTED_FOR_A_COUPLE_ACTION).addName(activeChar));
        request.cancel();
        break;
      case 0:
        activeChar.sendPacket(SystemMsg.THE_COUPLE_ACTION_WAS_DENIED);
        requestor.sendPacket(SystemMsg.THE_COUPLE_ACTION_WAS_CANCELLED);
        requestor.sendActionFailed();
        request.cancel();
        break;
      case 1:
        try
        {
          if (!checkCondition(activeChar, requestor) || !checkCondition(requestor, activeChar))
          {
            return;
          }
          Location loc = requestor.applyOffset(activeChar.getLoc(), 25);
          loc = GeoEngine.moveCheck(requestor.getX(), requestor.getY(), requestor.getZ(), loc.x, loc.y, requestor.getGeoIndex());
          requestor.moveToLocation(loc, 0, false);
          requestor.getAI().setNextAction(PlayableAI.nextAction.COUPLE_ACTION, activeChar, _actionId, true, false);
        }
        finally
        {
          request.done();
        }
        break;
    }
  }
View Full Code Here

   * @param requestor Player
   * @param target Player
   */
  private void sendInvite(Player requestor, Player target)
  {
    new Request(L2RequestType.CHANNEL, requestor, target).setTimeout(10000L);
    target.sendPacket(new ExAskJoinMPCC(requestor.getName()));
    requestor.sendMessage("You invited " + target.getName() + " to your Command Channel.");
  }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.Request

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.