Guest User

Untitled

a guest
Sep 8th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  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. * This program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  9. * details.
  10. * You should have received a copy of the GNU General Public License along with
  11. * this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. package com.l2jserver.gameserver.network.serverpackets;
  14.  
  15. import java.util.List;
  16.  
  17. import javolution.util.FastList;
  18.  
  19. /**
  20. * sample 0000: 6d 0c 00 00 00 00 00 00 00 03 00 00 00 f3 03 00 m...............
  21. * 0010: 00 00 00 00 00 01 00 00 00 f4 03 00 00 00 00 00 ................ 0020:
  22. * 00 01 00 00 00 10 04 00 00 00 00 00 00 01 00 00 ................ 0030: 00 2c
  23. * 04 00 00 00 00 00 00 03 00 00 00 99 04 00 .,.............. 0040: 00 00 00 00
  24. * 00 02 00 00 00 a0 04 00 00 00 00 00 ................ 0050: 00 01 00 00 00 c0
  25. * 04 00 00 01 00 00 00 01 00 00 ................ 0060: 00 76 00 00 00 01 00 00
  26. * 00 01 00 00 00 a3 00 00 .v.............. 0070: 00 01 00 00 00 01 00 00 00 c2
  27. * 00 00 00 01 00 00 ................ 0080: 00 01 00 00 00 d6 00 00 00 01 00 00
  28. * 00 01 00 00 ................ 0090: 00 f4 00 00 00
  29. * format d (ddd)
  30. *
  31. * @version $Revision: 1.3.2.1.2.5 $ $Date: 2005/03/27 15:29:39 $
  32. */
  33. public final class SkillList extends L2GameServerPacket
  34. {
  35. private static final String _S__6D_SKILLLIST = "[S] 5f SkillList";
  36. private final List<Skill> _skills;
  37.  
  38. static class Skill
  39. {
  40. public int id;
  41. public int level;
  42. public boolean passive;
  43. public boolean disabled;
  44. public boolean enchanted;
  45.  
  46. Skill(final int pId, final int pLevel, final boolean pPassive, final boolean pDisabled, final boolean pEnchanted)
  47. {
  48. id = pId;
  49. level = pLevel;
  50. passive = pPassive;
  51. disabled = pDisabled;
  52. enchanted = pEnchanted;
  53. }
  54. }
  55.  
  56. public SkillList()
  57. {
  58. _skills = new FastList<Skill>();
  59. }
  60.  
  61. public void addSkill(final int id, final int level, final boolean passive, final boolean disabled, final boolean enchanted)
  62. {
  63. _skills.add(new Skill(id, level, passive, disabled, enchanted));
  64. }
  65.  
  66. @Override
  67. protected final void writeImpl()
  68. {
  69. writeC(0x5f);
  70. writeD(_skills.size());
  71. for (final Skill temp : _skills)
  72. {
  73. writeD(temp.passive ? 1 : 0);
  74. writeD(temp.level);
  75. writeD(temp.id);
  76. writeC(temp.disabled ? 1 : 0);
  77. writeC(temp.enchanted ? 1 : 0);
  78. }
  79. }
  80.  
  81. /*
  82. * (non-Javadoc)
  83. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  84. */
  85. @Override
  86. public String getType()
  87. {
  88. return _S__6D_SKILLLIST;
  89. }
  90. }
Add Comment
Please, Sign In to add comment