Advertisement
Deedlit

ExShowScreenMessage epilogue

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