L2JDP Revision 6199:
Hello,
is there a way to make the script react to day and night changes? I know I could use the DayNightSpawnManager to spawn a certain creature, but what I want is to be able to react to the day and night change, because I want to randomly decide the location and re-add the spawn myself.
In GameTimeController I found this:
Code: Select all
_log.log(Level.CONFIG, getClass().getSimpleName() + ": Started."); long nextTickTime, sleepTime; boolean isNight = isNight(); if (isNight) { ThreadPoolManager.getInstance().executeAi(new Runnable() { @Override public final void run() { DayNightSpawnManager.getInstance().notifyChangeMode(); } }); }
I could easily add a listener, which (if registered to it) could notify all scripts about this change - not just DayNightSpawnManager. But I am not sure if this is something, that might be of interest by the L2J-Team. Perhaps there is even a different solution?
I greatly appreciate an answer and would do the job of adding the listener if there's a chance it might become part of L2J.
Hyrelius.