Package com.l2jfrozen.gameserver.network.serverpackets

Examples of com.l2jfrozen.gameserver.network.serverpackets.StatusUpdate


    // Send the InventoryUpdate Server->Client Packet to the player
    // Add Items in player inventory and equip them
    player.sendPacket(playerIU);

    // Send the StatusUpdate Server->Client Packet to the player with new CUR_LOAD (0x0e) information
    StatusUpdate su = new StatusUpdate(player.getObjectId());
    su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
    player.sendPacket(su);

    // Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers
    player.broadcastUserInfo();
View Full Code Here


      else if (skill.getSkillType() != SkillType.HEAL_PERCENT)
        hp *= target.calcStat(Stats.HEAL_EFFECTIVNESS, 100, null, null) / 100;
     
      target.setCurrentHp(hp + target.getCurrentHp());
      target.setLastHealAmount((int) hp);
      StatusUpdate su = new StatusUpdate(target.getObjectId());
      su.addAttribute(StatusUpdate.CUR_HP, (int) target.getCurrentHp());
      target.sendPacket(su);
      su = null;
     
      if (target instanceof L2PcInstance)
      {
View Full Code Here

    if(levelIncreased)
    {
      getActiveChar().getOwner().sendMessage("Your pet has increased it's level.");
    }

    StatusUpdate su = new StatusUpdate(getActiveChar().getObjectId());
    su.addAttribute(StatusUpdate.LEVEL, getLevel());
    su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
    su.addAttribute(StatusUpdate.MAX_MP, getMaxMp());
    getActiveChar().broadcastPacket(su);
    su = null;

    // Send a Server->Client packet PetInfo to the L2PcInstance
    getActiveChar().getOwner().sendPacket(new PetInfo(getActiveChar()));
View Full Code Here

      target.setCurrentHp(newHP);

      if(totalHeal > 0)
        target.setLastHealAmount((int) totalHeal);

      StatusUpdate su = new StatusUpdate(target.getObjectId());
      su.addAttribute(StatusUpdate.CUR_HP, (int) target.getCurrentHp());
      target.sendPacket(su);
      su = null;

      SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
      sm.addString("HP of the party has been balanced.");
View Full Code Here

      player.sendPacket(my);
      my = null;

      if(isAutoAttackable(player))
      {
        StatusUpdate su = new StatusUpdate(getObjectId());
        su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
        su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
        player.sendPacket(su);
        su = null;
      }

      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
View Full Code Here

      MyTargetSelected my = new MyTargetSelected(getObjectId(), player.getLevel() - getLevel());
      player.sendPacket(my);
      my = null;

      // Send a Server->Client packet StatusUpdate of the L2NpcInstance to the L2PcInstance to update its HP bar
      StatusUpdate su = new StatusUpdate(getObjectId());
      su.addAttribute(StatusUpdate.CUR_HP, (int) getStatus().getCurrentHp());
      su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
      player.sendPacket(su);
      su = null;

      // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
      player.sendPacket(new ValidateLocation(this));
View Full Code Here

        smsg = null;
      }
    }
    getPlayer().sendPacket(new ItemList(getPlayer(), false));

    StatusUpdate su = new StatusUpdate(getPlayer().getObjectId());
    su.addAttribute(StatusUpdate.CUR_LOAD, getPlayer().getCurrentLoad());
    getPlayer().sendPacket(su);
   
    //on quests, always refresh inventory
    //InventoryUpdate u = new InventoryUpdate();
    //u.addItem(item);
