Jump to content

Visible Castle Door Hp For L2Jfrozen


Tessa

Recommended Posts

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.

Link to comment
Share on other sites

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 by Tessa
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

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 by Rootware
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • rename the l2.bin into l2.exe
    • L2LIVE.PRO- Dynamic Mid-rates Essence Seven Signs GRAND OPENING - July 5, 20:00 GMT+3 (EEST) TEST SERVER IS OPEN - COME AND CHECK IT OUT TODAY! Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu   Server description * EXP/SP: Dynamic (x1- x100 based on your level, *before* Sayha and EXP buffs * Adena: x50 / Item Drop: x10 / Fishing EXP increased / Attribute EXP increased * Simplified gameplay to stay in the loop while not spending hours and hours farming * Starter Pack containing very useful items for beginners * MP replenishing potions with auto-consumption * No overpowered donations L2LIVE shop * All spellbook coupons, pet spellbook coupons and master books are sold via Game Assistant * Additionally you can buy SP pouches, enchanted talismans, pet training guides and various other consumables for Adena and L-Coin * More items such as cloaks, more talismans, agathions, belts, pendants, enchantment scrolls of various grades, evolution stones, etc will be added! Shop server as a shortcut, and all retail-like ways of earning items are still here! L-Coins * Drops with small change and in random amounts from Lv60+ monsters  * All raidbosses drop random amount of L-Coin Pouches generating up to 420 Lcoin per unit. **Grand Olympiad and Events** * Grand Olympiad is held week day * Format is 1v1, unlimited weekly fights  * Heroes are declared weekly at Sunday * There are three automated events - TvT, CTF and Deathmatch, running at evenings * Orc Fortress, Battle with Balok, Keber Hunter, Archievements Box, Daily Gift Calendar provisional events are active too Custom user commands * .offlineplay command, your character will keep playing till death or server restart * .offlineshop command, keeps your shop sitting until all items are purchased * .apon / .apoff - enable/disable HP/MP autoconsume And lots of other small improvements are waiting for you!   Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu
  • Topics

×
×
  • Create New...