Package net.sf.l2j.gameserver.serverpackets

Examples of net.sf.l2j.gameserver.serverpackets.SystemMessage


        {
            player = (L2PcInstance)target;
        }
        else
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
            return;
        }

        if (player.getObjectId() == activeChar.getObjectId())
        {
          player.sendPacket(new SystemMessage(SystemMessageId.CANNOT_USE_ON_YOURSELF));
        }
        else
        {
            try
            {
View Full Code Here


        {
            player = (L2PcInstance)target;
        }
        else
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
            return;
        }

        if (player.getObjectId() == activeChar.getObjectId())
        {
          player.sendPacket(new SystemMessage(SystemMessageId.CANNOT_USE_ON_YOURSELF));
        }
        else
        {
            int x = player.getX();
            int y = player.getY();
View Full Code Here

                spawn.setHeading(activeChar.getHeading());
                spawn.setRespawnDelay(respawnTime);
                SpawnTable.getInstance().addNewSpawn(spawn, true);
                spawn.init();

                SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
                sm.addString("Created " + template1.name + " on " + target.getObjectId() + ".");
                activeChar.sendPacket(sm);

                if (Config.DEBUG)
                {
                    _log.fine("Spawn at X="+spawn.getLocx()+" Y="+spawn.getLocy()+" Z="+spawn.getLocz());
                    _log.warning("GM: "+activeChar.getName()+"("+activeChar.getObjectId()+") moved NPC " + target.getObjectId());
                }
            }
            catch (Exception e)
            {
                activeChar.sendMessage("Target is not in game.");
            }

        }
        else
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
        }
    }
View Full Code Here

              continue;

          _target = (L2MonsterInstance) targetList[index];

          if (_activeChar != _target.getSeeder()) {
            SystemMessage sm = new SystemMessage(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_HARVEST);
            _activeChar.sendPacket(sm);
            continue;
          }

          boolean send = false;
          int total = 0;
          int cropId = 0;

          // TODO: check items and amount of items player harvest
          if (_target.isSeeded()) {
             if (calcSuccess()) {
               L2Attackable.RewardItem[] items = _target.takeHarvest();
                 if (items != null && items.length > 0) {
                     for (L2Attackable.RewardItem ritem : items) {
                         cropId = ritem.getItemId(); // always got 1 type of crop as reward
                         if (_activeChar.isInParty())
                           _activeChar.getParty().distributeItem(_activeChar, ritem, true, _target);
                         else {
                             L2ItemInstance item = _activeChar.getInventory().addItem("Manor", ritem.getItemId(), ritem.getCount(), _activeChar, _target);
                             if (iu != null) iu.addItem(item);
                             send = true;
                             total += ritem.getCount();
                         }
                     }
                     if (send) {
                         SystemMessage smsg = new SystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2);
                         smsg.addNumber(total);
                         smsg.addItemName(cropId);
                         _activeChar.sendPacket(smsg);
                         if (_activeChar.getParty() != null) {
                           smsg = new SystemMessage(SystemMessageId.S1_HARVESTED_S3_S2S);
                           smsg.addString(_activeChar.getName());
                           smsg.addNumber(total);
                           smsg.addItemName(cropId);
                        _activeChar.getParty().broadcastToPartyMembers(_activeChar, smsg);
                      }

                         if (iu != null) _activeChar.sendPacket(iu);
                     else _activeChar.sendPacket(new ItemList(_activeChar, false));
                     }
                 }
             } else {
               _activeChar.sendPacket(new SystemMessage(SystemMessageId.THE_HARVEST_HAS_FAILED));
             }
           } else {
               _activeChar.sendPacket(new SystemMessage(SystemMessageId.THE_HARVEST_FAILED_BECAUSE_THE_SEED_WAS_NOT_SOWN));
           }
      }

    }
