Jump to content
  • 0

Gm Shop just for premium


Question

Posted

As title say, i want to make a gm shop just for premium users. I make code like this and witout premium i still can use. I put few logs, but don't work. 

P.S. I use L2j-Sunrise.

 

package l2r.gameserver.model.actor.instance;

import java.util.StringTokenizer;

import l2r.gameserver.enums.InstanceType;
import l2r.gameserver.model.actor.FakePc;
import l2r.gameserver.model.actor.L2Npc;
import l2r.gameserver.model.actor.templates.L2NpcTemplate;
import l2r.gameserver.network.serverpackets.ActionFailed;
import l2r.gameserver.network.serverpackets.NpcHtmlMessage;

public class L2CustomShopInstance extends L2Npc
{
	@Override
	public void showChatWindow(L2PcInstance player)
	{
		player.sendPacket(ActionFailed.STATIC_PACKET);
		
		NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
		html.setFile(player, player.getHtmlPrefix(), "data/html/mods/shop/main.htm");
		html.replace("%objectId%", String.valueOf(getObjectId()));
		player.sendPacket(html);
	}
	
	/**
	 * @param template
	 */
	public L2CustomShopInstance(L2NpcTemplate template)
	{
		super(template);
		setInstanceType(InstanceType.L2CustomShopInstance);
		FakePc fpc = getFakePc();
		if (fpc != null)
		{
			setTitle(fpc.title);
		}
	}
	
	@Override
	public void onBypassFeedback(final L2PcInstance player, String command)
	{
		StringTokenizer st = new StringTokenizer(command, " ");
		String actualCommand = st.nextToken();
		if (player == null)
		{
			return;
		}
		if (!player.isPremium())
		{
			System.out.println("Only premium player can use this shop!");
			return;
		}
		
		if (actualCommand == null)
		{
			return;
		}
		
		if (actualCommand.startsWith("buy"))
		{
			System.out.println("buy");
		}
		else if (actualCommand.startsWith("sell"))
		{
			System.out.println("sell");
		}
		
	}
}

 

Thank you !

3 answers to this question

Recommended Posts

  • 0
Posted (edited)
import l2.gameserver.data.xml.holder.MultiSellHolder;
import l2.gameserver.model.Player;
import l2.gameserver.network.l2.components.SystemMsg;
import l2.gameserver.scripts.Functions;
import l2.gameserver.scripts.ScriptFile;
import l2.gameserver.utils.ItemFunctions;

public class ExchangeItemAndCheck extends Functions implements ScriptFile
{
    public void exchange_items_with_check()
    {
        Player player = getSelf();
        if(player == null || !CheckPlayerConditions(player))
            return;

        if(ItemFunctions.getItemCount(player, 99999) < 1) <Your Custom Premium Item is here>
        {
            player.sendPacket(SystemMsg.INCORRECT_ITEM_COUNT);
            return;
        }
        else
            MultiSellHolder.getInstance().SeparateAndSend(50000, player, 0);    } <Multisell of GM shop is here>
    @Override
    public void onLoad()
    {
    }
    @Override
    public void onReload()
    {
    }
    @Override
    public void onShutdown()
    {
    }
}

Works fine on Lucera. maybe it may help ya with yours.

Edited by Ehoq
Guest
This topic is now closed to further replies.


  • Posts

    • Another happy customer with custom Updater / Launcher for his server! Get one Yourself as well!
    • Where to buy Telegram Stars at low prices before September 1? The best solution is the SocNet Stars Telegram bot! Pavel Durov announced that new gifts are already near! And they may come out in early September. Stay ready together with our SocNet Stars Telegram bot! Cheap prices, best quality, fast delivery! You will have very little time before the next SOLD OUT. The opportunity to quickly earn and receive a valuable official NFT gift in Telegram is already close. Buy Telegram Stars quickly, profitably and safely - https://t.me/socnetstarsbot Many payment methods! Actual links to our projects: Telegram bot for buying Telegram Stars: Go Digital goods store: Go Telegram bot store: Go SMM Panel: Go We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via mail/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via mail — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via mail + active 2FA password — Instagram old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) — Facebook old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) | With friends and without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via mail (possibly also connected 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Write to the contacts below — we will discuss the terms! We are always open to other partnership offers as well. Contacts and support: Telegram: https://t.me/socnet_support  Telegram channel: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord server: https://discord.gg/y9AStFFsrh Email: solomonbog@socnet.store SocNet — digital goods and premium subscriptions store
    • Where to buy Telegram Stars at low prices before September 1? The best solution is the SocNet Stars Telegram bot! Pavel Durov announced that new gifts are already near! And they may come out in early September. Stay ready together with our SocNet Stars Telegram bot! Cheap prices, best quality, fast delivery! You will have very little time before the next SOLD OUT. The opportunity to quickly earn and receive a valuable official NFT gift in Telegram is already close. Buy Telegram Stars quickly, profitably and safely - https://t.me/socnetstarsbot Many payment methods! Actual links to our projects: Telegram bot for buying Telegram Stars: Go Digital goods store: Go Telegram bot store: Go SMM Panel: Go We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via mail/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via mail — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via mail + active 2FA password — Instagram old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) — Facebook old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) | With friends and without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via mail (possibly also connected 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Write to the contacts below — we will discuss the terms! We are always open to other partnership offers as well. Contacts and support: Telegram: https://t.me/socnet_support  Telegram channel: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord server: https://discord.gg/y9AStFFsrh Email: solomonbog@socnet.store SocNet — digital goods and premium subscriptions store
    • Where to buy Telegram Stars at low prices before September 1? The best solution is the SocNet Stars Telegram bot! Pavel Durov announced that new gifts are already near! And they may come out in early September. Stay ready together with our SocNet Stars Telegram bot! Cheap prices, best quality, fast delivery! You will have very little time before the next SOLD OUT. The opportunity to quickly earn and receive a valuable official NFT gift in Telegram is already close. Buy Telegram Stars quickly, profitably and safely - https://t.me/socnetstarsbot Many payment methods! Actual links to our projects: Telegram bot for buying Telegram Stars: Go Digital goods store: Go Telegram bot store: Go SMM Panel: Go We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via mail/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via mail — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via mail + active 2FA password — Instagram old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) — Facebook old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) | With friends and without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via mail (possibly also connected 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Write to the contacts below — we will discuss the terms! We are always open to other partnership offers as well. Contacts and support: Telegram: https://t.me/socnet_support  Telegram channel: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord server: https://discord.gg/y9AStFFsrh Email: solomonbog@socnet.store SocNet — digital goods and premium subscriptions store
    • Where to buy Telegram Stars at low prices before September 1? The best solution is the SocNet Stars Telegram bot! Pavel Durov announced that new gifts are already near! And they may come out in early September. Stay ready together with our SocNet Stars Telegram bot! Cheap prices, best quality, fast delivery! You will have very little time before the next SOLD OUT. The opportunity to quickly earn and receive a valuable official NFT gift in Telegram is already close. Buy Telegram Stars quickly, profitably and safely - https://t.me/socnetstarsbot Many payment methods! Actual links to our projects: Telegram bot for buying Telegram Stars: Go Digital goods store: Go Telegram bot store: Go SMM Panel: Go We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via mail/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via mail — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via mail + active 2FA password — Instagram old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) — Facebook old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) | With friends and without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via mail (possibly also connected 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Write to the contacts below — we will discuss the terms! We are always open to other partnership offers as well. Contacts and support: Telegram: https://t.me/socnet_support  Telegram channel: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord server: https://discord.gg/y9AStFFsrh Email: solomonbog@socnet.store SocNet — digital goods and premium subscriptions store
  • 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