Advertisement
Guest User

Untitled

a guest
Dec 27th, 2016
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 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. *
  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 net.sf.l2j.gameserver.network.serverpackets;
  16.  
  17. import java.util.ArrayList;
  18. import java.util.List;
  19.  
  20. import net.sf.l2j.gameserver.model.L2Object;
  21. import net.sf.l2j.gameserver.model.holder.IntIntHolder;
  22.  
  23. /**
  24. * format d d(dd)
  25. */
  26. public class StatusUpdate extends L2GameServerPacket
  27. {
  28. public static final int LEVEL = 0x01;
  29. public static final int EXP = 0x02;
  30. public static final int STR = 0x03;
  31. public static final int DEX = 0x04;
  32. public static final int CON = 0x05;
  33. public static final int INT = 0x06;
  34. public static final int WIT = 0x07;
  35. public static final int MEN = 0x08;
  36.  
  37. public static final int CUR_HP = 0x09;
  38. public static final int MAX_HP = 0x0a;
  39. public static final int CUR_MP = 0x0b;
  40. public static final int MAX_MP = 0x0c;
  41.  
  42. public static final int SP = 0x0d;
  43. public static final int CUR_LOAD = 0x0e;
  44. public static final int MAX_LOAD = 0x0f;
  45.  
  46. public static final int P_ATK = 0x11;
  47. public static final int ATK_SPD = 0x12;
  48. public static final int P_DEF = 0x13;
  49. public static final int EVASION = 0x14;
  50. public static final int ACCURACY = 0x15;
  51. public static final int CRITICAL = 0x16;
  52. public static final int M_ATK = 0x17;
  53. public static final int CAST_SPD = 0x18;
  54. public static final int M_DEF = 0x19;
  55. public static final int PVP_FLAG = 0x1a;
  56. public static final int KARMA = 0x1b;
  57.  
  58. public static final int CUR_CP = 0x21;
  59. public static final int MAX_CP = 0x22;
  60.  
  61. private final int _objectId;
  62. private final List<IntIntHolder> _attributes;
  63.  
  64. public StatusUpdate(L2Object object)
  65. {
  66. _attributes = new ArrayList<>();
  67. _objectId = object.getObjectId();
  68. }
  69.  
  70. public void addAttribute(final int id, final int level)
  71. {
  72. _attributes.add(new IntIntHolder(id, level));
  73. }
  74.  
  75. @Override
  76. protected final void writeImpl()
  77. {
  78. writeC(0x0e);
  79. writeD(_objectId);
  80. writeD(_attributes.size());
  81.  
  82. for (IntIntHolder temp : _attributes)
  83. {
  84. writeD(temp.getId());
  85. writeD(temp.getValue());
  86. }
  87. }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement