Jump to content

Nobless Npc


Boorinio

Recommended Posts

Hello Everyone!!!

An npc like this was requested by a user(i am lying no one requests from me  :alone: )  :LOL: so i am sharing it here!!!

 

Core Side

Index: E:/l2jdev/l2rebellion/workspace/L2jHellasC/config/Mods/L2JHellas.ini
===================================================================
--- E:/l2jdev/l2rebellion/workspace/L2jHellasC/config/Mods/L2JHellas.ini	(revision 104)
+++ E:/l2jdev/l2rebellion/workspace/L2jHellasC/config/Mods/L2JHellas.ini	(working copy)
@@ -6,6 +6,14 @@
# example: "Announce: Hi All [inspector]"  
AnnounceGmName = False

+#Nobless Npc.This Npc makes you nobless for an item count of your choise
+#Enable Nob npc?
+Allownobnpc = True
+#Item id for nobless
+NobItem = 3470
+#How many items should be removed for nobless status?
+NobCount = 1
+
# GM over enchant protection  
# if GM give more than X enchanted stuff to a player both get banned  
GMOverEnchant = 0
Index: E:/l2jdev/l2rebellion/workspace/L2jHellasC/java/com/l2jhellas/Config.java
===================================================================
--- E:/l2jdev/l2rebellion/workspace/L2jHellasC/java/com/l2jhellas/Config.java	(revision 104)
+++ E:/l2jdev/l2rebellion/workspace/L2jHellasC/java/com/l2jhellas/Config.java	(working copy)
@@ -637,6 +637,9 @@
	/** Check for bad ID ? */

	// l2jhellas_CONFIG_FILE
+	public static boolean ALLOW_NOB_NPC;
+	public static int NOBLESS_COUNT;
+	public static int NOBLESS_ITEM;
	public static boolean SHOW_NPC_CREST;
	public static String EMAIL_USER;
	public static String EMAIL_PASS;
@@ -2069,6 +2072,9 @@
				CHAMPION_SPCL_ITEM = Integer.parseInt(L2JHellasSettings.getProperty("ChampionSpecialItemID", "6393"));
				CHAMPION_SPCL_QTY = Integer.parseInt(L2JHellasSettings.getProperty("ChampionSpecialItemAmount", "1"));
				CHAMPION_SPCL_LVL_DIFF = Integer.parseInt(L2JHellasSettings.getProperty("ChampionSpecialItemLevelDiff", "0"));
+				ALLOW_NOB_NPC = Boolean.parseBoolean(L2JHellasSettings.getProperty("Allownobnpc", "True"));
+				NOBLESS_ITEM = Integer.parseInt(L2JHellasSettings.getProperty("NobItem", "3470"));
+				NOBLESS_COUNT = Integer.parseInt(L2JHellasSettings.getProperty("NobCount", "1"));
				SHOW_NPC_CREST = Boolean.parseBoolean(L2JHellasSettings.getProperty("ShowNpcCrest", "False"));
				ALLOW_CLASS_MASTER = Boolean.valueOf(L2JHellasSettings.getProperty("AllowClassMaster", "False"));
				ALLOW_REMOTE_CLASS_MASTER = Boolean.valueOf(L2JHellasSettings.getProperty("AllowRemoteClassMaster", "False"));
Index: E:/l2jdev/l2rebellion/workspace/L2jHellasC/java/com/l2jhellas/gameserver/model/actor/instance/L2NoblessInstance.java
===================================================================
--- E:/l2jdev/l2rebellion/workspace/L2jHellasC/java/com/l2jhellas/gameserver/model/actor/instance/L2NoblessInstance.java	(revision 0)
+++ E:/l2jdev/l2rebellion/workspace/L2jHellasC/java/com/l2jhellas/gameserver/model/actor/instance/L2NoblessInstance.java	(revision 0)
@@ -0,0 +1,120 @@
+/*
+ * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jhellas.gameserver.model.actor.instance;
+
+import java.util.StringTokenizer;
+import java.util.logging.Logger;
+
+import com.l2jhellas.Config;
+import com.l2jhellas.gameserver.ai.CtrlIntention;
+import com.l2jhellas.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jhellas.gameserver.network.serverpackets.ActionFailed;
+import com.l2jhellas.gameserver.network.serverpackets.MyTargetSelected;
+import com.l2jhellas.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jhellas.gameserver.network.serverpackets.SocialAction;
+import com.l2jhellas.gameserver.network.serverpackets.ValidateLocation;
+import com.l2jhellas.gameserver.templates.L2NpcTemplate;
+import com.l2jhellas.util.Rnd;
+
+
+/** Nobless Manager */
+public class L2NoblessInstance extends L2FolkInstance
+{
+	
+	public int item = Config.NOBLESS_ITEM,count = Config.NOBLESS_COUNT;
+	public L2NoblessInstance(int objectId, L2NpcTemplate template)
+	{
+		super(objectId, template);
+    }
+
+	private final static Logger _log = Logger.getLogger(L2NoblessInstance.class.getName());
+
+    @Override
+    public void onBypassFeedback(L2PcInstance player, String command)
+    {
+    	player.sendPacket(new ActionFailed());
+	    StringTokenizer st = new StringTokenizer(command, " ");
+	    String actualCommand = st.nextToken();
+	    @SuppressWarnings("unused")
+		String val = "";
+	    if (st.countTokens() >= 1)
+	    {
+	        val = st.nextToken();
+	    }
+	    if (actualCommand.equalsIgnoreCase("setnobless"))
+	    {
+	    	if(!(player instanceof L2PcInstance))
+                return;
+            L2PcInstance activeChar = player;
+            if(activeChar.isNoble())
+            {
+                activeChar.sendMessage("You Are Already A Noblesse!.");
+            }
+            else if(!Config.ALLOW_NOB_NPC)
+            {
+            	activeChar.sendMessage("Admin has disabled this npc!");
+            }
+            else if(Config.ALLOW_NOB_NPC && (activeChar.getInventory().getInventoryItemCount(item, - count) >= 0))
+            {
+            	activeChar.destroyItemByItemId("Nobless", item, count, activeChar, true);
+            	activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 16));
+                activeChar.setNoble(true);
+                activeChar.sendMessage("You Are Now a Noble,You Are Granted With Noblesse Status , And Noblesse Skills.");
+                activeChar.broadcastUserInfo();
+                activeChar.getInventory().addItem("Tiara", 7694, 1, activeChar, null);
+            }
+            
+	    }
+	    else
+	    {
+	    	super.onBypassFeedback(player, command);
+	    }
+    }
+
+    @Override
+    public void onAction(L2PcInstance player)
+    {
+	    if (this != player.getTarget())
+	    {
+	        player.setTarget(this);
+	        player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()));
+	        player.sendPacket(new ValidateLocation(this));
+	    }
+	    else if (isInsideRadius(player, INTERACTION_DISTANCE, false, false))
+	    {
+	        SocialAction sa = new SocialAction(getObjectId(), Rnd.get(8));
+	        broadcastPacket(sa);
+	        player.setLastFolkNPC(this);
+	        showMessageWindow(player);
+	        player.sendPacket(new ActionFailed());
+	    }
+	    else
+	    {
+	        player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
+	        player.sendPacket(new ActionFailed());
+	    }
+    }
+
+    private void showMessageWindow(L2PcInstance player)
+    {
+	    NpcHtmlMessage html = new NpcHtmlMessage(1);
+	    html.setFile("data/html/mods/Nobless.htm");
+	    html.replace("%objectId%", String.valueOf(getObjectId()));
+	    html.replace("%npcname%", getName());
+	    player.sendPacket(html);
+    }
+    
+    
+    }
\ No newline at end of file

 

Now go to data/html/mods like a  :good sir: (if mods folder doesn't exist just create one)

and put this html

<html><title>Nobless Manager</title>
<body>
<center>
<br>
<center><a action="bypass -h npc_%objectId%_setnobless">Give Me Noblesse Status</a><BR></center>
<BR>
<img src="L2UI_CH3.herotower_deco" align="center" width="256" height="32"><br>
</center>
</body>
</html>

 

 

Thanks for watching leave a comment if you like it pm me for private requests!  :gusta:

Link to comment
Share on other sites

  • 1 month later...

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

    • 📢 𝗦𝐭𝐚𝐫𝐭 𝐨𝐧 𝟐𝟲/𝟏𝟎/𝟐𝟎𝟐𝟒  𝟏6:𝟎𝟎 𝑳𝒐𝒏𝒅𝒐𝒏 𝑻𝒊𝒎𝒆 ⚔️ 𝗥𝗮𝘁𝗲𝘀: 𝗫𝗣 𝟐𝟱𝐗, 𝗔𝗱𝗲𝗻𝗮 𝟏𝟎𝐗, 𝗦𝗽𝗼𝗶𝗹 𝟏𝟎𝐗, 𝗗𝗿𝗼𝗽 7𝐗, 💬 𝗠𝗮𝘅 𝗲𝗻𝗰𝗵𝗮𝗻𝘁 +𝟭𝟲 𝘄𝗶𝘁𝗵 𝟱𝟎% 𝗻𝗼𝗿𝗺𝗮𝗹 𝗮𝗻𝗱 𝟲𝟎% 𝗯𝗹𝗲𝘀𝘀𝗲𝗱, 👉 𝗔𝘂𝘁𝗼 𝗲𝘃𝗲𝗻𝘁𝘀 🌍 𝗪𝗲𝗯𝗦𝗶𝘁𝗲: https://l2glorious.online/
    • Well, I'm looking for errors like the 1599 bug in attack speed bro Well, I'm looking for errors like the 1599 bug in attack speed bro
    • Hey! I’ve run into similar issues before. They usually track you through IPs, cookies, and sometimes even browser fingerprints, so just changing your MAC or IP probably won’t do the trick. I found that using a VPN really helps mask your IP, and clearing your cookies regularly makes a big difference. Also, browsing in incognito mode or using something like the Brave browser can help keep things private.
    • If you're trying to boost your attack speed in Interlude, I'd recommend focusing on optimizing your gear and skills instead of hunting for bugs. I’ve found that mixing up your equipment and looking for buffs that enhance attack speed can make a big difference. It’s also worth experimenting with different skill combos to maximize your damage output.
    • That code is shared of "Server Shares & Files [L2J]" section. Requires Java source of the server and interface modification.
  • Topics

×
×
  • Create New...