ExShowScreenMessage.java 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. /**
  17. * @author Kerberos
  18. *
  19. */
  20. public class ExShowScreenMessage extends L2GameServerPacket
  21. {
  22. private int _type;
  23. private int _sysMessageId;
  24. private int _unk1;
  25. private int _unk2;
  26. private int _unk3;
  27. private int _unk4;
  28. private int _size;
  29. private int _position;
  30. private boolean _effect;
  31. private String _text;
  32. private int _time;
  33. public ExShowScreenMessage (String text, int time)
  34. {
  35. _type = 1;
  36. _sysMessageId = -1;
  37. _unk1 = 0;
  38. _unk2 = 0;
  39. _unk3 = 0;
  40. _unk4 = 0;
  41. _position = 0x02;
  42. _text = text;
  43. _time = time;
  44. _size = 0;
  45. _effect = false;
  46. }
  47. public ExShowScreenMessage (int type, int messageId, int position, int unk1, int size, int unk2, int unk3,boolean showEffect, int time,int unk4, String text)
  48. {
  49. _type = type;
  50. _sysMessageId = messageId;
  51. _unk1 = unk1;
  52. _unk2 = unk2;
  53. _unk3 = unk3;
  54. _unk4 = unk4;
  55. _position = position;
  56. _text = text;
  57. _time = time;
  58. _size = size;
  59. _effect = showEffect;
  60. }
  61. @Override
  62. public String getType()
  63. {
  64. return "[S]FE:39 ExShowScreenMessage";
  65. }
  66. @Override
  67. protected void writeImpl()
  68. {
  69. writeC(0xfe);
  70. writeH(0x39);
  71. writeD(_type); // 0 - system messages, 1 - your defined text
  72. writeD(_sysMessageId); // system message id (_type must be 0 otherwise no effect)
  73. writeD(_position); // message position
  74. writeD(_unk1); // ?
  75. writeD(_size); // font size 0 - normal, 1 - small
  76. writeD(_unk2); // ?
  77. writeD(_unk3); // ?
  78. writeD(_effect == true ? 1 : 0); // upper effect (0 - disabled, 1 enabled) - _position must be 2 (center) otherwise no effect
  79. writeD(_time); // time
  80. writeD(_unk4); // ?
  81. writeS(_text); // your text (_type must be 1, otherwise no effect)
  82. }
  83. }