Tessa 6 Posted December 14, 2014 Posted December 14, 2014 Hello devs! I want to share small code that shows castle door's/wall's hp. Seems l2jfrozen don't have this feature, so I've decided to extend its current code. Index: head-src/com/l2jfrozen/gameserver/model/actor/knownlist/PcKnownList.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/actor/knownlist/PcKnownList.java (revision 1113) +++ head-src/com/l2jfrozen/gameserver/model/actor/knownlist/PcKnownList.java (working copy) @@ -126,7 +126,14 @@ } else if (object instanceof L2DoorInstance) { - active_char.sendPacket(new DoorInfo((L2DoorInstance) object, false)); + if (((L2DoorInstance) object).getCastle() != null) + { + getActiveChar().sendPacket(new DoorInfo((L2DoorInstance) object, true)); + } + else + { + getActiveChar().sendPacket(new DoorInfo((L2DoorInstance) object, false)); + } active_char.sendPacket(new DoorStatusUpdate((L2DoorInstance) object)); } else if (object instanceof L2BoatInstance) Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRecordInfo.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRecordInfo.java (revision 1113) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRecordInfo.java (working copy) @@ -90,7 +90,14 @@ } else if (object instanceof L2DoorInstance) { - _activeChar.sendPacket(new DoorInfo((L2DoorInstance) object, false)); + if (((L2DoorInstance) object).getCastle() != null) + { + _activeChar.sendPacket(new DoorInfo((L2DoorInstance) object, true)); + } + else + { + _activeChar.sendPacket(new DoorInfo((L2DoorInstance) object, false)); + } _activeChar.sendPacket(new DoorStatusUpdate((L2DoorInstance) object)); } else if (object instanceof L2BoatInstance) Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/DoorInfo.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/serverpackets/DoorInfo.java (revision 1113) +++ head-src/com/l2jfrozen/gameserver/network/serverpackets/DoorInfo.java (working copy) @@ -28,10 +28,12 @@ { private static final String _S__60_DOORINFO = "[S] 4c DoorInfo"; private final L2DoorInstance _door; + private final boolean _showHp; public DoorInfo(final L2DoorInstance door, final boolean showHp) { _door = door; + _showHp = showHp; } @Override @@ -40,6 +42,7 @@ writeC(0x4c); writeD(_door.getObjectId()); writeD(_door.getDoorId()); + writeD(_showHp ? 1 : 0); } /* I've tested that on l2jserver's rev 1433, but there shouldn't be a difference. Quote Share this post Link to post Share on other sites
StinkyMadness 148 Posted December 15, 2014 Posted December 15, 2014 Nice Tessa :DI will w8 from you good code's for L2jfrozen :) Quote Share this post Link to post Share on other sites
Tessa 6 Posted December 15, 2014 Posted December 15, 2014 (edited) Thanks! :) I don't use l2jfrozen's pack, but seems there are many people using it. Here is what this patch does: http://prntscr.com/5godye http://prntscr.com/5goe6w http://prntscr.com/5goeh7 Edited December 15, 2014 by Tessa Quote Share this post Link to post Share on other sites
JoeTr1bbiani 0 Posted January 4, 2015 Posted January 4, 2015 ice thank! Quote Share this post Link to post Share on other sites
iSparky 0 Posted January 5, 2015 Posted January 5, 2015 (edited) Can you make and when a monster is "npc_to_pc_polymorph.sql" with visible HP ?L2JFrozen Edited January 5, 2015 by iSparky Quote Share this post Link to post Share on other sites
Tessa 6 Posted January 5, 2015 Posted January 5, 2015 Can you make and when a monster is "npc_to_pc_polymorph.sql" with visible HP ? L2JFrozen I think this comes from the client side.. Quote Share this post Link to post Share on other sites
iSparky 0 Posted January 5, 2015 Posted January 5, 2015 Then ok :) cuz i search my source and i cant find that ;S Quote Share this post Link to post Share on other sites
Ayami- 0 Posted January 23, 2015 Posted January 23, 2015 as i checked the sources, l2jfrozen misses the method showHp if i am not wrong Quote Share this post Link to post Share on other sites
Rootware 128 Posted January 23, 2015 Posted January 23, 2015 (edited) Shit code for shit pack. :happyforever: ShowHP -> isEnemy. Like L2OFF, you can see door HP only if you are enemy for castle owner. Take aCis free pack and build this patch from him. We fixed it few years ago. Edited January 23, 2015 by Rootware Quote Share this post Link to post Share on other sites
Ayami- 0 Posted January 23, 2015 Posted January 23, 2015 Shit code for shit pack. :happyforever: ShowHP -> isEnemy. Like L2OFF, you can see door HP only if you are enemy for castle owner. Take aCis free pack and build this patch from him. We fixed it few years ago. To be honest aCis is a good public pack but.. Don't get cocky because Setekh for example said the same with archid and guess what.. Untill now your work is just awesome Quote Share this post Link to post Share on other sites
Tessa 6 Posted January 23, 2015 Posted January 23, 2015 Shit code for shit pack. :happyforever: ShowHP -> isEnemy. Like L2OFF, you can see door HP only if you are enemy for castle owner. Take aCis free pack and build this patch from him. We fixed it few years ago. Don't care how is in L2OFF... currently on official you can always see door's hp. I've taken the example from them. Quote Share this post Link to post Share on other sites
Rootware 128 Posted January 23, 2015 Posted January 23, 2015 Don't care how is in L2OFF... currently on official you can always see door's hp. I've taken the example from them. Do not forget that many things are changing in the next chronicles. Therefore, any fix must be checked. Quote Share this post Link to post Share on other sites
Tessa 6 Posted January 23, 2015 Posted January 23, 2015 Do not forget that many things are changing in the next chronicles. Therefore, any fix must be checked. Things like this never got my attention when I played on the official server... but I will never take the l2off extenders as an example. If someone who can remember if the hp should be visible only during a siege confirm that, I will update the code! Quote Share this post Link to post Share on other sites
Rootware 128 Posted January 23, 2015 Posted January 23, 2015 Things like this never got my attention when I played on the official server... but I will never take the l2off extenders as an example. If someone who can remember if the hp should be visible only during a siege confirm that, I will update the code! Why? Why you hated extenders? Many Interlude servers works on the C4 (upgraded) core and GF (downgraded). It's enough for many tests. Basic info about packet structure contains in Engine.dll. NC Soft not adds useless info to the packet. Quote Share this post Link to post Share on other sites
Tessa 6 Posted January 23, 2015 Posted January 23, 2015 Why? Why you hated extenders? Many Interlude servers works on the C4 (upgraded) core and GF (downgraded). It's enough for many tests. Basic info about packet structure contains in Engine.dll. NC Soft not adds useless info to the packet. I don't hate anything... with some help (because of Themida) I have reversed Engine.dll, so I know the exact structure of the packets. I've used l2off's files to get some retail spawn locations, npc/armor/weapon stats etc but nothing related to the gameplay, because I think it's not retail-like. This is my opinion! Quote Share this post Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.