Selaa lähdekoodia

just some event packets

janiii 15 vuotta sitten
vanhempi
sitoutus
688a4e5dab

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/L2GamePacketHandler.java

@@ -1066,7 +1066,7 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
 		                    	// BrRecentProductList
 		                    	break;
 		                    case 0x7d:
-		                    	// BrEventRankerList
+		                    	msg = new BrEventRankerList();
 		                    	break;
 		                    case 0x7e:
 		                    	// BrMinigameLoadScores

+ 64 - 0
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/BrEventRankerList.java

@@ -0,0 +1,64 @@
+/*
+ * This program 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.
+ * 
+ * This program 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 <http://www.gnu.org/licenses/>.
+ */
+package com.l2jserver.gameserver.network.clientpackets;
+
+import com.l2jserver.gameserver.network.serverpackets.ExBrLoadEventTopRankers;
+
+/**
+ * Halloween rank list client packet.
+ * 
+ * Format: (ch)ddd
+ *
+ */
+public class BrEventRankerList extends L2GameClientPacket
+{
+	private int _eventId;
+	private int _day;
+	private int _ranking;
+	
+	/* (non-Javadoc)
+	 * @see com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket#getType()
+	 */
+	@Override
+	public String getType()
+	{
+		return "[C] D0:7D BrEventRankerList";
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket#readImpl()
+	 */
+	@Override
+	protected void readImpl()
+	{
+		_eventId = readD();
+		_day = readD(); // 0 - current, 1 - previous
+		_ranking = readD();
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket#runImpl()
+	 */
+	@Override
+	protected void runImpl()
+	{
+		// TODO count, bestScore, myScore
+		int count = 0;
+		int bestScore = 0;
+		int myScore = 0;
+		getClient().sendPacket(new ExBrLoadEventTopRankers(_eventId, _day, count, bestScore, myScore));
+	}
+	
+}

+ 36 - 19
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/ExBrBroadcastEventState.java

@@ -14,29 +14,49 @@
  */
 package com.l2jserver.gameserver.network.serverpackets;
 
-
 /**
+ * Special event info packet.
  * @author Kerberos
  * @author mrTJO
- * Packet Format: dddddddSS
+ * Format: (ch)dddddddSS
  */
 public class ExBrBroadcastEventState extends L2GameServerPacket
 {
 	private int _eventId;
 	private 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;
-	public static final int HALLOWEEN_EVENT = 20091031;
-	public static final int RAISING_RUDOLPH = 20091225;
-	public static final int LOVERS_JUBILEE = 20100214;
-
+	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()
 	{
@@ -44,18 +64,15 @@ public class ExBrBroadcastEventState extends L2GameServerPacket
 		writeH(0xbd);
 		writeD(_eventId);
 		writeD(_eventState);
-		// Parameters
-		writeD(0x00);
-		writeD(0x00);
-		writeD(0x00);
-		writeD(0x00);
-		writeD(0x00);
-		writeD(0x00);
-		writeD(0x00);
-		writeS(null);
-		writeS(null);
+		writeD(_param0);
+		writeD(_param1);
+		writeD(_param2);
+		writeD(_param3);
+		writeD(_param4);
+		writeS(_param5);
+		writeS(_param6);
 	}
-
+	
 	/* (non-Javadoc)
 	 * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
 	 */

+ 60 - 0
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/ExBrBuffEventState.java

@@ -0,0 +1,60 @@
+/*
+ * This program 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.
+ * 
+ * This program 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 <http://www.gnu.org/licenses/>.
+ */
+package com.l2jserver.gameserver.network.serverpackets;
+
+/**
+ * Eva's Inferno event packet.
+ * Format: (ch)dddd // time info params: type (1 - %, 2 - npcId), value (depending on type: for type 1 - % value; for type 2 - 20573-20575), state (0-1), endtime (only when type 2)
+ *
+ */
+public class ExBrBuffEventState extends L2GameServerPacket
+{
+	private int _type; // 1 - %, 2 - npcId
+	private int _value; // depending on type: for type 1 - % value; for type 2 - 20573-20575
+	private int _state; // 0-1
+	private int _endtime; // only when type 2 as unix time in seconds from 1970
+	
+	public ExBrBuffEventState(int type, int value, int state, int endtime)
+	{
+		_type = type;
+		_value = value;
+		_state = state;
+		_endtime = endtime;
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#getType()
+	 */
+	@Override
+	public String getType()
+	{
+		return "[S] FE:BF ExBrBuffEventState";
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#writeImpl()
+	 */
+	@Override
+	protected void writeImpl()
+	{
+		writeC(0xfe);
+		writeH(0xbf);
+		writeD(_type);
+		writeD(_value);
+		writeD(_state);
+		writeD(_endtime);
+	}
+	
+}

+ 63 - 0
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/ExBrLoadEventTopRankers.java

@@ -0,0 +1,63 @@
+/*
+ * This program 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.
+ * 
+ * This program 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 <http://www.gnu.org/licenses/>.
+ */
+package com.l2jserver.gameserver.network.serverpackets;
+
+/**
+ * Halloween rank list server packet.
+ * 
+ * Format: (ch)ddddd
+ */
+public class ExBrLoadEventTopRankers extends L2GameServerPacket
+{
+	private int _eventId;
+	private int _day;
+	private int _count;
+	private int _bestScore;
+	private int _myScore;
+	
+	public ExBrLoadEventTopRankers(int eventId, int day, int count, int bestScore, int myScore)
+	{
+		_eventId = eventId;
+		_day = day;
+		_count = count;
+		_bestScore = bestScore;
+		_myScore = myScore;
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#writeImpl()
+	 */
+	@Override
+	protected final void writeImpl()
+	{
+		writeC(0xfe);
+		writeH(0xc1);
+		writeD(_eventId);
+		writeD(_day);
+		writeD(_count);
+		writeD(_bestScore);
+		writeD(_myScore);
+		
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
+	 */
+	@Override
+	public String getType()
+	{
+		return "[S] FE:C1 ExBrLoadEventTopRankers";
+	}
+}