Показать сообщение отдельно
Непрочитано 05.08.2015, 07:37   #53
Аватар для Gaikotsu
Герой

По умолчанию Re: Работа над Goddess of Destruction (part 7)

Код:
package l2p.gameserver.network.serverpackets;

import l2p.gameserver.model.Player;
import l2p.gameserver.network.serverpackets.components.NpcString;
import l2p.gameserver.network.serverpackets.components.Opcode;

public class ExSendUIEvent extends NpcStringContainer
{
	public static final int STYLE_TIMER_SHOW = 0;
	public static final int STYLE_TIMER_HIDE = 1;
	public static final int STYLE_BALLISTA_CHARGE = 2;
	public static final int STYLE_COUNTER = 3;
	public static final int STYLE_UNK_4 = 4;
	public static final int STYLE_PROGRESS_BAR = 5;
	public static final int STYLE_TEMPERATURE_1 = 6;
	public static final int STYLE_TEMPERATURE_2 = 7;
	public static final int STYLE_UNK_8 = 8;

	public static final int MODE_NONE = -1;
	public static final int MODE_REMAINING = 0;
	public static final int MODE_ELAPSED = 1;

	private int _objectId;
	private int _style;
	private int _mode;
	private int _value1;
	private int _value2;
	private int _sysStringId1;
	private int _sysStringId2;

	public ExSendUIEvent(Player player, int style, int mode, int value1, int value2, String... params)
	{
		this(player, style, mode, value1, value2, 0, 0, NpcString.NONE, params);
	}

	public ExSendUIEvent(Player player, int style, int mode, int value1, int value2, NpcString npcString, String... params)
	{
		this(player, style, mode, value1, value2, 0, 0, npcString, params);
	}

	public ExSendUIEvent(Player player, int style, int mode, int value1, int value2, int sysStringId1, int sysStringId2, NpcString npcString, String... params)
	{
		super(npcString, params);

		_objectId = player != null ? player.getObjectId() : 0;
		_style = style;
		_mode = mode;
		_value1 = value1;
		_value2 = value2;
		_sysStringId1 = sysStringId1;
		_sysStringId2 = sysStringId2;
	}

	@Override
	protected void writeImpl()
	{
		writeEx(Opcode.ExSendUIEvent);
		writeD(_objectId);
		writeD(_style); // ID timer (any style)
		writeD(0x00); // unknown
		writeD(0x00); // unknown
		writeS(String.valueOf(_mode)); // Name indicator

		if (_mode >= 0 && _style < 6)
		{
			writeS(String.valueOf(_value1 / 60)); // timer starting minute(s)
			writeS(String.valueOf(_value1 % 60)); // timer starting second(s)
			writeS(String.valueOf(_value2 / 60)); // timer length minute(s) (timer will disappear 10 seconds before it ends)
			writeS(String.valueOf(_value2 % 60)); // timer length second(s) (timer will disappear 10 seconds before it ends)
		}
		else
		{
			writeS(String.valueOf(_value1));
			writeS(String.valueOf(_value2));
			writeS(String.valueOf(_sysStringId1));
			writeS(String.valueOf(_sysStringId2));
		}

		writeElements();
	}
}
Gaikotsu вне форума Ответить с цитированием
Сказали спасибо: