Какой серверный пакет откроет AITimerWnd на клиенте?

LifeGame32

Прославленный
Местный
Сообщения
252
Розыгрыши
0
Решения
5
Репутация
339
Реакции
200
Баллы
1 438
Клиент HF. Какой серверный пакет откроет AITimerWnd на клиенте? Кто знает ? AITimerWnd - таймер
Shot00094.jpg
 
угу я вкурсе. только вот какой пакет должен отправить сервер чтобы открылся данный таймер. вот что я хотел.
и мне кажется это
public class ExBrBroadcastEventState extends L2GameServerPacket
{
private final int _eventId;
private final int _eventState;
private int _param0;
private int _param1;
private int _param2;
private int _param3;
private int _param4;
private String _param5;
private String _param6;

public static final int APRIL_FOOLS = 20090401;
public static final int EVAS_INFERNO = 20090801; // event state (0 - hide, 1 - show), day (1-14), percent (0-100)
public static final int HALLOWEEN_EVENT = 20091031; // event state (0 - hide, 1 - show)
public static final int RAISING_RUDOLPH = 20091225; // event state (0 - hide, 1 - show)
public static final int LOVERS_JUBILEE = 20100214; // event state (0 - hide, 1 - show)

public ExBrBroadcastEventState(int eventId, int eventState)
{
_eventId = eventId;
_eventState = eventState;
}

public ExBrBroadcastEventState(int eventId, int eventState, int param0, int param1, int param2, int param3, int param4, String param5, String param6)
{
_eventId = eventId;
_eventState = eventState;
_param0 = param0;
_param1 = param1;
_param2 = param2;
_param3 = param3;
_param4 = param4;
_param5 = param5;
_param6 = param6;
}

@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0xBC);
writeD(_eventId);
writeD(_eventState);
writeD(_param0);
writeD(_param1);
writeD(_param2);
writeD(_param3);
writeD(_param4);
writeS(_param5);
writeS(_param6);
}
}
_eventId = ???????????????????? хз чему.
 
Вот вам пример:
public void SendUiEventToClient(string msg, int time, bool increase, bool hide)
{
time -= 1; //Поправка на время
var answ = new GameWriter(GameDataToClient);
answ.writeB(PacketList.Server.ExSendUIEvent);
answ.writeD(0);
answ.writeD(hide ? 1 : 0);
answ.writeD(0);
answ.writeD(0);
answ.writeS(increase ? "1" : "0");
answ.writeS(Convert.ToString(time / 60));
answ.writeS(Convert.ToString(time % 60));
answ.writeS("0");
answ.writeS("0");
answ.writeD(-1); //1911120
answ.writeS(msg);
SendToClient(answ.Getpacket());
}
 
Код:
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();
	}
}
Код:
	protected void writeElements()
	{
		writeD(_npcString.getId());

		for (String st : _parameters)
			writeS(st);
	}
З.Ы. структуру править используемые хроники
 
всем спасибо. всё что мне нужно было qwerty123 сказал. можно закрывать тему.
 
Ну если решили отпишите для других, что за привычка
 
Ну если решили отпишите для других, что за привычка
шлём пакет ExSendUIEvent с сервера на клиент
shot00094-jpg.19683
и получаем таймер. вот и всё.
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see < >.
*/
package com.l2jserver.gameserver.network.serverpackets;

import java.util.Arrays;
import java.util.List;

import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;

