They are not spawning on their own and they won't start spawning on themselves. Any idea how to fix that, or if there is a working phantoms shere somewhere on the web could you pls provide me with a link?
I think there is an issue in the following code... Because I believe that somewhere in the code the minimum spawns has been set, and I cant change it in the configs so I have to change it from the code itself. The question, however, remains... How do you find where its written?
public static class PhantomSpawner implements Runnable
{
private final int _numSpawns;
private final long _delayInMilis;
private final boolean _generateNewPhantoms;
private int _curSpawns = 0;
private Location _loc = null;
private ScheduledFuture<?> _task = null;
public PhantomSpawner()
{
_numSpawns = Config.PHANTOM_SPAWN_MAX;
_delayInMilis = Config.PHANTOM_SPAWN_DELAY;
_generateNewPhantoms = true;
}
public PhantomSpawner(int numSpawns)
{
_numSpawns = numSpawns;
_delayInMilis = Config.PHANTOM_SPAWN_DELAY;
_generateNewPhantoms = true;
}
public PhantomSpawner(int numSpawns, long delayInMilis)
{
_numSpawns = numSpawns;
_delayInMilis = delayInMilis;
_generateNewPhantoms = true;
}
public PhantomSpawner(int numSpawns, long delayInMilis, boolean generateNewPhantoms)
{
_numSpawns = numSpawns;
_delayInMilis = delayInMilis;
_generateNewPhantoms = generateNewPhantoms;
}
public PhantomSpawner setLocation(Location loc)
{
_loc = loc;
return this;
}
@Override
public void run()
{
if (_numSpawns == 0)
{
return;
}
_task = ThreadPoolManager.getInstance().scheduleAtFixedRate(() ->
{
if (_curSpawns < _numSpawns)
{
// Do not spawn more than max phantoms.
if (L2ObjectsStorage.getAllPlayersStream().filter(Player::isPhantom).count() >= Config.PHANTOM_MAX_PLAYERS)
{
return;
}
int objId = getUnspawnedPhantomObjId();
if (objId < 0)
{
if (_generateNewPhantoms)
{
try
{
Player phantom = createNewPhantom();
if (phantom != null)
{
objId = phantom.getObjectId();
_log.info("Spawning phantom " + phantom + " through spawner. Cur/Max " + _curSpawns + "/" + _numSpawns);
}
}
catch (Exception e)
{
_log.error("ERROR: Spawning phantom through spawner. Cur/Max " + _curSpawns + "/" + _numSpawns, e);
}
}
else
{
return;
}
}
ThreadPoolManager.getInstance().execute(new PhantomSpawn(objId).setLocation(_loc));
_curSpawns++;
}
}, 0, _delayInMilis);
}
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.
hello everyone !
I need help with a l2script Rev H5-Salvation/Classic build. I compiled the project, installed everything but I can't log in to the server, it won't log me in. I tried a thousand ways without good results. I leave you the error when logging in either with the H5-Salvation Client.
ERROR ---> WARN: IPBANMANAGER ---> IP !!!!
I'm waiting for help! Thank you!
Question
Salty Mike
They are not spawning on their own and they won't start spawning on themselves. Any idea how to fix that, or if there is a working phantoms shere somewhere on the web could you pls provide me with a link?
I think there is an issue in the following code... Because I believe that somewhere in the code the minimum spawns has been set, and I cant change it in the configs so I have to change it from the code itself. The question, however, remains... How do you find where its written?
Edited by bru7al4 answers to this question
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.