Examples of SystemMessage


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

                          activeChar.addAutoSoulShot(_itemId);
                          ExAutoSoulShot atk = new ExAutoSoulShot(_itemId, _type);
                          activeChar.sendPacket(atk);

                          //start the auto soulshot use
                          SystemMessage sm = new SystemMessage(SystemMessageId.USE_OF_S1_WILL_BE_AUTO);
                          sm.addString(item.getItemName());
                          activeChar.sendPacket(sm);
                          sm = null;

                          activeChar.rechargeAutoSoulShot(true, true, true);
                      }
                      else {
                        if (activeChar.getActiveWeaponItem() != activeChar.getFistsWeaponItem()
                            && item.getItem().getCrystalType() == activeChar.getActiveWeaponItem().getCrystalType())
                        {
                          if (_itemId>=3947 && _itemId<=3952 && activeChar.isInOlympiadMode()){
                            SystemMessage sm = new SystemMessage(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
                            sm.addString(item.getItemName());
                            activeChar.sendPacket(sm);
                            sm = null;
                          }else{
                            activeChar.addAutoSoulShot(_itemId);
                            ExAutoSoulShot atk = new ExAutoSoulShot(_itemId, _type);
                            activeChar.sendPacket(atk);

                            // start the auto soulshot use
                            SystemMessage sm = new SystemMessage(SystemMessageId.USE_OF_S1_WILL_BE_AUTO);
                            sm.addString(item.getItemName());
                            activeChar.sendPacket(sm);
                            sm = null;

                            activeChar.rechargeAutoSoulShot(true, true, false);
                          }
                        }
                        else {
                          if ((_itemId >= 2509 && _itemId <= 2514) || (_itemId >= 3947 && _itemId <= 3952) || _itemId == 5790)
                            activeChar.sendPacket(new SystemMessage(SystemMessageId.SPIRITSHOTS_GRADE_MISMATCH));
                          else
                            activeChar.sendPacket(new SystemMessage(SystemMessageId.SOULSHOTS_GRADE_MISMATCH));
                        }
                      }
                    }
                }
                else if (_type == 0)
                {
                    activeChar.removeAutoSoulShot(_itemId);
                    ExAutoSoulShot atk = new ExAutoSoulShot(_itemId, _type);
                    activeChar.sendPacket(atk);

                    //cancel the auto soulshot use
                    SystemMessage sm = new SystemMessage(SystemMessageId.AUTO_USE_OF_S1_CANCELLED);
                    sm.addString(item.getItemName());
                    activeChar.sendPacket(sm);
                    sm = null;
                }
            }
        }
View Full Code Here

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

            int z = Integer.parseInt(z1);

            activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
            activeChar.teleToLocation(x, y, z, false);

            SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString("You have been teleported to " + Cords);
            activeChar.sendPacket(sm);
        } catch (NoSuchElementException nsee)
        {
            activeChar.sendMessage("Wrong or no Coordinates given.");
        }
View Full Code Here

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

    public static boolean checkIfOkToUseStriderSiegeAssault(L2Character activeChar, Castle castle, boolean isCheckOnly)
    {
        if (activeChar == null || !(activeChar instanceof L2PcInstance))
            return false;

        SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
        L2PcInstance player = (L2PcInstance)activeChar;

        if (castle == null || castle.getCastleId() <= 0)
            sm.addString("You must be on castle ground to use strider siege assault");
        else if (!castle.getSiege().getIsInProgress())
            sm.addString("You can only use strider siege assault during a siege.");
        else if (!(player.getTarget() instanceof L2DoorInstance))
            sm.addString("You can only use strider siege assault on doors and walls.");
        else if (!activeChar.isRiding())
            sm.addString("You can only use strider siege assault when on strider.");
        else
            return true;

        if (!isCheckOnly) {player.sendPacket(sm);}
        return false;
View Full Code Here

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

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

        TextBuilder replyMSG = new TextBuilder("<html><title>Teleport Character</title>");
View Full Code Here

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

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
        {
            int x = player.getX();
            int y = player.getY();
View Full Code Here

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

                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

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

              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

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

    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

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.