How to close doors of a dynamically created instance

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
HappyLDE
Posts: 123
Joined: Tue Sep 10, 2013 6:22 pm
Location: Belgium
Contact:

How to close doors of a dynamically created instance

Post by HappyLDE »

So i create a dynamic instance like this:

Code: Select all

final int InstanceId = InstanceManager.getInstance().createDynamicInstance(null);                        final Instance instance = InstanceManager.getInstance().getInstance(InstanceId);            instance.setAllowSummon(false);            instance.setPvPInstance(true);            instance.setEmptyDestroyTime(60000L);
How to close all doors inside? Seems that if i do getDoor() it returns null:

Code: Select all

instance.getDoor(doorId).closeMe();
:D Any idea?
Thank you for making L2JServer happen! :D
"If you believe you will fail or succeed, in both ways you are right." - Henry Ford
User avatar
Zealar
L2j Veteran
L2j Veteran
Posts: 1236
Joined: Sun Jul 15, 2007 10:29 am

Re: How to close doors of a dynamically created instance

Post by Zealar »

Use data templates from DP and add door inside. You can look data/instances/coliseum.xml
User avatar
HappyLDE
Posts: 123
Joined: Tue Sep 10, 2013 6:22 pm
Location: Belgium
Contact:

Re: How to close doors of a dynamically created instance

Post by HappyLDE »

Well that did it! Thank you Zealar, i now use those xmls by passing them to the createDynamicInstance("instancename.xml") insdead of null.

Edit: After adding the doors to the instance.xml i still had to close them like this though:

Code: Select all

for (L2DoorInstance door : instance.getDoors())            {                if (door != null) {                    door.closeMe();                }            }
Otherwise they wouldn't close even if i added default_state="close" to them:

Code: Select all

<door doorId="24220025" default_status="close" targetable="false" />
Thank you for making L2JServer happen! :D
"If you believe you will fail or succeed, in both ways you are right." - Henry Ford
HorridoJoho
L2j Senior Developer
L2j Senior Developer
Posts: 795
Joined: Sun Aug 14, 2005 11:27 am

Re: How to close doors of a dynamically created instance

Post by HorridoJoho »

HappyLDE wrote: Edit: After adding the doors to the instance.xml i still had to close them like this though:

Code: Select all

for (L2DoorInstance door : instance.getDoors())            {                if (door != null) {                    door.closeMe();                }            }
Otherwise they wouldn't close even if i added default_state="close" to them:

Code: Select all

<door doorId="24220025" default_status="close" targetable="false" />
Is this still bugged?
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: How to close doors of a dynamically created instance

Post by Sdw »

Never was tbh
Post Reply