GMViewCharacterInfo.java 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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 com.l2jserver.gameserver.model.Elementals;
  17. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  18. import com.l2jserver.gameserver.model.itemcontainer.Inventory;
  19. /**
  20. *
  21. * TODO Add support for Eval. Score
  22. *
  23. * dddddSdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddffffddddSddd rev420
  24. * dddddSdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddffffddddSdddcccddhh rev478
  25. * dddddSdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddffffddddSdddcccddhhddd rev551
  26. * @version $Revision: 1.2.2.2.2.8 $ $Date: 2005/03/27 15:29:39 $
  27. */
  28. public class GMViewCharacterInfo extends L2GameServerPacket
  29. {
  30. private static final String _S__8F_GMVIEWCHARINFO = "[S] 95 GMViewCharacterInfo";
  31. private L2PcInstance _activeChar;
  32. /**
  33. * @param _characters
  34. */
  35. public GMViewCharacterInfo(L2PcInstance character)
  36. {
  37. _activeChar = character;
  38. }
  39. @Override
  40. protected final void writeImpl()
  41. {
  42. float moveMultiplier = _activeChar.getMovementSpeedMultiplier();
  43. int _runSpd = (int) (_activeChar.getRunSpeed() / moveMultiplier);
  44. int _walkSpd = (int) (_activeChar.getWalkSpeed() / moveMultiplier);
  45. writeC(0x95);
  46. writeD(_activeChar.getX());
  47. writeD(_activeChar.getY());
  48. writeD(_activeChar.getZ());
  49. writeD(_activeChar.getHeading());
  50. writeD(_activeChar.getObjectId());
  51. writeS(_activeChar.getName());
  52. writeD(_activeChar.getRace().ordinal());
  53. writeD(_activeChar.getAppearance().getSex()? 1 : 0);
  54. writeD(_activeChar.getClassId().getId());
  55. writeD(_activeChar.getLevel());
  56. writeQ(_activeChar.getExp());
  57. writeD(_activeChar.getSTR());
  58. writeD(_activeChar.getDEX());
  59. writeD(_activeChar.getCON());
  60. writeD(_activeChar.getINT());
  61. writeD(_activeChar.getWIT());
  62. writeD(_activeChar.getMEN());
  63. writeD(_activeChar.getMaxHp());
  64. writeD((int) _activeChar.getCurrentHp());
  65. writeD(_activeChar.getMaxMp());
  66. writeD((int)_activeChar.getCurrentMp());
  67. writeD(_activeChar.getSp());
  68. writeD(_activeChar.getCurrentLoad());
  69. writeD(_activeChar.getMaxLoad());
  70. writeD(_activeChar.getPkKills());
  71. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIRALL));
  72. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_REAR));
  73. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEAR));
  74. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK));
  75. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RFINGER));
  76. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LFINGER));
  77. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HEAD));
  78. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
  79. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LHAND));
  80. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES));
  81. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST));
  82. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS));
  83. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET));
  84. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_BACK));
  85. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LRHAND));
  86. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR));
  87. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR2));
  88. // T1 new D's
  89. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RBRACELET));
  90. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LBRACELET));
  91. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO1));
  92. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO2));
  93. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO3));
  94. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO4));
  95. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO5));
  96. writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO6));
  97. writeD(0); // T3 Unknown
  98. // end of T1 new D's
  99. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIRALL));
  100. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_REAR));
  101. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEAR));
  102. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_NECK));
  103. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RFINGER));
  104. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LFINGER));
  105. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
  106. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
  107. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
  108. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
  109. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
  110. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
  111. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET));
  112. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BACK));
  113. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LRHAND));
  114. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
  115. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR2));
  116. // T1 new D's
  117. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RBRACELET));
  118. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LBRACELET));
  119. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO1));
  120. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO2));
  121. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO3));
  122. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO4));
  123. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO5));
  124. writeD(_activeChar.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_DECO6));
  125. writeD(0); // T3 Unknown
  126. writeD(0); // T3 Unknown
  127. writeD(0); // T3 Unknown
  128. // end of T1 new D's
  129. // c6 new h's
  130. writeH(0x00);
  131. writeH(0x00);
  132. writeH(0x00);
  133. writeH(0x00);
  134. writeH(0x00);
  135. writeH(0x00);
  136. writeH(0x00);
  137. writeH(0x00);
  138. writeH(0x00);
  139. writeH(0x00);
  140. writeH(0x00);
  141. writeH(0x00);
  142. writeH(0x00);
  143. writeH(0x00);
  144. writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND));
  145. writeH(0x00);
  146. writeH(0x00);
  147. writeH(0x00);
  148. writeH(0x00);
  149. writeH(0x00);
  150. writeH(0x00);
  151. writeH(0x00);
  152. writeH(0x00);
  153. writeH(0x00);
  154. writeH(0x00);
  155. writeH(0x00);
  156. writeH(0x00);
  157. writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LRHAND));
  158. writeH(0x00);
  159. writeH(0x00);
  160. writeH(0x00);
  161. writeH(0x00);
  162. // end of c6 new h's
  163. // start of T1 new h's
  164. writeH(0x00);
  165. writeH(0x00);
  166. writeH(0x00);
  167. writeH(0x00);
  168. writeH(0x00);
  169. writeH(0x00);
  170. writeH(0x00);
  171. writeH(0x00);
  172. writeH(0x00);
  173. writeH(0x00);
  174. writeH(0x00);
  175. writeH(0x00);
  176. writeH(0x00);
  177. writeH(0x00);
  178. writeH(0x00);
  179. writeH(0x00);
  180. // end of T1 new h's
  181. writeH(0x00);
  182. writeH(0x00);
  183. writeD(_activeChar.getPAtk(null));
  184. writeD(_activeChar.getPAtkSpd());
  185. writeD(_activeChar.getPDef(null));
  186. writeD(_activeChar.getEvasionRate(null));
  187. writeD(_activeChar.getAccuracy());
  188. writeD(_activeChar.getCriticalHit(null, null));
  189. writeD(_activeChar.getMAtk(null, null));
  190. writeD(_activeChar.getMAtkSpd());
  191. writeD(_activeChar.getPAtkSpd());
  192. writeD(_activeChar.getMDef(null, null));
  193. writeD(_activeChar.getPvpFlag()); // 0-non-pvp 1-pvp = violett name
  194. writeD(_activeChar.getKarma());
  195. writeD(_runSpd);
  196. writeD(_walkSpd);
  197. writeD(_runSpd); // swimspeed
  198. writeD(_walkSpd); // swimspeed
  199. writeD(_runSpd);
  200. writeD(_walkSpd);
  201. writeD(_runSpd);
  202. writeD(_walkSpd);
  203. writeF(moveMultiplier);
  204. writeF(_activeChar.getAttackSpeedMultiplier()); //2.9);//
  205. writeF(_activeChar.getCollisionRadius()); // scale
  206. writeF(_activeChar.getCollisionHeight()); // y offset ??!? fem dwarf 4033
  207. writeD(_activeChar.getAppearance().getHairStyle());
  208. writeD(_activeChar.getAppearance().getHairColor());
  209. writeD(_activeChar.getAppearance().getFace());
  210. writeD(_activeChar.isGM() ? 0x01 : 0x00); // builder level
  211. writeS(_activeChar.getTitle());
  212. writeD(_activeChar.getClanId()); // pledge id
  213. writeD(_activeChar.getClanCrestId()); // pledge crest id
  214. writeD(_activeChar.getAllyId()); // ally id
  215. writeC(_activeChar.getMountType()); // mount type
  216. writeC(_activeChar.getPrivateStoreType());
  217. writeC(_activeChar.hasDwarvenCraft() ? 1 : 0);
  218. writeD(_activeChar.getPkKills());
  219. writeD(_activeChar.getPvpKills());
  220. writeH(_activeChar.getRecomLeft());
  221. writeH(_activeChar.getRecomHave()); //Blue value for name (0 = white, 255 = pure blue)
  222. writeD(_activeChar.getClassId().getId());
  223. writeD(0x00); // special effects? circles around player...
  224. writeD(_activeChar.getMaxCp());
  225. writeD((int) _activeChar.getCurrentCp());
  226. writeC(_activeChar.isRunning() ? 0x01 : 0x00); //changes the Speed display on Status Window
  227. writeC(321);
  228. writeD(_activeChar.getPledgeClass()); //changes the text above CP on Status Window
  229. writeC(_activeChar.isNoble() ? 0x01 : 0x00);
  230. writeC(_activeChar.isHero() ? 0x01 : 0x00);
  231. writeD(_activeChar.getAppearance().getNameColor());
  232. writeD(_activeChar.getAppearance().getTitleColor());
  233. byte attackAttribute = _activeChar.getAttackElement();
  234. writeH(attackAttribute);
  235. writeH(_activeChar.getAttackElementValue(attackAttribute));
  236. writeH(_activeChar.getDefenseElementValue(Elementals.FIRE));
  237. writeH(_activeChar.getDefenseElementValue(Elementals.WATER));
  238. writeH(_activeChar.getDefenseElementValue(Elementals.WIND));
  239. writeH(_activeChar.getDefenseElementValue(Elementals.EARTH));
  240. writeH(_activeChar.getDefenseElementValue(Elementals.HOLY));
  241. writeH(_activeChar.getDefenseElementValue(Elementals.DARK));
  242. writeD(_activeChar.getFame());
  243. writeD(_activeChar.getVitalityPoints());
  244. }
  245. /* (non-Javadoc)
  246. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  247. */
  248. @Override
  249. public String getType()
  250. {
  251. return _S__8F_GMVIEWCHARINFO;
  252. }
  253. }