Package net.sf.l2j.gameserver.serverpackets

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


      else
        target.reduceCurrentHp(target.getMaxHp() + 1, activeChar);
    }
    else
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
    }
    AdminHelpPage.showHelpPage(activeChar, filename);
  }
View Full Code Here


    L2PcInstance player = null;
    if (target != null && target instanceof L2PcInstance)
      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
    {
      activeChar.teleToLocation(player.getX(), player.getY(), player.getZ(), true);
      activeChar.sendMessage("You're teleporting yourself to character " + player.getName());
    }
View Full Code Here

      statement.setString(1, player);
      ResultSet result = statement.executeQuery();
      if (result.next())
      {
        String acc_name = result.getString(1);
        SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
        if(acc_name.length() > 0)
        {
          LoginServerThread.getInstance().sendAccessLevel(acc_name, banLevel);
          sm.addString("Account Access Level for "+player+" set to "+banLevel+".");
        }
        else
          sm.addString("Couldn't find player: "+player+".");
        activeChar.sendPacket(sm);
      }
      else
        activeChar.sendMessage("Specified player name didn't lead to a valid account.");
      statement.close();
View Full Code Here

        L2PcInstance activeOwner = null;
        if (playable instanceof L2Summon)
        {
            activeOwner = ((L2Summon)playable).getOwner();
            activeOwner.sendPacket(new SystemMessage(SystemMessageId.PET_CANNOT_USE_ITEM));
            return;
        } else if (playable instanceof L2PcInstance)
        {
          activeOwner = (L2PcInstance)playable;
        }

        if (activeOwner == null)
          return;
        L2Summon activePet = activeOwner.getPet();

        if (activePet == null)
        {
            activeOwner.sendPacket(new SystemMessage(SystemMessageId.PETS_ARE_NOT_AVAILABLE_AT_THIS_TIME));
            return;
        }

        if (activePet.isDead())
        {
            activeOwner.sendPacket(new SystemMessage(SystemMessageId.SOULSHOTS_AND_SPIRITSHOTS_ARE_NOT_AVAILABLE_FOR_A_DEAD_PET));
            return;
        }

        int itemId = item.getItemId();
        boolean isBlessed = (itemId == 6647);
        int shotConsumption = 1;

        L2ItemInstance weaponInst = null;
        L2Weapon weaponItem = null;

        if ((activePet instanceof L2PetInstance) && !(activePet instanceof L2BabyPetInstance))
        {
            weaponInst = ((L2PetInstance)activePet).getActiveWeaponInstance();
            weaponItem = ((L2PetInstance)activePet).getActiveWeaponItem();

            if (weaponInst == null)
            {
                activeOwner.sendPacket(new SystemMessage(SystemMessageId.CANNOT_USE_SPIRITSHOTS));
                return;
            }

            if (weaponInst.getChargedSpiritshot() != L2ItemInstance.CHARGED_NONE)
            {
                // SpiritShots are already active.
                return;
            }

            int shotCount = item.getCount();
             shotConsumption = weaponItem.getSpiritShotCount();

            if (shotConsumption == 0)
            {
                activeOwner.sendPacket(new SystemMessage(SystemMessageId.CANNOT_USE_SPIRITSHOTS));
                return;
            }

            if (!(shotCount > shotConsumption))
            {
                // Not enough SpiritShots to use.
                activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET));
                return;
            }

            if (isBlessed)
                weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT);
            else
                weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_SPIRITSHOT);
        }
        else
        {
            if (activePet.getChargedSpiritShot() != L2ItemInstance.CHARGED_NONE)
                return;

            if (isBlessed)
                activePet.setChargedSpiritShot(L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT);
            else
                activePet.setChargedSpiritShot(L2ItemInstance.CHARGED_SPIRITSHOT);
        }

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

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

            activeOwner.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS));
            return;
        }

        // Pet uses the power of spirit.
        activeOwner.sendPacket(new SystemMessage(SystemMessageId.PET_USE_THE_POWER_OF_SPIRIT));

        Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUser(activePet, activePet, isBlessed? 2009:2008, 1, 0, 0), 360000/*600*/);
    }
View Full Code Here

        cw.setPlayer(player);
        cw.setItem(player.getInventory().getItemByItemId(cw.getItemId()));
        cw.giveSkill();
        player.setCursedWeaponEquipedId(cw.getItemId());

        SystemMessage sm = new SystemMessage(SystemMessageId.S2_MINUTE_OF_USAGE_TIME_ARE_LEFT_FOR_S1);
        sm.addString(cw.getName());
        //sm.addItemName(cw.getItemId());
        sm.addNumber((int)((cw.getEndTime() - System.currentTimeMillis()) / 60000));
        player.sendPacket(sm);
      }
    }
  }
View Full Code Here

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

        // now we need to find the equipped weapon of the targeted character...
        int curEnchant = 0; // display purposes only
View Full Code Here

        _activeChar = (L2PcInstance)playable;
        L2Object target = _activeChar.getTarget();

        if(!(target instanceof L2NpcInstance))
        {
            _activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
            _activeChar.sendPacket(new ActionFailed());
            return;
        }

        if ( !(target instanceof L2MonsterInstance||
            (target instanceof L2ChestInstance||
            (target instanceof L2BossInstance)   ||
            (target instanceof L2RaidBossInstance)) {
          _activeChar.sendPacket(new SystemMessage(SystemMessageId.THE_TARGET_IS_UNAVAILABLE_FOR_SEEDING));
          _activeChar.sendPacket(new ActionFailed());
          return;
        }

        _target = (L2MonsterInstance) target;

        if(_target == null || _target.isDead()) {
          _activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
          _activeChar.sendPacket(new ActionFailed());
            return;
        }

        if(_target.isSeeded()) {
          _activeChar.sendPacket(new ActionFailed());
          return;
        }

        _seedId = item.getItemId();

        if(areaValid(MapRegionTable.getInstance().getAreaCastle(_activeChar))) {
          //TODO: get right skill level
          _target.setSeeded(_seedId, _activeChar);
          L2Skill skill = SkillTable.getInstance().getInfo(2097, 3); //sowing skill
          _activeChar.useMagic(skill,false,false);
        } else {
          _activeChar.sendPacket(new SystemMessage(SystemMessageId.THIS_SEED_MAY_NOT_BE_SOWN_HERE));
        }
    }
View Full Code Here

    L2Skill skill = SkillTable.getInstance().getInfo(2229, itemId-6664);//box key skill
    L2Object target = activeChar.getTarget();

    if (!(target instanceof L2ChestInstance))
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
      activeChar.sendPacket(new ActionFailed());
    }
    else
    {
      L2ChestInstance chest = (L2ChestInstance) target;
View Full Code Here

            spawn.setLocz(target.getZ());
            L2World.getInstance().storeObject(spawn.spawnOne());

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

            SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString("Created " + template1.name + " at x: " + spawn.getLocx() + " y: " + spawn.getLocy() + " z: " + spawn.getLocz());
            activeChar.sendPacket(sm);
        }
        catch (Exception e)
        {
            SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString("Target is not ingame.");
            activeChar.sendPacket(sm);
        }
    }
