Get instance of spawn

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
laikeriz
Posts: 48
Joined: Sun Feb 01, 2009 8:35 pm

Get instance of spawn

Post 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?
Probe
Posts: 915
Joined: Thu Sep 03, 2009 6:36 pm
Location: Israel
Contact:

Re: Get instance of spawn

Post 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
laikeriz
Posts: 48
Joined: Sun Feb 01, 2009 8:35 pm

Re: Get instance of spawn

Post by laikeriz »

Thanks :)
Post Reply