Package net.sf.l2j.gameserver.serverpackets

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


      return;
    L2PcInstance activeChar = (L2PcInstance)playable;
        L2RecipeList rp = RecipeController.getInstance().getRecipeByItemId(item.getItemId());
       if (activeChar.hasRecipeList(rp.getId()))
        {
         SystemMessage sm = new SystemMessage(SystemMessageId.RECIPE_ALREADY_REGISTERED);
          activeChar.sendPacket(sm);
        }
        else
        {
          if (rp.isDwarvenRecipe())
          {
            if (activeChar.hasDwarvenCraft())
            {
          if (rp.getLevel()>activeChar.getDwarvenCraft())
          {
        //can't add recipe, becouse create item level too low
              SystemMessage sm = new SystemMessage(SystemMessageId.CREATE_LVL_TOO_LOW_TO_REGISTER);
              activeChar.sendPacket(sm);
          }
          else if (activeChar.getDwarvenRecipeBook().length >= activeChar.GetDwarfRecipeLimit())
        {
          //Up to $s1 recipes can be registered.
          SystemMessage sm = new SystemMessage(SystemMessageId.UP_TO_S1_RECIPES_CAN_REGISTER);
          sm.addNumber(activeChar.GetDwarfRecipeLimit());
              activeChar.sendPacket(sm);
        }
        else
          {
              activeChar.registerDwarvenRecipeList(rp);
              activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
              SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
              sm.addString("Added recipe \"" + rp.getRecipeName() + "\" to Dwarven RecipeBook");
              activeChar.sendPacket(sm);
          }
            }
            else
            {
              SystemMessage sm = new SystemMessage(SystemMessageId.CANT_REGISTER_NO_ABILITY_TO_CRAFT);
              activeChar.sendPacket(sm);
            }
          }
          else
          {
            if (activeChar.hasCommonCraft())
            {
          if (rp.getLevel()>activeChar.getCommonCraft())
          {
        //can't add recipe, becouse create item level too low
              SystemMessage sm = new SystemMessage(SystemMessageId.CREATE_LVL_TOO_LOW_TO_REGISTER);
              activeChar.sendPacket(sm);
          }
          else if (activeChar.getCommonRecipeBook().length >= activeChar.GetCommonRecipeLimit())
        {
          //Up to $s1 recipes can be registered.
          SystemMessage sm = new SystemMessage(SystemMessageId.UP_TO_S1_RECIPES_CAN_REGISTER);
          sm.addNumber(activeChar.GetCommonRecipeLimit());
              activeChar.sendPacket(sm);
        }
        else
          {
              activeChar.registerCommonRecipeList(rp);
              activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
              SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
              sm.addString("Added recipe \"" + rp.getRecipeName() + "\" to Common RecipeBook");
              activeChar.sendPacket(sm);
          }
            }
            else
            {
              SystemMessage sm = new SystemMessage(SystemMessageId.CANT_REGISTER_NO_ABILITY_TO_CRAFT);
              activeChar.sendPacket(sm);
            }
          }
        }
    }