View Full Code Here

    L2PcInstance requestor = player.getActiveRequester();
    if (requestor == null) return;

    if (_response == 1)
    {
      SystemMessage msg1 = null, msg2 = null;
      if (requestor.isInDuel())
      {
        msg1 = new SystemMessage(SystemMessageId.S1_CANNOT_DUEL_BECAUSE_S1_IS_ALREADY_ENGAGED_IN_A_DUEL);
        msg1.addString(requestor.getName());
        player.sendPacket(msg1);
        return;
      }
      else if (player.isInDuel())
      {
        player.sendPacket(new SystemMessage(SystemMessageId.YOU_ARE_UNABLE_TO_REQUEST_A_DUEL_AT_THIS_TIME));
        return;
      }

      if (_partyDuel == 1)
      {
        msg1 = new SystemMessage(SystemMessageId.YOU_HAVE_ACCEPTED_S1S_CHALLENGE_TO_A_PARTY_DUEL_THE_DUEL_WILL_BEGIN_IN_A_FEW_MOMENTS);
        msg1.addString(requestor.getName());

        msg2 = new SystemMessage(SystemMessageId.S1_HAS_ACCEPTED_YOUR_CHALLENGE_TO_DUEL_AGAINST_THEIR_PARTY_THE_DUEL_WILL_BEGIN_IN_A_FEW_MOMENTS);
        msg2.addString(player.getName());
      }
      else
      {
        msg1 = new SystemMessage(SystemMessageId.YOU_HAVE_ACCEPTED_S1S_CHALLENGE_TO_A_DUEL_THE_DUEL_WILL_BEGIN_IN_A_FEW_MOMENTS);
        msg1.addString(requestor.getName());

        msg2 = new SystemMessage(SystemMessageId.S1_HAS_ACCEPTED_YOUR_CHALLENGE_TO_A_DUEL_THE_DUEL_WILL_BEGIN_IN_A_FEW_MOMENTS);
        msg2.addString(player.getName());
      }

      player.sendPacket(msg1);
      requestor.sendPacket(msg2);

      DuelManager.getInstance().addDuel(requestor, player, _partyDuel);
    }
    else
    {
      SystemMessage msg = null;
      if (_partyDuel == 1) msg = new SystemMessage(SystemMessageId.THE_OPPOSING_PARTY_HAS_DECLINED_YOUR_CHALLENGE_TO_A_DUEL);
      else
      {
        msg = new SystemMessage(SystemMessageId.S1_HAS_DECLINED_YOUR_CHALLENGE_TO_A_DUEL);
        msg.addString(player.getName());
      }
        requestor.sendPacket(msg);
    }

    player.setActiveRequester(null);
