Jump to content
  • 0

[Help] Noblesse Only Shop


Question

Posted

Hey!

 

Is it possible to do a shop that only noblesse players can use?

I know that teleports has it's own noblesse section. So it should be, but I'm not sure how to do it.

 

<a action="bypass -h npc_%objectId%_Quest 2000_NoblesseTeleport">Noblesse Exclusive Teleport</a><br>

 

That's the htm code from a teleporter..

 

If you know how to do this, please give me a guide =)

6 answers to this question

Recommended Posts

  • 0
Posted

A java instance :

+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * <http://www.gnu.org/copyleft/gpl.html>
+ */
+package com.l2jserver.gameserver.model.actor.instance;
+
+import javolution.text.TextBuilder;
+
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
+
+/**
+ * @author  xLuc1 a.k.a DominiQue
+ */
+public class L2NobleInstance extends L2Npc
+{
+	private String filename;
+	public L2NobleInstance(int objectId, L2NpcTemplate template)
+	{
+		super(objectId, template);
+	}
+
+	@Override
+	public void onBypassFeedback(L2PcInstance player, String command) {
+		
+		if(player == null || player.getLastFolkNPC() == null 
+				|| player.getLastFolkNPC().getObjectId() != this.getObjectId()) {
+			return;
+		}
+				
+		if(command.startsWith("playmefirst"))
+			redname(player);		
+	}
+	
+	public static void noble(L2PcInstance player)
+	{
+		player.setNoble(true);
+	}	
+	
+	
+	@Override
+	public void showChatWindow(L2PcInstance player, int val) 
+	{
+		filename = (getHtmlPath(getNpcId(), val));
+		NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId());
+		msg.setHtml(colorWindow(player));
+		msg.replace("%objectId%", String.valueOf(this.getObjectId()));
+		player.sendPacket(msg);
+	}
+	private String colorWindow(L2PcInstance player) 
+	{
+		TextBuilder tb = new TextBuilder();
+
+			tb.append("<html><title>xLuc1</title><body>");
+			    tb.append("<center>");
+			    tb.append("<br>");
+			    tb.append("<img src=\"L2UI.SquareGray\" width=\"200\" height=\"1\"><br>");
+			    tb.append("Welcome "+player.getName()+"<br>");
+			    tb.append("<tr><td>I can make u a noble !</td></tr><br>");  
+			    tb.append("<img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\"></center><br>"); 
+			    tb.append("<br>");
+			    tb.append("<center>"); 
+			    tb.append("<button value= Noble action=\"bypass -h npc_%objectId%_playmefirst\" width=130 height=25 back= L2UI_ct1.button_df fore = L2UI_ct1.button_df>"); 
+			    tb.append("<center>");       
+			    tb.append("<center><img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\">");
+			    tb.append("</body></html>");
+		return tb.toString();
+	}
+	
+}

  • 0
Posted

if you have a non custom gk ... the server allready have a teleport for nobless  players at evry gatekeeper you can simply change the html from there....

but if you have a custom gk i recomand to make/ask for a script gk ...is no't hard to make one ....

here is a simple idea :

	def onEvent(self,event,st):
        htmltext = event
         if st.getPlayer().isNobless() :
		htmltext = "nobless.htm"
         else:    
                       htmltext = "nonnobless.htm"     
         return htmltext  

 

  • 0
Posted

since u show

<a action="bypass -h npc_%objectId%_Quest 2000_NoblesseTeleport">Noblesse Exclusive Teleport</a><br>

 

u can also use this too... with a bit rewrite... so if u don't want to do it in java try it.

 

gameserver\data\scripts\teleports\2000_NoblesseTeleport

c/p to

gameserver\data\scripts\custom\2000_NoblesseTeleport

rename it

999_NoblesseShop

 

 

gameserver\data  open scripts.cfg and add under custom:    custom/999_NoblesseShop/__init__.py

 

 

 

 

didnt tested but could work^^

 

I would really like to do it this way, but it doesn't work.

The npc just say;

"I have nothing to say to you

Quest(link)" and it doesn't link to anything good ^^

 

Any more suggestions?

  • 0
Posted

as i said i didn't test it^^

 

but now i did and its worked :P

 

gameserver\data\scripts\teleports\999_NoblesseShop

__init__.py

# Created by Ham Wong on 2007.02.28

import sys

from com.l2jserver.gameserver.model.quest        import State

from com.l2jserver.gameserver.model.quest        import QuestState

from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest

 

qn = "999_NoblesseShop"

NPC=[your npc ID]

 

html = '<html><title>Gatekeeper</title><body><br>Ah, you\'re a Noblesse! I can offer you a special service then.<br><br><br>\

