MagicSkillUse.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.L2Character;
  17. /**
  18. *
  19. * sample
  20. *
  21. * 0000: 5a d8 a8 10 48 d8 a8 10 48 10 04 00 00 01 00 00 Z...H...H.......
  22. * 0010: 00 f0 1a 00 00 68 28 00 00 .....h(..
  23. *
  24. * format dddddd dddh (h)
  25. *
  26. * @version $Revision: 1.4.2.1.2.4 $ $Date: 2005/03/27 15:29:39 $
  27. */
  28. public final class MagicSkillUse extends L2GameServerPacket
  29. {
  30. private static final String _S__5A_MAGICSKILLUSER = "[S] 48 MagicSkillUser";
  31. private int _targetId;
  32. private int _skillId;
  33. private int _skillLevel;
  34. private int _hitTime;
  35. private int _reuseDelay;
  36. private int _charObjId, _x, _y, _z;
  37. public MagicSkillUse(L2Character cha, L2Character target, int skillId, int skillLevel, int hitTime, int reuseDelay)
  38. {
  39. _charObjId = cha.getObjectId();
  40. _targetId = target.getObjectId();
  41. _skillId = skillId;
  42. _skillLevel = skillLevel;
  43. _hitTime = hitTime;
  44. _reuseDelay = reuseDelay;
  45. _x = cha.getX();
  46. _y = cha.getY();
  47. _z = cha.getZ();
  48. }
  49. public MagicSkillUse(L2Character cha, int skillId, int skillLevel, int hitTime, int reuseDelay)
  50. {
  51. _charObjId = cha.getObjectId();
  52. _targetId = cha.getTargetId();
  53. _skillId = skillId;
  54. _skillLevel = skillLevel;
  55. _hitTime = hitTime;
  56. _reuseDelay = reuseDelay;
  57. _x = cha.getX();
  58. _y = cha.getY();
  59. _z = cha.getZ();
  60. }
  61. @Override
  62. protected final void writeImpl()
  63. {
  64. writeC(0x48);
  65. writeD(_charObjId);
  66. writeD(_targetId);
  67. writeD(_skillId);
  68. writeD(_skillLevel);
  69. writeD(_hitTime);
  70. writeD(_reuseDelay);
  71. writeD(_x);
  72. writeD(_y);
  73. writeD(_z);
  74. writeH(0x00); // unknown loop but not AoE
  75. writeH(0x00);
  76. //for()
  77. //{
  78. writeH(0x00);
  79. writeH(0x00);
  80. writeH(0x00);
  81. //}
  82. }
  83. /* (non-Javadoc)
  84. * @see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#getType()
  85. */
  86. @Override
  87. public String getType()
  88. {
  89. return _S__5A_MAGICSKILLUSER;
  90. }
  91. }