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.
I want NPC shop custom to rentail.
Rentail shop has two window, one with price and below with item selected to confirme the buy and o want make that on custom shop .
1. Buy adrenaline
2. Install on virtual machine (virtualbox + windows 10)
3. Run adrenaline
4. Save state of vrtual machine.
= license adrenaline 4ever.
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 bru7alLink to comment
Share on other sites
4 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.