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.



  • Posts

    • Thank you for sharing this with us!   
    • Server L2 Reborn x1 C4 Signature   I am looking to buy a client modification, such as l2.ini or other possible files on the server The server uses SmartGuard protection, but as far as I understand, not all files are checked before launch   Сервер L2 Reborn x1 C4 Signature Ищу возможность приобрести модификацию клиента, например l2.ini или других возможных файлов на сервере. На сервере установлена защита SmartGuard, но, насколько я понимаю, не все файлы проверяются перед запуском. _______________________________________________________________ https://join.skype.com/invite/C72FPnumKn7e - Skype https://t.me/rebornclient - Telegram  
    • 🎉 The Big Moment Has Arrived! 🎉   Tomorrow is the day we've all been waiting for! L2KvN is opening its gates again, and we are waiting for you all to start this epic journey together! 🌟   🗓️ Date: November 17, 2024 ⏰ Time: 20:00 Greece (Athens), Russia (Moscow), Lithuania 18:00 United Kingdom 13:00 USA (Eastern Time), Argentina 10:00 AM US (Pacific Time) 14:00 Brazil 05:00 Russia (Vladivostok) ✨ What awaits you: ⚔️ Unique gameplay and intense PvP encounters 🎁 Exclusive events and rich rewards 👥 Live community and instant support 📈 Continuous upgrades for the ultimate experience 💬 Bring your friends, organize your teams, and get ready to conquer the world of L2KvN! 📢 Don't forget: We are here to help you! If you are a Clan Leader or Streamer, please contact us to become a part of this great community. 🛡️ The countdown is over – tomorrow we start! The game is just beginning… again! 💪   🌍 Dating in the world of L2KvN!
    • Very cool.   Unfortunately, I can't afford this fee.
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt  
  • Topics

×
×
  • Create New...