radjabov

Untitled

Jan 6th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1.  
  2. package ru.catssoftware.gameserver.network.serverpackets;
  3.  
  4. import ru.catssoftware.gameserver.model.L2ShortCut;
  5.  
  6. /**
  7. *
  8. *
  9. * sample
  10. *
  11. * 56
  12. * 01000000 04000000 dd9fb640 01000000
  13. *
  14. * 56
  15. * 02000000 07000000 38000000 03000000 01000000
  16. *
  17. * 56
  18. * 03000000 00000000 02000000 01000000
  19. *
  20. * format dd d/dd/d d
  21. *
  22. *
  23. * @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
  24. */
  25. public class ShortCutRegister extends L2GameServerPacket {
  26.  
  27. private static final String _S__56_SHORTCUTREGISTER = "[S] 44 ShortCutRegister";
  28. private L2ShortCut _shortcut;
  29.  
  30. /**
  31. * Register new skill shortcut
  32. * @param slot
  33. * @param type
  34. * @param typeId
  35. * @param level
  36. * @param dat2
  37. */
  38. public ShortCutRegister(L2ShortCut shortcut) {
  39. _shortcut = shortcut;
  40. }
  41.  
  42. @Override
  43. protected final void writeImpl() {
  44. writeC(0x44);
  45.  
  46. writeD(_shortcut.getType());
  47. writeD(_shortcut.getSlot() + _shortcut.getPage() * 12); // C4 Client
  48. switch (_shortcut.getType()) {
  49. case L2ShortCut.TYPE_ITEM: //1
  50. writeD(_shortcut.getId());
  51. writeD(_shortcut.getCharacterType());
  52. writeD(-1); // here should be item type
  53. writeD(0x00); // unknown
  54. writeD(0x00); // unknown
  55. writeD(0x00); // item augment id
  56. break;
  57. case L2ShortCut.TYPE_SKILL: //2
  58. writeD(_shortcut.getId());
  59. writeD(_shortcut.getLevel());
  60. writeC(0x00); // C5
  61. writeD(_shortcut.getCharacterType());
  62. break;
  63. default: {
  64. writeD(_shortcut.getId());
  65. writeD(_shortcut.getCharacterType());
  66. }
  67. }
  68. }
  69.  
  70. @Override
  71. public String getType() {
  72. return _S__56_SHORTCUTREGISTER;
  73. }
  74. }
Add Comment
Please, Sign In to add comment