View Full Code Here


        L2Clan clan = activeChar.getClan();
        if (clan == null) return;

        if((activeChar.getClanPrivileges() & L2Clan.CP_CL_MASTER_RIGHTS) != L2Clan.CP_CL_MASTER_RIGHTS)
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_DO_NOT_HAVE_THE_RIGHT_TO_DISMISS_AN_APPRENTICE));
          return;
        }

        L2ClanMember currentMember = clan.getClanMember(_currPlayerName);
        L2ClanMember targetMember = clan.getClanMember(_targetPlayerName);
        if (currentMember == null || targetMember == null) return;

        L2ClanMember apprenticeMember, sponsorMember;
        if (currentMember.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
        {
          apprenticeMember = currentMember;
          sponsorMember = targetMember;
        }
        else
        {
          apprenticeMember = targetMember;
          sponsorMember = currentMember;
        }

        L2PcInstance apprentice = apprenticeMember.getPlayerInstance();
        L2PcInstance sponsor = sponsorMember.getPlayerInstance();

        SystemMessage sm = null;
        if(_set == 0)
        {
          // test: do we get the current sponsor & apprentice from this packet or no?
          if (apprentice != null) apprentice.setSponsor(0);
          else // offline
            apprenticeMember.initApprenticeAndSponsor(0, 0);

          if (sponsor != null) sponsor.setApprentice(0);
          else // offline
            sponsorMember.initApprenticeAndSponsor(0, 0);

          apprenticeMember.saveApprenticeAndSponsor(0, 0);
          sponsorMember.saveApprenticeAndSponsor(0, 0);

          sm = new SystemMessage(SystemMessageId.S2_CLAN_MEMBER_S1_S_APPRENTICE_HAS_BEEN_REMOVED);
        }
        else
        {
          if (apprenticeMember.getSponsor() != 0 || sponsorMember.getApprentice() != 0
              || apprenticeMember.getApprentice() != 0 || sponsorMember.getSponsor() != 0)
          {
            activeChar.sendMessage("Remove previous connections first.");
            return;
          }
          if (apprentice != null)
            apprentice.setSponsor(sponsorMember.getObjectId());
          else // offline
            apprenticeMember.initApprenticeAndSponsor(0, sponsorMember.getObjectId());

          if (sponsor != null)
            sponsor.setApprentice(apprenticeMember.getObjectId());
          else // offline
            sponsorMember.initApprenticeAndSponsor(apprenticeMember.getObjectId(), 0);

          // saving to database even if online, since both must match
          apprenticeMember.saveApprenticeAndSponsor(0, sponsorMember.getObjectId());
          sponsorMember.saveApprenticeAndSponsor(apprenticeMember.getObjectId(), 0);

          sm = new SystemMessage(SystemMessageId.S2_HAS_BEEN_DESIGNATED_AS_APPRENTICE_OF_CLAN_MEMBER_S1);
        }
        sm.addString(sponsorMember.getName());
      sm.addString(apprenticeMember.getName());
      if (sponsor != activeChar && sponsor != apprentice) activeChar.sendPacket(sm);
      if (sponsor != null) sponsor.sendPacket(sm);
      if (apprentice != null) apprentice.sendPacket(sm);
    }
View Full Code Here

          return;

        _activeChar = (L2PcInstance)playable;

        if(_activeChar.getTarget() == null || !(_activeChar.getTarget() instanceof L2MonsterInstance)) {
            _activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
            _activeChar.sendPacket(new ActionFailed());
            return;
        }

        _target = (L2MonsterInstance)_activeChar.getTarget();