View Full Code Here

        sendPacket(new ItemList(activeChar, false));

        sendPacket(new ShortCutInit(activeChar));

        SystemMessage sm = new SystemMessage(SystemMessageId.WELCOME_TO_LINEAGE);
        sendPacket(sm);

        sm = new SystemMessage(SystemMessageId.S1_S2);
        sm.addString(getText("V2VsY29tZSB0byBhIEwySiBTZXJ2ZXIsIGZvdW5kZWQgYnkgTDJDaGVmLg=="));

        sendPacket(sm);
        sm = new SystemMessage(SystemMessageId.S1_S2);
        sm.addString(getText("RGV2ZWxvcGVkIGJ5IHRoZSBMMkogRGV2IFRlYW0gYXQgbDJqc2VydmVyLmNvbS4="));

        sendPacket(sm);

        if (Config.SERVER_VERSION != null)
        {
            sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString(getText("TDJKIFNlcnZlciBWZXJzaW9uOg==")+"      "+Config.SERVER_VERSION);
            sendPacket(sm);
        }

        if (Config.DATAPACK_VERSION != null)
        {
            sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString(getText("TDJKIERhdGFwYWNrIFZlcnNpb246")+"  "+Config.DATAPACK_VERSION);
            sendPacket(sm);
        }
        sm = null;

        sm = new SystemMessage(SystemMessageId.S1_S2);
        sm.addString(getText("Q29weXJpZ2h0IDIwMDQtMjAwNw=="));
        sendPacket(sm);
        sm = new SystemMessage(SystemMessageId.S1_S2);
        sm.addString(getText("V2VsY29tZSB0byA="));
        sm.addString(LoginServerThread.getInstance().getServerName());
        sendPacket(sm);

        SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);
        Announcements.getInstance().showAnnouncements(activeChar);

    Quest.playerEnter(activeChar);
    activeChar.sendPacket(new QuestList());

    if (Config.SERVER_NEWS)
    {
      String serverNews = HtmCache.getInstance().getHtm("data/html/servnews.htm");
      if (serverNews != null)
        sendPacket(new NpcHtmlMessage(1, serverNews));
    }

    PetitionManager.getInstance().checkPetitionMessages(activeChar);

        // send user info again .. just like the real client
        //sendPacket(ui);

        if (activeChar.getClanId() != 0 && activeChar.getClan() != null)
        {
          sendPacket(new PledgeShowMemberListAll(activeChar.getClan(), activeChar));
          sendPacket(new PledgeStatusChanged(activeChar.getClan()));
        }

    if (activeChar.isAlikeDead())
    {
      // no broadcast needed since the player will already spawn dead to others
      sendPacket(new Die(activeChar));
    }

    if (Config.ALLOW_WATER)
        activeChar.checkWaterState();

        if (Hero.getInstance().getHeroes() != null &&
                Hero.getInstance().getHeroes().containsKey(activeChar.getObjectId()))
            activeChar.setHero(true);

        setPledgeClass(activeChar);

    //add char to online characters
    activeChar.setOnlineStatus(true);

        notifyFriends(activeChar);
    notifyClanMembers(activeChar);
    notifySponsorOrApprentice(activeChar);

    activeChar.onPlayerEnter();

    if (Olympiad.getInstance().playerInStadia(activeChar))
        {
            activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
            activeChar.sendMessage("You have been teleported to the nearest town due to you being in an Olympiad Stadium");
        }

        if (DimensionalRiftManager.getInstance().checkIfInRiftZone(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false))
        {
            DimensionalRiftManager.getInstance().teleportToWaitingRoom(activeChar);
        }

    if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis())
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.CLAN_MEMBERSHIP_TERMINATED));
    }

    if (activeChar.getClan() != null)
    {
      activeChar.sendPacket(new PledgeSkillList(activeChar.getClan()));

      for (Siege siege : SiegeManager.getInstance().getSieges())
        {
          if (!siege.getIsInProgress()) continue;
        if (siege.checkIsAttacker(activeChar.getClan()))
            activeChar.setSiegeState((byte)1);
        else if (siege.checkIsDefender(activeChar.getClan()))
            activeChar.setSiegeState((byte)2);
        }
      // Add message at connexion if clanHall not paid.
      // Possibly this is custom...
      ClanHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(activeChar.getClan());
      if(clanHall != null){
        if(!clanHall.getPaid()){
          activeChar.sendPacket(new SystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW));
        }
      }
    }

    if (!activeChar.isGM() && activeChar.getSiegeState() < 2 && activeChar.isInsideZone(L2Character.ZONE_SIEGE))
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.