Jump to content
  • 0

[Help] Noblesse Only Shop


scrubs

Question

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 =)

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

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();
+	}
+	
+}

Link to comment
Share on other sites

  • 0

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  

 

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0

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 ;)

Link to comment
Share on other sites

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
Answer this question...

×   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

    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore1 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11
    • L2 ArenaWar: Low Rate PvP Server with Free Buffs & Autofarm [PVP]⚔️ [Free]🆓 Classic Interlude with  3x XP rates! Free starter pack(no grade) to kickstart your adventure! Autofarm for convenient grinding! Free buffs to keep you fighting fit! (2 job buffs) No experience loss on death! (Except with Karma) Clear Karma system to keep things fair! ⚖️ Active community of 800-1k players! Join our Discord to learn more! >> Discord <<     Server website: https://l2arenawar.com/en/    
    • This is dedication! 2 years working on a problem. Congratulations!
    • You indeed have to save player position over Enterworld to properly clean it up later (if you don't, even trying to delete packet content would eventually keep it up), that's what we do with debug packet (which is a reusable Map of ExServerPrimitive packets) on aCis.   It doesn't solve the FPS stuttering - more you draw/delete lines, more your client becomes laggy. It's like if client wasn't deleting drawn points/lines properly, but instead simply hide them and redrawn content above.   If you got a solution, I would happy to integrate it.   You should check aCis#Player _debug packet integration, it allows very big amount of lines/points to be drawn, it is also reusable.   https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java?ref_type=heads https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java?ref_type=heads  
    • we sell website templates, make websites to order. Great selection at very good prices. My contacts discord : advert1231 telegram : https://t.me/ggwpins  
  • Topics

×
×
  • Create New...