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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...