Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. /*
  2. * Copyright (C) 2004-2015 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.network.serverpackets;
  20.  
  21. import java.util.ArrayList;
  22. import java.util.List;
  23.  
  24. public final class SkillList extends L2GameServerPacket
  25. {
  26. private final List<Skill> _skills = new ArrayList<>();
  27.  
  28. static class Skill
  29. {
  30. public int id;
  31. public int level;
  32. public boolean passive;
  33. public boolean disabled;
  34. public boolean enchanted;
  35.  
  36. Skill(int pId, int pLevel, boolean pPassive, boolean pDisabled, boolean pEnchanted)
  37. {
  38. id = pId;
  39. level = pLevel;
  40. passive = pPassive;
  41. disabled = pDisabled;
  42. enchanted = pEnchanted;
  43. }
  44. }
  45.  
  46. public void addSkill(int id, int level, boolean passive, boolean disabled, boolean enchanted)
  47. {
  48. _skills.add(new Skill(id, level, passive, disabled, enchanted));
  49. }
  50.  
  51. @Override
  52. protected final void writeImpl()
  53. {
  54. writeC(0x5F);
  55. writeD(_skills.size());
  56.  
  57. for (Skill temp : _skills)
  58. {
  59. writeD(temp.passive ? 1 : 0);
  60. writeD(temp.level);
  61. writeD(temp.id);
  62. writeC(temp.disabled ? 1 : 0);
  63. writeC(temp.enchanted ? 1 : 0);
  64. }
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement