Package lineage2.gameserver.model

Examples of lineage2.gameserver.model.Player


   * Method runImpl.
   */
  @Override
  public void runImpl()
  {
    Player activeChar = getClient().getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    if (Config.COMMUNITYBOARD_ENABLED)
    {
      ICommunityBoardHandler handler = CommunityBoardManager.getInstance().getCommunityHandler(Config.BBS_DEFAULT);
      if (handler != null)
      {
        handler.onBypassCommand(activeChar, Config.BBS_DEFAULT);
      }
    }
    else
    {
      activeChar.sendPacket(new SystemMessage2(SystemMsg.THE_COMMUNITY_SERVER_IS_CURRENTLY_OFFLINE));
    }
  }
View Full Code Here


   * Method runImpl.
   */
  @Override
  protected void runImpl()
  {
    Player activeChar = getClient().getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    JumpWay way = activeChar.getCurrentJumpWay();
    if (way == null)
    {
      activeChar.onJumpingBreak();
      return;
    }
    JumpPoint point = way.getJumpPoint(_nextWayId);
    if (point == null)
    {
      activeChar.onJumpingBreak();
      return;
    }
    Location destLoc = point.getLocation();
    activeChar.broadcastPacketToOthers(new ExFlyMoveBroadcast(activeChar, 2, destLoc));
    activeChar.setLoc(destLoc);
    JumpTrack track = activeChar.getCurrentJumpTrack();
    if (track == null)
    {
      activeChar.onJumpingBreak();
      return;
    }
    JumpWay nextWay = track.getWay(_nextWayId);
    if (nextWay == null)
    {
      activeChar.onJumpingBreak();
      return;
    }
    activeChar.sendPacket(new ExFlyMove(activeChar.getObjectId(), nextWay.getPoints(), track.getId()));
    activeChar.setCurrentJumpWay(nextWay);
  }
