ExCursedWeaponLocation.java 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (C) 2004-2015 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.network.serverpackets;
  20. import java.util.List;
  21. import com.l2jserver.gameserver.model.Location;
  22. /**
  23. * Format: (ch) d[ddddd]
  24. * @author -Wooden-
  25. */
  26. public class ExCursedWeaponLocation extends L2GameServerPacket
  27. {
  28. private final List<CursedWeaponInfo> _cursedWeaponInfo;
  29. public ExCursedWeaponLocation(List<CursedWeaponInfo> cursedWeaponInfo)
  30. {
  31. _cursedWeaponInfo = cursedWeaponInfo;
  32. }
  33. @Override
  34. protected void writeImpl()
  35. {
  36. writeC(0xfe);
  37. writeH(0x47);
  38. if (!_cursedWeaponInfo.isEmpty())
  39. {
  40. writeD(_cursedWeaponInfo.size());
  41. for (CursedWeaponInfo w : _cursedWeaponInfo)
  42. {
  43. writeD(w.id);
  44. writeD(w.activated);
  45. writeD(w.pos.getX());
  46. writeD(w.pos.getY());
  47. writeD(w.pos.getZ());
  48. }
  49. }
  50. else
  51. {
  52. writeD(0);
  53. writeD(0);
  54. }
  55. }
  56. public static class CursedWeaponInfo
  57. {
  58. public Location pos;
  59. public int id;
  60. public int activated; // 0 - not activated ? 1 - activated
  61. public CursedWeaponInfo(Location p, int ID, int status)
  62. {
  63. pos = p;
  64. id = ID;
  65. activated = status;
  66. }
  67. }
  68. }