<table width=280><tr><td align=left width=180><a action="bypass -h npc_%objectId%_Link merchant/NPC ID - PAGE.htm">Armor</a></td></tr></table><br><br>\

        <table width=280><tr><td align=left width=180><a action="bypass -h npc_%objectId%_Link merchant/NPC ID - PAGE.htm">Weapon</a></td></tr></table><br><br>\

<table width=280><tr><td align=left width=180><a action="bypass -h npc_%objectId%_Link merchant/NPC ID - PAGE.htm">Jewely</a></td></tr></table><br><br>\

<br><br><br><br><a action="bypass -h npc_%objectId%_Chat 0">Back</a></body></html>'

 

class Quest (JQuest) :

 

def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

 

def onAdvEvent (self,event,npc, player) :

    return event

 

def onTalk (self,npc,player):

    st = player.getQuestState(qn)

    if player.isNoble() == 1 :

      bypass = 'Quest 999_NoblesseShop noble-nopass.htm'

      if st.getQuestItemsCount(13722):

        bypass = 'npc_%objectId%_Chat 44'

      htmltext=html.replace("%bypass%",str(bypass)).replace("%objectId%",str(npc.getObjectId()))

    else :

      htmltext="nobleshop-no.htm"

    return htmltext

 

QUEST      = Quest(-1,qn,"Teleports")

 

for item in NPC:

  QUEST.addStartNpc(item)

  QUEST.addTalkId(item)

 

re-name nobleteleporter-no.htm to nobleshop-no.htm

 

gameserver\data  open scripts.cfg and add under  # Teleports    teleports/999_NoblesseShop/__init__.py

 

set in your merchant the link

<a action="bypass -h npc_%objectId%_Quest 999_NoblesseShop">Enter Noblesse Shop</a>

 

 

enjoy ;)

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

    • L2 Editor is a desktop tool for editing Lineage 2 server and client data side by side. It opens L2J Mobius server XML (NPCs, skills, classes, zones, drops, experience), reads and writes the encrypted client data files for skills, NPC names, hunting zones, the minimap, and more, and renders the world map by stitching the client's radar textures and overlaying real zone polygons and NPC spawn points — both of which you can edit by dragging on the map. The NPC editor exposes every field as a structured form with enum dropdowns and includes a 3D point-cloud viewer of the NPC's model decoded straight from the client. The editor is chronicle-aware across 42 builds from Prelude to Orc Village: it decrypts every supported client format, derives which client files exist per chronicle at runtime, and shows a structured drift indicator that names exactly which fields disagree when server and client data drift apart. Built with Tauri, Rust, and React.   I am open to adding support for other server packs as well, if you are interested, send me a message on discord and send me the xml & xsd files   https://github.com/RumDum3/l2-editor    
    • I tried it, very neat work. Just keep improving it, there's potential.
    • 🔥 Grand Opening: 29 May 2026 – 19:00 Germany Time Website: https://l2-lorena.com/ Discord: https://discord.gg/TYZ88Tgx4b ━━━━━━━━━━━━━━━━━━━━━━ General Information • Chronicle: Interlude • Server Type: PvP Rates • EXP/SP: x5000 • Adena: x500 • Drop: x500 Premium Account • 2x EXP / Drop / Adena ━━━━━━━━━━━━━━━━━━━━━━ Starting Setup • Starting Town: Aden • Starting Level: 76 • Starting Gear: S-Grade ━━━━━━━━━━━━━━━━━━━━━━ Enchant System • Safe Enchant: +4 • Normal Scroll: 50% • Blessed Scroll: 70% • Crystal Scroll: 100% ━━━━━━━━━━━━━━━━━━━━━━ Subclass System • All classes available • Dominator subclass enabled • Dominator subclass cost: 20 Donate Coins ━━━━━━━━━━━━━━━━━━━━━━ Items Balance • Custom items • Elegia Armor added as Custom Set • Rare S-Grade items with boosted stats • Balanced PvP gameplay ━━━━━━━━━━━━━━━━━━━━━━ Siege & PvP Rewards • Aden Castle special reward: 200 Donate Coins • Competitive PvP and siege-focused gameplay ━━━━━━━━━━━━━━━━━━━━━━ Epic Bosses • All Epic Bosses available up to Valakas ━━━━━━━━━━━━━━━━━━━━━━ Augmentation Rates • Top LS: 100% skill chance • High LS: 7% skill chance • Mid LS: 3% skill chance ━━━━━━━━━━━━━━━━━━━━━━ Perfect For Players Who Want ✔ Fast progression ✔ Clean Interlude gameplay without custom chaos ✔ Active PvP action ✔ Competitive sieges ✔ Long-term fun
  • Topics

×
×
  • 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..