activeChar.sendMessage("Incorrect monster template.");
_log.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' template.");
return;
}
L2Spawn spawn = target.getSpawn();
if(spawn == null)
{
activeChar.sendMessage("Incorrect monster spawn.");
_log.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' spawn.");
return;
}
int respawnTime = spawn.getRespawnDelay()/1000;
boolean custom_boss_spawn = spawn.is_customBossInstance();
target.deleteMe();
spawn.stopRespawn();
//check to avoid that recalling a custom raid it will be saved into database
SpawnTable.getInstance().deleteSpawn(spawn, !custom_boss_spawn);
try
{
//L2MonsterInstance mob = new L2MonsterInstance(monsterTemplate, template1);
spawn = new L2Spawn(template1);
spawn.setLocx(activeChar.getX());
spawn.setLocy(activeChar.getY());
spawn.setLocz(activeChar.getZ());
spawn.setAmount(1);
spawn.setHeading(activeChar.getHeading());
spawn.setRespawnDelay(respawnTime);
SpawnTable.getInstance().addNewSpawn(spawn, !custom_boss_spawn);
spawn.init();
SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
sm.addString("Created " + template1.name + " on " + target.getObjectId() + ".");
activeChar.sendPacket(sm);
sm = null;
if(Config.DEBUG)
{
_log.fine("Spawn at X=" + spawn.getLocx() + " Y=" + spawn.getLocy() + " Z=" + spawn.getLocz());
_log.warning("GM: " + activeChar.getName() + "(" + activeChar.getObjectId() + ") moved NPC " + target.getObjectId());
}
spawn = null;
template1 = null;