Addition of TimeRestrictFieldDieLimitTime and TimeRestrictFieldUserAlarm.

Thanks to nasseka.
This commit is contained in:
MobiusDevelopment
2022-08-30 22:50:06 +00:00
parent ed5b923658
commit f044766abb
40 changed files with 650 additions and 146 deletions

View File

@@ -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.huntingzones;
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;
/**
* @author NasSeKa
*/
public class TimeRestrictFieldUserAlarm implements IClientOutgoingPacket
{
private final Player _player;
private final int _zoneId;
public TimeRestrictFieldUserAlarm(Player player, int zoneId)
{
_player = player;
_zoneId = zoneId;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ALARM.writeId(packet);
packet.writeD(_zoneId);
packet.writeD(_player.getTimedHuntingZoneRemainingTime(_zoneId) / 1000); // RemainTime (zone left time)
return true;
}
}

View File

@@ -21,19 +21,21 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author dontknowdontcare
* @author NasSeKa
*/
public class TimedHuntingZoneChargeResult implements IClientOutgoingPacket
{
private final int _zoneId;
private final int _secondsLeft;
private final int _newExtensionValue;
private final int _remainTime;
private final int _refillTime;
private final int _chargeTime;
public TimedHuntingZoneChargeResult(int zoneId, int secondsLeft, int newExtensionValue)
public TimedHuntingZoneChargeResult(int zoneId, int remainTime, int refillTime, int chargeTime)
{
_zoneId = zoneId;
_secondsLeft = secondsLeft;
_newExtensionValue = newExtensionValue;
_remainTime = remainTime;
_refillTime = refillTime;
_chargeTime = chargeTime;
}
@Override
@@ -41,8 +43,9 @@ public class TimedHuntingZoneChargeResult implements IClientOutgoingPacket
{
OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_CHARGE_RESULT.writeId(packet);
packet.writeD(_zoneId);
packet.writeD(_secondsLeft); // Remaining Time in zone.
packet.writeD(_newExtensionValue); // New Extension value.
packet.writeD(_remainTime);
packet.writeD(_refillTime);
packet.writeD(_chargeTime);
return true;
}
}

View File

@@ -41,8 +41,8 @@ public class TimedHuntingZoneEnter implements IClientOutgoingPacket
OutgoingPackets.EX_TIME_RESTRICT_FIELD_USER_ENTER.writeId(packet);
packet.writeC(1); // bEnterSuccess
packet.writeD(_zoneId);
packet.writeD((int) ((System.currentTimeMillis() / 60) / 1000)); // nEnterTimeStamp (current time in minutes)
packet.writeD(_player.getTimedHuntingZoneRemainingTime(_zoneId) / 1000); // nRemainTime (zone left time)
packet.writeD((int) (System.currentTimeMillis() / 1000)); // nEnterTimeStamp
packet.writeD((_player.getTimedHuntingZoneRemainingTime(_zoneId) / 1000) + 59); // nRemainTime (zone left time)
return true;
}
}