View Full Code Here

      // manor_menu_select?ask=X&state=Y&time=X
       
      if (CastleManorManager.getInstance().isUnderMaintenance())
      {
        player.sendPacket(new ActionFailed());
        player.sendPacket(new SystemMessage(SystemMessageId.THE_MANOR_SYSTEM_IS_CURRENTLY_UNDER_MAINTENANCE));
        return;
      }

      String params = command.substring(command.indexOf("?")+1);
      StringTokenizer st = new StringTokenizer(params, "&");
      int ask   = Integer.parseInt(st.nextToken().split("=")[1]);
      int state = Integer.parseInt(st.nextToken().split("=")[1]);
      int time  = Integer.parseInt(st.nextToken().split("=")[1]);

      int castleId;
      if (state == -1) // info for current manor
        castleId = getCastle().getCastleId();
      else        // info for requested manor
        castleId = state;

      switch (ask) { // Main action
      case 1: // Seed purchase
        if (castleId != getCastle().getCastleId()) {
          player.sendPacket(new SystemMessage(SystemMessageId.HERE_YOU_CAN_BUY_ONLY_SEEDS_OF_S1_MANOR));
        } else {
          L2TradeList tradeList = new L2TradeList(0);
          FastList<SeedProduction> seeds = getCastle().getSeedProduction(CastleManorManager.PERIOD_CURRENT);

          for (SeedProduction s : seeds) {
View Full Code Here

        String val = command.substring(21);
        L2PcInstance target = L2World.getInstance().getPlayer(val);
        if (target != null)
          showCharacterInfo(activeChar, target);
        else
          activeChar.sendPacket(new SystemMessage(SystemMessageId.CHARACTER_DOES_NOT_EXIST));
      }
      catch (StringIndexOutOfBoundsException e)
      {
        activeChar.sendMessage("Usage: //character_info <player_name>");
      }
    }
    else if (command.startsWith("admin_show_characters"))
    {
      try
      {
        String val = command.substring(22);
        int page = Integer.parseInt(val);
        listCharacters(activeChar, page);
      }
      catch (StringIndexOutOfBoundsException e)
      {
        //Case of empty page number
        activeChar.sendMessage("Usage: //show_characters <page_number>");
      }
    }
    else if (command.startsWith("admin_find_character"))
    {
      try
      {
        String val = command.substring(21);
        findCharacter(activeChar, val);
      }
      catch (StringIndexOutOfBoundsException e)
      {  //Case of empty character name
        activeChar.sendMessage("Usage: //find_character <character_name>");
        listCharacters(activeChar, 0);
      }
    }
    else if (command.startsWith("admin_find_ip"))
    {
      try
      {
        String val = command.substring(14);
        findCharactersPerIp(activeChar, val);
      }
      catch (Exception e)
      {  //Case of empty or malformed IP number
        activeChar.sendMessage("Usage: //find_ip <www.xxx.yyy.zzz>");
        listCharacters(activeChar, 0);
      }
    }
    else if (command.startsWith("admin_find_account"))
    {
      try
      {
        String val = command.substring(19);
        findCharactersPerAccount(activeChar, val);
      }
      catch (Exception e)
      {  //Case of empty or malformed player name
        activeChar.sendMessage("Usage: //find_account <player_name>");
        listCharacters(activeChar, 0);
      }
    }
    else if (command.equals("admin_edit_character"))
      editCharacter(activeChar);
    // Karma control commands
    else if (command.equals("admin_nokarma"))
      setTargetKarma(activeChar, 0);
    else if (command.startsWith("admin_setkarma"))
    {
      try
      {
        String val = command.substring(15);
        int karma = Integer.parseInt(val);
        if (activeChar == activeChar.getTarget() || activeChar.getAccessLevel()>=REQUIRED_LEVEL2)
          GMAudit.auditGMAction(activeChar.getName(), command, activeChar.getName(), "");
        setTargetKarma(activeChar, karma);
      }
      catch (StringIndexOutOfBoundsException e)
      {
        if (Config.DEVELOPER )
          System.out.println("Set karma error: "+e);
        activeChar.sendMessage("Usage: //setkarma <new_karma_value>");
      }
    }
    else if (command.startsWith("admin_save_modifications"))
    {
      try
      {
        String val = command.substring(24);
        if (activeChar == activeChar.getTarget() || activeChar.getAccessLevel()>=REQUIRED_LEVEL2)
          GMAudit.auditGMAction(activeChar.getName(), command, activeChar.getName(), "");
        adminModifyCharacter(activeChar, val);
      }
      catch (StringIndexOutOfBoundsException e)
      {  //Case of empty character name
        activeChar.sendMessage("Error while modifying character.");
        listCharacters(activeChar, 0);
      }
    }
    else if (command.startsWith("admin_rec"))
    {
      try
      {
        String val = command.substring(10);
        int recVal = Integer.parseInt(val);
        L2Object target = activeChar.getTarget();
        L2PcInstance player = null;
        if (activeChar != target && activeChar.getAccessLevel()<REQUIRED_LEVEL2)
          return false;
        if (target instanceof L2PcInstance) {
          player = (L2PcInstance)target;
        } else {
          return false;
        }
        player.setRecomHave(recVal);
        player.sendMessage("You have been recommended by a GM");
        player.broadcastUserInfo();
      } catch (Exception e)
      {
        activeChar.sendMessage("Usage: //rec number");
      }
    }
    else if (command.startsWith("admin_setclass"))
    {
      try
      {
        String val = command.substring(15);
        int classidval = Integer.parseInt(val);
        L2Object target = activeChar.getTarget();
        L2PcInstance player = null;
        if (activeChar != target && activeChar.getAccessLevel()<REQUIRED_LEVEL2)
          return false;
        if (target instanceof L2PcInstance)
          player = (L2PcInstance)target;
        else
          return false;
        boolean valid=false;
        for (ClassId classid: ClassId.values())
          if (classidval == classid.getId())
            valid = true;
        if (valid && (player.getClassId().getId() != classidval))
        {
          player.setClassId(classidval);
          if (!player.isSubClassActive())
            player.setBaseClass(classidval);
          String newclass = player.getTemplate().className;
          player.store();
          player.sendMessage("A GM changed your class to "+newclass);
          player.broadcastUserInfo();
          activeChar.sendMessage(player.getName()+" is a "+newclass);
        }
        activeChar.sendMessage("Usage: //setclass <valid_new_classid>");
      }
      catch (StringIndexOutOfBoundsException e)
      {
        AdminHelpPage.showHelpPage(activeChar, "charclasses.htm");
      }
    }
    else if (command.startsWith("admin_settitle"))
    {
      try
      {
        String val = command.substring(15);
        L2Object target = activeChar.getTarget();
        L2PcInstance player = null;
        if (activeChar != target && activeChar.getAccessLevel()<REQUIRED_LEVEL2)
          return false;
        if (target instanceof L2PcInstance) {
          player = (L2PcInstance)target;
        } else {
          return false;
        }
        player.setTitle(val);
        player.sendMessage("Your title has been changed by a GM");
        player.broadcastTitleInfo();
      }
      catch (StringIndexOutOfBoundsException e)
      {   //Case of empty character title
        activeChar.sendMessage("You need to specify the new title.");
      }
    }
    else if (command.startsWith("admin_setname"))
    {
      try
      {
        String val = command.substring(14);
        L2Object target = activeChar.getTarget();
        L2PcInstance player = null;
        if (activeChar != target && activeChar.getAccessLevel()<REQUIRED_LEVEL2)
          return false;
        if (target instanceof L2PcInstance) {
          player = (L2PcInstance)target;
        } else {
          return false;
        }
        player.setName(val);
        player.sendMessage("Your name has been changed by a GM");
        player.broadcastUserInfo();
        player.store();
      }
      catch (StringIndexOutOfBoundsException e)
      {   //Case of empty character name
        activeChar.sendMessage("Usage: //setname new_name_for_target");
      }
    }
    else if (command.startsWith("admin_setsex"))
    {
      L2Object target = activeChar.getTarget();
      L2PcInstance player = null;
      if (activeChar != target && activeChar.getAccessLevel()<REQUIRED_LEVEL2)
        return false;
      if (target instanceof L2PcInstance) {
        player = (L2PcInstance)target;
      } else {
        return false;
      }
      player.getAppearance().setSex(player.getAppearance().getSex()? false : true);
      player.sendMessage("Your gender has been changed by a GM");
      player.broadcastUserInfo();
      player.decayMe();
      player.spawnMe(player.getX(),player.getY(),player.getZ());
    }
    else if (command.startsWith("admin_setcolor"))
    {
      try
      {
        String val          = command.substring(15);
        L2Object target     = activeChar.getTarget();
        L2PcInstance player = null;
        if (activeChar != target && activeChar.getAccessLevel()<REQUIRED_LEVEL2)
          return false;
        if (target instanceof L2PcInstance) {
          player = (L2PcInstance)target;
        } else {
          return false;
        }
        player.getAppearance().setNameColor(Integer.decode("0x"+val));
        player.sendMessage("Your name color has been changed by a GM");
        player.broadcastUserInfo();
      }
      catch (StringIndexOutOfBoundsException e)
      {   //Case of empty color
        activeChar.sendMessage("You need to specify the new color.");
      }
    }
    else if (command.startsWith("admin_fullfood"))
    {
      L2Object target = activeChar.getTarget();
      if (target instanceof L2PetInstance)
      {
        L2PetInstance targetPet = (L2PetInstance)target;
        targetPet.setCurrentFed(targetPet.getMaxFed());
      }
      else
        activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
    }

    return true;
  }
View Full Code Here

      // for display
      int oldKarma = player.getKarma();
      // update karma
      player.setKarma(newKarma);
      //Common character information
      player.sendPacket( new SystemMessage(SystemMessageId.YOUR_KARMA_HAS_BEEN_CHANGED_TO).addString(String.valueOf(newKarma)));
      //Admin information
      activeChar.sendMessage("Successfully Changed karma for "+player.getName()+" from (" + oldKarma + ") to (" + newKarma + ").");
      if (Config.DEBUG)
        _log.fine("[SET KARMA] [GM]"+activeChar.getName()+" Changed karma for "+player.getName()+" from (" + oldKarma + ") to (" + newKarma + ").");
    }
View Full Code Here

        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

    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

                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

        // 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

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.