Page 1 of 1

How to close doors of a dynamically created instance

Posted: Sat Nov 15, 2014 5:40 pm
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?

Re: How to close doors of a dynamically created instance

Posted: Sun Nov 16, 2014 10:23 am
by Zealar
Use data templates from DP and add door inside. You can look data/instances/coliseum.xml

Re: How to close doors of a dynamically created instance

Posted: Sun Nov 16, 2014 7:46 pm
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" />

Re: How to close doors of a dynamically created instance

Posted: Sun Apr 19, 2015 11:08 am
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?

Re: How to close doors of a dynamically created instance

Posted: Mon Apr 20, 2015 9:46 am
by Sdw
Never was tbh