Page 1 of 1

[Info] Zone

Posted: Tue Sep 29, 2009 1:09 pm
by Mage
Hi boys,

In my server same time there is this error:

Code: Select all

java.lang.NullPointerException	at net.sf.l2j.gameserver.datatables.MapRegionTable.getTeleToLocation(MapRegionTable.java:575)	at net.sf.l2j.gameserver.model.actor.L2Character.teleToLocation(L2Character.java:684)	at handlers.skillhandlers.Recall.useSkill(Unknown Source)	at net.sf.l2j.gameserver.model.actor.L2Character.callSkill(L2Character.java:6465)	at net.sf.l2j.gameserver.model.actor.L2Character.onMagicHitTimer(L2Character.java:6189)	at net.sf.l2j.gameserver.model.actor.L2Character$MagicUseTask.run(L2Character.java:2535)	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)	at java.util.concurrent.FutureTask.run(FutureTask.java:138)	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)	at java.lang.Thread.run(Thread.java:619)
I think that this is an error of Zone.

Is it possible to create a big Zone in all world, if the player dead in a point where there isn't the zone, he will be teleporter in the big city ? (for example Giran)

Thank :)

Re: [Info] Zone

Posted: Tue Sep 29, 2009 2:54 pm
by Probe
can't see what the error is without seeing the code, in what script did the error appear?

Re: [Info] Zone

Posted: Tue Sep 29, 2009 3:02 pm
by janiii
the exception comes from this place:

Code: Select all

// Get the nearest town// TODO: Micht: Maybe we should add some checks to prevent exception here.coord = [b]TownManager.getClosestTown(activeChar)[/b].getSpawnLoc();
the null value comes from:

Code: Select all

    public final static L2TownZone getTown(int townId)    {    	for (L2ZoneType temp : ZoneManager.getInstance().getAllZones())    	{        	if (temp instanceof L2TownZone && ((L2TownZone) temp).getTownId() == townId)        		return (L2TownZone) temp;    	}        [b]return null;[/b]    }
there are no town zones defined for the town ids: 18, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36

Re: [Info] Zone

Posted: Tue Sep 29, 2009 3:20 pm
by Mage
Oh yes :)

in return null; is it possible set a teleport? for exmple:

Code: Select all

    public final static L2TownZone getTown(int townId)    {    	for (L2ZoneType temp : ZoneManager.getInstance().getAllZones())    	{        	if (temp instanceof L2TownZone && ((L2TownZone) temp).getTownId() == townId)        		return (L2TownZone) temp;    	}[color=#FF0000][b]player.teleToLocation(X, Y, Z);[/b][/color]        [b]return null;[/b]    }
How can i import "player"?

Very Thank Janii

Re: [Info] Zone

Posted: Tue Sep 29, 2009 5:58 pm
by Mage
Janii i tried, can this work?

Code: Select all

    public final static L2TownZone getTown(int townId)    {    	for (L2ZoneType temp : ZoneManager.getInstance().getAllZones())     	{    	if (temp instanceof L2TownZone && ((L2TownZone) temp).getTownId() == townId)    	return (L2TownZone) temp;    	}   [color=#FF0000]    [b]	return getTown(11);[/b][/color]    }
I change "return null;" with "return getTown(11);"

Now if there isn't "zone" the player will be teleport in giran town? True? (with to village)

Re: [Info] Zone

Posted: Tue Sep 29, 2009 6:00 pm
by janiii
Mage wrote:Now if there isn't "zone" the player will be teleport in giran town? True? (with to village)
yeah, that should work :)

Re: [Info] Zone

Posted: Tue Sep 29, 2009 6:02 pm
by Mage
janiii wrote:
Mage wrote:Now if there isn't "zone" the player will be teleport in giran town? True? (with to village)
yeah, that should work :)
Perfect, but does the error in GS appear? or nothing?