NewCharacterSuccess.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. import java.util.List;
  17. import com.l2jserver.gameserver.templates.chars.L2PcTemplate;
  18. import javolution.util.FastList;
  19. /**
  20. * This class ...
  21. *
  22. * @version $Revision: 1.3.2.1.2.7 $ $Date: 2005/03/27 15:29:39 $
  23. */
  24. public class NewCharacterSuccess extends L2GameServerPacket
  25. {
  26. // dddddddddddddddddddd
  27. private static final String _S__23_CHARTEMPLATES = "[S] 0d CharTemplates";
  28. private List<L2PcTemplate> _chars = new FastList<L2PcTemplate>();
  29. public NewCharacterSuccess()
  30. {
  31. }
  32. public void addChar(L2PcTemplate template)
  33. {
  34. _chars.add(template);
  35. }
  36. @Override
  37. protected final void writeImpl()
  38. {
  39. writeC(0x0d);
  40. writeD(_chars.size());
  41. for (L2PcTemplate temp : _chars)
  42. {
  43. if (temp == null)
  44. continue;
  45. writeD(temp.race.ordinal());
  46. writeD(temp.classId.getId());
  47. writeD(0x46);
  48. writeD(temp.baseSTR);
  49. writeD(0x0a);
  50. writeD(0x46);
  51. writeD(temp.baseDEX);
  52. writeD(0x0a);
  53. writeD(0x46);
  54. writeD(temp.baseCON);
  55. writeD(0x0a);
  56. writeD(0x46);
  57. writeD(temp.baseINT);
  58. writeD(0x0a);
  59. writeD(0x46);
  60. writeD(temp.baseWIT);
  61. writeD(0x0a);
  62. writeD(0x46);
  63. writeD(temp.baseMEN);
  64. writeD(0x0a);
  65. }
  66. }
  67. /* (non-Javadoc)
  68. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  69. */
  70. @Override
  71. public String getType()
  72. {
  73. return _S__23_CHARTEMPLATES;
  74. }
  75. }