Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java (working copy)
- @@ -0,0 +1,55 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.handler.BypassHandler;
- +import org.l2jmobius.gameserver.handler.IBypassHandler;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +
- +/**
- + * format ch c: (id) 0xD0 h: (subid) 0x13
- + * @author -Wooden-
- + */
- +public class RequestOlympiadMatchList implements IClientIncomingPacket
- +{
- + private static final String COMMAND = "arenalist";
- +
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if ((player == null) || !player.inObserverMode())
- + {
- + return;
- + }
- +
- + final IBypassHandler handler = BypassHandler.getInstance().getHandler(COMMAND);
- + if (handler != null)
- + {
- + handler.useBypass(COMMAND, player, null);
- + }
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java (working copy)
- @@ -0,0 +1,43 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadMatchMakingResult implements IClientOutgoingPacket
- +{
- + private final int _cGameRuleType;
- + private final int _type;
- +
- + public ExOlympiadMatchMakingResult(Player player, int cGameRuleType, int type)
- + {
- + _cGameRuleType = 0;
- + _type = type;
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
- + packet.writeC(_type);
- + packet.writeD(_cGameRuleType);
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java (working copy)
- @@ -0,0 +1,53 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadMatchInfo implements IClientOutgoingPacket
- +{
- + private final String _szTeam1Name;
- + private final String _szTeam2Name;
- + private final int _nTeam1WinCount;
- + private final int _nTeam2WinCount;
- + private final int _round;
- +
- + public ExOlympiadMatchInfo(String szTeam1Name, String szTeam2Name, int nTeam1WinCount, int nTeam2WinCount, int round)
- + {
- + _szTeam1Name = szTeam1Name;
- + _szTeam2Name = szTeam2Name;
- + _nTeam1WinCount = nTeam1WinCount;
- + _nTeam2WinCount = nTeam2WinCount;
- + _round = round;
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
- +
- + packet.writeS(String.format("%1$-" + 23 + "s", _szTeam2Name)); // Name 2
- + packet.writeD(_nTeam2WinCount); // Wins 2
- + packet.writeS(String.format("%1$-" + 23 + "s", _szTeam1Name)); // Name 1
- + packet.writeD(_nTeam1WinCount); // Wins 1
- + packet.writeD(_round); // Round
- + packet.writeD(100); // Seconds
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java (working copy)
- @@ -0,0 +1,32 @@
- +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
- +
- +public class OlympiadMatchMaking implements IClientIncomingPacket
- +{
- +
- + private byte _cGameRuleType;
- +
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- +
- + player.sendPacket(new ExOlympiadMatchMakingResult(player, _cGameRuleType, 1));
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java (working copy)
- @@ -0,0 +1,32 @@
- +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
- +
- +public class OlympiadMatchMakingCancel implements IClientIncomingPacket
- +{
- +
- + private byte _cGameRuleType;
- +
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- +
- + player.sendPacket(new ExOlympiadMatchMakingResult(player, _cGameRuleType, 0));
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java (working copy)
- @@ -0,0 +1,48 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
- +
- +public class OlympiadUI implements IClientIncomingPacket
- +{
- + private byte _cGameRuleType;
- + private int _type;
- +
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
- + _type = packet.readD();
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- + player.sendPacket(new ExOlympiadRecord(player, _cGameRuleType, _type));
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java (working copy)
- @@ -0,0 +1,48 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
- +
- +/**
- + * Format: (ch)d d: unknown (always 0?)
- + * @author mrTJO
- + */
- +public class RequestExOlympiadMatchListRefresh implements IClientIncomingPacket
- +{
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- +
- + player.sendPacket(new ExOlympiadMatchList());
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java (working copy)
- @@ -0,0 +1,55 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.handler.BypassHandler;
- +import org.l2jmobius.gameserver.handler.IBypassHandler;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +
- +/**
- + * format ch c: (id) 0xD0 h: (subid) 0x13
- + * @author -Wooden-
- + */
- +public class RequestOlympiadMatchList implements IClientIncomingPacket
- +{
- + private static final String COMMAND = "arenalist";
- +
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if ((player == null) || !player.inObserverMode())
- + {
- + return;
- + }
- +
- + final IBypassHandler handler = BypassHandler.getInstance().getHandler(COMMAND);
- + if (handler != null)
- + {
- + handler.useBypass(COMMAND, player, null);
- + }
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java (working copy)
- @@ -0,0 +1,50 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +
- +/**
- + * format ch c: (id) 0xD0 h: (subid) 0x12
- + * @author -Wooden-
- + */
- +public class RequestOlympiadObserverEnd implements IClientIncomingPacket
- +{
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- +
- + if (player.inObserverMode())
- + {
- + player.leaveOlympiadObserverMode();
- + }
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java (working copy)
- @@ -0,0 +1,32 @@
- +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
- +
- +public class OlympiadMatchMakingCancel implements IClientIncomingPacket
- +{
- +
- + private byte _cGameRuleType;
- +
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- +
- + player.sendPacket(new ExOlympiadMatchMakingResult(player, _cGameRuleType, 0));
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java (working copy)
- @@ -0,0 +1,37 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadMatchInfoEnd implements IClientOutgoingPacket
- +{
- +
- + public ExOlympiadMatchInfoEnd()
- + {
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
- +
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java (working copy)
- @@ -0,0 +1,48 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
- +
- +/**
- + * Format: (ch)d d: unknown (always 0?)
- + * @author mrTJO
- + */
- +public class RequestExOlympiadMatchListRefresh implements IClientIncomingPacket
- +{
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- +
- + player.sendPacket(new ExOlympiadMatchList());
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/ExIncomingPackets.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/network/ExIncomingPackets.java (working copy)
- @@ -122,6 +122,12 @@
- import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
- import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorCancel;
- import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorList;
- +import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMaking;
- +import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMakingCancel;
- +import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadUI;
- +import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestExOlympiadMatchListRefresh;
- +import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadMatchList;
- +import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadObserverEnd;
- import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyList;
- import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyListOnlyLoc;
- import org.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeAnnounce;
- @@ -553,8 +559,8 @@
- EX_PAYBACK_LIST(0x175, null, ConnectionState.IN_GAME),
- EX_PAYBACK_GIVE_REWARD(0x176, null, ConnectionState.IN_GAME),
- EX_AUTOPLAY_SETTING(0x177, ExAutoPlaySetting::new, ConnectionState.IN_GAME),
- - EX_OLYMPIAD_MATCH_MAKING(0x178, null, ConnectionState.IN_GAME),
- - EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, null, ConnectionState.IN_GAME),
- + EX_OLYMPIAD_MATCH_MAKING(0x178, OlympiadMatchMaking::new, ConnectionState.IN_GAME),
- + EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, OlympiadMatchMakingCancel::new, ConnectionState.IN_GAME),
- EX_FESTIVAL_BM_INFO(0x17A, null, ConnectionState.IN_GAME),
- EX_FESTIVAL_BM_GAME(0x17B, null, ConnectionState.IN_GAME),
- EX_GACHA_SHOP_INFO(0x17C, null, ConnectionState.IN_GAME),
- @@ -593,7 +599,7 @@
- EX_CRAFT_RANDOM_MAKE(0x19D, null, ConnectionState.IN_GAME),
- EX_MULTI_SELL_LIST(0x19E, null, ConnectionState.IN_GAME),
- EX_SAVE_ITEM_ANNOUNCE_SETTING(0x19F, null, ConnectionState.IN_GAME),
- - EX_OLYMPIAD_UI(0x1A0, null, ConnectionState.IN_GAME),
- + EX_OLYMPIAD_UI(0x1A0, OlympiadUI::new, ConnectionState.IN_GAME),
- // 270
- EX_SHARED_POSITION_SHARING_UI(0x1A1, null, ConnectionState.IN_GAME),
- EX_SHARED_POSITION_TELEPORT_UI(0x1A2, null, ConnectionState.IN_GAME),
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java (working copy)
- @@ -0,0 +1,92 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import java.util.ArrayList;
- +import java.util.List;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.olympiad.AbstractOlympiadGame;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameClassed;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNonClassed;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author mrTJO
- + */
- +public class ExOlympiadMatchList implements IClientOutgoingPacket
- +{
- + private final List<OlympiadGameTask> _games = new ArrayList<>();
- +
- + public ExOlympiadMatchList()
- + {
- + OlympiadGameTask task;
- + for (int i = 0; i < OlympiadGameManager.getInstance().getNumberOfStadiums(); i++)
- + {
- + task = OlympiadGameManager.getInstance().getOlympiadTask(i);
- + if (task != null)
- + {
- + if (!task.isGameStarted() || task.isBattleFinished())
- + {
- + continue; // initial or finished state not shown
- + }
- + _games.add(task);
- + }
- + }
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
- +
- + packet.writeD(0); // Type 0 = Match List, 1 = Match Result
- +
- + packet.writeD(_games.size());
- + packet.writeD(0);
- +
- + for (OlympiadGameTask curGame : _games)
- + {
- + final AbstractOlympiadGame game = curGame.getGame();
- + if (game != null)
- + {
- + packet.writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
- +
- + if (game instanceof OlympiadGameNonClassed)
- + {
- + packet.writeD(1);
- + }
- + else if (game instanceof OlympiadGameClassed)
- + {
- + packet.writeD(2);
- + }
- + else
- + {
- + packet.writeD(0);
- + }
- +
- + packet.writeD(curGame.isRunning() ? 2 : 1); // (1 = Standby, 2 = Playing)
- + packet.writeS(game.getPlayerNames()[0]); // Player 1 Name
- + packet.writeS(game.getPlayerNames()[1]); // Player 2 Name
- + }
- + }
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java (working copy)
- @@ -32,10 +32,10 @@
- import org.l2jmobius.gameserver.model.zone.ZoneId;
- import org.l2jmobius.gameserver.model.zone.type.OlympiadStadiumZone;
- import org.l2jmobius.gameserver.network.SystemMessageId;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
- import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
- /**
- * @author JIV
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java (working copy)
- @@ -0,0 +1,46 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author godson
- + */
- +public class ExOlympiadMode implements IClientOutgoingPacket
- +{
- + private final int _mode;
- +
- + /**
- + * @param mode (0 = return, 3 = spectate)
- + */
- + public ExOlympiadMode(int mode)
- + {
- + _mode = mode;
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_MODE.writeId(packet);
- +
- + packet.writeC(_mode);
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -55,6 +55,7 @@
- import org.l2jmobius.gameserver.model.item.instance.Item;
- import org.l2jmobius.gameserver.model.item.type.EtcItemType;
- import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
- +import org.l2jmobius.gameserver.model.olympiad.Olympiad;
- import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
- import org.l2jmobius.gameserver.model.punishment.PunishmentType;
- import org.l2jmobius.gameserver.model.quest.Quest;
- @@ -121,6 +122,7 @@
- import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusReady;
- import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExShowHomunculusBirthInfo;
- import org.l2jmobius.gameserver.network.serverpackets.limitshop.ExBloodyCoinCount;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
- import org.l2jmobius.gameserver.util.BuilderUtil;
- /**
- @@ -643,6 +645,12 @@
- player.sendMessage("Experience gain is disabled.");
- }
- + // Send packet that olympiad is opened.
- + if (Config.ALT_OLY_ENABLE_OLYMPIAD && Olympiad.getInstance().inCompPeriod())
- + {
- + player.sendPacket(new ExOlympiadInfo(player, 1));
- + }
- +
- player.updateSymbolSealSkills();
- player.broadcastUserInfo();
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java (working copy)
- @@ -0,0 +1,84 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import java.util.ArrayList;
- +import java.util.List;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.model.skill.BuffInfo;
- +import org.l2jmobius.gameserver.model.skill.Skill;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author godson
- + */
- +public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
- +{
- + private final int _playerId;
- + private final List<BuffInfo> _effects = new ArrayList<>();
- + private final List<Skill> _effects2 = new ArrayList<>();
- +
- + public ExOlympiadSpelledInfo(Player player)
- + {
- + _playerId = player.getObjectId();
- + }
- +
- + public void addSkill(BuffInfo info)
- + {
- + _effects.add(info);
- + }
- +
- + public void addSkill(Skill skill)
- + {
- + _effects2.add(skill);
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_SPELLED_INFO.writeId(packet);
- +
- + packet.writeD(_playerId);
- + packet.writeD(_effects.size() + _effects2.size());
- + for (BuffInfo info : _effects)
- + {
- + if ((info != null) && info.isInUse())
- + {
- + packet.writeD(info.getSkill().getDisplayId());
- + packet.writeH(info.getSkill().getDisplayLevel());
- + packet.writeH(0x00); // Sub level
- + packet.writeD(info.getSkill().getAbnormalType().getClientId());
- + writeOptionalD(packet, info.getSkill().isAura() ? -1 : info.getTime());
- + }
- + }
- + for (Skill skill : _effects2)
- + {
- + if (skill != null)
- + {
- + packet.writeD(skill.getDisplayId());
- + packet.writeH(skill.getDisplayLevel());
- + packet.writeH(0x00); // Sub level
- + packet.writeD(skill.getAbnormalType().getClientId());
- + packet.writeH(-1);
- + }
- + }
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/model/actor/Player.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/model/actor/Player.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/model/actor/Player.java (working copy)
- @@ -307,7 +307,6 @@
- import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
- import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip;
- import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
- import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCoinInfo;
- import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
- import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
- @@ -364,6 +363,7 @@
- import org.l2jmobius.gameserver.network.serverpackets.commission.ExResponseCommissionInfo;
- import org.l2jmobius.gameserver.network.serverpackets.friend.FriendStatus;
- import org.l2jmobius.gameserver.network.serverpackets.limitshop.ExBloodyCoinCount;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
- import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
- import org.l2jmobius.gameserver.taskmanager.AutoPlayTaskManager;
- import org.l2jmobius.gameserver.taskmanager.AutoUseTaskManager;
- Index: java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java (working copy)
- @@ -36,10 +36,10 @@
- import org.l2jmobius.gameserver.model.events.impl.olympiad.OnOlympiadMatchResult;
- import org.l2jmobius.gameserver.model.instancezone.Instance;
- import org.l2jmobius.gameserver.network.SystemMessageId;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchResult;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
- import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchResult;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
- /**
- * @author GodKratos, Pere, DS
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java (working copy)
- @@ -0,0 +1,48 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
- +
- +public class OlympiadUI implements IClientIncomingPacket
- +{
- + private byte _cGameRuleType;
- + private int _type;
- +
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
- + _type = packet.readD();
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- + player.sendPacket(new ExOlympiadRecord(player, _cGameRuleType, _type));
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/GameServer.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/GameServer.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/GameServer.java (working copy)
- @@ -354,8 +354,15 @@
- InstanceManager.getInstance();
- printSection("Olympiad");
- - Olympiad.getInstance();
- - Hero.getInstance();
- + if (Config.ALT_OLY_ENABLE_OLYMPIAD)
- + {
- + Olympiad.getInstance();
- + Hero.getInstance();
- + }
- + else
- + {
- + printSection("Olympiad is disabled.");
- + }
- // Call to load caches
- printSection("Cache");
- Index: java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java (working copy)
- @@ -39,11 +39,11 @@
- import org.l2jmobius.gameserver.model.siege.Fort;
- import org.l2jmobius.gameserver.model.skill.Skill;
- import org.l2jmobius.gameserver.network.SystemMessageId;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
- import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
- import org.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
- import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
- /**
- * @author godson, GodKratos, Pere, DS
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java (working copy)
- @@ -0,0 +1,43 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadInfo implements IClientOutgoingPacket
- +{
- + private static int _open;
- +
- + public ExOlympiadInfo(Player player, int open)
- + {
- + _open = open;
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
- + packet.writeC(_open); // bOpen
- + packet.writeD(0); // nRemainTime
- + packet.writeC(1); // cGameRuleType
- +
- + return true;
- + }
- +}
- Index: dist/game/config/Olympiad.ini
- ===================================================================
- --- dist/game/config/Olympiad.ini (revision 10239)
- +++ dist/game/config/Olympiad.ini (working copy)
- @@ -9,6 +9,10 @@
- # Also please understand what you are changing before you do so on a live server.
- # ---------------------------------------------------------------------------
- +# Enable/Disable Olympiad
- +# Default: True
- +AltOlyEnableOlympiad = True
- +
- # Olympiad Start Time in Military hours Default 8pm (20)
- # Default: 20
- AltOlyStartTime = 20
- @@ -22,9 +26,9 @@
- # Default: 14400000
- AltOlyCPeriod = 14400000
- -# Olympiad Battle Period, Default 5 minutes.
- -# Default: 300000
- -AltOlyBattle = 300000
- +# Olympiad Battle Period, Default 100 seconds.
- +# Default: 100000
- +AltOlyBattle = 100000
- # Olympiad Weekly Period, Default 1 week
- # Used for adding points to nobles
- @@ -36,13 +40,9 @@
- AltOlyVPeriod = 86400000
- # Points for reaching Noblesse for the first time
- -# Default: 10
- -AltOlyStartPoints = 10
- +# Default: 1000
- +AltOlyStartPoints = 1000
- -# Points every week
- -# Default: 10
- -AltOlyWeeklyPoints = 10
- -
- # Required number of participants for the class based games
- # Default: 20
- AltOlyClassedParticipants = 20
- @@ -133,8 +133,8 @@
- AltOlyDividerNonClassed = 5
- # Maximum number of matches a Noblesse character can join per week
- -# Default: 30
- -AltOlyMaxWeeklyMatches = 30
- +# Default: 25
- +AltOlyMaxWeeklyMatches = 25
- # Enable competitions only on specific days. Usage: 1,2,3,4,5,6,7 (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY)
- # Default: 6,7 (FRIDAY,SATURDAY)
- Index: java/org/l2jmobius/gameserver/model/EffectList.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/model/EffectList.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/model/EffectList.java (working copy)
- @@ -47,9 +47,9 @@
- import org.l2jmobius.gameserver.model.skill.SkillBuffType;
- import org.l2jmobius.gameserver.network.serverpackets.AbnormalStatusUpdate;
- import org.l2jmobius.gameserver.network.serverpackets.ExAbnormalStatusUpdateFromTarget;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadSpelledInfo;
- import org.l2jmobius.gameserver.network.serverpackets.PartySpelled;
- import org.l2jmobius.gameserver.network.serverpackets.ShortBuffStatusUpdate;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadSpelledInfo;
- /**
- * Effect lists.<br>
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java (working copy)
- @@ -0,0 +1,32 @@
- +package org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
- +
- +public class OlympiadMatchMaking implements IClientIncomingPacket
- +{
- +
- + private byte _cGameRuleType;
- +
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + _cGameRuleType = (byte) packet.readC(); // _cGameRuleType
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- +
- + player.sendPacket(new ExOlympiadMatchMakingResult(player, _cGameRuleType, 1));
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java (working copy)
- @@ -0,0 +1,69 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import java.util.Calendar;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.model.olympiad.Olympiad;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadRecord implements IClientOutgoingPacket
- +{
- + private final Player _player;
- + private final int _cGameRuleType;
- + private final int _type;
- +
- + public ExOlympiadRecord(Player player, int cGameRuleType, int type)
- + {
- + _player = player;
- + _cGameRuleType = cGameRuleType;
- + _type = OlympiadManager.getInstance().isRegistered(player) ? 1 : 0; //
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_RECORD.writeId(packet);
- + packet.writeD(Olympiad.getInstance().getNoblePoints(_player)); // nPoint
- + packet.writeD(Olympiad.getInstance().getCompetitionWon(_player.getObjectId())); // nWinCount
- + packet.writeD(Olympiad.getInstance().getCompetitionLost(_player.getObjectId())); // nLoseCount
- + packet.writeD(Olympiad.getInstance().getRemainingWeeklyMatches(_player.getObjectId())); // nMatchCount
- + // Previous Cycle
- + packet.writeD(149); // nPrevClassType
- + packet.writeD(1); // nPrevRank in all servers
- + packet.writeD(2); // nPrevRankCount number of participants with 25+ matches
- + packet.writeD(3); // nPrevClassRank in all servers
- + packet.writeD(4); // nPrevClassRankCount number of participants with 25+ matches
- + packet.writeD(5); // nPrevClassRankByServer in current server
- + packet.writeD(6); // nPrevClassRankByServerCount number of participants with 25+ matches
- + packet.writeD(1500); // nPrevPoint
- + packet.writeD(7); // nPrevWinCount
- + packet.writeD(8); // nPrevLoseCount
- + packet.writeD(9); // nPrevGrade
- + packet.writeD(Calendar.getInstance().get(Calendar.YEAR)); // nSeasonYear
- + packet.writeD(Calendar.getInstance().get(Calendar.MONTH) + 1); // nSeasonMonth
- + packet.writeC(Olympiad.getInstance().inCompPeriod() ? 0x00 : 0x01); // bMatchOpen
- + packet.writeD(Olympiad.getInstance().getCurrentCycle()); // nSeason
- + packet.writeC(_type); // bRegistered
- + packet.writeD(_cGameRuleType); // cGameRuleType
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java (working copy)
- @@ -299,7 +299,7 @@
- packet.writeC(_player.getPvpFlag());
- packet.writeD(_player.getReputation()); // Reputation
- packet.writeC(_player.getNobleLevel());
- - packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
- + packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
- packet.writeC(_player.getPledgeClass());
- packet.writeD(_player.getPkKills());
- packet.writeD(_player.getPvpKills());
- Index: java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java (working copy)
- @@ -94,7 +94,6 @@
- protected static final long VALIDATION_PERIOD = Config.ALT_OLY_VPERIOD; // 24 hours
- public static final int DEFAULT_POINTS = Config.ALT_OLY_START_POINTS;
- - protected static final int WEEKLY_POINTS = Config.ALT_OLY_WEEKLY_POINTS;
- public static final String CHAR_ID = "charId";
- public static final String CLASS_ID = "class_id";
- @@ -769,8 +768,6 @@
- {
- _scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(() ->
- {
- - addWeeklyPoints();
- - LOGGER.info("Olympiad System: Added weekly points to nobles");
- resetWeeklyMatches();
- LOGGER.info("Olympiad System: Reset weekly matches to nobles");
- @@ -778,22 +775,6 @@
- }, getMillisToWeekChange(), WEEKLY_PERIOD);
- }
- - protected synchronized void addWeeklyPoints()
- - {
- - if (_period == 1)
- - {
- - return;
- - }
- -
- - int currentPoints;
- - for (StatSet nobleInfo : NOBLES.values())
- - {
- - currentPoints = nobleInfo.getInt(POINTS);
- - currentPoints += WEEKLY_POINTS;
- - nobleInfo.set(POINTS, currentPoints);
- - }
- - }
- -
- /**
- * Resets number of matches, classed matches, non classed matches, team matches done by noble characters in the week.
- */
- Index: java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java (working copy)
- @@ -261,6 +261,8 @@
- // Beginning of the battle
- case BATTLE_STARTED:
- {
- + final SystemMessage sm = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
- + _stadium.broadcastPacket(sm);
- _countDown = 0;
- _state = OlympiadGameState.BATTLE_IN_PROGRESS; // set state first, used in zone update
- if (!startBattle())
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java (working copy)
- @@ -0,0 +1,43 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadInfo implements IClientOutgoingPacket
- +{
- + private static int _open;
- +
- + public ExOlympiadInfo(Player player, int open)
- + {
- + _open = open;
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
- + packet.writeC(_open); // bOpen
- + packet.writeD(0); // nRemainTime
- + packet.writeC(1); // cGameRuleType
- +
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java (working copy)
- @@ -0,0 +1,41 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author GodKratos
- + */
- +public class ExOlympiadMatchEnd implements IClientOutgoingPacket
- +{
- + public static final ExOlympiadMatchEnd STATIC_PACKET = new ExOlympiadMatchEnd();
- +
- + private ExOlympiadMatchEnd()
- + {
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_MATCH_END.writeId(packet);
- +
- + return true;
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java (working copy)
- @@ -0,0 +1,53 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadMatchInfo implements IClientOutgoingPacket
- +{
- + private final String _szTeam1Name;
- + private final String _szTeam2Name;
- + private final int _nTeam1WinCount;
- + private final int _nTeam2WinCount;
- + private final int _round;
- +
- + public ExOlympiadMatchInfo(String szTeam1Name, String szTeam2Name, int nTeam1WinCount, int nTeam2WinCount, int round)
- + {
- + _szTeam1Name = szTeam1Name;
- + _szTeam2Name = szTeam2Name;
- + _nTeam1WinCount = nTeam1WinCount;
- + _nTeam2WinCount = nTeam2WinCount;
- + _round = round;
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
- +
- + packet.writeS(String.format("%1$-" + 23 + "s", _szTeam2Name)); // Name 2
- + packet.writeD(_nTeam2WinCount); // Wins 2
- + packet.writeS(String.format("%1$-" + 23 + "s", _szTeam1Name)); // Name 1
- + packet.writeD(_nTeam1WinCount); // Wins 1
- + packet.writeD(_round); // Round
- + packet.writeD(100); // Seconds
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java (working copy)
- @@ -0,0 +1,37 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadMatchInfoEnd implements IClientOutgoingPacket
- +{
- +
- + public ExOlympiadMatchInfoEnd()
- + {
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
- +
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java (working copy)
- @@ -0,0 +1,92 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import java.util.ArrayList;
- +import java.util.List;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.olympiad.AbstractOlympiadGame;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameClassed;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNonClassed;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author mrTJO
- + */
- +public class ExOlympiadMatchList implements IClientOutgoingPacket
- +{
- + private final List<OlympiadGameTask> _games = new ArrayList<>();
- +
- + public ExOlympiadMatchList()
- + {
- + OlympiadGameTask task;
- + for (int i = 0; i < OlympiadGameManager.getInstance().getNumberOfStadiums(); i++)
- + {
- + task = OlympiadGameManager.getInstance().getOlympiadTask(i);
- + if (task != null)
- + {
- + if (!task.isGameStarted() || task.isBattleFinished())
- + {
- + continue; // initial or finished state not shown
- + }
- + _games.add(task);
- + }
- + }
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
- +
- + packet.writeD(0); // Type 0 = Match List, 1 = Match Result
- +
- + packet.writeD(_games.size());
- + packet.writeD(0);
- +
- + for (OlympiadGameTask curGame : _games)
- + {
- + final AbstractOlympiadGame game = curGame.getGame();
- + if (game != null)
- + {
- + packet.writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
- +
- + if (game instanceof OlympiadGameNonClassed)
- + {
- + packet.writeD(1);
- + }
- + else if (game instanceof OlympiadGameClassed)
- + {
- + packet.writeD(2);
- + }
- + else
- + {
- + packet.writeD(0);
- + }
- +
- + packet.writeD(curGame.isRunning() ? 2 : 1); // (1 = Standby, 2 = Playing)
- + packet.writeS(game.getPlayerNames()[0]); // Player 1 Name
- + packet.writeS(game.getPlayerNames()[1]); // Player 2 Name
- + }
- + }
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java (working copy)
- @@ -0,0 +1,43 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadMatchMakingResult implements IClientOutgoingPacket
- +{
- + private final int _cGameRuleType;
- + private final int _type;
- +
- + public ExOlympiadMatchMakingResult(Player player, int cGameRuleType, int type)
- + {
- + _cGameRuleType = 0;
- + _type = type;
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
- + packet.writeC(_type);
- + packet.writeD(_cGameRuleType);
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java (working copy)
- @@ -0,0 +1,93 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import java.util.List;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadInfo;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author JIV
- + */
- +public class ExOlympiadMatchResult implements IClientOutgoingPacket
- +{
- + private final boolean _tie;
- + private int _winTeam; // 1,2
- + private int _loseTeam = 2;
- + private final List<OlympiadInfo> _winnerList;
- + private final List<OlympiadInfo> _loserList;
- +
- + public ExOlympiadMatchResult(boolean tie, int winTeam, List<OlympiadInfo> winnerList, List<OlympiadInfo> loserList)
- + {
- + _tie = tie;
- + _winTeam = winTeam;
- + _winnerList = winnerList;
- + _loserList = loserList;
- + if (_winTeam == 2)
- + {
- + _loseTeam = 1;
- + }
- + else if (_winTeam == 0)
- + {
- + _winTeam = 1;
- + }
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
- + packet.writeD(2); // Type 0 = Match List, 1 = Match Result, 2 = New Oly look, 3 = 3v3
- + packet.writeD(_tie ? 1 : 0); // 0 - win, 1 - tie
- + packet.writeS(_winnerList.get(0).getName());
- + packet.writeD(_winTeam);
- + packet.writeD(_winnerList.size());
- + for (OlympiadInfo info : _winnerList)
- + {
- + packet.writeS(info.getName());
- + packet.writeS(info.getClanName());
- + packet.writeD(info.getClanId());
- + packet.writeD(info.getClassId());
- + packet.writeD(info.getDamage());
- + packet.writeD(info.getCurrentPoints());
- + packet.writeD(info.getDiffPoints());
- + packet.writeD(0); // Helios
- + }
- + packet.writeD(_loseTeam);
- + packet.writeD(_loserList.size());
- + for (OlympiadInfo info : _loserList)
- + {
- + packet.writeS(info.getName());
- + packet.writeS(info.getClanName());
- + packet.writeD(info.getClanId());
- + packet.writeD(info.getClassId());
- + packet.writeD(info.getDamage());
- + packet.writeD(info.getCurrentPoints());
- + packet.writeD(info.getDiffPoints());
- + packet.writeD(0); // Helios
- + }
- + packet.writeC(3); // Round 1 outcome
- + packet.writeC(2); // Round 2 outcome
- + packet.writeC(3); // Round 3 outcome
- + packet.writeD(15); // Bonus Reward
- + packet.writeD(0); // Bonus Reward for looser
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java (working copy)
- @@ -0,0 +1,46 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author godson
- + */
- +public class ExOlympiadMode implements IClientOutgoingPacket
- +{
- + private final int _mode;
- +
- + /**
- + * @param mode (0 = return, 3 = spectate)
- + */
- + public ExOlympiadMode(int mode)
- + {
- + _mode = mode;
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_MODE.writeId(packet);
- +
- + packet.writeC(_mode);
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java (working copy)
- @@ -0,0 +1,69 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import java.util.Calendar;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.model.olympiad.Olympiad;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +public class ExOlympiadRecord implements IClientOutgoingPacket
- +{
- + private final Player _player;
- + private final int _cGameRuleType;
- + private final int _type;
- +
- + public ExOlympiadRecord(Player player, int cGameRuleType, int type)
- + {
- + _player = player;
- + _cGameRuleType = cGameRuleType;
- + _type = OlympiadManager.getInstance().isRegistered(player) ? 1 : 0; //
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_RECORD.writeId(packet);
- + packet.writeD(Olympiad.getInstance().getNoblePoints(_player)); // nPoint
- + packet.writeD(Olympiad.getInstance().getCompetitionWon(_player.getObjectId())); // nWinCount
- + packet.writeD(Olympiad.getInstance().getCompetitionLost(_player.getObjectId())); // nLoseCount
- + packet.writeD(Olympiad.getInstance().getRemainingWeeklyMatches(_player.getObjectId())); // nMatchCount
- + // Previous Cycle
- + packet.writeD(149); // nPrevClassType
- + packet.writeD(1); // nPrevRank in all servers
- + packet.writeD(2); // nPrevRankCount number of participants with 25+ matches
- + packet.writeD(3); // nPrevClassRank in all servers
- + packet.writeD(4); // nPrevClassRankCount number of participants with 25+ matches
- + packet.writeD(5); // nPrevClassRankByServer in current server
- + packet.writeD(6); // nPrevClassRankByServerCount number of participants with 25+ matches
- + packet.writeD(1500); // nPrevPoint
- + packet.writeD(7); // nPrevWinCount
- + packet.writeD(8); // nPrevLoseCount
- + packet.writeD(9); // nPrevGrade
- + packet.writeD(Calendar.getInstance().get(Calendar.YEAR)); // nSeasonYear
- + packet.writeD(Calendar.getInstance().get(Calendar.MONTH) + 1); // nSeasonMonth
- + packet.writeC(Olympiad.getInstance().inCompPeriod() ? 0x00 : 0x01); // bMatchOpen
- + packet.writeD(Olympiad.getInstance().getCurrentCycle()); // nSeason
- + packet.writeC(_type); // bRegistered
- + packet.writeD(_cGameRuleType); // cGameRuleType
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java (working copy)
- @@ -0,0 +1,84 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import java.util.ArrayList;
- +import java.util.List;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.model.skill.BuffInfo;
- +import org.l2jmobius.gameserver.model.skill.Skill;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author godson
- + */
- +public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
- +{
- + private final int _playerId;
- + private final List<BuffInfo> _effects = new ArrayList<>();
- + private final List<Skill> _effects2 = new ArrayList<>();
- +
- + public ExOlympiadSpelledInfo(Player player)
- + {
- + _playerId = player.getObjectId();
- + }
- +
- + public void addSkill(BuffInfo info)
- + {
- + _effects.add(info);
- + }
- +
- + public void addSkill(Skill skill)
- + {
- + _effects2.add(skill);
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_SPELLED_INFO.writeId(packet);
- +
- + packet.writeD(_playerId);
- + packet.writeD(_effects.size() + _effects2.size());
- + for (BuffInfo info : _effects)
- + {
- + if ((info != null) && info.isInUse())
- + {
- + packet.writeD(info.getSkill().getDisplayId());
- + packet.writeH(info.getSkill().getDisplayLevel());
- + packet.writeH(0x00); // Sub level
- + packet.writeD(info.getSkill().getAbnormalType().getClientId());
- + writeOptionalD(packet, info.getSkill().isAura() ? -1 : info.getTime());
- + }
- + }
- + for (Skill skill : _effects2)
- + {
- + if (skill != null)
- + {
- + packet.writeD(skill.getDisplayId());
- + packet.writeH(skill.getDisplayLevel());
- + packet.writeH(0x00); // Sub level
- + packet.writeD(skill.getAbnormalType().getClientId());
- + packet.writeH(-1);
- + }
- + }
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java (working copy)
- @@ -0,0 +1,102 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.model.olympiad.Participant;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author godson
- + */
- +public class ExOlympiadUserInfo implements IClientOutgoingPacket
- +{
- + private final Player _player;
- + private Participant _par = null;
- + private int _curHp;
- + private int _maxHp;
- + private int _curCp;
- + private int _maxCp;
- +
- + public ExOlympiadUserInfo(Player player)
- + {
- + _player = player;
- + if (_player != null)
- + {
- + _curHp = (int) _player.getCurrentHp();
- + _maxHp = _player.getMaxHp();
- + _curCp = (int) _player.getCurrentCp();
- + _maxCp = _player.getMaxCp();
- + }
- + else
- + {
- + _curHp = 0;
- + _maxHp = 100;
- + _curCp = 0;
- + _maxCp = 100;
- + }
- + }
- +
- + public ExOlympiadUserInfo(Participant par)
- + {
- + _par = par;
- + _player = par.getPlayer();
- + if (_player != null)
- + {
- + _curHp = (int) _player.getCurrentHp();
- + _maxHp = _player.getMaxHp();
- + _curCp = (int) _player.getCurrentCp();
- + _maxCp = _player.getMaxCp();
- + }
- + else
- + {
- + _curHp = 0;
- + _maxHp = 100;
- + _curCp = 0;
- + _maxCp = 100;
- + }
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_USER_INFO.writeId(packet);
- +
- + if (_player != null)
- + {
- + packet.writeC(_player.getOlympiadSide());
- + packet.writeD(_player.getObjectId());
- + packet.writeS(_player.getName());
- + packet.writeD(_player.getClassId().getId());
- + }
- + else
- + {
- + packet.writeC(_par.getSide());
- + packet.writeD(_par.getObjectId());
- + packet.writeS(_par.getName());
- + packet.writeD(_par.getBaseClass());
- + }
- +
- + packet.writeD(_curHp);
- + packet.writeD(_maxHp);
- + packet.writeD(_curCp);
- + packet.writeD(_maxCp);
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java (working copy)
- @@ -0,0 +1,93 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import java.util.List;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadInfo;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author JIV
- + */
- +public class ExOlympiadMatchResult implements IClientOutgoingPacket
- +{
- + private final boolean _tie;
- + private int _winTeam; // 1,2
- + private int _loseTeam = 2;
- + private final List<OlympiadInfo> _winnerList;
- + private final List<OlympiadInfo> _loserList;
- +
- + public ExOlympiadMatchResult(boolean tie, int winTeam, List<OlympiadInfo> winnerList, List<OlympiadInfo> loserList)
- + {
- + _tie = tie;
- + _winTeam = winTeam;
- + _winnerList = winnerList;
- + _loserList = loserList;
- + if (_winTeam == 2)
- + {
- + _loseTeam = 1;
- + }
- + else if (_winTeam == 0)
- + {
- + _winTeam = 1;
- + }
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
- + packet.writeD(2); // Type 0 = Match List, 1 = Match Result, 2 = New Oly look, 3 = 3v3
- + packet.writeD(_tie ? 1 : 0); // 0 - win, 1 - tie
- + packet.writeS(_winnerList.get(0).getName());
- + packet.writeD(_winTeam);
- + packet.writeD(_winnerList.size());
- + for (OlympiadInfo info : _winnerList)
- + {
- + packet.writeS(info.getName());
- + packet.writeS(info.getClanName());
- + packet.writeD(info.getClanId());
- + packet.writeD(info.getClassId());
- + packet.writeD(info.getDamage());
- + packet.writeD(info.getCurrentPoints());
- + packet.writeD(info.getDiffPoints());
- + packet.writeD(0); // Helios
- + }
- + packet.writeD(_loseTeam);
- + packet.writeD(_loserList.size());
- + for (OlympiadInfo info : _loserList)
- + {
- + packet.writeS(info.getName());
- + packet.writeS(info.getClanName());
- + packet.writeD(info.getClanId());
- + packet.writeD(info.getClassId());
- + packet.writeD(info.getDamage());
- + packet.writeD(info.getCurrentPoints());
- + packet.writeD(info.getDiffPoints());
- + packet.writeD(0); // Helios
- + }
- + packet.writeC(3); // Round 1 outcome
- + packet.writeC(2); // Round 2 outcome
- + packet.writeC(3); // Round 3 outcome
- + packet.writeD(15); // Bonus Reward
- + packet.writeD(0); // Bonus Reward for looser
- + return true;
- + }
- +}
- Index: dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
- ===================================================================
- --- dist/game/data/scripts/ai/others/OlyManager/OlyManager.java (revision 10239)
- +++ dist/game/data/scripts/ai/others/OlyManager/OlyManager.java (working copy)
- @@ -42,7 +42,7 @@
- import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
- import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
- import org.l2jmobius.gameserver.network.SystemMessageId;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchList;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
- import ai.AbstractNpcAI;
- Index: dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
- ===================================================================
- --- dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java (revision 10239)
- +++ dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java (working copy)
- @@ -16,12 +16,15 @@
- */
- package handlers.usercommandhandlers;
- +import org.l2jmobius.Config;
- import org.l2jmobius.gameserver.handler.IUserCommandHandler;
- import org.l2jmobius.gameserver.model.WorldObject;
- import org.l2jmobius.gameserver.model.actor.Player;
- import org.l2jmobius.gameserver.model.olympiad.Olympiad;
- +import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
- import org.l2jmobius.gameserver.network.SystemMessageId;
- import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
- /**
- * Olympiad Stat user command.
- @@ -37,6 +40,11 @@
- @Override
- public boolean useUserCommand(int id, Player player)
- {
- + if (!Config.ALT_OLY_ENABLE_OLYMPIAD)
- + {
- + player.sendMessage("Olympiad is disabled. Please try again later.");
- + return false;
- + }
- if (id != COMMAND_IDS[0])
- {
- return false;
- @@ -43,9 +51,14 @@
- }
- final int nobleObjId = player.getObjectId();
- - final WorldObject target = player.getTarget();
- - if ((target == null) || !target.isPlayer() || (target.getActingPlayer().getNobleLevel() == 0))
- + WorldObject target = player.getTarget();
- + if ((target == null) || !target.isPlayer())
- {
- + player.sendPacket(new ExOlympiadRecord(player, 1, OlympiadManager.getInstance().isRegistered(player) ? 1 : 0));
- + return true;
- + }
- + else if ((target.getActingPlayer().getNobleLevel() == 0))
- + {
- player.sendPacket(SystemMessageId.THIS_COMMAND_CAN_ONLY_BE_USED_WHEN_THE_TARGET_IS_AN_AWAKENED_NOBLESSE_EXALTED);
- return false;
- }
- @@ -60,6 +73,7 @@
- final SystemMessage sm2 = new SystemMessage(SystemMessageId.THIS_WEEK_YOU_CAN_PARTICIPATE_IN_A_TOTAL_OF_S1_MATCHES);
- sm2.addInt(Olympiad.getInstance().getRemainingWeeklyMatches(nobleObjId));
- player.sendPacket(sm2);
- + player.sendPacket(new ExOlympiadRecord(player, 1, OlympiadManager.getInstance().isRegistered(player) ? 1 : 0));
- return true;
- }
- Index: java/org/l2jmobius/Config.java
- ===================================================================
- --- java/org/l2jmobius/Config.java (revision 10239)
- +++ java/org/l2jmobius/Config.java (working copy)
- @@ -516,6 +516,7 @@
- public static int WORLD_CHAT_MIN_LEVEL;
- public static int WORLD_CHAT_POINTS_PER_DAY;
- public static Duration WORLD_CHAT_INTERVAL;
- + public static boolean ALT_OLY_ENABLE_OLYMPIAD;
- public static int ALT_OLY_START_TIME;
- public static int ALT_OLY_MIN;
- public static long ALT_OLY_CPERIOD;
- @@ -523,7 +524,6 @@
- public static long ALT_OLY_WPERIOD;
- public static long ALT_OLY_VPERIOD;
- public static int ALT_OLY_START_POINTS;
- - public static int ALT_OLY_WEEKLY_POINTS;
- public static int ALT_OLY_CLASSED;
- public static int ALT_OLY_NONCLASSED;
- public static List<ItemHolder> ALT_OLY_WINNER_REWARD;
- @@ -2431,6 +2431,7 @@
- // Load Olympiad config file (if exists)
- final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
- + ALT_OLY_ENABLE_OLYMPIAD = olympiadConfig.getBoolean("AltOlyEnableOlympiad", true);
- ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 20);
- ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
- ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
- @@ -2437,8 +2438,7 @@
- ALT_OLY_BATTLE = olympiadConfig.getLong("AltOlyBattle", 300000);
- ALT_OLY_WPERIOD = olympiadConfig.getLong("AltOlyWPeriod", 604800000);
- ALT_OLY_VPERIOD = olympiadConfig.getLong("AltOlyVPeriod", 86400000);
- - ALT_OLY_START_POINTS = olympiadConfig.getInt("AltOlyStartPoints", 10);
- - ALT_OLY_WEEKLY_POINTS = olympiadConfig.getInt("AltOlyWeeklyPoints", 10);
- + ALT_OLY_START_POINTS = olympiadConfig.getInt("AltOlyStartPoints", 1000);
- ALT_OLY_CLASSED = olympiadConfig.getInt("AltOlyClassedParticipants", 10);
- ALT_OLY_NONCLASSED = olympiadConfig.getInt("AltOlyNonClassedParticipants", 20);
- ALT_OLY_WINNER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyWinReward", "45584,12"));
- @@ -2455,7 +2455,7 @@
- ALT_OLY_MAX_POINTS = olympiadConfig.getInt("AltOlyMaxPoints", 10);
- ALT_OLY_DIVIDER_CLASSED = olympiadConfig.getInt("AltOlyDividerClassed", 5);
- ALT_OLY_DIVIDER_NON_CLASSED = olympiadConfig.getInt("AltOlyDividerNonClassed", 5);
- - ALT_OLY_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("AltOlyMaxWeeklyMatches", 30);
- + ALT_OLY_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("AltOlyMaxWeeklyMatches", 25);
- ALT_OLY_LOG_FIGHTS = olympiadConfig.getBoolean("AltOlyLogFights", false);
- ALT_OLY_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("AltOlyShowMonthlyWinners", true);
- ALT_OLY_ANNOUNCE_GAMES = olympiadConfig.getBoolean("AltOlyAnnounceGames", true);
- Index: java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java (working copy)
- @@ -34,7 +34,7 @@
- import org.l2jmobius.gameserver.model.zone.ZoneId;
- import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
- import org.l2jmobius.gameserver.network.SystemMessageId;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
- /**
- * An olympiad stadium
- Index: java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java (revision 10239)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java (working copy)
- @@ -19,7 +19,7 @@
- import org.l2jmobius.commons.network.PacketReader;
- import org.l2jmobius.gameserver.model.actor.Player;
- import org.l2jmobius.gameserver.network.GameClient;
- -import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchList;
- +import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
- /**
- * Format: (ch)d d: unknown (always 0?)
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java (working copy)
- @@ -0,0 +1,41 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author GodKratos
- + */
- +public class ExOlympiadMatchEnd implements IClientOutgoingPacket
- +{
- + public static final ExOlympiadMatchEnd STATIC_PACKET = new ExOlympiadMatchEnd();
- +
- + private ExOlympiadMatchEnd()
- + {
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_MATCH_END.writeId(packet);
- +
- + return true;
- + }
- +}
- \ No newline at end of file
- Index: java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java (working copy)
- @@ -0,0 +1,102 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.serverpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketWriter;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.model.olympiad.Participant;
- +import org.l2jmobius.gameserver.network.OutgoingPackets;
- +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
- +
- +/**
- + * @author godson
- + */
- +public class ExOlympiadUserInfo implements IClientOutgoingPacket
- +{
- + private final Player _player;
- + private Participant _par = null;
- + private int _curHp;
- + private int _maxHp;
- + private int _curCp;
- + private int _maxCp;
- +
- + public ExOlympiadUserInfo(Player player)
- + {
- + _player = player;
- + if (_player != null)
- + {
- + _curHp = (int) _player.getCurrentHp();
- + _maxHp = _player.getMaxHp();
- + _curCp = (int) _player.getCurrentCp();
- + _maxCp = _player.getMaxCp();
- + }
- + else
- + {
- + _curHp = 0;
- + _maxHp = 100;
- + _curCp = 0;
- + _maxCp = 100;
- + }
- + }
- +
- + public ExOlympiadUserInfo(Participant par)
- + {
- + _par = par;
- + _player = par.getPlayer();
- + if (_player != null)
- + {
- + _curHp = (int) _player.getCurrentHp();
- + _maxHp = _player.getMaxHp();
- + _curCp = (int) _player.getCurrentCp();
- + _maxCp = _player.getMaxCp();
- + }
- + else
- + {
- + _curHp = 0;
- + _maxHp = 100;
- + _curCp = 0;
- + _maxCp = 100;
- + }
- + }
- +
- + @Override
- + public boolean write(PacketWriter packet)
- + {
- + OutgoingPackets.EX_OLYMPIAD_USER_INFO.writeId(packet);
- +
- + if (_player != null)
- + {
- + packet.writeC(_player.getOlympiadSide());
- + packet.writeD(_player.getObjectId());
- + packet.writeS(_player.getName());
- + packet.writeD(_player.getClassId().getId());
- + }
- + else
- + {
- + packet.writeC(_par.getSide());
- + packet.writeD(_par.getObjectId());
- + packet.writeS(_par.getName());
- + packet.writeD(_par.getBaseClass());
- + }
- +
- + packet.writeD(_curHp);
- + packet.writeD(_maxHp);
- + packet.writeD(_curCp);
- + packet.writeD(_maxCp);
- + return true;
- + }
- +}
- Index: java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
- ===================================================================
- --- java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java (nonexistent)
- +++ java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java (working copy)
- @@ -0,0 +1,50 @@
- +/*
- + * This file is part of the L2J Mobius project.
- + *
- + * 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 org.l2jmobius.gameserver.network.clientpackets.olympiad;
- +
- +import org.l2jmobius.commons.network.PacketReader;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.network.GameClient;
- +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
- +
- +/**
- + * format ch c: (id) 0xD0 h: (subid) 0x12
- + * @author -Wooden-
- + */
- +public class RequestOlympiadObserverEnd implements IClientIncomingPacket
- +{
- + @Override
- + public boolean read(GameClient client, PacketReader packet)
- + {
- + return true;
- + }
- +
- + @Override
- + public void run(GameClient client)
- + {
- + final Player player = client.getPlayer();
- + if (player == null)
- + {
- + return;
- + }
- +
- + if (player.inObserverMode())
- + {
- + player.leaveOlympiadObserverMode();
- + }
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement