Package com.l2jfrozen.gameserver.network.serverpackets

Examples of com.l2jfrozen.gameserver.network.serverpackets.SystemMessage


    if(activeChar == null)
      return;

    if(!(L2World.getInstance().findObject(_target) instanceof L2PcInstance))
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_INVITED_THE_WRONG_TARGET));
      return;
    }

    L2PcInstance target = (L2PcInstance) L2World.getInstance().findObject(_target);
    L2Clan clan = activeChar.getClan();
View Full Code Here


      return;
    }

    _activeChar.setWantsPeace(1);
    _activeChar.deathPenalty(false);
    SystemMessage msg = new SystemMessage(SystemMessageId.YOU_HAVE_PERSONALLY_SURRENDERED_TO_THE_S1_CLAN);
    msg.addString(_pledgeName);
    _activeChar.sendPacket(msg);
    msg = null;
    ClanTable.getInstance().checkSurrender(_clan, clan);
  }
View Full Code Here

    if (activeChar == null)
      return;
   
    if (activeChar.getClan() == null)
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER));
      return;
    }
   
    if (activeChar.isClanLeader())
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.CLAN_LEADER_CANNOT_WITHDRAW));
      return;
    }
   
    if (activeChar.isInCombat())
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_LEAVE_DURING_COMBAT));
      return;
    }
   
    L2Clan clan = activeChar.getClan();
   
    clan.removeClanMember(activeChar.getName(), System.currentTimeMillis() + Config.ALT_CLAN_JOIN_DAYS * 86400000L); // 24*60*60*1000 = 86400000
   
    SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
    sm.addString(activeChar.getName());
    clan.broadcastToOnlineMembers(sm);
    sm = null;
   
    // Remove the Player From the Member list
    clan.broadcastToOnlineMembers(new PledgeShowMemberListDelete(activeChar.getName()));
   
    activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_WITHDRAWN_FROM_CLAN));
    activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_MUST_WAIT_BEFORE_JOINING_ANOTHER_CLAN));
    activeChar.setActiveWarehouse(null);
  }