View Full Code Here

      //{
      //  mp = target.getMaxMp() - target.getCurrentMp();
      //}
      target.setLastHealAmount((int) mp);
      target.setCurrentMp(mp + target.getCurrentMp());
      StatusUpdate sump = new StatusUpdate(target.getObjectId());
      sump.addAttribute(StatusUpdate.CUR_MP, (int) target.getCurrentMp());
      target.sendPacket(sump);

      if(actChar instanceof L2PcInstance && actChar != target)
      {
        SystemMessage sm = new SystemMessage(SystemMessageId.S2_MP_RESTORED_BY_S1);
View Full Code Here

        MyTargetSelected my = new MyTargetSelected(getObjectId(), player.getLevel() - getLevel());
        player.sendPacket(my);
        my = null;
       
        // Send a Server->Client packet StatusUpdate of the L2NpcInstance to the L2PcInstance to update its HP bar
        StatusUpdate su = new StatusUpdate(getObjectId());
        su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
        su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
        player.sendPacket(su);
        su = null;
      }
      else
      {
View Full Code Here

     
      // Check if the player is attackable (without a forced attack)
      if (isAutoAttackable(player))
      {
        // Send a Server->Client packet StatusUpdate of the L2NpcInstance to the L2PcInstance to update its HP bar
        StatusUpdate su = new StatusUpdate(getObjectId());
        su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
        su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
        player.sendPacket(su);
        su = null;
      }
     
      // Send a Server->Client NpcHtmlMessage() containing the GM console about this L2NpcInstance
      NpcHtmlMessage html = new NpcHtmlMessage(0);
      TextBuilder html1 = new TextBuilder("<html><body><center><font color=\"LEVEL\">NPC Information</font></center>");
      String className = getClass().getName().substring(43);
      html1.append("<br>");
     
      html1.append("Instance Type: " + className + "<br1>Faction: " + getFactionId() + "<br1>Location ID: " + (getSpawn() != null ? getSpawn().getLocation() : 0) + "<br1>");
     
      if (this instanceof L2ControllableMobInstance)
      {
        html1.append("Mob Group: " + MobGroupTable.getInstance().getGroupForMob((L2ControllableMobInstance) this).getGroupId() + "<br>");
      }
      else
      {
        html1.append("Respawn Time: " + (getSpawn() != null ? getSpawn().getRespawnDelay() / 1000 + "  Seconds<br>" : "?  Seconds<br>"));
      }
     
      html1.append("<table border=\"0\" width=\"100%\">");
      html1.append("<tr><td>Object ID</td><td>" + getObjectId() + "</td><td>NPC ID</td><td>" + getTemplate().npcId + "</td></tr>");
      html1.append("<tr><td>Castle</td><td>" + getCastle().getCastleId() + "</td><td>Coords</td><td>" + getX() + "," + getY() + "," + getZ() + "</td></tr>");
      html1.append("<tr><td>Level</td><td>" + getLevel() + "</td><td>Aggro</td><td>" + (this instanceof L2Attackable ? ((L2Attackable) this).getAggroRange() : 0) + "</td></tr>");
      html1.append("</table><br>");
     
      html1.append("<font color=\"LEVEL\">Combat</font>");
      html1.append("<table border=\"0\" width=\"100%\">");
      html1.append("<tr><td>Current HP</td><td>" + getCurrentHp() + "</td><td>Current MP</td><td>" + getCurrentMp() + "</td></tr>");
      html1.append("<tr><td>Max.HP</td><td>" + (int) (getMaxHp() / getStat().calcStat(Stats.MAX_HP, 1, this, null)) + "*" + getStat().calcStat(Stats.MAX_HP, 1, this, null) + "</td><td>Max.MP</td><td>" + getMaxMp() + "</td></tr>");
      html1.append("<tr><td>P.Atk.</td><td>" + getPAtk(null) + "</td><td>M.Atk.</td><td>" + getMAtk(null, null) + "</td></tr>");
      html1.append("<tr><td>P.Def.</td><td>" + getPDef(null) + "</td><td>M.Def.</td><td>" + getMDef(null, null) + "</td></tr>");
      html1.append("<tr><td>Accuracy</td><td>" + getAccuracy() + "</td><td>Evasion</td><td>" + getEvasionRate(null) + "</td></tr>");
      html1.append("<tr><td>Critical</td><td>" + getCriticalHit(null, null) + "</td><td>Speed</td><td>" + getRunSpeed() + "</td></tr>");
      html1.append("<tr><td>Atk.Speed</td><td>" + getPAtkSpd() + "</td><td>Cast.Speed</td><td>" + getMAtkSpd() + "</td></tr>");
      html1.append("</table><br>");
     
      html1.append("<font color=\"LEVEL\">Basic Stats</font>");
      html1.append("<table border=\"0\" width=\"100%\">");
      html1.append("<tr><td>STR</td><td>" + getSTR() + "</td><td>DEX</td><td>" + getDEX() + "</td><td>CON</td><td>" + getCON() + "</td></tr>");
      html1.append("<tr><td>INT</td><td>" + getINT() + "</td><td>WIT</td><td>" + getWIT() + "</td><td>MEN</td><td>" + getMEN() + "</td></tr>");
      html1.append("</table>");
     
      html1.append("<br><center><table><tr><td><button value=\"Edit NPC\" action=\"bypass -h admin_edit_npc " + getTemplate().npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br1></td>");
      html1.append("<td><button value=\"Kill\" action=\"bypass -h admin_kill\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><br1></tr>");
      html1.append("<tr><td><button value=\"Show DropList\" action=\"bypass -h admin_show_droplist " + getTemplate().npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
      html1.append("<td><button value=\"Delete\" action=\"bypass -h admin_delete\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
      html1.append("<tr><td><button value=\"Show Skillist\" action=\"bypass -h admin_show_skilllist_npc " + getTemplate().npcId + "\" width=100 height=20 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td></td></tr>");
      html1.append("</table></center><br>");
      html1.append("</body></html>");
     
      html.setHtml(html1.toString());
      player.sendPacket(html);
      html = null;
      html1 = null;
      className = null;
    }
    else if (Config.ALT_GAME_VIEWNPC)
    {
      // Set the target of the L2PcInstance player
      player.setTarget(this);
     
      // Send a Server->Client packet MyTargetSelected to the L2PcInstance player
      // The player.getLevel() - getLevel() permit to display the correct color in the select window
      MyTargetSelected my = new MyTargetSelected(getObjectId(), player.getLevel() - getLevel());
      player.sendPacket(my);
      my = null;
     
      // Check if the player is attackable (without a forced attack)
      if (isAutoAttackable(player))
      {
        // Send a Server->Client packet StatusUpdate of the L2NpcInstance to the L2PcInstance to update its HP bar
        StatusUpdate su = new StatusUpdate(getObjectId());
        su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
        su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
        player.sendPacket(su);
        su = null;
      }
     
      NpcHtmlMessage html = new NpcHtmlMessage(0);
      TextBuilder html1 = new TextBuilder("<html><body>");
     
      html1.append("<br><center><font color=\"LEVEL\">[Drop Info]</font></center>");
      html1.append("Rates legend: <font color=\"ff0000\">50%+</font> <font color=\"00ff00\">30%+</font> <font color=\"0000ff\">less than 30%</font>");
      html1.append("<table border=0 width=\"100%\">");
     
      for (final L2DropCategory cat : getTemplate().getDropData())
      {
        final FastList<L2DropData> drops = cat.getAllDrops();
        if (drops != null)
          for (final L2DropData drop : drops)
          {
            if (drop == null || ItemTable.getInstance().getTemplate(drop.getItemId()) == null)
            {
              continue;
            }
           
            String name = ItemTable.getInstance().getTemplate(drop.getItemId()).getName();
           
            if (drop.getChance() >= 600000)
            {
              html1.append("<tr><td><font color=\"ff0000\">" + name + "</font></td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
            }
            else if (drop.getChance() >= 300000)
            {
              html1.append("<tr><td><font color=\"00ff00\">" + name + "</font></td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
            }
            else
            {
              html1.append("<tr><td><font color=\"0000ff\">" + name + "</font></td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
            }
          }
      }
     
      html1.append("</table>");
      html1.append("</body></html>");
     
      html.setHtml(html1.toString());
      player.sendPacket(html);
     
      html = null;
      html1 = null;
    }
    else
    // Like L2OFF set the target of the L2PcInstance player
    {
      // Check if the L2PcInstance already target the L2NpcInstance
      if (this != player.getTarget())
      {
        // Set the target of the L2PcInstance player
        player.setTarget(this);
       
        // Check if the player is attackable (without a forced attack)
        if (isAutoAttackable(player))
        {
          // Send a Server->Client packet MyTargetSelected to the L2PcInstance player
          // The player.getLevel() - getLevel() permit to display the correct color in the select window
          MyTargetSelected my = new MyTargetSelected(getObjectId(), player.getLevel() - getLevel());
          player.sendPacket(my);
          my = null;
         
          // Send a Server->Client packet StatusUpdate of the L2NpcInstance to the L2PcInstance to update its HP bar
          StatusUpdate su = new StatusUpdate(getObjectId());
          su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
          su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
          player.sendPacket(su);
          su = null;
        }
        else
        {
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.network.serverpackets.StatusUpdate

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.