2
0

ExOlympiadSpelledInfo.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.gameserver.model.actor.instance.L2PcInstance;
  18. import javolution.util.FastList;
  19. /**
  20. * This class ...
  21. *
  22. * @version $Revision: 1.4.2.1.2.3 $ $Date: 2005/03/27 15:29:57 $
  23. *
  24. * @author godson
  25. */
  26. public class ExOlympiadSpelledInfo extends L2GameServerPacket
  27. {
  28. // chdd(dhd)
  29. private static final String _S__FE_2A_OLYMPIADSPELLEDINFO = "[S] FE:7b ExOlympiadSpelledInfo";
  30. private int _playerID;
  31. private List<Effect> _effects;
  32. private class Effect
  33. {
  34. protected int _skillId;
  35. protected int _level;
  36. protected int _duration;
  37. public Effect(int pSkillId, int pLevel, int pDuration)
  38. {
  39. _skillId = pSkillId;
  40. _level = pLevel;
  41. _duration = pDuration;
  42. }
  43. }
  44. public ExOlympiadSpelledInfo(L2PcInstance player)
  45. {
  46. _effects = new FastList<Effect>();
  47. _playerID = player.getObjectId();
  48. }
  49. public void addEffect(int skillId, int level, int duration)
  50. {
  51. _effects.add(new Effect(skillId, level, duration));
  52. }
  53. @Override
  54. protected final void writeImpl()
  55. {
  56. writeC(0xfe);
  57. writeH(0x7b);
  58. writeD(_playerID);
  59. writeD(_effects.size());
  60. for (Effect temp : _effects)
  61. {
  62. writeD(temp._skillId);
  63. writeH(temp._level);
  64. writeD(temp._duration/1000);
  65. }
  66. }
  67. /* (non-Javadoc)
  68. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  69. */
  70. @Override
  71. public String getType()
  72. {
  73. return _S__FE_2A_OLYMPIADSPELLEDINFO;
  74. }
  75. }