View Full Code Here

      return;

    if(_commandsLenght > 255)
    {
      //Invalid macro. Refer to the Help file for instructions.
      player.sendPacket(new SystemMessage(SystemMessageId.INVALID_MACRO));
      return;
    }

    if(player.getMacroses().getAllMacroses().length > 24)
    {
      //You may create up to 24 macros.
      player.sendPacket(new SystemMessage(SystemMessageId.YOU_MAY_CREATE_UP_TO_24_MACROS));
      return;
    }

    if(_macro.name.length() == 0)
    {
      //Enter the name of the macro.
      player.sendPacket(new SystemMessage(SystemMessageId.ENTER_THE_MACRO_NAME));
      return;
    }

    if(_macro.descr.length() > 32)
    {
      //Macro descriptions may contain up to 32 characters.
      player.sendPacket(new SystemMessage(SystemMessageId.MACRO_DESCRIPTION_MAX_32_CHARS));
      return;
    }
   
    //Security Check
    for(L2MacroCmd command:_macro.commands){
     
      if(!checkSecurityOnCommand(command)){
       
        //Invalid macro. Refer to the Help file for instructions.
        player.sendPacket(new SystemMessage(SystemMessageId.INVALID_MACRO));
        player.sendMessage("SecurityCheck: not more then 2x ',' or 2x ';' in the same command");
        return;
       
      }
     
View Full Code Here

      return;

    L2PcInstance targetPlayer = L2World.getInstance().getPlayer(_reciever);
    if(targetPlayer == null || !targetPlayer.getFriendList().contains(activeChar.getName()))
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME));
      return;
    }

    if(Config.LOG_CHAT)
    {
View Full Code Here

    if (_activeChar == null)
      return;
   
    if (!_activeChar.isInPartyMatchRoom() && _activeChar.getParty() != null && _activeChar.getParty().getLeader() != _activeChar)
    {
      _activeChar.sendPacket(new SystemMessage(SystemMessageId.CANT_VIEW_PARTY_ROOMS));
      _activeChar.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }
   
    if (_activeChar.isInPartyMatchRoom())
View Full Code Here

          L2ItemInstance spb = player.getInventory().getItemByItemId(spbId);

          if(spb == null)
          {
            // Haven't spellbook
            player.sendPacket(new SystemMessage(SystemMessageId.ITEM_MISSING_TO_LEARN_SKILL));
            return;
          }

          // ok
          player.destroyItem("Consume", spb, trainer, true);
        }
      }
      else
      {
        SystemMessage sm = new SystemMessage(SystemMessageId.NOT_ENOUGH_SP_TO_LEARN_SKILL);
        player.sendPacket(sm);

        return;
      }
    }
    else if(_skillType == 1)
    {
      int costid = 0;
      int costcount = 0;
      // Skill Learn bug Fix
      L2SkillLearn[] skillsc = SkillTreeTable.getInstance().getAvailableSkills(player);

      for(L2SkillLearn s : skillsc)
      {
        L2Skill sk = SkillTable.getInstance().getInfo(s.getId(), s.getLevel());

        if(sk == null || sk != skill)
        {
          continue;
        }

        counts++;
        costid = s.getIdCost();
        costcount = s.getCostCount();
        _requiredSp = s.getSpCost();
      }

      if(counts == 0)
      {
        player.sendMessage("You are trying to learn skill that u can't..");
        Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " tried to learn skill that he can't!!!", IllegalPlayerAction.PUNISH_KICK);
        return;
      }

      if(player.getSp() >= _requiredSp)
      {
        if(!player.destroyItemByItemId("Consume", costid, costcount, trainer, false))
        {
          // Haven't spellbook
          player.sendPacket(new SystemMessage(SystemMessageId.ITEM_MISSING_TO_LEARN_SKILL));
          return;
        }

        SystemMessage sm = new SystemMessage(SystemMessageId.DISSAPEARED_ITEM);
        sm.addNumber(costcount);
        sm.addItemName(costid);
        sendPacket(sm);
      }
      else
      {
        SystemMessage sm = new SystemMessage(SystemMessageId.NOT_ENOUGH_SP_TO_LEARN_SKILL);
        player.sendPacket(sm);
        return;
      }
    }
    else if(_skillType == 2) //pledgeskills TODO: Find appropriate system messages.
    {
      if(!player.isClanLeader())
      {
        // TODO: Find and add system msg
        player.sendMessage("This feature is available only for the clan leader");
        return;
      }

      int itemId = 0;
      int repCost = 100000000;
      // Skill Learn bug Fix
      L2PledgeSkillLearn[] skills = SkillTreeTable.getInstance().getAvailablePledgeSkills(player);

      for(L2PledgeSkillLearn s : skills)
      {
        L2Skill sk = SkillTable.getInstance().getInfo(s.getId(), s.getLevel());

        if(sk == null || sk != skill)
        {
          continue;
        }

        counts++;
        itemId = s.getItemId();
        repCost = s.getRepCost();
      }

      if(counts == 0)
      {
        player.sendMessage("You are trying to learn skill that u can't..");
        Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " tried to learn skill that he can't!!!", IllegalPlayerAction.PUNISH_KICK);
        return;
      }

      if(player.getClan().getReputationScore() >= repCost)
      {
        if(Config.LIFE_CRYSTAL_NEEDED)
        {
          if(!player.destroyItemByItemId("Consume", itemId, 1, trainer, false))
          {
            // Haven't spellbook
            player.sendPacket(new SystemMessage(SystemMessageId.ITEM_MISSING_TO_LEARN_SKILL));
            return;
          }

          SystemMessage sm = new SystemMessage(SystemMessageId.DISSAPEARED_ITEM);
          sm.addItemName(itemId);
          sm.addNumber(1);
          sendPacket(sm);
        }
      }
      else
      {
        SystemMessage sm = new SystemMessage(SystemMessageId.ACQUIRE_SKILL_FAILED_BAD_CLAN_REP_SCORE);
        player.sendPacket(sm);
        return;
      }
      player.getClan().setReputationScore(player.getClan().getReputationScore() - repCost, true);
      player.getClan().addNewSkill(skill);

      if(Config.DEBUG)
      {
        _log.fine("Learned pledge skill " + _id + " for " + _requiredSp + " SP.");
      }

      SystemMessage cr = new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
      cr.addNumber(repCost);
      player.sendPacket(cr);
      SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_SKILL_S1_ADDED);
      sm.addSkillName(_id);
      player.sendPacket(sm);

      player.getClan().broadcastToOnlineMembers(new PledgeSkillList(player.getClan()));

      for(L2PcInstance member : player.getClan().getOnlineMembers(""))
      {
        member.sendSkillList();
      }
     
      if(trainer instanceof L2VillageMasterInstance){
        ((L2VillageMasterInstance) trainer).showPledgeSkillList(player);
      }
     
      return;
    }

    else
    {
      _log.warning("Recived Wrong Packet Data in Aquired Skill - unk1:" + _skillType);
      return;
    }

    player.addSkill(skill, true);

    if(Config.DEBUG)
    {
      _log.fine("Learned skill " + _id + " for " + _requiredSp + " SP.");
    }

    player.setSp(player.getSp() - _requiredSp);

    StatusUpdate su = new StatusUpdate(player.getObjectId());
    su.addAttribute(StatusUpdate.SP, player.getSp());
    player.sendPacket(su);

    SystemMessage sp = new SystemMessage(SystemMessageId.SP_DECREASED_S1);
    sp.addNumber(_requiredSp);
    sendPacket(sp);

    SystemMessage sm = new SystemMessage(SystemMessageId.LEARNED_SKILL_S1);
    sm.addSkillName(_id);
    player.sendPacket(sm);

    // update all the shortcuts to this skill
    if(_level > 1)
    {
View Full Code Here

      tradeList.addItemByItemId(itemId, count, price, enchant);
      cost += count * price;
     
      if (cost > Integer.MAX_VALUE)
      {
        player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED));
        player.sendPacket(new PrivateStoreManageListBuy(player));
        return;
      }
    }
   
    if (_count <= 0)
    {
      player.setPrivateStoreType(L2PcInstance.STORE_PRIVATE_NONE);
      player.broadcastUserInfo();
      return;
    }
   
    if (player.isProcessingTransaction())
    {
      player.sendMessage("Store mode are disable while trading.");
      player.sendPacket(new PrivateStoreManageListBuy(player));
      return;
    }
   
    // Check maximum number of allowed slots for pvt shops
    if (_count > player.GetPrivateBuyStoreLimit())
    {
      player.sendPacket(new PrivateStoreManageListBuy(player));
      player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED));
      return;
    }
   
    // Check for available funds
    if (Config.SELL_BY_ITEM)
    {
      if (cost > player.getItemCount(Config.SELL_ITEM, -1) || cost <= 0)
      {
        player.sendPacket(new PrivateStoreManageListBuy(player));
        player.sendPacket(new SystemMessage(SystemMessageId.THE_PURCHASE_PRICE_IS_HIGHER_THAN_MONEY));
        return;
      }
    }
    else
    {
      if (cost > player.getAdena() || cost <= 0)
      {
        player.sendPacket(new PrivateStoreManageListBuy(player));
        player.sendPacket(new SystemMessage(SystemMessageId.THE_PURCHASE_PRICE_IS_HIGHER_THAN_MONEY));
        return;
      }
    }
   
    player.sitDown();
