Jump to content

Recommended Posts

Posted (edited)

Can someone please help me with this one?
I saw it on others server but cant find it anywhere..


Example:
When player get lvl 20.. a chat apears to the player giving him an option to teleport to the next Leveling zone

Im working on a High Five custom server dont know the Rev's name

 

package ai.npc.Teleports.UpTeleport;

import ai.npc.AbstractNpcAI;

import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

public class UpTeleport extends AbstractNpcAI
{
	// NPC
	private static final int NPC = IdNpc;//TERIA QUE SER AUTOMATICO SEM USO DE NPC
	// Lvl para teleportar
	private static final int Up_1 = 20;// Teleporta pra Zona 1
	private static final int Up_2 = 40;// Teleporta pra Zona 2
	private static final int Up_3 = 60;// Teleporta pra Zona 3
	private static final int Up_4 = 85;// Teleporta pra Cidade

	//Esquema
	public String onTalk(L2Npc npc, L2PcInstance player)
	{
		if (player.getLevel() == Up_1)
		{
			player.teleToLocation(-55154, 107224, -3731);
			return null;
		}
		else if (player.getLevel() == Up_2)
		{
			player.teleToLocation(-55154, 107224, -3731);
			return null;
		}		
		else if (player.getLevel() == Up_3)
		{
			player.teleToLocation(-55154, 107224, -3731);
			return null;
		}		
		else if (player.getLevel() == Up_4)
		{
			player.teleToLocation(-55154, 107224, -3731);
			return null;
		}		
	}
	private UpTeleport(String name, String descr)
	{
		super(name, descr);
		addStartNpc(NPC);
		addTalkId(NPC);
	}
	public static void main(String[] args)
	{
		new UpTeleport(UpTeleport.class.getSimpleName(), "ai/npc/Teleports");
	}
}

How can i make it work without player having to talk to a NPC...? 

Edited by Tamira

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..