MonRaceInfo.java 2.2 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 com.l2jserver.gameserver.model.actor.L2Npc;
  21. public class MonRaceInfo extends L2GameServerPacket
  22. {
  23. private final int _unknown1;
  24. private final int _unknown2;
  25. private final L2Npc[] _monsters;
  26. private final int[][] _speeds;
  27. public MonRaceInfo(int unknown1, int unknown2, L2Npc[] monsters, int[][] speeds)
  28. {
  29. /*
  30. * -1 0 to initial the race 0 15322 to start race 13765 -1 in middle of race -1 0 to end the race
  31. */
  32. _unknown1 = unknown1;
  33. _unknown2 = unknown2;
  34. _monsters = monsters;
  35. _speeds = speeds;
  36. }
  37. @Override
  38. protected final void writeImpl()
  39. {
  40. writeC(0xe3);
  41. writeD(_unknown1);
  42. writeD(_unknown2);
  43. writeD(0x08);
  44. for (int i = 0; i < 8; i++)
  45. {
  46. writeD(_monsters[i].getObjectId()); // npcObjectID
  47. writeD(_monsters[i].getTemplate().getId() + 1000000); // npcID
  48. writeD(14107); // origin X
  49. writeD(181875 + (58 * (7 - i))); // origin Y
  50. writeD(-3566); // origin Z
  51. writeD(12080); // end X
  52. writeD(181875 + (58 * (7 - i))); // end Y
  53. writeD(-3566); // end Z
  54. writeF(_monsters[i].getTemplate().getfCollisionHeight()); // coll. height
  55. writeF(_monsters[i].getTemplate().getfCollisionRadius()); // coll. radius
  56. writeD(120); // ?? unknown
  57. for (int j = 0; j < 20; j++)
  58. {
  59. if (_unknown1 == 0)
  60. {
  61. writeC(_speeds[i][j]);
  62. }
  63. else
  64. {
  65. writeC(0x00);
  66. }
  67. }
  68. writeD(0x00);
  69. writeD(0x00); // CT2.3 special effect
  70. }
  71. }
  72. }