MyTargetSelected.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver.gameserver.network.serverpackets;
  16. /**
  17. *
  18. * <p>
  19. * sample bf 73 5d 30 49 01 00
  20. * <p>
  21. * format dh (objectid, color)
  22. * <p>
  23. * color -xx -> -9 red<p>
  24. * -8 -> -6 light-red<p>
  25. * -5 -> -3 yellow<p>
  26. * -2 -> 2 white<p>
  27. * 3 -> 5 green<p>
  28. * 6 -> 8 light-blue<p>
  29. * 9 -> xx blue<p>
  30. * <p>
  31. * usually the color equals the level difference to the selected target
  32. *
  33. * @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
  34. */
  35. public class MyTargetSelected extends L2GameServerPacket
  36. {
  37. private static final String _S__BF_MYTARGETSELECTED = "[S] b9 MyTargetSelected";
  38. private int _objectId;
  39. private int _color;
  40. /**
  41. * @param int objectId of the target
  42. * @param int level difference to the target. name color is calculated from that
  43. */
  44. public MyTargetSelected(int objectId, int color)
  45. {
  46. _objectId = objectId;
  47. _color = color;
  48. }
  49. @Override
  50. protected final void writeImpl()
  51. {
  52. writeC(0xb9);
  53. writeD(_objectId);
  54. writeH(_color);
  55. writeD(0x00);
  56. }
  57. /* (non-Javadoc)
  58. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  59. */
  60. @Override
  61. public String getType()
  62. {
  63. return _S__BF_MYTARGETSELECTED;
  64. }
  65. }