ExCursedWeaponLocation.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 java.util.List;
  17. import com.l2jserver.util.Point3D;
  18. /**
  19. * Format: (ch) d[ddddd]
  20. *
  21. * @author -Wooden-
  22. */
  23. public class ExCursedWeaponLocation extends L2GameServerPacket
  24. {
  25. private static final String _S__FE_46_EXCURSEDWEAPONLOCATION = "[S] FE:47 ExCursedWeaponLocation";
  26. private List<CursedWeaponInfo> _cursedWeaponInfo;
  27. public ExCursedWeaponLocation(List<CursedWeaponInfo> cursedWeaponInfo)
  28. {
  29. _cursedWeaponInfo = cursedWeaponInfo;
  30. }
  31. /**
  32. * @see com.l2jserver.util.network.BaseSendablePacket.ServerBasePacket#writeImpl()
  33. */
  34. @Override
  35. protected void writeImpl()
  36. {
  37. writeC(0xfe);
  38. writeH(0x47);
  39. if(!_cursedWeaponInfo.isEmpty())
  40. {
  41. writeD(_cursedWeaponInfo.size());
  42. for(CursedWeaponInfo w : _cursedWeaponInfo)
  43. {
  44. writeD(w.id);
  45. writeD(w.activated);
  46. writeD(w.pos.getX());
  47. writeD(w.pos.getY());
  48. writeD(w.pos.getZ());
  49. }
  50. }
  51. else
  52. {
  53. writeD(0);
  54. writeD(0);
  55. }
  56. }
  57. /**
  58. * @see com.l2jserver.gameserver.BasePacket#getType()
  59. */
  60. @Override
  61. public String getType()
  62. {
  63. return _S__FE_46_EXCURSEDWEAPONLOCATION;
  64. }
  65. public static class CursedWeaponInfo
  66. {
  67. public Point3D pos;
  68. public int id;
  69. public int activated; //0 - not activated ? 1 - activated
  70. public CursedWeaponInfo(Point3D p, int ID, int status)
  71. {
  72. pos = p;
  73. id = ID;
  74. activated = status;
  75. }
  76. }
  77. }