Show the HP of castle doors and walls.

This commit is contained in:
MobiusDevelopment 2019-03-31 00:27:45 +00:00
parent 364935f72a
commit e75b660e91
3 changed files with 19 additions and 2 deletions

View File

@ -122,7 +122,14 @@ public class PlayerKnownList extends PlayableKnownList
}
else if (object instanceof DoorInstance)
{
active_char.sendPacket(new DoorInfo((DoorInstance) object, false));
if (((DoorInstance) object).getCastle() != null)
{
active_char.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else
{
active_char.sendPacket(new DoorInfo((DoorInstance) object, false));
}
active_char.sendPacket(new DoorStatusUpdate((DoorInstance) object));
}
else if (object instanceof FenceInstance)

View File

@ -90,7 +90,14 @@ public class RequestRecordInfo extends GameClientPacket
}
else if (object instanceof DoorInstance)
{
_player.sendPacket(new DoorInfo((DoorInstance) object, false));
if (((DoorInstance) object).getCastle() != null)
{
_player.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else
{
_player.sendPacket(new DoorInfo((DoorInstance) object, false));
}
_player.sendPacket(new DoorStatusUpdate((DoorInstance) object));
}
else if (object instanceof BoatInstance)

View File

@ -25,10 +25,12 @@ import com.l2jmobius.gameserver.model.actor.instance.DoorInstance;
public class DoorInfo extends GameServerPacket
{
private final DoorInstance _door;
private final boolean _showHp;
public DoorInfo(DoorInstance door, boolean showHp)
{
_door = door;
_showHp = showHp;
}
@Override
@ -37,5 +39,6 @@ public class DoorInfo extends GameServerPacket
writeC(0x4c);
writeD(_door.getObjectId());
writeD(_door.getDoorId());
writeD(_showHp ? 0x01 : 0x00);
}
}