Jump to content
  • 0

VIP Npc


Question

9 answers to this question

Recommended Posts

  • 0
Posted

So you need NPC with possibility to confer the status of VIP?

 

Why python? It could be java quest based NPC aswell.

  • 0
Posted

Not tested, but should be fine, fast code:

 

package custom.VipManager;

import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;

/**
* @author Matim
* @version 1.0
*/
public class VipManager extends Quest
{
private final static String qn = "VipManager";

private final static int NPC = 50013;

public VipManager(int questId, String name, String descr)
{
	super(questId, name, descr);
	addFirstTalkId(NPC);
	addStartNpc(NPC);
	addTalkId(NPC);
}

@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
	String htmltext = "";

	String name = player.getName();

	if (event.equalsIgnoreCase("1"))
	{
		if (player.isVip()) // TODO u need this Cheack! 
		{
			htmltext = "<html><title>VIP Manager</title><head><body><center>" +
			           "<br>Sorry <font color=\"LEVEL\">" + name + "</font>, but you are already VIP!";
		}
		else
		{	
			if (player.getInventory().getItemByItemId(6630) == null)
			{
				return "error";
			}
			else
			{	
				if if (player.getLevel() < 80)
				{
					player.sendMessage("You need Level 80 or higher!");
				}
				else
				{
					player.setIsVip(true); // TODO u need this method to set VIP! 

					htmltext = "<html><title>VIP Manager</title><head><body><center>" +
			                   "<br>Congratulations <font color=\"LEVEL\">" + name + "</font>, you are VIP now!";
				}
			}
		}
	}

	else	
		htmltext = "Error, check whole NPC code!";
	return htmltext;
}

@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
	String htmltext = "";
	QuestState qs = player.getQuestState(qn);
	if (qs == null)
		qs = newQuestState(player);

	htmltext = "<html><title></title><head><body><center>" +
			   "<br><img src=l2ui.bbs_lineage2 height=16 width=80>" +
			   "<font color=AAAAAA>VIP Manager</font><br>" +
                   "<img src=L2UI_CH3.herotower_deco width=256 height=32>" +
                   
                   "<button value=\"Make me VIP!\" action=\"bypass -h Quest VipManager 1\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21><br>" +

			   "<font color=\"cc9900\"><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></font><br1></center></body></head></html>";
			   
	return htmltext;
}

public static void main(String[] args)
{
	new VipManager(-1, qn, "custom");
}
}

 

Warning, you need:

 

isVip(); boolean check (check if is/isnt Vip)

 

setIsVip(boolean b); to make player VIP

 

Maybe your pack has support for VIP engine, I guess it has since you need it.

 

I guess you know, how to install it, right?

  • 0
Posted

matim, on code you write:

				if if (player.getLevel() < 80)
				{
					player.sendMessage("You need Level 80 or higher!");
				}

i mean the double ifs :D

 

 

edit: sorry i didn't see date

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


  • Posts

    • Where's the proof? I can tell you're a scammer.
    • Where was I called a scammer? Is there any proof, etc.? There are a lot of reviews about our store online, etc. https://zhyk.org/forum/showthread.php?t=1108673
    • U was reported as scammer in your previos topic why u create new topic?
    • 🔍 Inventory 1.0 is a next-generation inventory system that stands out with its special minimal clothing system. Carefully designed and prepared according to the highest standards of your server, it not only enhances your gaming experience but also contributes to your server's infrastructure. ⚙️ Supported: QB-CORE Features: ✅ Instant Delivery: All products you purchase will be instantly assigned to your account as soon as your payment is completed. ✅ Clothing System: With the special animated clothing configurations in your inventory, you will be able to change outfits with ease. Experience a unique roleplaying experience with high-quality animations and customizable clothing options. ✅ Minimalist Inventory System: This inventory system, with its visuals, animations, and mechanics, offers maximum efficiency without overwhelming your screen and limiting your roleplaying experience. It’s designed to be user-friendly while enhancing your roleplaying experience. ✅ Continuous Updates: The content in the inventory is regularly updated with innovative features added. New animations, additional clothing options, and cutting-edge features ensure a fresh and dynamic experience. ✅ Easy Setup and Compatibility: Compatible with QB-CORE, this system is easy to install and optimized for quick integration into your server. It works seamlessly with a simple drag-and-drop method. ✅ Performance Optimization: The system is optimized to avoid low FPS and performance drops. All features of the inventory run smoothly without affecting your server’s performance. ✅ Multilingual Support: With support for different languages, you can cater to an international player base and build a larger community on your server. ✅ Flexible Customization Options: You can fully customize the inventory according to your needs and server rules. Choose between different outfits and animations to create a unique gaming experience. ✅ Comprehensive Help and Support: With 24/7 support, you can quickly resolve any issues you encounter. Our technical support and user guides are always here to assist you. Shop Now! Take your game to the next level with Inventory 1.0  and enjoy its unique features. Get ready to make a real difference in your roleplaying experience!   --------------------------TEBEX: https://matza.tebex.io/package/7174862 --------------------------
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock