Page 1 of 1

Get instance of spawn

Posted: Fri Oct 09, 2009 6:35 pm
by laikeriz
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 3506:
L2JDP Revision 6606:
I'm trying to get instance of new spawn:

Code: Select all

	private void spawnMonster(String monsterId, int mobCount, int x, int y, int z, int respawnDelay)	{ 		L2NpcTemplate template1; 		int monsterTemplate = Integer.parseInt(monsterId);		template1 = NpcTable.getInstance().getTemplate(monsterTemplate); 		try		{			L2Spawn spawn = new L2Spawn(template1);			spawn.setLocx(x);			spawn.setLocy(y);			spawn.setLocz(z);			spawn.setAmount(mobCount);			spawn.setHeading(1);			spawn.setRespawnDelay(respawnDelay);		}		catch (Exception e)		{		}	}
Maby i should:

Code: Select all

public static Map<L2MonsterInstance> _monsters = new FastMap<L2MonsterInstance>();_monsters.put((L2MonsterInstance) spawn)
Or how should i do it?

Re: Get instance of spawn

Posted: Fri Oct 09, 2009 6:54 pm
by Probe
L2Spawn isn't a monster class, so you can't do (L2MonsterInstance) spawn..
ANYWAYS..


the method addSpawn in
http://www.l2jserver.com/svn/trunk/L2_G ... Quest.java

should answer all your questions

Re: Get instance of spawn

Posted: Fri Oct 09, 2009 7:34 pm
by laikeriz
Thanks :)