GMViewCharacterInfo.java 11 KB

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