Package net.sf.l2j.gameserver.serverpackets

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


    if (obj == null)
      obj = activeChar;

        if (obj instanceof L2ControllableMobInstance)
        {
            activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
            return;
        }

    doResurrect((L2Character)obj);
View Full Code Here


      return;
    }

    if (obj == null || obj instanceof L2PcInstance || obj instanceof L2ControllableMobInstance)
        {
        activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
        return;
        }

    doResurrect((L2Character)obj);
  }
View Full Code Here

        ResultSet rset = statement.executeQuery();

        L2PcInstance friend;
            String friendName;

            SystemMessage sm = new SystemMessage(SystemMessageId.FRIEND_S1_HAS_LOGGED_IN);
            sm.addString(cha.getName());

            while (rset.next())
            {
                friendName = rset.getString("friend_name");
View Full Code Here

  {
    L2Clan clan = activeChar.getClan();
    if (clan != null)
    {
      clan.getClanMember(activeChar.getName()).setPlayerInstance(activeChar);
      SystemMessage msg = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN);
      msg.addString(activeChar.getName());
      clan.broadcastToOtherOnlineMembers(msg, activeChar);
      msg = null;
      clan.broadcastToOtherOnlineMembers(new PledgeShowMemberListUpdate(activeChar), activeChar);
    }
  }
View Full Code Here

      }

      activeChar.getInventory().destroyItem("Extract", item, activeChar, null);
      activeChar.getInventory().addItem("Extract", itemToCreateId, amount, activeChar, item);

      SystemMessage sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
      sm.addItemName(itemToCreateId);
      sm.addNumber(amount);
        activeChar.sendPacket(sm);

        ItemList playerUI = new ItemList(activeChar, false);
    activeChar.sendPacket(playerUI);
  }
View Full Code Here

    {
      L2PcInstance sponsor = (L2PcInstance)L2World.getInstance().findObject(activeChar.getSponsor());

      if (sponsor != null)
      {
        SystemMessage msg = new SystemMessage(SystemMessageId.YOUR_APPRENTICE_S1_HAS_LOGGED_IN);
        msg.addString(activeChar.getName());
        sponsor.sendPacket(msg);
      }
    }
    else if (activeChar.getApprentice() != 0)
    {
      L2PcInstance apprentice = (L2PcInstance)L2World.getInstance().findObject(activeChar.getApprentice());

      if (apprentice != null)
      {
        SystemMessage msg = new SystemMessage(SystemMessageId.YOUR_SPONSOR_S1_HAS_LOGGED_IN);
        msg.addString(activeChar.getName());
        apprentice.sendPacket(msg);
      }
    }
  }
View Full Code Here

        // Check if Soulshot can be used
    if (weaponInst == null || weaponItem.getSoulShotCount() == 0)
    {
            if(!activeChar.getAutoSoulShot().containsKey(itemId))
                activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_USE_SOULSHOTS));
      return;
    }

    // Check for correct grade
        int weaponGrade = weaponItem.getCrystalType();
        if ((weaponGrade == L2Item.CRYSTAL_NONE && itemId != 5789 && itemId != 1835) ||
      (weaponGrade == L2Item.CRYSTAL_D && itemId != 1463) ||
      (weaponGrade == L2Item.CRYSTAL_C && itemId != 1464) ||
      (weaponGrade == L2Item.CRYSTAL_B && itemId != 1465) ||
      (weaponGrade == L2Item.CRYSTAL_A && itemId != 1466) ||
      (weaponGrade == L2Item.CRYSTAL_S && itemId != 1467))
    {
            if(!activeChar.getAutoSoulShot().containsKey(itemId))
                activeChar.sendPacket(new SystemMessage(SystemMessageId.SOULSHOTS_GRADE_MISMATCH));
      return;
    }

        activeChar.soulShotLock.lock();
        try
        {
          // Check if Soulshot is already active
          if (weaponInst.getChargedSoulshot() != L2ItemInstance.CHARGED_NONE)
            return;

          // Consume Soulshots if player has enough of them
          int saSSCount = (int)activeChar.getStat().calcStat(Stats.SOULSHOT_COUNT, 0, null, null);
          int SSCount = saSSCount == 0 ? weaponItem.getSoulShotCount() : saSSCount;

          if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), SSCount, null, false))
          {
            if(activeChar.getAutoSoulShot().containsKey(itemId))
            {
              activeChar.removeAutoSoulShot(itemId);
              activeChar.sendPacket(new ExAutoSoulShot(itemId, 0));

              SystemMessage sm = new SystemMessage(SystemMessageId.AUTO_USE_OF_S1_CANCELLED);
              sm.addString(item.getItem().getName());
              activeChar.sendPacket(sm);
            }
            else activeChar.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SOULSHOTS));
            return;
          }

          // Charge soulshot
          weaponInst.setChargedSoulshot(L2ItemInstance.CHARGED_SOULSHOT);
        }
        finally
        {
          activeChar.soulShotLock.unlock();
        }

    // Send message to client
        activeChar.sendPacket(new SystemMessage(SystemMessageId.ENABLED_SOULSHOT));
        Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUser(activeChar, activeChar, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/*600*/);
  }
 
View Full Code Here

    if (pet == null)
      return;

    if (pet.getName() != null)
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.NAMING_YOU_CANNOT_SET_NAME_OF_THE_PET));
      return;
    }
    else if (PetNameTable.getInstance().doesPetNameExist(_name, pet.getTemplate().npcId))
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.NAMING_ALREADY_IN_USE_BY_ANOTHER_PET));
      return;
    }
        else if ((_name.length() < 3) || (_name.length() > 16))
    {
            SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString("Your pet's name can be up to 16 characters.");
      // SystemMessage sm = new SystemMessage(SystemMessage.NAMING_PETNAME_UP_TO_8CHARS);
          activeChar.sendPacket(sm);
          sm = null;

      return;
    }
        else if (!PetNameTable.getInstance().isValidPetName(_name))
    {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.NAMING_PETNAME_CONTAINS_INVALID_CHARS));
      return;
    }

    pet.setName(_name);
    pet.broadcastPacket(new NpcInfo(pet, activeChar));
View Full Code Here

    activeChar.broadcastPacket(MSU);

    activeChar.startAbnormalEffect(BIGHEAD_EFFECT);
    activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);

    SystemMessage sm = new SystemMessage(SystemMessageId.USE_S1);
    sm.addSkillName(MYSTERY_POTION_SKILL);
    activeChar.sendPacket(sm);

    MysteryPotionStop mp = new MysteryPotionStop(playable);
    ThreadPoolManager.getInstance().scheduleEffect(mp, EFFECT_DURATION);
    }
View Full Code Here

      }

      // Sending notification to a clan leader
      L2PcInstance clanLeader = L2World.getInstance().getPlayer(clan.getLeader().getName());
      if (clanLeader != null)
        clanLeader.sendPacket(new SystemMessage(SystemMessageId.THE_MANOR_INFORMATION_HAS_BEEN_UPDATED));

      c.setNextPeriodApproved(false);
    }
  }
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.