public class ExSendUIEvent extends L2GameServerPacket
{
private final int _objectId;
private final boolean _type;
private final boolean _countUp;
private final int _startTime;
private final int _endTime;
private final int _npcstringId;
private List<String> _params = null;

/**
* @param player
* @param hide
* @param countUp
* @param startTime
* @param endTime
* @param text
*/
public ExSendUIEvent(L2PcInstance player, boolean hide, boolean countUp, int startTime, int endTime, String text)
{
this(player, hide, countUp, startTime, endTime, -1, text);
}

/**
* @param player
* @param hide
* @param countUp
* @param startTime
* @param endTime
* @param npcString
* @param params
*/
public ExSendUIEvent(L2PcInstance player, boolean hide, boolean countUp, int startTime, int endTime, NpcStringId npcString, String... params)
{
this(player, hide, countUp, startTime, endTime, npcString.getId(), params);
}

/**
* @param player
* @param hide 0 = show, 1 = hide (there is 2 = pause and 3 = resume also but they don't work well you can only pause count down and you cannot resume it because resume hides the counter).
* @param countUp 0 = count down, 1 = count up
* @param startTime
* @param endTime
* @param npcstringId
* @param params
*/
public ExSendUIEvent(L2PcInstance player, boolean hide, boolean countUp, int startTime, int endTime, int npcstringId, String... params)
{
_objectId = player.getObjectId();
_type = hide;
_countUp = countUp;
_startTime = startTime;
_endTime = endTime;
_npcstringId = npcstringId;
_params = Arrays.asList(params);
}

@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x8E);
writeD(_objectId);
writeD(_type ? 1 : 0); // 0 = show, 1 = hide (there is 2 = pause and 3 = resume also but they don't work well you can only pause count down and you cannot resume it because resume hides the counter).
writeD(0);// unknown
writeD(0);// unknown
writeS(_countUp ? "1" : "0"); // 0 = count down, 1 = count up
// timer always disappears 10 seconds before end // Таймер всегда исчезает за 10 секунд до конца
writeS(String.valueOf(_startTime / 60));
writeS(String.valueOf(_startTime % 60));
writeS(String.valueOf(_endTime / 60));
writeS(String.valueOf(_endTime % 60));
writeD(_npcstringId);
if (_params != null)
{
for (String param : _params)
{
writeS(param);
}
}
}
}
 
шлём пакет ExSendUIEvent с сервера на клиент
shot00094-jpg.19683
и получаем таймер. вот и всё.
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see < >.
*/
package com.l2jserver.gameserver.network.serverpackets;

import java.util.Arrays;
import java.util.List;

import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;

public class ExSendUIEvent extends L2GameServerPacket
{
private final int _objectId;
private final boolean _type;
private final boolean _countUp;
private final int _startTime;
private final int _endTime;
private final int _npcstringId;
private List<String> _params = null;

/**
* @param player
* @param hide
* @param countUp
* @param startTime
* @param endTime
* @param text
*/
public ExSendUIEvent(L2PcInstance player, boolean hide, boolean countUp, int startTime, int endTime, String text)
{
this(player, hide, countUp, startTime, endTime, -1, text);
}

/**
* @param player
* @param hide
* @param countUp
* @param startTime
* @param endTime
* @param npcString
* @param params
*/
public ExSendUIEvent(L2PcInstance player, boolean hide, boolean countUp, int startTime, int endTime, NpcStringId npcString, String... params)
{
this(player, hide, countUp, startTime, endTime, npcString.getId(), params);
}

/**
* @param player
* @param hide 0 = show, 1 = hide (there is 2 = pause and 3 = resume also but they don't work well you can only pause count down and you cannot resume it because resume hides the counter).
* @param countUp 0 = count down, 1 = count up
* @param startTime
* @param endTime
* @param npcstringId
* @param params
*/
public ExSendUIEvent(L2PcInstance player, boolean hide, boolean countUp, int startTime, int endTime, int npcstringId, String... params)
{
_objectId = player.getObjectId();
_type = hide;
_countUp = countUp;
_startTime = startTime;
_endTime = endTime;
_npcstringId = npcstringId;
_params = Arrays.asList(params);
}

@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x8E);
writeD(_objectId);
writeD(_type ? 1 : 0); // 0 = show, 1 = hide (there is 2 = pause and 3 = resume also but they don't work well you can only pause count down and you cannot resume it because resume hides the counter).
writeD(0);// unknown
writeD(0);// unknown
writeS(_countUp ? "1" : "0"); // 0 = count down, 1 = count up
// timer always disappears 10 seconds before end // Таймер всегда исчезает за 10 секунд до конца
writeS(String.valueOf(_startTime / 60));
writeS(String.valueOf(_startTime % 60));
writeS(String.valueOf(_endTime / 60));
writeS(String.valueOf(_endTime % 60));
writeD(_npcstringId);
if (_params != null)
{
for (String param : _params)
{
writeS(param);
}
}
}
}
Зачем мне? И выше было сказано и не раз о том же.
 
Последнее редактирование:
Назад
Сверху Снизу