View Full Code Here

  }
 
  @Override
  public String onEvent(String event, QuestState st, NpcInstance npc)
  {
    Player player = st.getPlayer();
    String htmltext = event;
    if (event.equalsIgnoreCase("sirgustavathebaldt_q194_2.htm"))
    {
      st.setCond(1);
      st.setState(STARTED);
      st.playSound(SOUND_ACCEPT);
    }
    else if (event.equalsIgnoreCase("sirgustavathebaldt_q194_2c.htm"))
    {
      st.setCond(2);
      st.playSound(SOUND_MIDDLE);
      player.showQuestMovie(ExStartScenePlayer.SCENE_SSQ_CONTRACT_OF_MAMMON);
      return null;
    }
    else if (event.equalsIgnoreCase("sirgustavathebaldt_q194_3.htm"))
    {
      st.setCond(3);
      st.playSound(SOUND_MIDDLE);
      st.giveItems(AthebaldtsIntroduction, 1);
    }
    else if (event.equalsIgnoreCase("colin_q194_3.htm"))
    {
      st.takeItems(AthebaldtsIntroduction, -1);
      st.setCond(4);
    }
    else if (event.equalsIgnoreCase("colin_q194_3a.htm"))
    {
      if ((player.getTransformation() != 0) || player.isMounted())
      {
        player.sendPacket(Msg.YOU_ALREADY_POLYMORPHED_AND_CANNOT_POLYMORPH_AGAIN);
        return null;
      }
      negateSpeedBuffs(player);
      SkillTable.getInstance().getInfo(6201, 1).getEffects(npc, player, false, false);
    }
    else if (event.equalsIgnoreCase("frog_q194_2.htm"))
    {
      st.setCond(5);
      st.playSound(SOUND_MIDDLE);
      st.giveItems(FrogKingsBead, 1);
    }
    else if (event.equalsIgnoreCase("colin_q194_5.htm"))
    {
      st.setCond(6);
      st.takeItems(FrogKingsBead, -1);
      st.playSound(SOUND_MIDDLE);
    }
    else if (event.equalsIgnoreCase("colin_q194_6.htm"))
    {
      if ((player.getTransformation() != 0) || player.isMounted())
      {
        player.sendPacket(Msg.YOU_ALREADY_POLYMORPHED_AND_CANNOT_POLYMORPH_AGAIN);
        return null;
      }
      st.setCond(7);
      st.playSound(SOUND_MIDDLE);
      negateSpeedBuffs(player);
      SkillTable.getInstance().getInfo(6202, 1).getEffects(player, player, false, false);
    }
    else if (event.equalsIgnoreCase("tess_q194_2.htm"))
    {
      st.setCond(8);
      st.giveItems(GrandmaTessCandyPouch, 1);
      st.playSound(SOUND_MIDDLE);
    }
    else if (event.equalsIgnoreCase("colin_q194_8.htm"))
    {
      st.setCond(9);
      st.takeItems(GrandmaTessCandyPouch, -1);
      st.playSound(SOUND_MIDDLE);
    }
    else if (event.equalsIgnoreCase("colin_q194_9.htm"))
    {
      if ((player.getTransformation() != 0) || player.isMounted())
      {
        player.sendPacket(Msg.YOU_ALREADY_POLYMORPHED_AND_CANNOT_POLYMORPH_AGAIN);
        return null;
      }
      st.setCond(10);
      st.playSound(SOUND_MIDDLE);
      negateSpeedBuffs(player);
      SkillTable.getInstance().getInfo(6203, 1).getEffects(player, player, false, false);
    }
    else if (event.equalsIgnoreCase("kuta_q194_2.htm"))
    {
      st.setCond(11);
      st.giveItems(NativesGlove, 1);
      st.playSound(SOUND_MIDDLE);
    }
    else if (event.equalsIgnoreCase("colin_q194_10a.htm"))
    {
      st.setCond(12);
      st.takeItems(NativesGlove, -1);
      st.playSound(SOUND_MIDDLE);
    }
    else if (event.equalsIgnoreCase("claudiaathebaldt_q194_2.htm"))
    {
      if (player.getBaseClassId() == player.getActiveClassId())
      {
        st.addExpAndSp(10000000, 2500000);
        st.setState(COMPLETED);
        st.exitCurrentQuest(false);
        st.playSound(SOUND_FINISH);
      }
      else
      {
        return "subclass_forbidden.htm";
      }
    }
    else if (event.equalsIgnoreCase("colin_q194_11a.htm"))
    {
      if ((player.getTransformation() != 0) || player.isMounted())
      {
        player.sendPacket(Msg.YOU_ALREADY_POLYMORPHED_AND_CANNOT_POLYMORPH_AGAIN);
        return null;
      }
      negateSpeedBuffs(player);
      SkillTable.getInstance().getInfo(6201, 1).getEffects(player, player, false, false);
    }
    else if (event.equalsIgnoreCase("colin_q194_12a.htm"))
    {
      if ((player.getTransformation() != 0) || player.isMounted())
      {
        player.sendPacket(Msg.YOU_ALREADY_POLYMORPHED_AND_CANNOT_POLYMORPH_AGAIN);
        return null;
      }
      negateSpeedBuffs(player);
      SkillTable.getInstance().getInfo(6202, 1).getEffects(player, player, false, false);
    }
    else if (event.equalsIgnoreCase("colin_q194_13a.htm"))
    {
      if ((player.getTransformation() != 0) || player.isMounted())
      {
        player.sendPacket(Msg.YOU_ALREADY_POLYMORPHED_AND_CANNOT_POLYMORPH_AGAIN);
        return null;
      }
      negateSpeedBuffs(player);
      SkillTable.getInstance().getInfo(6203, 1).getEffects(player, player, false, false);
    }
View Full Code Here

   * Method runImpl.
   */
  @Override
  protected void runImpl()
  {
    Player player = getClient().getActiveChar();
    if ((player == null) || (_count == 0))
    {
      return;
    }
    if (!player.getPlayerAccess().UseWarehouse)
    {
      player.sendActionFailed();
      return;
    }
    if (player.isActionsDisabled())
    {
      player.sendActionFailed();
      return;
    }
    if (player.isInStoreMode())
    {
      player.sendPacket(SystemMsg.WHILE_OPERATING_A_PRIVATE_STORE_OR_WORKSHOP_YOU_CANNOT_DISCARD_DESTROY_OR_TRADE_AN_ITEM);
      return;
    }
    if (player.isInTrade())
    {
      player.sendActionFailed();
      return;
    }
    NpcInstance whkeeper = player.getLastNpc();
    if ((whkeeper == null) || !player.isInRangeZ(whkeeper, Creature.INTERACTION_DISTANCE))
    {
      return;
    }
    if (!player.getAccountChars().containsKey(_objectId))
    {
      return;
    }
    PcInventory inventory = player.getInventory();
    PcFreight freight = new PcFreight(_objectId);
    freight.restore();
    inventory.writeLock();
    freight.writeLock();
    try
    {
      int slotsleft = 0;
      long adenaDeposit = 0;
      slotsleft = Config.FREIGHT_SLOTS - freight.getSize();
      int items = 0;
      for (int i = 0; i < _count; i++)
      {
        ItemInstance item = inventory.getItemByObjectId(_items[i]);
        if ((item == null) || (item.getCount() < _itemQ[i]) || !item.getTemplate().isFreightable())
        {
          _items[i] = 0;
          _itemQ[i] = 0L;
          continue;
        }
        if (!item.isStackable() || (freight.getItemByItemId(item.getItemId()) == null))
        {
          if (slotsleft <= 0)
          {
            _items[i] = 0;
            _itemQ[i] = 0L;
            continue;
          }
          slotsleft--;
        }
        if (item.getItemId() == ItemTemplate.ITEM_ID_ADENA)
        {
          adenaDeposit = _itemQ[i];
        }
        items++;
      }
      if (slotsleft <= 0)
      {
        player.sendPacket(SystemMsg.YOU_HAVE_EXCEEDED_THE_QUANTITY_THAT_CAN_BE_INPUTTED);
      }
      if (items == 0)
      {
        player.sendPacket(SystemMsg.INCORRECT_ITEM_COUNT);
        return;
      }
      long fee = SafeMath.mulAndCheck(items, _FREIGHT_FEE);
      if ((fee + adenaDeposit) > player.getAdena())
      {
        player.sendPacket(SystemMsg.YOU_LACK_THE_FUNDS_NEEDED_TO_PAY_FOR_THIS_TRANSACTION);
        return;
      }
      if (!player.reduceAdena(fee, true))
      {
        player.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
        return;
      }
      for (int i = 0; i < _count; i++)
      {
        if (_items[i] == 0)
        {
          continue;
        }
        ItemInstance item = inventory.removeItemByObjectId(_items[i], _itemQ[i]);
        Log.LogItem(player, Log.FreightDeposit, item);
        freight.addItem(item);
      }
    }
    catch (ArithmeticException ae)
    {
      player.sendPacket(SystemMsg.YOU_HAVE_EXCEEDED_THE_QUANTITY_THAT_CAN_BE_INPUTTED);
      return;
    }
    finally
    {
      freight.writeUnlock();
      inventory.writeUnlock();
    }
    player.sendChanges();
    player.sendPacket(SystemMsg.THE_TRANSACTION_IS_COMPLETE);
  }
View Full Code Here

  /**
   * Method evolve.
   */
  public void evolve()
  {
    Player player = getSelf();
    NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    Summon pl_pet = player.getSummonList().getPet();
    if (player.getInventory().getItemByItemId(BABY_BUFFALO_PANPIPE) == null)
    {
      show("scripts/services/petevolve/no_item.htm", player, npc);
      return;
    }
    if ((pl_pet == null) || pl_pet.isDead())
    {
      show("scripts/services/petevolve/evolve_no.htm", player, npc);
      return;
    }
    if (pl_pet.getNpcId() != BABY_BUFFALO)
    {
      show("scripts/services/petevolve/no_pet.htm", player, npc);
      return;
    }
    if (Config.ALT_IMPROVED_PETS_LIMITED_USE && player.isMageClass())
    {
      show("scripts/services/petevolve/no_class_w.htm", player, npc);
      return;
    }
    if (pl_pet.getLevel() < 55)
    {
      show("scripts/services/petevolve/no_level.htm", player, npc);
      return;
    }
    int controlItemId = pl_pet.getControlItemObjId();
    player.getSummonList().unsummonPet(false);
    ItemInstance control = player.getInventory().getItemByObjectId(controlItemId);
    control.setItemId(IN_BABY_BUFFALO_NECKLACE);
    control.setEnchantLevel(L2Pet.IMPROVED_BABY_BUFFALO.getMinLevel());
    control.setJdbcState(JdbcEntityState.UPDATED);
    control.update();
    player.sendItemList(false);
    show("scripts/services/petevolve/yes_pet.htm", player, npc);
  }
View Full Code Here

  @Override
  public String onTalk(NpcInstance npc, QuestState st)
  {
    int npcId = npc.getNpcId();
    int cond = st.getCond();
    Player player = st.getPlayer();
    String htmltext = "noquest";
    if (player.getBaseClassId() != player.getActiveClassId())
    {
      return "subclass_forbidden.htm";
    }
    if (npcId == SirGustavAthebaldt)
    {
      QuestState qs = player.getQuestState(_193_SevenSignDyingMessage.class);
      if ((cond == 0) && (player.getLevel() >= 79) && (qs != null) && qs.isCompleted())
      {
        htmltext = "sirgustavathebaldt_q194_1.htm";
      }
      else if (cond == 1)
      {
        htmltext = "sirgustavathebaldt_q194_2b.htm";
      }
      else if (cond == 2)
      {
        htmltext = "sirgustavathebaldt_q194_2c.htm";
      }
      else if (cond == 3)
      {
        if (st.getQuestItemsCount(AthebaldtsIntroduction) < 1)
        {
          st.giveItems(AthebaldtsIntroduction, 1);
        }
        htmltext = "sirgustavathebaldt_q194_4.htm";
      }
      else
      {
        htmltext = "sirgustavathebaldt_q194_0.htm";
        st.exitCurrentQuest(true);
      }
    }
    else if (npcId == Colin)
    {
      if (cond == 3)
      {
        if (st.getQuestItemsCount(AthebaldtsIntroduction) > 0)
        {
          htmltext = "colin_q194_1.htm";
        }
        else
        {
          htmltext = "colin_q194_0b.htm";
        }
      }
      else if (cond == 5)
      {
        htmltext = "colin_q194_4.htm";
      }
      else if (cond == 6)
      {
        htmltext = "colin_q194_5.htm";
      }
      else if (cond == 8)
      {
        htmltext = "colin_q194_7.htm";
      }
      else if (cond == 9)
      {
        htmltext = "colin_q194_8.htm";
      }
      else if (cond == 11)
      {
        htmltext = "colin_q194_10.htm";
      }
      else if (cond == 12)
      {
        htmltext = "colin_q194_14.htm";
      }
      else if ((cond == 4) && (player.getTransformation() == 0))
      {
        htmltext = "colin_q194_11.htm";
      }
      else if ((cond == 7) && (player.getTransformation() == 0))
      {
        htmltext = "colin_q194_12.htm";
      }
      else if ((cond == 10) && (player.getTransformation() == 0))
      {
        htmltext = "colin_q194_13.htm";
      }
      else if (((cond == 4) || (cond == 7) || (cond == 10)) && (player.getTransformation() != 0))
      {
        htmltext = "colin_q194_0a.htm";
      }
    }
    else if (npcId == Frog)
    {
      if ((cond == 4) && (player.getTransformation() == 111))
      {
        htmltext = "frog_q194_1.htm";
      }
      else if ((cond == 5) && (player.getTransformation() == 111))
      {
        htmltext = "frog_q194_4.htm";
      }
      else
      {
        htmltext = "frog_q194_3.htm";
      }
    }
    else if (npcId == Tess)
    {
      if ((cond == 7) && (player.getTransformation() == 112))
      {
        htmltext = "tess_q194_1.htm";
      }
      else if ((cond == 8) && (player.getTransformation() == 112))
      {
        htmltext = "tess_q194_3.htm";
      }
      else
      {
        htmltext = "tess_q194_0.htm";
      }
    }
    else if (npcId == Kuta)
    {
      if ((cond == 10) && (player.getTransformation() == 101))
      {
        htmltext = "kuta_q194_1.htm";
      }
      else if ((cond == 11) && (player.getTransformation() == 101))
      {
        htmltext = "kuta_q194_3.htm";
      }
      else
      {
View Full Code Here

  /**
   * Method evolve.
   */
  public void evolve()
  {
    Player player = getSelf();
    NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    Summon pl_pet = player.getSummonList().getPet();
    if (player.getInventory().getItemByItemId(BABY_COUGAR_CHIME) == null)
    {
      show("scripts/services/petevolve/no_item.htm", player, npc);
      return;
    }
    if ((pl_pet == null) || pl_pet.isDead())
    {
      show("scripts/services/petevolve/evolve_no.htm", player, npc);
      return;
    }
    if (pl_pet.getNpcId() != BABY_COUGAR)
    {
      show("scripts/services/petevolve/no_pet.htm", player, npc);
      return;
    }
    if (pl_pet.getLevel() < 55)
    {
      show("scripts/services/petevolve/no_level.htm", player, npc);
      return;
    }
    int controlItemId = pl_pet.getControlItemObjId();
    player.getSummonList().unsummonPet(false);
    ItemInstance control = player.getInventory().getItemByObjectId(controlItemId);
    control.setItemId(IN_COUGAR_CHIME);
    control.setEnchantLevel(L2Pet.IMPROVED_BABY_COUGAR.getMinLevel());
    control.setJdbcState(JdbcEntityState.UPDATED);
    control.update();
    player.sendItemList(false);
    show("scripts/services/petevolve/yes_pet.htm", player, npc);
  }
View Full Code Here

   * Method runImpl.
   */
  @Override
  protected void runImpl()
  {
    Player player = getClient().getActiveChar();
    if (player == null)
    {
      return;
    }
    Henna henna = HennaHolder.getInstance().getHenna(_symbolId);
    if (henna != null)
    {
      player.sendPacket(new HennaUnequipInfo(henna, player));
    }
  }
View Full Code Here

  /**
   * Method evolve.
   */
  public void evolve()
  {
    Player player = getSelf();
    NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (player.getInventory().getItemByItemId(GREAT_WOLF_NECKLACE) == null)
    {
      show("scripts/services/petevolve/no_item.htm", player, npc);
      return;
    }
    Summon pl_pet = player.getSummonList().getPet();
    if ((pl_pet == null) || pl_pet.isDead())
    {
      show("scripts/services/petevolve/evolve_no.htm", player, npc);
      return;
    }
    if (pl_pet.getNpcId() != GREAT_WOLF)
    {
      show("scripts/services/petevolve/no_wolf.htm", player, npc);
      return;
    }
    if (pl_pet.getLevel() < 70)
    {
      show("scripts/services/petevolve/no_level_gw.htm", player, npc);
      return;
    }
    int controlItemId = pl_pet.getControlItemObjId();
    player.getSummonList().unsummonPet(false);
    ItemInstance control = player.getInventory().getItemByObjectId(controlItemId);
    control.setItemId(FENRIR_NECKLACE);
    control.setEnchantLevel(L2Pet.FENRIR_WOLF.getMinLevel());
    control.setJdbcState(JdbcEntityState.UPDATED);
    control.update();
    player.sendItemList(false);
    show("scripts/services/petevolve/yes_wolf.htm", player, npc);
  }
View Full Code Here

   * Method runImpl.
   */
  @Override
  public void runImpl()
  {
    Player activeChar = getClient().getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    ICommunityBoardHandler handler = CommunityBoardManager.getInstance().getCommunityHandler(_url);
    if (handler != null)
    {
      if (!Config.COMMUNITYBOARD_ENABLED)
      {
        activeChar.sendPacket(new SystemMessage2(SystemMsg.THE_COMMUNITY_SERVER_IS_CURRENTLY_OFFLINE));
      }
      else
      {
        handler.onWriteCommand(activeChar, _url, _arg1, _arg2, _arg3, _arg4, _arg5);
      }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.Player

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.