ZeRo* Posted May 31, 2009 Posted May 31, 2009 This share works in all the packs l2j,l2jfree,l2jemu. If you have any error delete it..It's not necessary in all the packs Credits SpooKNoF It's the only who made this and i don't want karma. I took the code from SpooKNoF for the share Index: //java/com/l2dot/gameserver/network/serverpackets/DoorInfo.java =================================================================== --- //java/com/l2dot/gameserver/network/serverpackets/DoorInfo.java (revision 47) +++ //java/com/l2dot/gameserver/network/serverpackets/DoorInfo.java (revision 59) @@ -20,5 +20,6 @@ import com.l2dot.gameserver.model.actor.instance.L2DoorInstance; - + import com.l2dot.gameserver.model.actor.instance.L2StaticObjectInstance; + import com.l2dot.gameserver.network.serverpackets.StaticObject; /** * 60 @@ -38,17 +39,46 @@ private static final String _S__60_DOORINFO = " 4c DoorInfo"; Index: //java/com/l2dot/gameserver/network/serverpackets/DoorInfo.java private L2DoorInstance _door; + private final int _staticObjectId; + private final int _objectId; + private final int _type; + private final boolean _isTargetable; + private final boolean _isClosed; + private final boolean _isEnemyOf; + private final int _maxHp; + private final int _currentHp; + private final boolean _showHp; + private final int _damageGrade; - public DoorInfo(L2DoorInstance door) - { - _door=door; - } + + public DoorInfo(L2DoorInstance door, boolean showHp) + { + _staticObjectId = door.getDoorId(); + _objectId = door.getObjectId(); + _type = 1; + _door=door; + _isTargetable = true; + _isClosed = !door.getOpen(); + _isEnemyOf = door.isEnemyOf(_door); + _maxHp = door.getMaxHp(); + _currentHp = (int) door.getCurrentHp(); + _showHp = showHp; + _damageGrade = door.getDamage(); + } - @Override - protected final void writeImpl() - { - writeC(0x4c); - writeD(_door.getObjectId()); - writeD(_door.getDoorId()); - } + @Override + protected final void writeImpl() + { + writeC(0x4c); + writeD(_door.getObjectId()); + writeD(_door.getDoorId()); + writeD(_type); + writeD(_isTargetable ? 1 : 0); + writeD(_isClosed ? 1 : 0); + writeD(_door.isEnemyOf(getClient().getActiveChar()) ? 1 : 0); + writeD(_currentHp); + writeD(_maxHp); + writeD(_showHp ? 1 : 0); + writeD(_damageGrade); + } /* (non-Javadoc) @@ -62,2 +92,3 @@ } + Index: //java/com/l2dot/gameserver/network/clientpackets/RequestRecordInfo.java =================================================================== --- //com/l2dot/gameserver/network/clientpackets/RequestRecordInfo.java (revision 47) +++ /java/com/l2dot/gameserver/network/clientpackets/RequestRecordInfo.java (revision 61) @@ -80,5 +80,5 @@ else if (object instanceof L2DoorInstance) { - _activeChar.sendPacket(new DoorInfo((L2DoorInstance) object)); + _activeChar.sendPacket(new DoorInfo((L2DoorInstance) object, false)); _activeChar.sendPacket(new DoorStatusUpdate((L2DoorInstance) object)); } Index: //java/com/l2dot/gameserver/model/actor/knownlist/PcKnownList.java =================================================================== --- //java/com/l2dot/gameserver/model/actor/knownlist/PcKnownList.java (revision 47) +++ //java/com/l2dot/gameserver/model/actor/knownlist/PcKnownList.java (revision 60) @@ -114,5 +114,5 @@ else if (object instanceof L2DoorInstance) { - getActiveChar().sendPacket(new DoorInfo((L2DoorInstance) object)); + getActiveChar().sendPacket(new DoorInfo((L2DoorInstance) object, false)); getActiveChar().sendPacket(new DoorStatusUpdate((L2DoorInstance) object)); } Quote
Stefoulis15 Posted May 31, 2009 Posted May 31, 2009 well , as zero* says this is spooknof's code. it shouldnt be in public. its stolen.i mean he gaved it to me , and someone stolen my assembla account for a while , and took dot's source and this code too. and some others.. -.- whatever. thanks to spooknof for this. and thanks zero for posting it Quote
Intrepid Posted May 31, 2009 Posted May 31, 2009 stef dont need to explain yourself... Credits SpooKNoF It's the only who made this and i don't want karma. I took the code from SpooKNoF for the share only for interlude :) and its the only one who made it? hes just one who made it work under that shitty interlude :) anyway gg Quote
Horus Posted May 31, 2009 Posted May 31, 2009 Its not actually Spook's code, but fine, he was going to share it anyway ^^ Quote
LouLou Posted May 31, 2009 Posted May 31, 2009 ok realy nice zero but you have and other codes? this is prety nice and i i think the l2dot was the best why you stop working this? where i add this? private L2DoorInstance _door; + private final int _staticObjectId; + private final int _objectId; + private final int _type; + private final boolean _isTargetable; + private final boolean _isClosed; + private final boolean _isEnemyOf; + private final int _maxHp; + private final int _currentHp; + private final boolean _showHp; + private final int _damageGrade; - public DoorInfo(L2DoorInstance door) - { - _door=door; - } + + public DoorInfo(L2DoorInstance door, boolean showHp) + { + _staticObjectId = door.getDoorId(); + _objectId = door.getObjectId(); + _type = 1; + _door=door; + _isTargetable = true; + _isClosed = !door.getOpen(); + _isEnemyOf = door.isEnemyOf(_door); + _maxHp = door.getMaxHp(); + _currentHp = (int) door.getCurrentHp(); + _showHp = showHp; + _damageGrade = door.getDamage(); + } - @Override - protected final void writeImpl() - { - writeC(0x4c); - writeD(_door.getObjectId()); - writeD(_door.getDoorId()); - } + @Override + protected final void writeImpl() + { + writeC(0x4c); + writeD(_door.getObjectId()); + writeD(_door.getDoorId()); + writeD(_type); + writeD(_isTargetable ? 1 : 0); + writeD(_isClosed ? 1 : 0); + writeD(_door.isEnemyOf(getClient().getActiveChar()) ? 1 : 0); + writeD(_currentHp); + writeD(_maxHp); + writeD(_showHp ? 1 : 0); + writeD(_damageGrade); + } /* (non-Javadoc) @@ -62,2 +92,3 @@ } + Quote
haitext Posted May 31, 2009 Posted May 31, 2009 ok realy nice zero but you have and other codes? this is prety nice and i i think the l2dot was the best why you stop working this? where i add this? private L2DoorInstance _door; + private final int _staticObjectId; + private final int _objectId; + private final int _type; + private final boolean _isTargetable; + private final boolean _isClosed; + private final boolean _isEnemyOf; + private final int _maxHp; + private final int _currentHp; + private final boolean _showHp; + private final int _damageGrade; - public DoorInfo(L2DoorInstance door) - { - _door=door; - } + + public DoorInfo(L2DoorInstance door, boolean showHp) + { + _staticObjectId = door.getDoorId(); + _objectId = door.getObjectId(); + _type = 1; + _door=door; + _isTargetable = true; + _isClosed = !door.getOpen(); + _isEnemyOf = door.isEnemyOf(_door); + _maxHp = door.getMaxHp(); + _currentHp = (int) door.getCurrentHp(); + _showHp = showHp; + _damageGrade = door.getDamage(); + } - @Override - protected final void writeImpl() - { - writeC(0x4c); - writeD(_door.getObjectId()); - writeD(_door.getDoorId()); - } + @Override + protected final void writeImpl() + { + writeC(0x4c); + writeD(_door.getObjectId()); + writeD(_door.getDoorId()); + writeD(_type); + writeD(_isTargetable ? 1 : 0); + writeD(_isClosed ? 1 : 0); + writeD(_door.isEnemyOf(getClient().getActiveChar()) ? 1 : 0); + writeD(_currentHp); + writeD(_maxHp); + writeD(_showHp ? 1 : 0); + writeD(_damageGrade); + } /* (non-Javadoc) @@ -62,2 +92,3 @@ } + loulou i think you are noob but ok... bfw http://my-trac.assembla.com/L2Dot/timeline where it is? Quote
yankiller Posted July 24, 2009 Posted July 24, 2009 Mages,vlepo oti ine sxetika palio to post,alla kapios pou kserei borei na mu apadisei pos duleyei ayto to pragma parapano?pou to vazo,ti kano?Kai an dn leiturgei,iparxei allos tropos na fixaro to bug me tis koloportes na dialiontai mono se siege? Quote
TheEngo Posted July 26, 2009 Posted July 26, 2009 Thank you for the script, but i get 1 error right here: _isClosed = !door.getOpen(); What should i change !door.getOpen() too? I'm using L2Server Interludes top revision EDIT: Seems that changing _closed into int solved the problem, but i don't know if the doors going to work. Quote
Matim Posted July 26, 2009 Posted July 26, 2009 Thank you for the script, but i get 1 error right here: _isClosed = !door.getOpen(); What should i change !door.getOpen() too? I'm using L2Server Interludes top revision EDIT: Seems that changing _closed into int solved the problem, but i don't know if the doors going to work. I have the same error, could you post how it should look ? Quote
ZeRo* Posted July 27, 2009 Author Posted July 27, 2009 Thank you for the script, but i get 1 error right here: _isClosed = !door.getOpen(); What should i change !door.getOpen() too? I'm using L2Server Interludes top revision EDIT: Seems that changing _closed into int solved the problem, but i don't know if the doors going to work. Read The share 1st :) If you have any error delete it...... Quote
bakr Posted August 19, 2009 Posted August 19, 2009 hmm tell Me Ecplise... Close (!) Town Chat 500 pvp Open CHat.. Quote
Cod3x Posted June 22, 2010 Posted June 22, 2010 Sorry for "spamming" in this old thread, but i thought it was a great share and many peaple had a problem :D Thank you for the script, but i get 1 error right here: _isClosed = !door.getOpen(); What should i change !door.getOpen() too? I'm using L2Server Interludes top revision EDIT: Seems that changing _closed into int solved the problem, but i don't know if the doors going to work. Since in l2doorinstance getOpen is int, and int as we know can't accept "!" the correct is the following. _isClosed = door.getOpen() == 0; I have the same error, could you post how it should look ? Quote
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.
Note: Your post will require moderator approval before it will be visible.