View Full Code Here

    if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) && !(player.isGM() && Config.GM_RESTART_FIGHTING))
    {
      if (Config.DEBUG)
        _log.fine("DEBUG " + getType() + ": Player " + player.getName() + " tried to logout while Fighting");
     
      player.sendPacket(new SystemMessage(SystemMessageId.CANT_LOGOUT_WHILE_FIGHTING));
      player.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }
   
    // Dont allow leaving if player is in combat
View Full Code Here

    int refinerItemId = refinerItem.getItem().getItemId();
   
    // is the item a life stone?
    if (refinerItemId < 8723 || refinerItemId > 8762)
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.THIS_IS_NOT_A_SUITABLE_ITEM));
      return;
    }
   
    int gemstoneCount = 0;
    int gemstoneItemId = 0;
    @SuppressWarnings("unused")
    int lifeStoneLevel = getLifeStoneLevel(refinerItemId);
    SystemMessage sm = new SystemMessage(SystemMessageId.REQUIRES_S1_S2);
   
    switch (itemGrade)
    {
      case L2Item.CRYSTAL_C:
         gemstoneCount = 20;
        gemstoneItemId = GEMSTONE_C;
         sm.addNumber(gemstoneCount);
        sm.addString("Gemstone C");
         break;
       case L2Item.CRYSTAL_B:
         gemstoneCount = 30;
        gemstoneItemId = GEMSTONE_B;
         sm.addNumber(gemstoneCount);
        sm.addString("Gemstone B");
         break;
       case L2Item.CRYSTAL_A:
         gemstoneCount = 20;
        gemstoneItemId = GEMSTONE_A;
         sm.addNumber(gemstoneCount);
        sm.addString("Gemstone A");
         break;
       case L2Item.CRYSTAL_S:
         gemstoneCount = 25;
        gemstoneItemId = GEMSTONE_S;
         sm.addNumber(gemstoneCount);
        sm.addString("Gemstone S");
         break;
    }
   
    activeChar.sendPacket(new ExConfirmVariationRefiner(_refinerItemObjId, refinerItemId, gemstoneItemId, gemstoneCount));
    activeChar.sendPacket(sm);
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.network.serverpackets.SystemMessage

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.