Examples of SystemMessage


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

        L2ItemInstance weaponInst = activeChar.getActiveWeaponInstance();
        L2Weapon weaponItem = activeChar.getActiveWeaponItem();
        int itemId = item.getItemId();

        if (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;
          return;
        }

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

        // Check if Blessed Spiritshot is already active (it can be charged over Spiritshot)
        if (weaponInst.getChargedSpiritshot() != L2ItemInstance.CHARGED_NONE) return;

        // Check for correct grade
        int weaponGrade = weaponItem.getCrystalType();
    if ((weaponGrade == L2Item.CRYSTAL_NONE && itemId != 3947) ||
        (weaponGrade == L2Item.CRYSTAL_D && itemId != 3948) ||
        (weaponGrade == L2Item.CRYSTAL_C && itemId != 3949) ||
        (weaponGrade == L2Item.CRYSTAL_B && itemId != 3950) ||
        (weaponGrade == L2Item.CRYSTAL_A && itemId != 3951) ||
        (weaponGrade == L2Item.CRYSTAL_S && itemId != 3952))
        {
            if(!activeChar.getAutoSoulShot().containsKey(itemId))
                activeChar.sendPacket(new SystemMessage(SystemMessageId.SPIRITSHOTS_GRADE_MISMATCH));
            return;
        }

        // Consume Blessed Spiritshot if player has enough of them
        if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), 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_SPIRITSHOTS));
            return;
        }

        // Charge Blessed Spiritshot
        weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT);

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

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

    if (resetConsumingMana) _consumingMana = false;

    L2PcInstance player = ((L2PcInstance)L2World.getInstance().findObject(getOwnerId()));
    if (player != null)
    {
      SystemMessage sm;
      switch (_mana)
      {
        case 10:
          sm = new SystemMessage(SystemMessageId.S1S_REMAINING_MANA_IS_NOW_10);
          sm.addString(getItemName());
          player.sendPacket(sm);
          break;
        case 5:
          sm = new SystemMessage(SystemMessageId.S1S_REMAINING_MANA_IS_NOW_5);
          sm.addString(getItemName());
          player.sendPacket(sm);
          break;
        case 1:
          sm = new SystemMessage(SystemMessageId.S1S_REMAINING_MANA_IS_NOW_1);
          sm.addString(getItemName());
          player.sendPacket(sm);
          break;
      }

      if (_mana == 0) // The life time has expired
      {
        sm = new SystemMessage(SystemMessageId.S1S_REMAINING_MANA_IS_NOW_0);
        sm.addString(getItemName());
        player.sendPacket(sm);

        // unequip
        if (isEquipped())
        {
View Full Code Here

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

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

                if (spb == null)// Haven't spellbook
                {
                  player.sendPacket(new SystemMessage(SystemMessageId.YOU_DONT_HAVE_ALL_OF_THE_ITEMS_NEEDED_TO_ENCHANT_THAT_SKILL));
                  return;
                }
                // ok
                player.destroyItem("Consume", spb, trainer, true);
              }
          }
          else
          {
            SystemMessage sm = new SystemMessage(SystemMessageId.YOU_DONT_HAVE_ENOUGH_EXP_TO_ENCHANT_THAT_SKILL);
              player.sendPacket(sm);
            return;
          }
        }
        else
        {
          SystemMessage sm = new SystemMessage(SystemMessageId.YOU_DONT_HAVE_ENOUGH_SP_TO_ENCHANT_THAT_SKILL);
          player.sendPacket(sm);
          return;
        }
        if (Rnd.get(100) <= _rate)
        {
          player.addSkill(skill, true);

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

          player.getStat().removeExpAndSp(_requiredExp, _requiredSp);

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

            SystemMessage ep = new SystemMessage(SystemMessageId.EXP_DECREASED_BY_S1);
            ep.addNumber(_requiredExp);
            sendPacket(ep);

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

          SystemMessage sm = new SystemMessage(SystemMessageId.YOU_HAVE_SUCCEEDED_IN_ENCHANTING_THE_SKILL_S1);
          sm.addSkillName(_skillId);
          player.sendPacket(sm);
        }
        else
        {
          if (skill.getLevel() > 100)
          {
            _skillLvl = _baseLvl;
            player.addSkill(SkillTable.getInstance().getInfo(_skillId, _skillLvl), true);
            player.sendSkillList();
          }
          SystemMessage sm = new SystemMessage(SystemMessageId.YOU_HAVE_FAILED_TO_ENCHANT_THE_SKILL_S1);
          sm.addSkillName(_skillId);
          player.sendPacket(sm);
        }
        trainer.showEnchantSkillList(player, player.getClassId());

        // update all the shortcuts to this skill
View Full Code Here

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

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

        // Check if Spiritshot is already active
        if (weaponInst.getChargedSpiritshot() != L2ItemInstance.CHARGED_NONE) return;

        // Check for correct grade
        int weaponGrade = weaponItem.getCrystalType();
    if ((weaponGrade == L2Item.CRYSTAL_NONE && itemId != 5790 && itemId != 2509) ||
        (weaponGrade == L2Item.CRYSTAL_D && itemId != 2510) ||
        (weaponGrade == L2Item.CRYSTAL_C && itemId != 2511) ||
        (weaponGrade == L2Item.CRYSTAL_B && itemId != 2512) ||
        (weaponGrade == L2Item.CRYSTAL_A && itemId != 2513) ||
        (weaponGrade == L2Item.CRYSTAL_S && itemId != 2514))
    {
            if(!activeChar.getAutoSoulShot().containsKey(itemId))
                activeChar.sendPacket(new SystemMessage(SystemMessageId.SPIRITSHOTS_GRADE_MISMATCH));
      return;
    }

        // Consume Spiritshot if player has enough of them
        if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), 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_SPIRITSHOTS));
      return;
    }

        // Charge Spiritshot
    weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_SPIRITSHOT);

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

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

    L2PcInstance player = null;
    if (target instanceof L2PcInstance)
      player = (L2PcInstance)target;
    else
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
      return;
    }
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    adminReply.setFile("data/html/admin/expsp.htm");
    adminReply.replace("%name%", player.getName());
View Full Code Here

Examples of org.openqreg.bean.Systemmessage

      con = DbHandler.getConnection();
      Iterator<? extends Usergroup> groupsIterator = UsergroupFinderBase
          .findAll(con).iterator();
      Iterator<? extends Systemmessage> messageIterator;
      Usergroup usergroup;
      Systemmessage systemmessage;
      Set<Systemmessage> group;
      while (groupsIterator.hasNext()) {
        usergroup = groupsIterator.next();
        group = new HashSet<Systemmessage>();
        messageIterator = SystemmessageFinder.findByGroupid(con,
View Full Code Here

Examples of org.zeroexchange.model.message.SystemMessage

    protected void sendPrivateMassage(Collection<User> recipients,
            User sender, String subject, String body) {
        for(User recipient: recipients) {
          Message message = null;
          if(sender == null) {
                message = new SystemMessage();
          } else {
            message = new UserMessage();           
                ((UserMessage)message).setSender(sender);
          }
            message.setMessage(body);
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.