View Full Code Here

    int amount = 0;
    int x = 0;
    int y = 0;

    List<SystemMessage> sysmsgs = new FastList<SystemMessage>();
    SystemMessage msg = null;

    for(TradeItem buyerItem : buyerslist)
    {
        for(x=0 ; x < sellerslist.size(); x++)//find in sellerslist
        {
            temp2 = sellerslist.get(x);
            if (temp2.getItemId() == buyerItem.getItemId())
            {
                sellerItem = sellerInv.getItemByItemId(buyerItem.getItemId());
                break;
            }
        }

        if (sellerItem !=null)
        {
            if (buyerItem.getCount()> temp2.getCount())
            {
                amount = temp2.getCount();
            }
            if (buyerItem.getCount()> sellerItem.getCount())
            {
                amount = sellerItem.getCount();
            }
            else
            {
                amount = buyerItem.getCount();
            }
                if (buyerItem.getCount() > Integer.MAX_VALUE / buyerItem.getOwnersPrice())
                {
                    _log.warning("Integer Overflow on Cost. Possible Exploit attempt between "+buyer.getName()+" and "+seller.getName()+".");
                    return;
                }
                //int cost = amount * buyerItem.getOwnersPrice();
                enchantLevel = sellerItem.getEnchantLevel();
            sellerItem = sellerInv.destroyItem("", sellerItem.getObjectId(),amount, null, null);
//            buyer.reduceAdena(cost);
//            seller.addAdena(cost);
            newitem = itemTable.createItem("L2TradeList", sellerItem.getItemId(), amount, buyer, seller);
                newitem.setEnchantLevel(enchantLevel);
            temp = buyerInv.addItem("", newitem, null, null);
            if (amount == 1)//system msg stuff
            {
                msg = new SystemMessage(SystemMessageId.S1_PURCHASED_S2);
                msg.addString(buyer.getName());
                msg.addItemName(sellerItem.getItemId());
                sysmsgs.add(msg);
                msg = new SystemMessage(SystemMessageId.S1_PURCHASED_S2);
                msg.addString("You");
                msg.addItemName(sellerItem.getItemId());
                sysmsgs.add(msg);
            }
            else
            {
                msg = new SystemMessage(SystemMessageId.S1_PURCHASED_S3_S2_S);
                msg.addString(buyer.getName());
                msg.addItemName(sellerItem.getItemId());
                msg.addNumber(amount);
                sysmsgs.add(msg);
                msg = new SystemMessage(SystemMessageId.S1_PURCHASED_S3_S2_S);
                msg.addString("You");
                msg.addItemName(sellerItem.getItemId());
                msg.addNumber(amount);
                sysmsgs.add(msg);
            }
            if(temp2.getCount() == buyerItem.getCount())
            {
                sellerslist.remove(temp2);
View Full Code Here

          {
            L2ItemInstance item = player.getInventory().addItem("Sweep", ritem.getItemId(), ritem.getCount(), player, target);
            if (iu != null) iu.addItem(item);
            send = true;

            SystemMessage smsg;
            if (ritem.getCount() > 1)
            {
              smsg = new SystemMessage(SystemMessageId.EARNED_S2_S1_S); // earned $s2$s1
              smsg.addItemName(ritem.getItemId());
                            smsg.addNumber(ritem.getCount());
            }
            else
            {
              smsg = new SystemMessage(SystemMessageId.EARNED_ITEM); // earned $s1
              smsg.addItemName(ritem.getItemId());
            }
            player.sendPacket(smsg);
          }
        }
            }
View Full Code Here

          L2ItemInstance item = _activeChar.getInventory().getItemByItemId(_seedId);
          //Consuming used seed
        _activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);

        SystemMessage sm = null;
        if (calcSuccess()) {
            _activeChar.sendPacket(new PlaySound("Itemsound.quest_itemget"));
              _target.setSeeded();
              sm = new SystemMessage(SystemMessageId.THE_SEED_WAS_SUCCESSFULLY_SOWN);
          } else {
            sm = new SystemMessage(SystemMessageId.THE_SEED_WAS_NOT_SOWN);
      }
        if (_activeChar.getParty() == null) {
          _activeChar.sendPacket(sm);
        } else {
          _activeChar.getParty().broadcastToPartyMembers(sm);
View Full Code Here

            target = (L2Character)targets[index];

            double cp = skill.getPower();
            //int cLev = activeChar.getLevel();
            //hp += skill.getPower()/*+(Math.sqrt(cLev)*cLev)+cLev*/;
            SystemMessage sm = new SystemMessage(SystemMessageId.S1_CP_WILL_BE_RESTORED);
            sm.addNumber((int)cp);
            target.sendPacket(sm);
            target.setCurrentCp(cp+target.getCurrentCp());
            StatusUpdate sump = new StatusUpdate(target.getObjectId());
            sump.addAttribute(StatusUpdate.CUR_CP, (int)target.getCurrentCp());
            target.sendPacket(sump);
View Full Code Here

                  _paid = false;
                  if(System.currentTimeMillis()>_paidUntil+_chRate){
                     if(GameServer.gameServer.getCHManager() != null && GameServer.gameServer.getCHManager().loaded()){
                    AuctionManager.getInstance().initNPC(getId());
                      ClanHallManager.getInstance().setFree(getId());
                        Clan.broadcastToOnlineMembers(new SystemMessage(SystemMessageId.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE_THEREFORE_THE_CLAN_HALL_OWNERSHIP_HAS_BEEN_REVOKED));
                    }else
                          ThreadPoolManager.getInstance().scheduleGeneral(new FeeTask(), 3000);
                  }else{
                    updateDb();
                        SystemMessage sm = new SystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
                        sm.addNumber(getLease());
                    Clan.broadcastToOnlineMembers(sm);
                    if(System.currentTimeMillis()+(1000*60*60*24)<=_paidUntil+_chRate)
                      ThreadPoolManager.getInstance().scheduleGeneral(new FeeTask(), System.currentTimeMillis()+(1000*60*60*24));
                    else
                      ThreadPoolManager.getInstance().scheduleGeneral(new FeeTask(), (_paidUntil+_chRate)-System.currentTimeMillis());
View Full Code Here

TOP

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